/* ================================================================
   VK VAULT — styles.css (v9 final)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ============ THEME TOKENS ============ */
:root,
[data-theme="dark"] {
  --bg:        #07070f;
  --bg-2:      #0d0d1c;
  --surface:   rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.06);
  --surface-3: rgba(255,255,255,0.09);
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);
  --text:      #eef0f6;
  --text-dim:  #8f93a8;
  --text-mute: #545872;
  --accent:    #7c5cff;
  --accent-2:  #22d3ee;
  --accent-3:  #f472b6;
  --danger:    #ff5470;
  --success:   #34d399;
  --warning:   #fbbf24;
  --info:      #60a5fa;
  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --font:      'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-md: 0 12px 40px rgba(0,0,0,0.35);
  --grad-brand: linear-gradient(135deg, #7c5cff, #22d3ee);
  --grad-text: linear-gradient(120deg, #fff 30%, #b9a8ff 60%, #7ee7ff 100%);
}

[data-theme="light"] {
  --bg:        #f5f6fb;
  --bg-2:      #ffffff;
  --surface:   rgba(255,255,255,0.85);
  --surface-2: rgba(255,255,255,0.95);
  --surface-3: rgba(240,242,250,1);
  --border:    rgba(15,20,45,0.09);
  --border-2:  rgba(15,20,45,0.16);
  --text:      #14162b;
  --text-dim:  #565a75;
  --text-mute: #8b8fa6;
  --accent:    #6244f0;
  --accent-2:  #0891b2;
  --accent-3:  #db2777;
  --danger:    #e11d48;
  --success:   #059669;
  --warning:   #d97706;
  --info:      #2563eb;
  --shadow-lg: 0 20px 60px rgba(15,20,45,0.14);
  --shadow-md: 0 12px 40px rgba(15,20,45,0.1);
  --grad-text: linear-gradient(120deg, #14162b 20%, #6244f0 60%, #0891b2 100%);
}

/* ============ BASE ============ */
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  transition: background-color .35s ease, color .35s ease;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button, a { touch-action: manipulation; }
button { font-family: inherit; }

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}

/* ============ SPLASH ============ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #131033 0%, #07070f 70%);
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-bg { position: absolute; inset: 0; overflow: hidden; }
.splash-orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.55;
  animation: splashFloat 10s ease-in-out infinite;
}
.splash-orb-1 { width: 340px; height: 340px; background: #7c5cff; top: 10%; left: 10%; }
.splash-orb-2 { width: 280px; height: 280px; background: #22d3ee; bottom: 8%; right: 8%; animation-delay: -3s; }
.splash-orb-3 { width: 220px; height: 220px; background: #f472b6; top: 60%; left: 55%; animation-delay: -6s; opacity: 0.35; }
@keyframes splashFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(30px,-20px) scale(1.15); }
}
.splash-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
  padding: 0 30px; text-align: center;
}
.splash-logo {
  position: relative;
  width: 100px; height: 100px;
  display: grid; place-items: center;
  border-radius: 28px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 20px 60px rgba(124,92,255,0.55), inset 0 2px 0 rgba(255,255,255,0.3);
  animation: splashLogoPop 0.7s cubic-bezier(.22,1.4,.36,1) both;
  overflow: hidden;
}
.splash-logo svg { width: 48px; height: 48px; z-index: 2; position: relative; }
.splash-logo img { width: 100%; height: 100%; object-fit: contain; }
.splash-ring {
  position: absolute; inset: -14px;
  border-radius: 34px;
  border: 2px solid rgba(124,92,255,0.4);
  animation: splashRing 2s ease-out infinite;
  pointer-events: none;
}
.splash-ring-2 { inset: -26px; border-color: rgba(34,211,238,0.3); animation-delay: 1s; }
@keyframes splashLogoPop {
  0%   { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  60%  { opacity: 1; transform: scale(1.1) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes splashRing {
  0%   { opacity: 0.8; transform: scale(0.9); }
  100% { opacity: 0;   transform: scale(1.35); }
}
.splash-title {
  display: flex; gap: 2px; flex-wrap: wrap; justify-content: center;
  font-size: 40px; font-weight: 700; letter-spacing: -0.02em;
  margin-top: 6px;
}
.splash-letter {
  display: inline-block;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: splashLetterIn 0.6s cubic-bezier(.22,1.4,.36,1) both;
  animation-delay: calc(0.35s + var(--i) * 0.06s);
}
.splash-letter-space { width: 10px; }
@keyframes splashLetterIn {
  0%   { opacity: 0; transform: translateY(30px) rotate(-8deg); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) rotate(0); filter: blur(0); }
}
.splash-tag {
  font-size: 13px; color: #8f93a8;
  letter-spacing: 0.2em; text-transform: uppercase;
  animation: splashFade 0.7s ease both;
  animation-delay: 1s;
}
.splash-progress {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
  margin-top: 16px;
  animation: splashFade 0.7s ease both;
  animation-delay: 1.15s;
}
.splash-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  animation: splashProgress 1.6s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: 1.2s;
}
@keyframes splashProgress {
  0%   { width: 0%; }
  40%  { width: 55%; }
  70%  { width: 82%; }
  100% { width: 100%; }
}
.splash-credit {
  font-size: 11px; color: #8f93a8; opacity: 0.7;
  margin-top: 8px; letter-spacing: 0.05em;
  animation: splashFade 0.7s ease both;
  animation-delay: 1.6s;
}
.splash-credit strong { color: #eef0f6; font-weight: 500; opacity: 0.9; }
@keyframes splashFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ ONBOARDING ============ */
.onboarding {
  position: fixed; inset: 0; z-index: 8500;
  background: radial-gradient(circle at 50% 40%, #131033 0%, #07070f 70%);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: fadeIn .4s;
}
[data-theme="light"] .onboarding {
  background: radial-gradient(circle at 50% 40%, #e8e5f8 0%, #f5f6fb 70%);
}
.onboarding-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.onboarding-track::-webkit-scrollbar { display: none; }

.onboarding-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 40px 30px 20px;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.onboarding-icon {
  width: 96px; height: 96px;
  border-radius: 28px;
  background: var(--grad-brand);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 20px 60px rgba(124,92,255,0.5);
  flex-shrink: 0;
  animation: onboardingPop .6s cubic-bezier(.22,1.4,.36,1);
}
.onboarding-icon svg { width: 46px; height: 46px; }
@keyframes onboardingPop {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
.onboarding-slide h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #eef0f6;
  max-width: 340px;
  line-height: 1.2;
}
[data-theme="light"] .onboarding-slide h2 { color: #14162b; }
.onboarding-slide h2 .grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.onboarding-slide p {
  font-size: 14.5px;
  line-height: 1.7;
  color: #8f93a8;
  max-width: 340px;
}
[data-theme="light"] .onboarding-slide p { color: #565a75; }

.onboarding-features {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  max-width: 360px;
  width: 100%;
  text-align: left;
}
.onboarding-feature {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: #eef0f6;
  font-size: 13.5px;
}
[data-theme="light"] .onboarding-feature {
  background: rgba(255,255,255,0.85);
  border-color: rgba(15,20,45,0.1);
  color: #14162b;
}
.onboarding-feature-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(124,92,255,0.2);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.onboarding-feature-icon svg { width: 17px; height: 17px; }

.onboarding-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px 0 4px;
  flex-shrink: 0;
}
.onboarding-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(143,147,168,0.3);
  transition: width .3s, background .3s;
  cursor: pointer;
}
.onboarding-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
}

.onboarding-actions {
  display: flex; gap: 10px;
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.onboarding-skip {
  background: transparent; border: none;
  color: #8f93a8;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 12px;
  transition: color .2s, background .2s;
}
.onboarding-skip:hover { color: #eef0f6; background: rgba(255,255,255,0.05); }
[data-theme="light"] .onboarding-skip { color: #565a75; }
[data-theme="light"] .onboarding-skip:hover { color: #14162b; background: rgba(15,20,45,0.05); }

.onboarding-next {
  flex: 1;
  max-width: 200px;
  padding: 13px 20px;
  border-radius: 12px;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124,92,255,0.4);
  transition: transform .15s, box-shadow .25s;
}
.onboarding-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(124,92,255,0.55);
}
.onboarding-next:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ ANIMATED BG ============ */
.bg-layer {
  position: fixed; inset: 0;
  overflow: hidden; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(124,92,255,0.22) 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(34,211,238,0.18) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
[data-theme="light"] .bg-layer {
  background:
    radial-gradient(circle at 20% 10%, rgba(124,92,255,0.14) 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(34,211,238,0.12) 0%, transparent 55%),
    linear-gradient(180deg, #f5f6fb, #e5e8f5);
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 18s ease-in-out infinite; }
.orb-1 { width: 420px; height: 420px; background: #7c5cff; top: -120px; left: -100px; }
.orb-2 { width: 360px; height: 360px; background: #22d3ee; bottom: -120px; right: -80px; animation-delay: -6s; }
.orb-3 { width: 300px; height: 300px; background: #f472b6; top: 40%; left: 55%; animation-delay: -12s; opacity: 0.35; }
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.08); }
  66%      { transform: translate(-30px,40px) scale(0.95); }
}
.grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6; mix-blend-mode: overlay;
}
[data-theme="light"] .grain { opacity: 0.25; }

/* ============ APP SHELL ============ */
.app-shell {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
[data-theme="light"] .app-shell { background: rgba(255,255,255,0.72); }
@media (min-width: 520px) {
  .app-shell { box-shadow: 0 0 80px rgba(124,92,255,0.15), 0 0 200px rgba(34,211,238,0.06); }
}

/* ============ VIEWS ============ */
.view {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.view.active {
  display: flex;
  animation: viewIn 0.45s cubic-bezier(.22,1,.36,1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } }

#view-dash {
  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#view-dash.active { display: flex; }

.scroll-region {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  display: flex; flex-direction: column;
}
.scroll-region::-webkit-scrollbar { width: 6px; }
.scroll-region::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
.scroll-region::-webkit-scrollbar-track { background: transparent; }

.bottom-spacer { height: 90px; flex-shrink: 0; }

/* ============ LOGIN ============ */
#view-login, #view-reset {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.login-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 40px 26px;
  animation: viewIn 0.6s cubic-bezier(.22,1,.36,1);
}

.brand { text-align: center; }
.brand-mark {
  width: 68px; height: 68px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 40px rgba(124,92,255,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: pulse 3.5s ease-in-out infinite;
}
.brand-mark svg { width: 34px; height: 34px; }
@keyframes pulse {
  0%,100% { box-shadow: 0 10px 40px rgba(124,92,255,0.45), inset 0 1px 0 rgba(255,255,255,0.25); }
  50%     { box-shadow: 0 10px 60px rgba(124,92,255,0.75), inset 0 1px 0 rgba(255,255,255,0.35); }
}
.brand-title {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; letter-spacing: 0.03em; }

.login-form {
  padding: 24px 22px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500;
}
.field input {
  width: 100%; padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 15px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--text-mute); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.ghost-icon {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 8px; border-radius: 10px;
  display: grid; place-items: center;
  transition: color .2s, background .2s;
  position: relative;
}
.ghost-icon:hover { color: var(--text); background: var(--surface-2); }
.ghost-icon svg { width: 18px; height: 18px; }
.input-wrap .ghost-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

.btn-primary {
  position: relative; padding: 14px;
  border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #5b3ee0);
  color: #fff;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: 0.01em;
  box-shadow: 0 8px 30px rgba(124,92,255,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform .15s, box-shadow .25s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 40px rgba(124,92,255,0.5); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.7; cursor: wait; transform: none; }

.btn-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg { color: var(--danger); font-size: 13px; min-height: 16px; text-align: center; }
.note { color: var(--text-dim); font-size: 12px; text-align: center; line-height: 1.5; }
.forgot-link { display: block; text-align: center; margin: -6px 0; }

.footer-links { text-align: center; color: var(--text-dim); font-size: 13px; }
.link-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font); font-size: 13px; cursor: pointer;
  transition: color .2s;
}
.link-btn:hover { color: var(--accent-2); }
.dot { margin: 0 8px; }

/* ============ AUTH DIVIDER / SWITCH ============ */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0;
  color: var(--text-mute);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { padding: 0 4px; }

.auth-switch {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
  flex-wrap: wrap;
}
.auth-switch .link-btn {
  font-weight: 600;
  color: var(--accent);
}
.auth-switch .link-btn:hover { color: var(--accent-2); }

/* ============ GOOGLE BUTTON ============ */
.btn-google {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s, border-color .2s, background .2s;
}
.btn-google:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-google:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
[data-theme="light"] .btn-google { background: #fff; }

/* ============ SIGNUP FORM ============ */
#signup-form {
  padding: 24px 22px;
  display: none;
  flex-direction: column;
  gap: 14px;
}
#signup-form .signup-header {
  text-align: center;
  margin-bottom: 6px;
}
#signup-form .signup-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#signup-form .signup-header p {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============ APP BAR ============ */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 5;
}
[data-theme="light"] .app-bar { background: rgba(255,255,255,0.85); }

.app-bar-left {
  display: flex; align-items: center;
  gap: 10px;
  min-width: 0; flex: 1;
}
.app-bar-actions {
  display: flex; align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.avatar-btn {
  position: relative;
  background: none; border: none;
  cursor: pointer; padding: 0;
  border-radius: 16px;
  flex-shrink: 0;
}
.avatar {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 20px rgba(124,92,255,0.35);
  overflow: hidden;
  background-size: cover; background-position: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-plan-badge {
  position: absolute; bottom: -3px; right: -3px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #451a03;
  font-size: 8px; font-weight: 800;
  padding: 2px 5px; border-radius: 6px;
  letter-spacing: 0.05em;
  border: 2px solid var(--bg);
}
[data-theme="light"] .avatar-plan-badge { border-color: #fff; }

.app-bar-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.greeting { font-size: 11px; color: var(--text-dim); letter-spacing: 0.03em; }
.user-name {
  font-size: 14px; font-weight: 600;
  max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; border-radius: 10px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  animation: pulseBadge 2s ease-in-out infinite;
}
[data-theme="light"] .bell-badge { border-color: #fff; }
@keyframes pulseBadge {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,84,112,0.7); }
  50%     { box-shadow: 0 0 0 6px rgba(255,84,112,0); }
}

/* ============ STATS ============ */
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px 0;
  flex-shrink: 0;
}
.stat {
  padding: 12px 8px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num {
  font-size: 19px; font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label {
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* ============ GLASS ============ */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
[data-theme="light"] .glass-card {
  background: rgba(255,255,255,0.85);
  box-shadow: 0 1px 3px rgba(15,20,45,0.04);
}

/* ============ STORAGE BAR ============ */
.storage-bar {
  margin: 10px 16px 0;
  padding: 9px 14px;
  display: flex; flex-direction: column; gap: 5px;
  flex-shrink: 0;
}
.storage-bar-head { display: flex; justify-content: space-between; align-items: center; }
.storage-bar-label {
  font-size: 10.5px; color: var(--text-dim);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
}
.storage-bar-value { font-size: 11px; color: var(--text); font-family: var(--mono); }
.storage-bar-track {
  height: 5px;
  background: var(--surface-3);
  border-radius: 5px; overflow: hidden;
}
.storage-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 5px;
  transition: width .6s cubic-bezier(.22,1,.36,1), background .3s;
}
.storage-bar-fill.warn { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.storage-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #b91c3c); }

.storage-upgrade-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 0;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent));
  color: var(--text);
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  text-align: center; cursor: pointer;
  transition: transform .15s, box-shadow .25s;
  flex-shrink: 0;
}
.storage-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ============ FAVORITES ============ */
.favorites-section {
  margin: 0;
  padding: 0 0 4px;
  border-bottom: 1px dashed var(--border-2);
  margin-bottom: 6px;
}
.favorites-section .section-head { padding: 10px 16px 6px; }
.favorites-section .section-head h2 { font-size: 14px; color: var(--text-dim); letter-spacing: 0.02em; }
.favorites-section .file-list { padding: 0 16px 6px; }

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex; align-items: center;
  gap: 4px;
  padding: 12px 16px 0;
  min-height: 40px;
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.breadcrumb::-webkit-scrollbar { display: none; }

.crumb {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
  transition: color .2s, background .2s, border-color .2s;
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  line-height: 1.4;
}
.crumb:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.crumb.current {
  color: var(--text);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  cursor: default;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb.current:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.crumb-sep { color: var(--text-mute); font-size: 12px; padding: 0 2px; flex-shrink: 0; }

.crumb-back {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 4px;
  transition: background .2s, border-color .2s, transform .15s;
  padding: 0;
}
.crumb-back:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  transform: translateX(-2px);
}
.crumb-back svg { width: 16px; height: 16px; }

/* ============ SEARCH BAR ============ */
.search-bar {
  display: flex; align-items: center;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 10px 14px;
  flex-shrink: 0;
}
.search-bar svg { width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; }
.search-bar input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text);
  font-family: var(--font); font-size: 14px;
}
.search-bar input::placeholder { color: var(--text-mute); }

/* ============ SECTION HEAD ============ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
  flex-shrink: 0;
  gap: 8px;
}
.section-head h2 {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.chip {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-family: var(--font); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.danger { color: var(--danger); }
.chip.danger:hover { border-color: var(--danger); }

/* ============ SELECT BAR ============ */
.select-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 16px 0;
  padding: 9px 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 14px;
  font-size: 13px;
  animation: itemIn .25s cubic-bezier(.22,1,.36,1);
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}
.select-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.select-actions .chip { padding: 5px 10px; font-size: 11px; }

/* ============ FILE LIST ============ */
.file-list {
  list-style: none;
  padding: 4px 16px 16px;
  display: flex; flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ============ FILE / FOLDER ITEMS ============ */
.file-item, .folder-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .18s, background .2s, border-color .2s;
  animation: itemIn 0.4s cubic-bezier(.22,1,.36,1) backwards;
  position: relative;
  flex-shrink: 0;
}
[data-theme="light"] .file-item,
[data-theme="light"] .folder-item { background: rgba(255,255,255,0.9); }

.file-item:hover, .folder-item:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-2px);
}
.folder-item:hover { border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); }

.file-item.selected, .folder-item.selected {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
}

@keyframes itemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-icon, .folder-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.folder-icon {
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  color: var(--accent-2);
}
.folder-icon svg { width: 22px; height: 22px; }

.file-icon[data-type="pdf"]   { background: color-mix(in srgb, #ff5470 15%, transparent); color: #ff5470; }
.file-icon[data-type="image"] { background: color-mix(in srgb, #34d399 15%, transparent); color: #34d399; }
.file-icon[data-type="video"] { background: color-mix(in srgb, #f472b6 15%, transparent); color: #f472b6; }
.file-icon[data-type="audio"] { background: color-mix(in srgb, #22d3ee 15%, transparent); color: #22d3ee; }
.file-icon[data-type="doc"]   { background: color-mix(in srgb, #60a5fa 15%, transparent); color: #60a5fa; }
.file-icon[data-type="zip"]   { background: color-mix(in srgb, #fbbf24 15%, transparent); color: #fbbf24; }
.file-icon[data-type="code"]  { background: color-mix(in srgb, #a78bfa 15%, transparent); color: #a78bfa; }

.file-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.file-name {
  font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-sub {
  font-size: 11.5px; color: var(--text-dim);
  display: flex; gap: 6px; flex-wrap: wrap;
  overflow: hidden;
}
.file-sub .sep { opacity: 0.4; }

.file-menu {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim);
  padding: 6px; border-radius: 8px;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.file-menu:hover { background: var(--surface-2); color: var(--text); }
.file-menu svg { width: 18px; height: 18px; display: block; }

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-mute);
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: color .2s, background .2s, transform .15s;
}
.star-btn:hover {
  color: var(--warning);
  background: var(--surface-2);
  transform: scale(1.1);
}
.star-btn.starred { color: var(--warning); }
.star-btn.starred svg { fill: currentColor; }
.star-btn svg { width: 18px; height: 18px; display: block; }

.select-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--border-2);
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface-2);
  transition: all .2s;
}
.file-item.selected .select-check,
.folder-item.selected .select-check {
  background: var(--accent);
  border-color: var(--accent);
}
.select-check svg {
  width: 13px; height: 13px; color: #fff;
  opacity: 0;
  transition: opacity .2s;
}
.file-item.selected .select-check svg,
.folder-item.selected .select-check svg { opacity: 1; }

/* ============ EMPTY ============ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
  flex-shrink: 0;
}
.empty-icon {
  width: 68px; height: 68px; border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.empty-icon svg { width: 32px; height: 32px; color: var(--text-dim); }
.empty-state p { font-size: 15px; font-weight: 500; color: var(--text); }
.empty-state span { font-size: 13px; color: var(--text-dim); }

/* ============ FAB — v9 (label-based) ============ */
.fab-wrap {
  position: absolute;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
}
.fab-wrap.open { pointer-events: auto; }

.fab-wrap > .fab {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: var(--grad-brand);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 36px rgba(124,92,255,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform .18s, box-shadow .25s;
  order: 2;
  padding: 0;
}
.fab-wrap > .fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 18px 48px rgba(124,92,255,0.65);
}
.fab-wrap > .fab:active { transform: scale(0.96); }
.fab-wrap > .fab svg { width: 26px; height: 26px; display: block; }

.fab-menu {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  animation: fabMenuIn 0.25s cubic-bezier(.22,1.4,.36,1);
}
@keyframes fabMenuIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* FAB ITEM — supports both <label> and <button> */
.fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  white-space: nowrap;
  transition: transform .15s, box-shadow .25s, border-color .2s;
  animation: fabItemIn 0.3s cubic-bezier(.22,1.4,.36,1) backwards;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-decoration: none;
}
[data-theme="light"] .fab-item {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15,20,45,0.15);
}
.fab-item:nth-child(1) { animation-delay: 0.04s; }
.fab-item:nth-child(2) { animation-delay: 0.08s; }
.fab-item:nth-child(3) { animation-delay: 0.12s; }
.fab-item:nth-child(4) { animation-delay: 0.16s; }

@keyframes fabItemIn {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,92,255,0.25);
  border-color: var(--accent);
}
.fab-item-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
  pointer-events: none;
}
.fab-item-icon svg { width: 16px; height: 16px; display: block; }
.fab-item-label { pointer-events: none; }

/* Children don't steal the click */
.fab-item-icon,
.fab-item-label {
  pointer-events: none;
}

.fab-wrap.open > .fab {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--danger), #b91c3c);
  box-shadow: 0 12px 36px rgba(255,84,112,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}
.fab-wrap.open > .fab:hover { transform: rotate(45deg) scale(1.05); }

.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0,0,0,0.25);
  animation: fadeIn 0.2s;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-theme="light"] .fab-backdrop {
  background: rgba(15,20,45,0.15);
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  display: flex; justify-content: space-around;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 4;
}
[data-theme="light"] .bottom-nav { background: rgba(255,255,255,0.9); }

.nav-item {
  flex: 1;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  color: var(--text-dim);
  font-family: var(--font); font-size: 10.5px;
  padding: 6px 4px;
  border-radius: 12px;
  transition: color .2s, background .2s;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); }

/* ============ SHEET ============ */
.sheet {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s;
}
[data-theme="light"] .sheet-backdrop { background: rgba(15,20,45,0.35); }
.sheet-body {
  position: relative; width: 100%; max-width: 460px;
  padding: 16px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--bg-2);
  animation: slideUp .35s cubic-bezier(.22,1,.36,1);
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-bottom: none;
}
[data-theme="light"] .sheet-body { background: #fff; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 44px; height: 4px;
  background: var(--border-2);
  border-radius: 4px;
  margin: 0 auto 18px;
}
.sheet-body h3 { font-size: 19px; margin-bottom: 14px; font-weight: 600; }
.sheet-body p { color: var(--text-dim); font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.sheet-body ul { color: var(--text-dim); font-size: 14px; line-height: 1.8; padding-left: 20px; margin-bottom: 16px; }
.sheet-body strong { color: var(--text); }

.btn-secondary {
  display: block; width: 100%;
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: background .2s, border-color .2s;
  margin-top: 8px;
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--accent); }

/* ============ PANEL ============ */
.panel {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
}
.panel-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s;
}
[data-theme="light"] .panel-bg { background: rgba(15,20,45,0.4); }
.panel-body {
  position: relative; width: 100%; max-width: 460px;
  height: 100dvh; max-height: 100dvh;
  border-radius: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: panelIn .35s cubic-bezier(.22,1,.36,1);
  border: none;
}
@media (min-width: 520px) {
  .panel-body {
    height: 92dvh;
    max-height: 92dvh;
    border-radius: 24px;
    border: 1px solid var(--border);
  }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.panel-head h3 {
  font-size: 16px; font-weight: 600;
  flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.panel-head-right { display: flex; gap: 6px; align-items: center; min-width: 32px; }
.panel-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: thin;
}

/* ============ PROFILE ============ */
.profile-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.profile-avatar-wrap { position: relative; margin-bottom: 12px; }
.profile-avatar {
  width: 92px; height: 92px; border-radius: 28px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff; font-weight: 700; font-size: 34px;
  box-shadow: 0 12px 40px rgba(124,92,255,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  overflow: hidden;
  background-size: cover; background-position: center;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
  position: absolute; bottom: -4px; right: -4px;
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--accent); color: #fff;
  border: 3px solid var(--bg);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124,92,255,0.5);
  transition: transform .15s;
  padding: 0;
}
.profile-avatar-edit:hover { transform: scale(1.08); }
.profile-avatar-edit svg { width: 16px; height: 16px; }
.profile-name { font-size: 19px; font-weight: 600; margin-top: 4px; }
.profile-email {
  font-size: 12.5px; color: var(--text-dim); margin-top: 2px;
  word-break: break-all; text-align: center; padding: 0 12px;
}
.profile-plan-tag {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
  color: var(--text);
}
.profile-plan-tag.pro {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #451a03;
  border-color: transparent;
  font-weight: 700;
}

.settings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.settings-group-title {
  font-size: 11px; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin: 16px 0 8px;
  font-weight: 600;
}
.settings-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  text-align: left; width: 100%;
  font-family: var(--font); font-size: 14px; color: var(--text);
}
.settings-item:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateX(2px);
}
.settings-item .icon {
  width: 34px; height: 34px; border-radius: 10px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.settings-item .icon svg { width: 17px; height: 17px; }
.settings-item .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-item .title { font-size: 14px; font-weight: 500; }
.settings-item .sub { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-item .chev { color: var(--text-dim); flex-shrink: 0; }
.settings-item .chev svg { width: 15px; height: 15px; }
.settings-item.danger .icon { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.settings-item.danger:hover { border-color: var(--danger); }

.toggle-switch {
  width: 42px; height: 24px; border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative; cursor: pointer;
  transition: background .25s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-dim);
  transition: transform .25s, background .25s;
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-switch.on::after { transform: translateX(18px); background: #fff; }

.app-lock-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 6px;
}
.app-lock-row .icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.app-lock-row .icon svg { width: 17px; height: 17px; }
.app-lock-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-lock-row .title { font-size: 14px; font-weight: 500; }
.app-lock-row .sub { font-size: 12px; color: var(--text-dim); }

/* ============ NOTIFICATIONS ============ */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  animation: itemIn .35s cubic-bezier(.22,1,.36,1) backwards;
  position: relative;
}
.notif-item:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateY(-1px);
}
.notif-item.unread { padding-left: 20px; }
.notif-item.unread::before {
  content: "";
  position: absolute; left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 17px;
  background: color-mix(in srgb, var(--info) 15%, transparent);
  color: var(--info);
}
.notif-item[data-type="success"] .notif-icon,
.notif-item[data-type="payment_approved"] .notif-icon,
.notif-item[data-type="plan_approved"] .notif-icon,
.notif-item[data-type="refund_approved"] .notif-icon,
.notif-item[data-type="email_change_approved"] .notif-icon { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.notif-item[data-type="warning"] .notif-icon,
.notif-item[data-type="storage_warning"] .notif-icon,
.notif-item[data-type="plan_rejected"] .notif-icon { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.notif-item[data-type="error"] .notif-icon,
.notif-item[data-type="payment_rejected"] .notif-icon,
.notif-item[data-type="refund_rejected"] .notif-icon,
.notif-item[data-type="email_change_rejected"] .notif-icon { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.notif-item[data-type="promo"] .notif-icon { background: var(--grad-brand); color: #fff; }
.notif-item[data-type="system"] .notif-icon,
.notif-item[data-type="maintenance"] .notif-icon { background: var(--surface-3); color: var(--text-dim); }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.notif-text { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; word-break: break-word; }
.notif-meta { font-size: 11px; color: var(--text-mute); margin-top: 6px; display: flex; gap: 8px; }

.notif-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 10px;
  color: var(--text-dim); text-align: center;
}
.notif-empty-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.notif-empty-icon svg { width: 28px; height: 28px; color: var(--text-dim); }
.notif-empty p { font-size: 15px; font-weight: 500; color: var(--text); }

.notif-dialog {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.notif-dialog-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s;
}
[data-theme="light"] .notif-dialog-backdrop { background: rgba(15,20,45,0.4); }
.notif-dialog-body {
  position: relative;
  width: 100%; max-width: 400px;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: dialogIn .4s cubic-bezier(.22,1.4,.36,1);
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] .notif-dialog-body { background: #fff; }
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.notif-dialog-accent { height: 6px; width: 100%; }
.notif-dialog-inner { padding: 24px 22px 20px; }
.notif-dialog-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 26px;
  margin-bottom: 16px;
}
.notif-dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.notif-dialog-text { font-size: 14px; line-height: 1.6; color: var(--text-dim); margin-bottom: 20px; }
.notif-dialog-actions { display: flex; flex-direction: column; gap: 8px; }

.notif-dialog.type-info      .notif-dialog-accent { background: linear-gradient(90deg, var(--info), #3b82f6); }
.notif-dialog.type-info      .notif-dialog-icon   { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.notif-dialog.type-success   .notif-dialog-accent { background: linear-gradient(90deg, var(--success), #059669); }
.notif-dialog.type-success   .notif-dialog-icon   { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.notif-dialog.type-warning   .notif-dialog-accent { background: linear-gradient(90deg, var(--warning), #d97706); }
.notif-dialog.type-warning   .notif-dialog-icon   { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.notif-dialog.type-error     .notif-dialog-accent { background: linear-gradient(90deg, var(--danger), #b91c3c); }
.notif-dialog.type-error     .notif-dialog-icon   { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.notif-dialog.type-action    .notif-dialog-accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.notif-dialog.type-action    .notif-dialog-icon   { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.notif-dialog.type-promo     .notif-dialog-accent { background: linear-gradient(90deg, #fbbf24, #f472b6, var(--accent)); }
.notif-dialog.type-promo     .notif-dialog-icon   { background: linear-gradient(135deg, #fbbf24, #f472b6); color: #fff; }
.notif-dialog.type-system    .notif-dialog-accent { background: var(--border-2); }
.notif-dialog.type-system    .notif-dialog-icon   { background: var(--surface-3); color: var(--text-dim); }

/* ============ PLANS / UPI / PAYMENTS ============ */
.plan-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s;
}
[data-theme="light"] .plan-card { background: rgba(255,255,255,0.9); }
.plan-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.plan-card.current { border-color: var(--success); }
.plan-card.featured {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.plan-card.featured::before {
  content: "POPULAR";
  position: absolute; top: 14px; right: -34px;
  background: var(--grad-brand); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 40px;
  transform: rotate(45deg);
  box-shadow: 0 4px 12px rgba(124,92,255,0.4);
}
.plan-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.plan-desc { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 12px; }
.plan-price .amt {
  font-size: 26px; font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.plan-price .per { font-size: 12px; color: var(--text-dim); }
.plan-features { list-style: none; padding: 0; margin-bottom: 14px; }
.plan-features li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 4px 0; color: var(--text-dim);
}
.plan-features li::before {
  content: "✓";
  color: var(--success); font-weight: 700; font-size: 13px;
  width: 17px; height: 17px; border-radius: 50%;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  display: grid; place-items: center; flex-shrink: 0;
}
.plan-cta {
  width: 100%; padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border-radius: 12px; cursor: pointer;
  transition: all .2s;
}
.plan-cta.primary {
  background: var(--grad-brand);
  border: none; color: #fff;
  box-shadow: 0 6px 20px rgba(124,92,255,0.4);
}
.plan-cta.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(124,92,255,0.55); }
.plan-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.plan-cta.current { color: var(--success); border-color: var(--success); }

.upi-box {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 14px;
}
.upi-id-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; gap: 12px;
  background: var(--bg);
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  margin-bottom: 12px;
}
.upi-id-label { font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.upi-id-value { font-size: 16px; font-weight: 700; font-family: var(--mono); margin-top: 3px; word-break: break-all; }
.upi-name-value { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.amount-display { text-align: center; padding: 14px 0; margin-bottom: 12px; }
.amount-display .amt {
  font-size: 40px; font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.02em;
}
.amount-display .sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.upload-drop {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px dashed var(--border-2);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  margin-bottom: 12px;
}
.upload-drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.upload-drop.has-file { border-color: var(--success); border-style: solid; }
.upload-drop-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
}
.upload-drop-icon svg { width: 22px; height: 22px; }
.upload-drop-title { font-size: 14px; font-weight: 500; }
.upload-drop-sub { font-size: 12px; color: var(--text-dim); }
.upload-drop-preview { max-width: 200px; border-radius: 10px; }

.pay-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.pay-row .pay-info { flex: 1; min-width: 0; }
.pay-row .pay-plan { font-size: 13.5px; font-weight: 500; }
.pay-row .pay-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; word-break: break-word; }
.pay-row .pay-amount { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.pay-status {
  font-size: 10px; padding: 3px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  white-space: nowrap;
}
.pay-status.pending  { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.pay-status.approved { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.pay-status.rejected { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.pay-status.refunded { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }

/* ============ ABOUT ============ */
.about-hero {
  text-align: center;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.about-hero .about-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 34px rgba(124,92,255,0.4);
}
.about-hero .about-logo svg { width: 32px; height: 32px; }
.about-hero h4 {
  font-size: 19px; font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 4px;
}
.about-hero .about-version {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.15em; text-transform: uppercase;
  font-family: var(--mono);
}
.about-section { margin-bottom: 18px; }
.about-section h5 {
  font-size: 11px; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 10px; font-weight: 600;
}
.about-section p { margin-bottom: 8px; }
.about-section ul { padding-left: 18px; }
.about-section li { margin-bottom: 4px; }

.about-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.about-tag {
  padding: 5px 10px; border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim);
  font-family: var(--mono);
}
.about-company {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  margin-bottom: 12px;
}
.about-company-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff; font-weight: 700; font-size: 17px;
  flex-shrink: 0;
}
.about-company-info { flex: 1; min-width: 0; }
.about-company-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.about-company-role { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.about-contact { display: flex; flex-direction: column; gap: 8px; }
.about-contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  font-size: 13px;
  transition: border-color .2s, background .2s;
}
.about-contact-row:hover { border-color: var(--accent); background: var(--surface-2); }
.about-contact-row .icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.about-contact-row .icon svg { width: 15px; height: 15px; }
.about-contact-row .label { color: var(--text-dim); font-size: 11px; }
.about-contact-row .value { color: var(--text); font-size: 13px; font-weight: 500; word-break: break-all; }

.about-footer {
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}
.about-footer strong { color: var(--text); font-weight: 500; }
.about-footer .heart { color: var(--danger); }

/* ============ MOVE / PROMPT / SHARE ============ */
.move-list {
  max-height: 50dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.move-item {
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font-family: var(--font); font-size: 14px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  transition: background .2s, border-color .2s;
}
.move-item:hover { background: var(--surface-2); border-color: var(--accent); }
.move-item.disabled { opacity: 0.5; pointer-events: none; }
.move-item .badge-mini {
  margin-left: auto;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}

.prompt-input {
  width: 100%; padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 15px;
  margin-bottom: 14px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.prompt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prompt-actions .btn-secondary,
.prompt-actions .btn-primary { margin-top: 0; }

.note-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font);
  line-height: 1.6;
  margin-bottom: 14px;
}

.share-note { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.expiry-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.expiry-opt {
  padding: 12px; border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font); font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.expiry-opt:hover { color: var(--text); border-color: var(--accent); }
.expiry-opt.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 500;
}
.expiry-opt[data-pro-only="true"].locked { opacity: 0.6; }

#share-result {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.share-url-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 6px 12px;
}
.share-url-row input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text);
  font-family: var(--mono); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis;
}
.share-expiry-line { font-size: 12px; color: var(--text-dim); text-align: center; }

.share-password-toggle {
  margin: 4px 0 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.share-password-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.share-password-title { font-size: 14px; font-weight: 500; color: var(--text); }
.share-password-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.share-password-fields {
  margin-top: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  animation: slideDown .25s cubic-bezier(.22,1,.36,1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.share-password-fields .prompt-input { margin-bottom: 0; }

.share-password-display {
  margin-top: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 12px;
  animation: itemIn .3s cubic-bezier(.22,1,.36,1);
}
.share-password-display-label {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.share-password-display-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border-2);
}

/* ============ COMMENTS ============ */
.comment-list {
  max-height: 40dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.comment-item {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: itemIn .3s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.comment-item-head {
  display: flex; justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-author {
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 600;
}
.comment-time { font-size: 10.5px; color: var(--text-mute); }
.comment-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-del {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  transition: color .2s, background .2s;
}
.comment-del:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.comment-form {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.comment-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 70px;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ============ TRASH ============ */
.trash-item {
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  animation: itemIn .35s cubic-bezier(.22,1,.36,1) backwards;
}
[data-theme="light"] .trash-item { background: rgba(255,255,255,0.9); }
.trash-meta { flex: 1; min-width: 0; }
.trash-name {
  font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-sub {
  font-size: 11.5px; color: var(--text-dim);
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 2px;
}
.trash-sub .sep { opacity: 0.4; }
.trash-actions { display: flex; gap: 6px; flex-shrink: 0; }
.trash-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.trash-btn.restore {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.trash-btn.restore:hover {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border-color: var(--success);
}
.trash-btn.delete {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.trash-btn.delete:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: var(--danger);
}
.trash-empty-btn {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.trash-empty-btn:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  border-color: var(--danger);
}
.trash-info {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 14px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  line-height: 1.6;
}

/* ============ GLOBAL SEARCH PANEL ============ */
.search-panel {
  position: fixed; inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: searchPanelIn 0.28s cubic-bezier(.22,1,.36,1);
}
@media (min-width: 520px) {
  .search-panel {
    max-width: 460px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
}
@keyframes searchPanelIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-panel-head {
  display: flex; align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-panel-input {
  flex: 1;
  display: flex; align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s;
}
.search-panel-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.search-panel-input svg {
  width: 18px; height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.search-panel-input input {
  flex: 1; min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}
.search-panel-input input::placeholder { color: var(--text-mute); }

.search-filters {
  display: flex; gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.search-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .2s;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
  gap: 8px;
}
.search-hint {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px;
  gap: 10px;
  color: var(--text-dim);
  text-align: center;
}
.search-hint-icon {
  width: 68px; height: 68px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.search-hint-icon svg { width: 30px; height: 30px; color: var(--text-dim); }
.search-hint p { font-size: 15px; font-weight: 500; color: var(--text); }
.search-hint span { font-size: 13px; color: var(--text-dim); }
.search-group-label {
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 4px 4px;
}

/* ============ PIN LOCK SCREEN ============ */
.lock-screen {
  position: fixed; inset: 0;
  z-index: 9500;
  background: radial-gradient(circle at 50% 40%, #131033 0%, #07070f 70%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .3s;
}
[data-theme="light"] .lock-screen {
  background: radial-gradient(circle at 50% 40%, #e8e5f8 0%, #f5f6fb 70%);
}
.lock-content {
  width: 100%;
  max-width: 340px;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: viewIn .45s cubic-bezier(.22,1,.36,1);
}
.lock-icon {
  width: 76px; height: 76px;
  border-radius: 24px;
  background: var(--grad-brand);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 14px 44px rgba(124,92,255,0.5);
  margin-bottom: 8px;
}
.lock-icon svg { width: 34px; height: 34px; }
.lock-title {
  font-size: 22px;
  font-weight: 700;
  color: #eef0f6;
  letter-spacing: -0.01em;
}
[data-theme="light"] .lock-title { color: #14162b; }
.lock-sub {
  font-size: 13px;
  color: #8f93a8;
  text-align: center;
  min-height: 18px;
}
[data-theme="light"] .lock-sub { color: #565a75; }

.pin-dots {
  display: flex; gap: 12px;
  margin: 12px 0 6px;
  height: 20px;
}
.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(143,147,168,0.5);
  background: transparent;
  transition: background .15s, border-color .15s, transform .15s;
}
.pin-dot.filled {
  background: #7c5cff;
  border-color: #7c5cff;
  transform: scale(1.15);
}
.pin-dots.error .pin-dot {
  background: #ff5470;
  border-color: #ff5470;
  animation: shake .4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
}
.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #eef0f6;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, transform .1s, border-color .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .pin-key {
  background: rgba(255,255,255,0.9);
  border-color: rgba(15,20,45,0.1);
  color: #14162b;
}
.pin-key:hover {
  background: rgba(124,92,255,0.15);
  border-color: rgba(124,92,255,0.5);
}
.pin-key:active { transform: scale(0.94); }
.pin-key-clear,
.pin-key-del {
  font-size: 14px;
  font-weight: 600;
  color: #8f93a8;
}
[data-theme="light"] .pin-key-clear,
[data-theme="light"] .pin-key-del { color: #565a75; }

.pin-setup-hint {
  font-size: 12.5px;
  color: var(--text-dim);
  min-height: 18px;
  text-align: center;
  margin-bottom: 6px;
}
.pin-setup-hint.error { color: var(--danger); }
.pin-setup-hint.success { color: var(--success); }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--text);
  z-index: 300;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  animation: toastIn .3s cubic-bezier(.22,1,.36,1);
  max-width: calc(100vw - 40px);
  text-align: center;
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ UPLOAD BAR ============ */
.upload-bar {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  max-width: 440px;
  width: calc(100% - 40px);
}
.upload-bar-inner {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 14px 18px;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}
.upload-bar-inner span { font-size: 13px; display: block; margin-bottom: 8px; }
.upload-bar-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 6px;
}
.progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--grad-brand);
  transition: width .2s;
}

/* ============ PREVIEW ============ */
.preview {
  position: fixed; inset: 0;
  z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.preview-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s;
}
[data-theme="light"] .preview-backdrop { background: rgba(15,20,45,0.4); }
.preview-body {
  position: relative;
  width: 100%; max-width: 460px;
  max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  animation: zoomIn .3s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
[data-theme="light"] .preview-body { background: #fff; }
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
  gap: 8px;
}
.preview-head span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 75%;
  flex: 1;
}
.preview-stage {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 70dvh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid; place-items: center;
  padding: 12px;
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}
.preview-stage img,
.preview-stage video {
  max-width: 100%; max-height: 65dvh;
  border-radius: 10px;
}
.preview-stage iframe {
  width: 100%; height: 60dvh;
  border: none; border-radius: 10px;
  background: #fff;
}
.preview-stage pre {
  width: 100%; padding: 14px;
  font-family: var(--mono); font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border-radius: 10px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-actions {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}
.preview-actions .btn-secondary { margin: 0; }

/* ============ RESPONSIVE ============ */
@media (min-width: 520px) {
  body {
    background:
      radial-gradient(circle at 20% 10%, rgba(124,92,255,0.18) 0%, transparent 50%),
      radial-gradient(circle at 80% 90%, rgba(34,211,238,0.14) 0%, transparent 55%),
      var(--bg);
  }
  [data-theme="light"] body {
    background:
      radial-gradient(circle at 20% 10%, rgba(124,92,255,0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 90%, rgba(34,211,238,0.08) 0%, transparent 55%),
      var(--bg);
  }
  .file-list { padding: 4px 20px 16px; }
  .stat-row { padding: 14px 20px 0; }
  .storage-bar { margin: 12px 20px 0; }
  .storage-upgrade-btn { width: calc(100% - 40px); margin: 8px 20px 0; }
  .breadcrumb { padding: 12px 20px 0; }
  .search-bar { margin: 10px 20px 0; }
  .section-head { padding: 16px 20px 8px; }
  .select-bar { margin: 6px 20px 0; }
  .bottom-spacer { height: 100px; }
}

@media (max-height: 640px) {
  .stat-row { padding-top: 8px; gap: 6px; }
  .stat { padding: 9px 6px; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 9px; }
  .storage-bar { margin-top: 8px; padding: 8px 12px; }
  .breadcrumb { padding-top: 8px; min-height: 34px; }
  .search-bar { margin-top: 8px; padding: 8px 12px; }
  .section-head { padding: 12px 16px 6px; }
  .section-head h2 { font-size: 15px; }
  .app-bar { padding: 10px 14px; }
  .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
}

@media (max-width: 360px) {
  .app-bar-actions .ghost-icon { padding: 6px; }
  .app-bar-actions .ghost-icon svg { width: 16px; height: 16px; }
  .user-name { max-width: 100px; }
  .stat-num { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .orb, .splash-orb { animation: none; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .fab-wrap { bottom: calc(84px + env(safe-area-inset-bottom)); }
}