:root {
  --bg: #06111e;
  --surface: #0b1c2c;
  --surface2: #10273b;
  --line: #1d3a52;
  --text: #f4f9ff;
  --muted: #91a9bf;
  --blue: #079cff;
  --cyan: #20dcff;
  --green: #18d89b;
  --red: #ff526d;
  --purple: #a75cff;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

body {
  background: radial-gradient(ellipse at 50% -15%, #103b60 0, transparent 48%), var(--bg);
}

.hidden,
.app.hidden,
.auth-wrapper.hidden,
.modal-backdrop.hidden,
.offline-screen.hidden,
[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ========================================== */
/* APP SPLASH / ZERO-FLICKER LOADER           */
/* ========================================== */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-icon {
  width: 72px;
  height: 72px;
  color: var(--cyan);
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #103b5d, #071a2a);
  border: 1px solid #1baeff66;
  box-shadow: 0 0 35px rgba(0, 170, 255, 0.35);
  margin-bottom: 16px;
  animation: splashPulse 2s infinite ease-in-out;
}

.splash-icon svg {
  width: 44px;
}

.splash-title {
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.6px;
  color: var(--text);
}

.splash-title span {
  color: var(--cyan);
}

.splash-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.splash-spinner {
  display: flex;
  gap: 8px;
  margin-top: 26px;
}

.splash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: splashDotBounce 1.4s infinite ease-in-out both;
}

.splash-dot:nth-child(1) { animation-delay: -0.32s; }
.splash-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(0, 170, 255, 0.25); }
  50% { transform: scale(1.05); box-shadow: 0 0 45px rgba(0, 170, 255, 0.5); }
}

@keyframes splashDotBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========================================== */
/* AUTHENTICATION / LOGIN SCREEN              */
/* ========================================== */
.auth-wrapper {
  max-width: 480px;
  min-height: 100dvh;
  margin: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.auth-card {
  width: 100%;
  background: linear-gradient(150deg, #0b1e30, #06121d);
  border: 1px solid #1c3d57;
  border-radius: 24px;
  padding: 28px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid #1baeff66;
  border-radius: 17px;
  background: linear-gradient(145deg, #103b5d, #071a2a);
  box-shadow: 0 0 25px rgba(0, 170, 255, 0.28);
}

.auth-brand-icon svg {
  width: 36px;
}

.auth-title {
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.6px;
}

.auth-title span {
  color: var(--cyan);
}

.auth-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: #091724;
  border: 1px solid #1b354b;
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
  transition: 0.16s;
}

.auth-tab-btn.active {
  background: #079cff;
  color: #fff;
  box-shadow: 0 2px 10px rgba(7, 156, 255, 0.35);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 11px;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.5;
}

.auth-alert.error {
  background: #491724;
  border: 1px solid #ff526d80;
  color: #ff9cab;
}

.auth-alert.success {
  background: #0d3829;
  border: 1px solid #18d89b80;
  color: #61f3bf;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 650;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1e3e58;
  background: #071725;
  color: #fff;
  font-size: 13px;
  transition: 0.16s;
}

.auth-field input:focus {
  border-color: var(--cyan);
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin: 14px 2px 20px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
}

.auth-remember input {
  accent-color: var(--cyan);
}

.auth-link-btn {
  background: none;
  border: 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
}

.app-downloads-box {
  margin-top: 24px;
  border-top: 1px solid #17334b;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-download-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(145deg, #0f273b, #091a28);
  border: 1px solid #1e3f59;
  border-radius: 13px;
  text-decoration: none;
  color: var(--text);
  transition: 0.16s;
}

.app-download-card:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.dl-glyph {
  font-size: 20px;
}

.app-download-card strong {
  display: block;
  font-size: 11px;
}

.app-download-card small {
  font-size: 9px;
  color: var(--muted);
}

.dl-arrow {
  margin-left: auto;
  color: var(--cyan);
  font-weight: 800;
  font-size: 14px;
}

/* ========================================== */
/* MAIN APP SHELL (5 SCREENS)                 */
/* ========================================== */
.app {
  max-width: 520px;
  min-height: 100dvh;
  margin: auto;
  position: relative;
  background: linear-gradient(180deg, #071827, #04101b 65%);
  border-left: 1px solid #15334b;
  border-right: 1px solid #15334b;
  overflow: hidden;
  padding-bottom: 86px;
}

/* Topbar */
.topbar {
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #17334b;
  background: #071827ed;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
}

.brand-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid #1baeff66;
  border-radius: 12px;
  background: linear-gradient(145deg, #103b5d, #071a2a);
  box-shadow: 0 0 18px rgba(0, 170, 255, 0.2);
}

.brand-icon svg {
  width: 26px;
}

.brand {
  min-width: 0;
  flex: 1;
}

.brand-name {
  font-weight: 850;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.brand-name span {
  color: var(--cyan);
}

.brand-sub {
  font-size: 9px;
  color: #91a9bf;
  margin-top: 2px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #10263a;
  color: #d8edff;
  border: 1px solid #25445d;
  border-radius: 11px;
  font-size: 16px;
  transition: 0.18s;
}

.mini-btn:active, .nav-btn:active, .action-card:active, .primary:active {
  transform: scale(0.96);
}

main {
  padding: 16px 14px 22px;
}

.page {
  display: none;
  animation: appear 0.2s ease;
}

.page.active {
  display: block;
}

@keyframes appear {
  from { opacity: 0.4; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Welcome Card */
.welcome {
  position: relative;
  overflow: hidden;
  border: 1px solid #167ab46b;
  border-radius: 20px;
  padding: 20px 18px;
  margin-bottom: 16px;
  background: linear-gradient(110deg, #0c2e4b, #071a2b 68%);
  min-height: 124px;
}

.welcome:after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  right: -35px;
  top: -48px;
  background: #087fff2c;
  filter: blur(6px);
}

.welcome h1 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.7px;
  position: relative;
  z-index: 1;
}

.welcome h1 span {
  color: var(--cyan);
}

.welcome p {
  margin: 0;
  color: #a9c1d6;
  font-size: 11px;
  line-height: 1.55;
  max-width: 260px;
  position: relative;
  z-index: 1;
}

.hero-cloud {
  position: absolute;
  right: 17px;
  bottom: 18px;
  color: #1cbcff;
  font-size: 40px;
  filter: drop-shadow(0 0 14px #008fff);
  z-index: 1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 18px 2px 10px;
}

.section-head h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  font-size: 10px;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 750;
  padding: 6px;
}

/* Quick Actions Grid */
.grid-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-card {
  min-height: 85px;
  padding: 10px 4px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #20415c;
  border-radius: 15px;
  background: linear-gradient(150deg, #10283c, #091a29);
  color: var(--text);
  transition: 0.16s;
}

.action-card .glyph {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: #064d7a;
  color: #71e7ff;
  border: 1px solid #1dafff70;
}

.action-card:nth-child(2) .glyph {
  background: #063f67;
  color: #56c5ff;
}

.action-card:nth-child(3) .glyph {
  background: #361a59;
  color: #d3a2ff;
  border-color: #a75cff70;
}

.action-card:nth-child(4) .glyph {
  background: #4c3109;
  color: #ffd078;
  border-color: #ffb32c70;
}

.action-card strong {
  font-size: 10px;
  white-space: nowrap;
}

/* Drives Grid */
.drive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.drive-card {
  padding: 12px 11px;
  border: 1px solid #1e4058;
  border-radius: 15px;
  background: linear-gradient(145deg, #10283a, #071724);
  min-width: 0;
}

.drive-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-icon {
  width: 34px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c9eaff, #5a8daf);
  color: #09213a;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px #fff7;
}

.drive-name {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-type {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 999px;
  margin-top: 9px;
  background: #063c30;
  color: #61f3bf;
}

.state.off {
  background: #481b28;
  color: #ff9eae;
}

.state:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.meter {
  height: 7px;
  border-radius: 99px;
  background: #20384b;
  overflow: hidden;
  margin: 9px 0 7px;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #079cff, #27e3d4);
  transition: width 0.3s ease;
}

.drive-foot {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 9px;
  color: #c5d8e8;
}

.drive-free {
  font-size: 10px;
  font-weight: 800;
  margin-top: 7px;
}

/* Dropzone */
.dropzone {
  margin-top: 8px;
  padding: 18px 12px;
  text-align: center;
  border: 1px dashed #1ebcff;
  border-radius: 17px;
  background: linear-gradient(145deg, #082440, #071827);
  transition: 0.16s;
}

.upload-cloud {
  font-size: 32px;
  color: var(--cyan);
  filter: drop-shadow(0 0 12px rgba(0, 143, 255, 0.4));
}

.dropzone h3 {
  font-size: 13px;
  margin: 7px 0 4px;
}

.dropzone p {
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 13px;
}

.primary {
  border: 1px solid #54dfff;
  border-radius: 13px;
  background: linear-gradient(100deg, #0879ee, #04b6ef);
  box-shadow: 0 7px 20px rgba(0, 142, 255, 0.2);
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 12px 17px;
  transition: 0.16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary.full {
  width: 100%;
}

.secondary {
  border: 1px solid #294a63;
  border-radius: 12px;
  background: #0c2031;
  color: #d6eaff;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 13px;
}

/* Storage Card & Donut */
.storage-card {
  border: 1px solid #20425b;
  border-radius: 17px;
  background: linear-gradient(145deg, #10283a, #081824);
  padding: 15px;
  margin-top: 8px;
}

.storage-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.donut {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(#19d9dd 0 0%, #24425b 0% 100%);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
}

.donut:after {
  content: attr(data-pct);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #0b1d2c;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 15px;
}

.storage-stats {
  flex: 1;
}

.storage-stats strong {
  font-size: 13px;
}

.storage-stats p {
  font-size: 10px;
  color: var(--muted);
  margin: 6px 0;
}

.storage-stats b {
  color: #dceeff;
}

/* Files Explorer Page */
.admin-scope-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-drive-select-box {
  background: linear-gradient(145deg, #0d273d, #081a28);
  border: 1px solid #1e4566;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0 12px;
}

.breadcrumbs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: #091c2c;
  border: 1px solid #1b384f;
  border-radius: 10px;
  margin: 8px 0 10px;
  font-size: 11px;
}

.breadcrumb-crumb {
  color: var(--cyan);
  cursor: pointer;
  font-weight: 750;
  border: 0;
  background: none;
  padding: 2px 4px;
  border-radius: 4px;
}

.breadcrumb-crumb:hover {
  background: rgba(32, 220, 255, 0.15);
}

.breadcrumb-separator {
  color: var(--muted);
  font-size: 10px;
}

.search {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #24455f;
  border-radius: 13px;
  background: #0a1c2c;
  margin: 12px 0 10px;
}

.search span {
  color: #83a4bf;
  font-size: 14px;
}

.search input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: white;
  padding: 11px 0;
  font-size: 12px;
}

.filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  white-space: nowrap;
  padding: 7px 12px;
  border: 1px solid #26455e;
  border-radius: 999px;
  background: #0c2031;
  color: #a9c1d7;
  font-size: 10px;
  font-weight: 750;
  transition: 0.16s;
}

.filter.active {
  background: #0679bc;
  border-color: #32ceff;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.25);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.file-card {
  min-width: 0;
  border: 1px solid #1e3e55;
  border-radius: 13px;
  background: #0b1d2b;
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.thumb {
  height: 76px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #143a54, #0b2237);
  font-size: 28px;
  position: relative;
  cursor: pointer;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.photo {
  background: #081a28;
}

.thumb.video:after {
  content: "▶";
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(6, 17, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 11px;
  padding-left: 2px;
}

.file-name {
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 6px 2px 3px;
}

.file-size {
  font-size: 9px;
  color: var(--muted);
  margin: 0 2px 4px;
}

.file-actions {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  margin-top: auto;
}

.tiny-action {
  border: 0;
  background: none;
  color: #5ddfff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 4px;
}

/* Cleaner Page */
.clean-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid #1b3549;
  cursor: pointer;
}

.clean-row:last-child {
  border-bottom: 0;
}

.clean-icon {
  width: 34px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #2a4b63;
  border-radius: 10px;
  background: #102a40;
  font-size: 16px;
}

.clean-info {
  flex: 1;
  min-width: 0;
}

.clean-info strong {
  font-size: 11px;
  display: block;
}

.clean-info span {
  font-size: 9px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.clean-row input {
  accent-color: #079cff;
  width: 17px;
  height: 17px;
}

.clean-size {
  font-size: 10px;
  color: var(--cyan);
  font-weight: 800;
}

/* Enhanced Smart Cleaner & Duplicate Remover Styles */
.cleaner-hero-card {
  padding: 18px;
  border: 1px solid #1c4a6b;
  border-radius: 18px;
  background: linear-gradient(145deg, #0d283d, #081a29);
  margin-top: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.cleaner-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cleaner-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cleaner-hero-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.cleaner-hero-title span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}
.cleaner-hero-badge {
  background: rgba(24, 216, 155, 0.12);
  border: 1px solid rgba(24, 216, 155, 0.35);
  color: var(--green);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cleaner-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.cleaner-stat-box {
  background: rgba(11, 28, 44, 0.7);
  border: 1px solid #1c3b54;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.cleaner-stat-box span {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.cleaner-stat-box strong {
  font-size: 14px;
  display: block;
}
.cleaner-stat-box.wasted strong {
  color: var(--red);
}
.cleaner-stat-box.dupes strong {
  color: var(--cyan);
}
.cleaner-stat-box.safe strong {
  color: var(--green);
}
.cleaner-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.btn-auto-clean {
  flex: 1.4;
  background: linear-gradient(100deg, #079cff, #20dcff);
  color: #04131f;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-auto-clean:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.btn-auto-clean:active {
  transform: translateY(1px);
}
.btn-review-dupes {
  flex: 1;
  background: rgba(16, 39, 59, 0.85);
  border: 1px solid #214d72;
  color: var(--cyan);
  font-weight: 600;
  font-size: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cluster-card {
  background: #091a27;
  border: 1px solid #1a3c57;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}
.cluster-head {
  padding: 10px 14px;
  background: #0f273b;
  border-bottom: 1px solid #1a3c57;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.cluster-head-title {
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cluster-head-wasted {
  color: var(--red);
  font-weight: 700;
  font-size: 10px;
}
.cluster-items {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cluster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(16, 42, 64, 0.3);
}
.cluster-item.is-original {
  border-color: rgba(24, 216, 155, 0.35);
  background: rgba(24, 216, 155, 0.06);
}
.cluster-item.is-duplicate {
  border-color: rgba(255, 82, 109, 0.25);
  background: rgba(255, 82, 109, 0.05);
}
.cluster-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-safe {
  background: rgba(24, 216, 155, 0.2);
  color: var(--green);
  border: 1px solid rgba(24, 216, 155, 0.4);
}
.badge-dupe {
  background: rgba(255, 82, 109, 0.2);
  color: var(--red);
  border: 1px solid rgba(255, 82, 109, 0.4);
}
.cluster-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: #153247;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid #1b3d59;
}
.cluster-meta {
  flex: 1;
  min-width: 0;
}
.cluster-meta strong {
  display: block;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cluster-meta span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}
.btn-delete-single-copy {
  background: rgba(255, 82, 109, 0.15);
  border: 1px solid rgba(255, 82, 109, 0.4);
  color: var(--red);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-delete-single-copy:hover {
  background: rgba(255, 82, 109, 0.3);
}

/* Profile Page */
.profile-card {
  padding: 15px;
  border: 1px solid #21445c;
  border-radius: 17px;
  background: linear-gradient(145deg, #10283a, #081824);
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar-wrap {
  position: relative;
  flex: none;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(135deg, #168bff, #21d8ff);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 142, 255, 0.35);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-camera-btn {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #06111e;
  background: #079cff;
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info strong {
  font-size: 14px;
  display: block;
}

.profile-info p {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0;
}

.setting-list {
  margin-top: 13px;
  border: 1px solid #1e4058;
  border-radius: 16px;
  overflow: hidden;
  background: #0a1b2a;
}

.setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid #1b3549;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-glyph {
  width: 33px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #10314a;
  color: #6ddfff;
  font-size: 16px;
  flex: none;
}

.setting-copy {
  flex: 1;
  min-width: 0;
}

.setting-copy strong {
  font-size: 11px;
  display: block;
}

.setting-copy small {
  font-size: 9px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.chevron {
  color: #7c9bb4;
  font-size: 18px;
}

.switch {
  width: 35px;
  height: 20px;
  border-radius: 99px;
  background: #1b4055;
  padding: 3px;
  flex: none;
  transition: 0.2s;
}

.switch:after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}

.switch.on {
  background: #05b980;
}

.switch.on:after {
  transform: translateX(15px);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  z-index: 12;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 100%);
  height: 74px;
  padding: 8px 7px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #071827f5;
  border-top: 1px solid #1b3b53;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: #7f9bb3;
  font-size: 9px;
  font-weight: 700;
  transition: 0.16s;
}

.nav-btn .nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-btn.active {
  color: var(--cyan);
}

.nav-btn.active .nav-icon {
  filter: drop-shadow(0 0 7px #00cfff);
}

/* Floating Action Center Upload Nav Button */
.nav-btn[data-page="uploadPage"] .nav-icon {
  background: linear-gradient(135deg, #079cff, #20dcff);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: -6px;
  box-shadow: 0 4px 12px rgba(7, 156, 255, 0.4);
}

/* Toast */
.toast {
  position: fixed;
  z-index: 40;
  bottom: 94px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  background: #12344a;
  border: 1px solid #2cbfff;
  color: #eafaff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 11, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
}

.modal-box {
  width: min(520px, 94vw);
  background: linear-gradient(150deg, #0d263c, #071725);
  border: 1px solid #1e4566;
  border-radius: 20px;
  padding: 16px 14px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #1a3a54;
}

.modal-header h3 {
  font-size: 13px;
  font-weight: 750;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex: none;
  border-radius: 50%;
  background: #102d44;
  border: 1px solid #265074;
  color: #fff;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.modal-close:active {
  transform: scale(0.92);
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.media-modal-box {
  width: min(720px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.media-header-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-header-info h3 {
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.media-meta-badge {
  font-size: 11px;
  color: var(--muted);
}

.modal-body#mediaContainer {
  min-height: 220px;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  margin: 6px 0 12px;
  padding: 8px;
}

.modal-body#mediaContainer img,
.modal-body#mediaContainer video {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.media-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: 0.16s ease;
}

.secondary.action-pill-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary.action-pill-btn:hover {
  border-color: var(--cyan);
}

/* ========================================== */
/* SERVER OFFLINE FALLBACK SCREEN (SNIPPET 2) */
/* ========================================== */
.offline-screen {
  display: none;
  min-height: 100dvh;
  background: #fff;
  color: #182432;
  padding: calc(24px + env(safe-area-inset-top)) 25px calc(26px + env(safe-area-inset-bottom));
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.offline-screen.show {
  display: flex;
}

.offline-symbol {
  width: 120px;
  height: 110px;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #0b9dff;
}

.offline-symbol svg {
  width: 112px;
  filter: drop-shadow(0 7px 14px rgba(21, 159, 255, 0.25));
}

.offline-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ef3445;
  color: #fff;
  border: 4px solid #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
}

.offline-brand {
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -1px;
  margin: 0;
  color: #18232f;
}

.offline-brand span {
  color: #087ff5;
}

.offline-title {
  font-size: 24px;
  color: #df2737;
  margin: 8px 0 12px;
  font-weight: 850;
}

.offline-copy {
  max-width: 330px;
  font-size: 13px;
  line-height: 1.65;
  color: #657180;
  margin: 0 0 25px;
}

.offline-refresh {
  width: min(100%, 330px);
  border: 0;
  border-radius: 14px;
  padding: 15px;
  background: linear-gradient(100deg, #087cf5, #0ca7ff);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(7, 140, 255, 0.25);
  transition: transform 0.16s, box-shadow 0.16s;
}

.offline-refresh:active {
  transform: scale(0.97);
}

.offline-info {
  width: min(100%, 360px);
  text-align: left;
  border: 1px solid #e0e7ed;
  background: #f8fafc;
  border-radius: 16px;
  padding: 17px;
  margin-top: 25px;
}

.offline-info strong {
  font-size: 13px;
  color: #141b23;
}

.offline-info ul {
  margin: 10px 0 0;
  padding-left: 19px;
  color: #667382;
  font-size: 12px;
  line-height: 1.9;
}

.offline-foot {
  font-size: 10px;
  color: #a0aab5;
  margin-top: 22px;
}

/* ========================================== */
/* GENERAL INPUTS & MODAL ENHANCEMENTS        */
/* ========================================== */
.attach-drive-input,
.modal-input {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.16s;
  width: 100%;
}

.attach-drive-input:focus,
.modal-input:focus {
  border-color: var(--cyan);
  outline: none;
}

.drive-letter-input {
  width: 75px !important;
  text-align: center;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 14px;
}

.drive-label-input {
  flex: 1;
}

.target-drive-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.media-loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
  gap: 12px;
}

.media-loading-indicator .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(2, 132, 199, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================== */
/* LIGHT MODE ENHANCEMENT (ZERO INVISIBILITY) */
/* ========================================== */
html[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --line: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #0284c7;
  --cyan: #0284c7;
  --green: #059669;
  --red: #e11d48;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface2: #f1f5f9;
    --line: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --blue: #0284c7;
    --cyan: #0284c7;
    --green: #059669;
    --red: #e11d48;
  }
}

html[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% -15%, #cde4ff 0, transparent 48%), #f4f7fb;
  color: #0f172a;
}

html[data-theme="light"] .auth-card,
html[data-theme="light"] .app {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .auth-field input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .auth-field input::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] .auth-tabs {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

html[data-theme="light"] .auth-tab-btn {
  color: #64748b;
}

html[data-theme="light"] .auth-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

html[data-theme="light"] .app-downloads-box {
  border-color: #e2e8f0;
}

html[data-theme="light"] .app-download-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .app-download-card strong {
  color: #0f172a;
}

html[data-theme="light"] .app-download-card small {
  color: #64748b;
}

html[data-theme="light"] .dl-glyph,
html[data-theme="light"] .dl-arrow {
  color: #0284c7;
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
}

html[data-theme="light"] .brand-name {
  color: #0f172a;
}

html[data-theme="light"] .brand-sub {
  color: #64748b;
}

html[data-theme="light"] .brand-icon {
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  color: #0284c7;
  border-color: #7dd3fc;
}

html[data-theme="light"] .mini-btn {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

html[data-theme="light"] .welcome {
  background: linear-gradient(110deg, #e0f2fe, #f0f9ff 68%);
  border-color: #7dd3fc;
  color: #0c4a6e;
}

html[data-theme="light"] .welcome h1 {
  color: #0c4a6e;
}

html[data-theme="light"] .welcome p {
  color: #0369a1;
}

html[data-theme="light"] .hero-cloud {
  color: #0284c7;
}

html[data-theme="light"] .action-card {
  background: linear-gradient(150deg, #ffffff, #f8fafc);
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .drive-card {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .drive-name {
  color: #0f172a;
}

html[data-theme="light"] .drive-foot {
  color: #475569;
}

html[data-theme="light"] .drive-free {
  color: #0f172a;
}

html[data-theme="light"] .dropzone {
  background: #f0f9ff;
  border: 2px dashed #38bdf8;
  color: #0c4a6e;
}

html[data-theme="light"] .dropzone h3 {
  color: #0c4a6e;
}

html[data-theme="light"] .dropzone p {
  color: #0369a1;
}

html[data-theme="light"] .upload-cloud {
  color: #0284c7;
}

html[data-theme="light"] .admin-scope-bar .filter {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .admin-scope-bar .filter.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

html[data-theme="light"] .admin-drive-select-box,
html[data-theme="light"] .target-drive-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .breadcrumbs-row {
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="light"] .breadcrumb-crumb {
  color: #0284c7;
}

html[data-theme="light"] .storage-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .donut:after {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="light"] .clean-icon {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}

html[data-theme="light"] .file-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .file-name {
  color: #0f172a;
}

html[data-theme="light"] .file-size {
  color: #64748b;
}

html[data-theme="light"] .tiny-action {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .search {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .search input {
  color: #0f172a;
}

html[data-theme="light"] .filters .filter {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .filters .filter.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

html[data-theme="light"] .profile-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .profile-info strong {
  color: #0f172a;
}

html[data-theme="light"] .profile-info p {
  color: #64748b;
}

html[data-theme="light"] .setting-row {
  background: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme="light"] .setting-copy strong {
  color: #0f172a;
}

html[data-theme="light"] .setting-copy small {
  color: #64748b;
}

html[data-theme="light"] .setting-glyph {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0284c7;
}

html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top-color: #cbd5e1;
}

html[data-theme="light"] .nav-btn {
  color: #64748b;
}

html[data-theme="light"] .nav-btn.active {
  color: #0284c7;
}

html[data-theme="light"] .offline-screen {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="light"] .offline-title {
  color: #0f172a;
}

html[data-theme="light"] .offline-copy {
  color: #64748b;
}

html[data-theme="light"] .offline-info {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

html[data-theme="light"] .offline-info strong {
  color: #0f172a;
}

html[data-theme="light"] .offline-foot {
  color: #94a3b8;
}

html[data-theme="light"] .modal-box {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0;
}

html[data-theme="light"] .modal-header h3 {
  color: #0f172a;
}

html[data-theme="light"] .modal-close {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .media-modal-box {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .modal-body#mediaContainer {
  background: #f1f5f9 !important;
}

html[data-theme="light"] .media-modal-actions {
  border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .secondary.action-pill-btn {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .attach-drive-input,
html[data-theme="light"] .modal-input,
html[data-theme="light"] .drive-letter-input,
html[data-theme="light"] .drive-label-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .dropzone {
  background: #f0f9ff !important;
  background-image: none !important;
  border: 2px dashed #0284c7 !important;
  color: #0c4a6e !important;
}

/* System Light Mode Fallback rules */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) body {
    background: radial-gradient(ellipse at 50% -15%, #cde4ff 0, transparent 48%), #f4f7fb;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .auth-card,
  html:not([data-theme="dark"]) .app {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  }
  html:not([data-theme="dark"]) .auth-field input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .auth-field input::placeholder {
    color: #94a3b8;
  }
  html:not([data-theme="dark"]) .auth-tabs {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
  }
  html:not([data-theme="dark"]) .auth-tab-btn {
    color: #64748b;
  }
  html:not([data-theme="dark"]) .auth-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
  }
  html:not([data-theme="dark"]) .app-downloads-box {
    border-color: #e2e8f0;
  }
  html:not([data-theme="dark"]) .app-download-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .app-download-card strong {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .app-download-card small {
    color: #64748b;
  }
  html:not([data-theme="dark"]) .dl-glyph,
  html:not([data-theme="dark"]) .dl-arrow {
    color: #0284c7;
  }
  html:not([data-theme="dark"]) .topbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e2e8f0;
  }
  html:not([data-theme="dark"]) .brand-name {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .brand-sub {
    color: #64748b;
  }
  html:not([data-theme="dark"]) .brand-icon {
    background: linear-gradient(145deg, #e0f2fe, #bae6fd);
    color: #0284c7;
    border-color: #7dd3fc;
  }
  html:not([data-theme="dark"]) .action-card {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .drive-card {
    background: #ffffff;
    border-color: #cbd5e1;
  }
  html:not([data-theme="dark"]) .drive-name {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .dropzone {
    background: #f0f9ff !important;
    background-image: none !important;
    border: 2px dashed #0284c7 !important;
    color: #0c4a6e !important;
  }
  html:not([data-theme="dark"]) .dropzone h3 {
    color: #0c4a6e !important;
  }
  html:not([data-theme="dark"]) .dropzone p {
    color: #0369a1 !important;
  }
  html:not([data-theme="dark"]) .storage-card {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .file-card {
    background: #ffffff;
    border-color: #cbd5e1;
  }
  html:not([data-theme="dark"]) .file-name {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .setting-row {
    background: #ffffff;
    border-color: #cbd5e1;
  }
  html:not([data-theme="dark"]) .setting-copy strong {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top-color: #cbd5e1;
  }
  html:not([data-theme="dark"]) .modal-box {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .media-modal-box {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
  }
  html:not([data-theme="dark"]) .modal-body#mediaContainer {
    background: #f1f5f9 !important;
  }
  html:not([data-theme="dark"]) .media-modal-actions {
    border-top: 1px solid #e2e8f0 !important;
  }
  html:not([data-theme="dark"]) .secondary.action-pill-btn {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
  }
  html:not([data-theme="dark"]) .modal-header h3 {
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .modal-close {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
  }
  html:not([data-theme="dark"]) .attach-drive-input,
  html:not([data-theme="dark"]) .modal-input,
  html:not([data-theme="dark"]) .drive-letter-input,
  html:not([data-theme="dark"]) .drive-label-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
  }
}

/* ========================================== */
/* DESKTOP RESPONSIVE WORKSPACE (STEP 3)       */
/* ========================================== */
@media (min-width: 768px) {
  body {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  .app:not(.hidden) {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh !important;
    box-shadow: none !important;
    padding-bottom: 0 !important;
  }

  .auth-wrapper:not(.hidden) {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
  }

  .topbar {
    display: none !important;
  }

  .bottom-nav {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    order: -1 !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    height: 100vh !important;
    flex: 0 0 240px !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
    gap: 8px !important;
    padding: 28px 16px !important;
    background: var(--surface) !important;
    border-right: 1px solid var(--line) !important;
    border-top: none !important;
    border-radius: 0 !important;
    z-index: 100 !important;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08) !important;
  }

  .bottom-nav::before {
    content: "YuvaCloud";
    display: block;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -0.5px;
    color: var(--cyan);
    padding: 0 12px 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }

  .bottom-nav .nav-btn {
    flex: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    height: auto !important;
    background: transparent !important;
    color: var(--muted) !important;
    transition: background 0.16s, color 0.16s !important;
  }

  .bottom-nav .nav-btn:hover {
    background: var(--surface2) !important;
    color: var(--text) !important;
  }

  .bottom-nav .nav-btn.active {
    background: var(--blue) !important;
    color: #ffffff !important;
  }

  .bottom-nav .nav-btn span {
    font-size: 14px !important;
    color: inherit !important;
  }

  .bottom-nav .nav-icon {
    font-size: 18px !important;
    color: inherit !important;
  }

  .bottom-nav .nav-btn[data-page="uploadPage"] .nav-icon {
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
  }

  main {
    flex: 1 !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding: 36px 44px 80px !important;
    box-sizing: border-box !important;
  }

  .drive-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 16px !important;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 16px !important;
  }

  .grid-actions {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding: 10px;
    gap: 7px;
  }
  .brand-sub {
    font-size: 8px;
  }
  .brand-name {
    font-size: 15px;
  }
  .grid-actions {
    gap: 5px;
  }
  .drive-card {
    padding: 9px;
  }
  .file-grid {
    gap: 6px;
  }
  .thumb {
    height: 66px;
  }
}

/* ========================================== */
/* V7.5 HIGH CONTRAST & THEME INTEGRITY FIXES */
/* ========================================== */

/* Dark Mode Contrast Rules */
:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  --text: #e6f1fb;
  --muted: #8ea3b7;
}

:root[data-theme="dark"] .drive-foot,
:root:not([data-theme="light"]) .drive-foot {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
}

:root[data-theme="dark"] .drive-foot b,
:root:not([data-theme="light"]) .drive-foot b {
  color: #38bdf8;
  font-weight: 850;
  font-size: 11px;
}

:root[data-theme="dark"] .donut:after,
:root:not([data-theme="light"]) .donut:after {
  background: #0b1d2c;
  color: #e6f1fb;
  font-weight: 850;
}

/* Light Mode High-Contrast Rules (OS & Explicit data-theme="light") */
html[data-theme="light"] .donut:after,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .donut:after {
    background: #ffffff !important;
    color: #0f172a !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  }
}

html[data-theme="light"] .donut,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .donut {
    background: conic-gradient(#0284c7 0 0%, #cbd5e1 0% 100%) !important;
  }
}

html[data-theme="light"] .storage-stats strong,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .storage-stats strong {
    color: #0f172a !important;
    font-weight: 800 !important;
  }
  html:not([data-theme="dark"]) .storage-stats small {
    color: #475569 !important;
  }
}

html[data-theme="light"] .drive-foot,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .drive-foot {
    color: #475569 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
  }
}

html[data-theme="light"] .drive-foot b,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .drive-foot b {
    color: #0284c7 !important;
    font-weight: 850 !important;
    font-size: 11px !important;
  }
}

html[data-theme="light"] .drive-free,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .drive-free {
    color: #0f172a !important;
    font-weight: 800 !important;
  }
}

html[data-theme="light"] .meter,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .meter {
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
  }
  html:not([data-theme="dark"]) .meter span {
    background: linear-gradient(90deg, #0284c7, #06b6d4) !important;
  }
}

/* Trash Cards & Scope Switcher Styling */
.trash-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

html[data-theme="light"] .trash-card,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .trash-card {
    background: #ffffff !important;
    border: 1px dashed #fca5a5 !important;
  }
}

html[data-theme="light"] .trash-header-bar,
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .trash-header-bar {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
  }
}

.trash-badge-tag {
  letter-spacing: 0.3px;
}

#btnEmptyTrash:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}
