/* =========================================================
   قارئ PDF — Design System
   Arabic RTL · IBM Plex Sans Arabic · cool/warm/violet × light/dark
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
[hidden] { display: none !important; }

body {
  font-family: 'IBM Plex Sans Arabic', 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}
input, button, textarea, select { font-family: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--fg-mute); }
.link { color: var(--accent); border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); }
.link:hover { border-bottom-color: var(--accent); }
.link-mini { color: var(--accent); font-size: 13px; font-weight: 500; }
.link-inline { color: var(--accent); font-weight: 600; cursor: pointer; }

/* =========================================================
   THEME VARIABLES
   ========================================================= */

:root,
[data-theme="light"][data-variant="cool"] {
  --bg: oklch(0.985 0.005 220);
  --bg-elev: oklch(1 0 0);
  --bg-soft: oklch(0.97 0.006 220);
  --bg-inset: oklch(0.955 0.008 220);
  --fg: oklch(0.22 0.015 240);
  --fg-mute: oklch(0.55 0.015 240);
  --fg-dim: oklch(0.72 0.012 240);
  --line: oklch(0.92 0.008 230);
  --line-strong: oklch(0.86 0.012 230);
  --accent: oklch(0.58 0.08 215);
  --accent-soft: oklch(0.94 0.03 215);
  --accent-fg: oklch(0.99 0.005 215);
  --ok: oklch(0.66 0.1 160);
  --warn: oklch(0.72 0.12 65);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow: 0 4px 16px -8px rgba(17,24,39,.1), 0 1px 2px rgba(17,24,39,.04);
  --shadow-lg: 0 24px 60px -30px rgba(17,24,39,.22), 0 4px 12px -4px rgba(17,24,39,.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="light"][data-variant="warm"] {
  --bg: oklch(0.985 0.008 70);
  --bg-elev: oklch(1 0 0);
  --bg-soft: oklch(0.97 0.012 70);
  --bg-inset: oklch(0.955 0.014 70);
  --fg: oklch(0.24 0.02 50);
  --fg-mute: oklch(0.55 0.02 50);
  --fg-dim: oklch(0.72 0.015 50);
  --line: oklch(0.92 0.012 60);
  --line-strong: oklch(0.86 0.016 60);
  --accent: oklch(0.62 0.11 50);
  --accent-soft: oklch(0.94 0.04 60);
  --accent-fg: oklch(0.99 0.005 60);
  --ok: oklch(0.66 0.1 160);
  --warn: oklch(0.72 0.12 65);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow: 0 4px 16px -8px rgba(17,24,39,.1), 0 1px 2px rgba(17,24,39,.04);
  --shadow-lg: 0 24px 60px -30px rgba(17,24,39,.22), 0 4px 12px -4px rgba(17,24,39,.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="light"][data-variant="violet"] {
  --bg: oklch(0.985 0.006 290);
  --bg-elev: oklch(1 0 0);
  --bg-soft: oklch(0.97 0.008 290);
  --bg-inset: oklch(0.955 0.01 290);
  --fg: oklch(0.22 0.02 280);
  --fg-mute: oklch(0.54 0.02 280);
  --fg-dim: oklch(0.72 0.012 280);
  --line: oklch(0.92 0.01 285);
  --line-strong: oklch(0.86 0.014 285);
  --accent: oklch(0.52 0.14 285);
  --accent-soft: oklch(0.94 0.04 285);
  --accent-fg: oklch(0.99 0.005 285);
  --ok: oklch(0.66 0.1 160);
  --warn: oklch(0.72 0.12 65);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow: 0 4px 16px -8px rgba(17,24,39,.1), 0 1px 2px rgba(17,24,39,.04);
  --shadow-lg: 0 24px 60px -30px rgba(17,24,39,.22), 0 4px 12px -4px rgba(17,24,39,.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"][data-variant="cool"] {
  --bg: oklch(0.18 0.012 240);
  --bg-elev: oklch(0.22 0.015 240);
  --bg-soft: oklch(0.24 0.014 240);
  --bg-inset: oklch(0.15 0.012 240);
  --fg: oklch(0.96 0.005 240);
  --fg-mute: oklch(0.68 0.012 240);
  --fg-dim: oklch(0.5 0.01 240);
  --line: oklch(0.3 0.015 240);
  --line-strong: oklch(0.38 0.02 240);
  --accent: oklch(0.72 0.1 215);
  --accent-soft: oklch(0.3 0.04 215);
  --accent-fg: oklch(0.12 0.01 215);
  --ok: oklch(0.72 0.11 160);
  --warn: oklch(0.78 0.12 65);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 16px -8px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 60px -30px rgba(0,0,0,.6), 0 4px 12px -4px rgba(0,0,0,.3);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"][data-variant="warm"] {
  --bg: oklch(0.2 0.02 50);
  --bg-elev: oklch(0.24 0.022 50);
  --bg-soft: oklch(0.26 0.02 50);
  --bg-inset: oklch(0.17 0.018 50);
  --fg: oklch(0.97 0.01 60);
  --fg-mute: oklch(0.7 0.015 55);
  --fg-dim: oklch(0.52 0.012 55);
  --line: oklch(0.32 0.022 50);
  --line-strong: oklch(0.4 0.026 50);
  --accent: oklch(0.76 0.12 60);
  --accent-soft: oklch(0.3 0.05 60);
  --accent-fg: oklch(0.15 0.02 55);
  --ok: oklch(0.72 0.11 160);
  --warn: oklch(0.78 0.12 65);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 16px -8px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 60px -30px rgba(0,0,0,.6), 0 4px 12px -4px rgba(0,0,0,.3);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"][data-variant="violet"] {
  --bg: oklch(0.18 0.02 285);
  --bg-elev: oklch(0.22 0.025 285);
  --bg-soft: oklch(0.24 0.022 285);
  --bg-inset: oklch(0.15 0.018 285);
  --fg: oklch(0.96 0.008 290);
  --fg-mute: oklch(0.68 0.015 285);
  --fg-dim: oklch(0.5 0.012 285);
  --line: oklch(0.3 0.022 285);
  --line-strong: oklch(0.38 0.03 285);
  --accent: oklch(0.74 0.14 290);
  --accent-soft: oklch(0.3 0.06 290);
  --accent-fg: oklch(0.14 0.02 290);
  --ok: oklch(0.72 0.11 160);
  --warn: oklch(0.78 0.12 65);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 16px -8px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 60px -30px rgba(0,0,0,.6), 0 4px 12px -4px rgba(0,0,0,.3);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

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

/* =========================================================
   LOGIN SCREEN
   ========================================================= */

.login-root {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.login-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.blob-1 { width: 520px; height: 520px; background: var(--accent); top: -200px; right: -150px; opacity: 0.2; }
.blob-2 { width: 420px; height: 420px; background: var(--accent); bottom: -180px; left: -100px; opacity: 0.15; }
.blob-3 { width: 300px; height: 300px; background: var(--accent); top: 40%; left: 20%; opacity: 0.08; }
[data-theme="dark"] .blob   { opacity: 0.35; }
[data-theme="dark"] .blob-2 { opacity: 0.28; }
[data-theme="dark"] .blob-3 { opacity: 0.14; }

.login-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 48px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub  { font-size: 10px; color: var(--fg-mute); letter-spacing: 0.12em; text-transform: uppercase; font-family: 'Space Grotesk', sans-serif; }

.login-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 96px;
  gap: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-card-head { margin-bottom: 24px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif;
}
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 8px; }
.login-card-head p { font-size: 14px; line-height: 1.5; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.field label { font-size: 12px; color: var(--fg-mute); font-weight: 500; }

.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
  color: var(--fg);
}
.field input::placeholder { color: var(--fg-dim); }
.field input:focus {
  background: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 15%, transparent);
}

.input-with-affix { position: relative; }
.affix-btn {
  position: absolute;
  top: 50%; left: 10px;
  transform: translateY(-50%);
  padding: 6px; border-radius: 6px;
  color: var(--fg-mute);
}
.affix-btn:hover { color: var(--fg); background: var(--bg-inset); }
.input-with-affix input { padding-left: 38px; }

.login-success {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: oklch(0.42 0.14 160);
  background: oklch(0.95 0.03 160);
  border: 1px solid oklch(0.85 0.06 160);
  border-radius: 8px;
  padding: 10px 12px;
  animation: fade-in 0.25s ease;
}
[data-theme="dark"] .login-success {
  color: oklch(0.75 0.12 160);
  background: oklch(0.24 0.04 160);
  border-color: oklch(0.34 0.08 160);
}

.login-error {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: oklch(0.55 0.2 25);
  background: oklch(0.96 0.02 25);
  border: 1px solid oklch(0.88 0.04 25);
  border-radius: 8px;
  padding: 10px 12px;
  animation: fade-in 0.25s ease;
}
.login-error > svg { flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.login-error > span { display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .login-error {
  color: oklch(0.78 0.15 25);
  background: oklch(0.25 0.04 25);
  border-color: oklch(0.35 0.08 25);
}
.login-resend-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: oklch(0.55 0.2 25);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-align: right;
}
[data-theme="dark"] .login-resend-btn { color: oklch(0.78 0.15 25); }
.login-resend-btn:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: none; }

/* Field label row (label + hint icon) */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.field-label-row label { margin-bottom: 0; }
.field-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  color: var(--fg-mute);
  font-size: 10px;
  font-weight: 700;
  cursor: default;
  flex-shrink: 0;
}
.field-hint::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--fg);
  color: var(--bg-elev);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  text-align: right;
}
.field-hint:hover::after { opacity: 1; }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  transition: all 0.15s ease;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow); }

.login-card-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--fg-mute);
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dot { color: var(--fg-dim); }

.login-marquee {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.marquee-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.marquee-item .num { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.marquee-item .lbl { font-size: 11px; color: var(--fg-mute); }
.divider-v { width: 1px; height: 22px; background: var(--line); }

@media (max-width: 640px) {
  .login-top { padding: 18px 20px; }
  .login-card { padding: 28px 22px 22px; }
  .login-card h1 { font-size: 22px; }
  .login-marquee { flex-direction: column; gap: 12px; padding: 16px 24px; border-radius: 16px; }
  .divider-v { width: 22px; height: 1px; }
}

/* =========================================================
   APP SHELL — sidenav + main
   ========================================================= */

.app-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
}

.sidenav {
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Brand row: logo + theme toggle side by side */
.sn-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sn-theme-btn { flex-shrink: 0; }

.sn-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sn-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--fg-mute);
  font-weight: 500;
  transition: all 0.15s ease;
  width: 100%;
  text-align: right;
}
.sn-nav button svg { color: var(--fg-dim); flex-shrink: 0; }
.sn-nav button:hover { background: var(--bg-inset); color: var(--fg); }
.sn-nav button:hover svg { color: var(--fg-mute); }
.sn-nav button.on { background: var(--bg-elev); color: var(--fg); box-shadow: var(--shadow-sm); }
.sn-nav button.on svg { color: var(--accent); }
.sn-nav .badge {
  margin-right: auto;
  font-size: 11px;
  padding: 2px 7px;
  background: var(--bg-inset);
  border-radius: 999px;
  color: var(--fg-mute);
  font-family: 'Space Grotesk', sans-serif;
}
.sn-nav button.on .badge { background: var(--accent-soft); color: var(--accent); }

/* Divider and logout in nav */
.sn-nav-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 4px;
}
.sn-nav-logout { color: var(--err, #e05252) !important; }
.sn-nav-logout svg { color: var(--err, #e05252) !important; }
.sn-nav-logout:hover { background: color-mix(in oklch, var(--err, #e05252) 8%, transparent) !important; }

/* old footer — kept for mobile compat, hidden on desktop */
.sn-foot { display: none; }
.sn-user-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px 6px;
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--fg-mute);
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--bg-inset); color: var(--fg); }
.icon-btn.ghost:hover { background: var(--bg-elev); }

/* =========================================================
   MOBILE TOP BAR
   ========================================================= */
.mob-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 100;
  background: color-mix(in oklch, var(--bg-elev) 90%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mob-brand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.mob-brand-btn:hover { background: var(--bg-inset); }

.mob-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  color: var(--fg-mute);
  transition: background 0.15s ease, color 0.15s ease;
}
.mob-burger:hover,
.mob-burger.open { background: var(--bg-inset); color: var(--fg); }

/* Dropdown menu */
.mob-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
}
.mob-menu-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, var(--bg) 40%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mob-menu-panel {
  position: absolute;
  top: 56px;
  left: 12px; right: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: menu-drop 0.18s ease;
}
@keyframes menu-drop {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mob-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.mob-menu-row-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--fg-mute);
  flex-shrink: 0;
}
.mob-menu-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.mob-theme-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
  transition: all 0.15s ease;
}
.mob-theme-pill:hover { background: var(--accent); color: #fff; }

.mob-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 0 18px;
}

.mob-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-align: right;
  transition: background 0.12s ease;
}
.mob-menu-btn svg { color: var(--fg-mute); flex-shrink: 0; }
.mob-menu-btn:hover { background: var(--bg-soft); }
.mob-menu-logout { color: var(--err, #e05252); }
.mob-menu-logout svg { color: var(--err, #e05252); }
.mob-menu-logout:hover { background: color-mix(in oklch, var(--err, #e05252) 8%, transparent); }

.app-main {
  padding: 28px 36px 96px;
  min-width: 0;
  overflow-y: auto;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; }
.page-sub { font-size: 13.5px; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   LANDING PAGE
   ========================================================= */

.landing-main:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
}

.landing-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: landing-fade 0.5s ease;
}

@keyframes landing-fade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.landing-logo {
  width: 96px; height: 96px;
  border-radius: 24px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 25%, transparent);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px color-mix(in oklch, var(--accent) 18%, transparent);
}

.landing-name {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.1;
}

.landing-sub {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 40px;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.landing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
  width: 100%;
}

.landing-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 14px;
  width: 100%;
  color: var(--fg);
  border: 1.5px solid var(--line-strong);
  background: none;
  transition: all 0.15s ease;
}
.landing-btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.landing-btn-ghost svg { color: var(--fg-mute); transition: color 0.15s ease; }
.landing-btn-ghost:hover svg { color: var(--accent); }

/* =========================================================
   UPLOAD SCREEN
   ========================================================= */

.upload-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  margin-inline: auto;
  width: 100%;
}

.upload-card { overflow: hidden; }

/* While uploading/converting, hide sidebar cards */
.upload-grid.uploading .speaker-card,
.upload-grid.uploading .tips-card-standalone { display: none; }

.dropzone {
  padding: 56px 32px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  margin: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-soft);
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 10%, transparent);
}
.dz-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.dz-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.dz-sub   { font-size: 13px; color: var(--fg-mute); }
.dz-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  width: 100%;
  justify-content: center;
}
.dz-meta .sep { opacity: 0.5; }

/* =========================================================
   UPLOAD PROGRESS & CONVERTING STATES
   ========================================================= */

/* Clickable brand logo */
.sn-brand {
  border-radius: 10px;
  transition: background 0.15s ease;
}
.sn-brand:hover { background: var(--bg-inset); }

/* Upload progress state */
.upload-progress { padding: 28px 24px; display: flex; flex-direction: column; gap: 0; }

.conv-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.conv-back {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-mute);
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  font-weight: 500;
}
.conv-back:hover { background: var(--bg-soft); color: var(--fg); }

.up-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.up-file-icon {
  width: 42px; height: 42px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.up-file-icon.ok {
  background: color-mix(in oklch, var(--ok) 15%, transparent);
  color: var(--ok);
}
.up-file-info { flex: 1; min-width: 0; }
.up-file-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-file-meta { font-size: 12px; color: var(--fg-mute); margin-top: 2px; }

/* Converting state */
.converting-view {
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}
.conv-est-wrap {
  padding: 14px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.conv-est-time {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.conv-text { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.conv-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.conv-sub { font-size: 13px; line-height: 1.55; }
.conv-steps {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  flex-wrap: wrap;
  justify-content: center;
}
.cs-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-dim); }
.cs-dots { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.cs-dots span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.cs-step.done { color: var(--ok); }
.cs-step.active { color: var(--accent); }
.cs-step.active .cs-dots span { animation: wave-dot 0.9s ease-in-out infinite; }
.cs-step.active .cs-dots span:nth-child(2) { animation-delay: 0.15s; }
.cs-step.active .cs-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wave-dot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-4px); opacity: 0.3; }
}

/* Speaker / config card */
.speaker-card { display: flex; flex-direction: column; }
.config-card  { display: flex; flex-direction: column; }
.configure    { padding: 22px; display: flex; flex-direction: column; gap: 18px; flex: 1; }

/* File ready state */
.upload-ready {
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ready-file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ready-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ready-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
}
.ready-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-mute);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: none;
  transition: all 0.15s ease;
}
.ready-clear:hover { border-color: var(--fg-dim); color: var(--fg); }

/* Tips standalone card */
.tips-card-standalone { padding: 0; overflow: hidden; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.config-section { display: flex; flex-direction: column; }

.speaker-row-new {
  display: flex;
  gap: 8px;
  align-items: center;
}

.speaker-select-styled {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  direction: rtl;
  transition: all 0.15s ease;
}
.speaker-select-styled:hover,
.speaker-select-styled:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 15%, transparent);
}

.preview-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 40px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.preview-btn:hover { border-color: var(--accent); color: var(--accent); }
.preview-btn.previewing { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Tips card */
.tips-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.tips-title { font-size: 14px; font-weight: 600; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.tips-list li { display: flex; gap: 12px; font-size: 13px; line-height: 1.45; }
.tip-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.tips-list b { font-weight: 600; }
.tips-list p { color: var(--fg-mute); font-size: 12.5px; margin-top: 2px; }

/* Error / status banner */
.status-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 12px;
  animation: fade-in 0.25s ease;
}
.status-err {
  background: oklch(0.96 0.02 25);
  border: 1px solid oklch(0.88 0.04 25);
  color: oklch(0.5 0.2 25);
}
[data-theme="dark"] .status-err {
  background: oklch(0.25 0.04 25);
  border-color: oklch(0.35 0.08 25);
  color: oklch(0.78 0.15 25);
}
.status-msg button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  margin-right: auto;
  padding: 2px;
  opacity: 0.7;
  display: flex;
  align-items: center;
}
.status-msg button:hover { opacity: 1; }

/* =========================================================
   LIBRARY SCREEN
   ========================================================= */

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 24px;
}

.lib-card {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease;
  animation: fade-in 0.35s ease both;
}
.lib-card:hover { transform: translateY(-2px); }

.lib-cover-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 10 / 14;
  background: var(--bg-inset);
  flex-shrink: 0;
}
.lib-cover-wrap:hover .lib-play { opacity: 1; }

.lib-cover-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
}
.lib-cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lib-cover-initial {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
  pointer-events: none;
}
.lib-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  color: white;
}
.lib-new {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
}

.lib-info { display: flex; flex-direction: column; gap: 4px; }
.lib-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-author { font-size: 12px; color: var(--fg-mute); }
.lib-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  margin-top: 2px;
}
.lib-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
}
.lib-status.ready      { background: color-mix(in oklch, var(--ok) 15%, transparent); color: var(--ok); }
.lib-status.processing { background: var(--accent-soft); color: var(--accent); }
.lib-status.error      { background: oklch(0.93 0.03 25); color: oklch(0.5 0.2 25); }
[data-theme="dark"] .lib-status.error { background: oklch(0.25 0.04 25); color: oklch(0.78 0.15 25); }

.lib-delete-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.lib-cover-wrap:hover .lib-delete-btn,
.lib-delete-btn:focus-visible { opacity: 1; }
.lib-delete-btn:hover { background: oklch(0.48 0.2 25); }

.lib-progress {
  height: 3px;
  background: var(--bg-inset);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.lib-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.lib-view-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 24px;
  color: var(--fg-dim);
  text-align: center;
}
.lib-empty-icon { opacity: 0.4; color: var(--fg-mute); }
.lib-view-empty p { font-size: 14px; }
.lib-empty-sub { font-size: 12px; color: var(--fg-dim); }

/* =========================================================
   PLAYER SCREEN
   ========================================================= */

.player-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.player-wrap-solo { grid-template-columns: 1fr !important; max-width: 700px; margin-left: auto; margin-right: auto; }

.player-main { padding: 32px; display: flex; flex-direction: column; gap: 24px; position: relative; }
.player-main-v2 { padding: 36px 40px; gap: 28px; }

/* Book hero */
.pm-hero {
  display: flex;
  gap: 28px;
  align-items: center;
}
.pm-hero-v2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.pm-meta { flex: 1; min-width: 0; }
.pm-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  font-family: 'Space Grotesk', sans-serif;
}
.pm-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.pm-author { font-size: 13.5px; color: var(--fg-mute); }

/* New book cover */
.book-cover-new {
  width: 120px;
  height: 168px;
  flex-shrink: 0;
}
.cover-art {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.35), 0 2px 6px -2px rgba(0,0,0,0.15);
  position: relative;
  transition: transform 0.3s ease;
}
.cover-art:hover { transform: scale(1.02) rotate(-0.5deg); }
.cover-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0px, transparent 6px, rgba(0,0,0,0.04) 6px, rgba(0,0,0,0.04) 7px);
  pointer-events: none;
}
.cover-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.cover-initial { display: none; } /* superseded by cover-title */

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 1;
}
#cover-art:has(#cover-img:not([hidden])) .cover-title,
#cover-art:has(#cover-img:not([hidden])) .cover-wave { display: none; }

.cover-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  text-align: center;
  padding: 0 10px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  line-height: 1;
  z-index: 1;
  user-select: none;
}
.cover-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  z-index: 1;
}
.cw-bar {
  width: 3px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  animation: none;
}
.cw-bar:nth-child(1) { height: 8px; }
.cw-bar:nth-child(2) { height: 14px; }
.cw-bar:nth-child(3) { height: 20px; }
.cw-bar:nth-child(4) { height: 14px; }
.cw-bar:nth-child(5) { height: 8px; }

/* Animate only when audio is playing */
.cover-wave.playing .cw-bar {
  background: rgba(255,255,255,0.85);
  animation: cw-play 0.8s ease-in-out infinite;
}
.cover-wave.playing .cw-bar:nth-child(1) { animation-delay: 0s; }
.cover-wave.playing .cw-bar:nth-child(2) { animation-delay: .12s; }
.cover-wave.playing .cw-bar:nth-child(3) { animation-delay: .24s; }
.cover-wave.playing .cw-bar:nth-child(4) { animation-delay: .36s; }
.cover-wave.playing .cw-bar:nth-child(5) { animation-delay: .24s; }
@keyframes cw-play {
  0%,100% { transform: scaleY(0.35); }
  50%     { transform: scaleY(1); }
}

/* Waveform scrubber */
.waveform {
  position: relative;
  height: 96px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  overflow: hidden;
}
.wf-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.wf-bar {
  flex: 1;
  min-height: 3px;
  background: var(--fg-dim);
  border-radius: 1px;
  opacity: 0.4;
  transition: background 0.1s ease;
}
.wf-bar.played {
  background: var(--accent);
  opacity: 1;
}
.wf-seek {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}
.wf-cursor {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 0%;
  width: 2px;
  background: var(--fg);
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
  transition: right 0.1s linear;
}
.wf-cursor::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fg);
}

/* Time row */
.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: 'Space Grotesk', sans-serif;
  margin-top: -16px;
  color: var(--fg-mute);
  padding: 0 4px;
}

/* Playback controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 0;
}
.ctrl-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--fg);
  transition: all 0.15s ease;
}
.ctrl-btn.sec { color: var(--fg-mute); }
.ctrl-btn.sec:hover { background: var(--bg-inset); color: var(--fg); }
.ctrl-btn.primary {
  width: 72px; height: 72px;
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 8px 24px -8px color-mix(in oklch, var(--accent) 60%, transparent);
}
.ctrl-btn.primary:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px -8px color-mix(in oklch, var(--accent) 80%, transparent);
}

/* Extras panel */
.extras-panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 18px;
}
.extras-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.extras-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.el-title { font-size: 13.5px; font-weight: 500; }
.el-sub   { font-size: 11.5px; color: var(--fg-mute); }
.extras-divider { height: 1px; background: var(--line); }

/* Download button */
.player-download-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.player-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--fg-mute);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.player-download-btn:hover {
  background: var(--bg-inset);
  color: var(--fg);
  border-color: var(--accent);
}

/* Speed segmented control */
.speed-seg {
  display: flex;
  background: var(--bg-inset);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.speed-seg button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-mute);
  font-family: 'Space Grotesk', sans-serif;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s ease;
}
.speed-seg button.on {
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* Volume control */
.vol-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vol-custom {
  position: relative;
  width: 100px;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.vol-track {
  width: 100%;
  height: 4px;
  background: var(--bg-inset);
  border-radius: 999px;
  overflow: hidden;
}
.vol-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 100%;
  transition: width 0.05s linear;
}
.vol-thumb {
  position: absolute;
  top: 50%;
  left: calc(100% - 7px);
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
  transition: left 0.05s linear, transform 0.1s ease;
}
.vol-custom:hover .vol-thumb,
.vol-custom.dragging .vol-thumb { transform: translateY(-50%) scale(1.2); }

/* Processing overlay */
.processing-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, var(--bg-elev) 92%, transparent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}
.proc-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 280px;
}
.proc-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc-text { font-size: 14px; color: var(--fg-mute); font-weight: 500; }
.proc-bar-wrap {
  width: 200px;
  height: 4px;
  background: var(--bg-inset);
  border-radius: 999px;
  overflow: hidden;
}
.proc-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .player-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-root { grid-template-columns: 1fr; }

  /* Show mobile top bar */
  .mob-topbar { display: flex; }

  /* Bottom tab nav */
  .sidenav {
    position: fixed;
    bottom: 0;
    right: 0; left: 0;
    top: auto;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 6px 8px env(safe-area-inset-bottom, 0px);
    z-index: 50;
    background: var(--bg-elev);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .sn-brand-row, .sn-foot { display: none; }
  .sn-nav { flex-direction: row; justify-content: space-around; }
  .sn-nav button { flex-direction: column; gap: 4px; padding: 8px 10px; font-size: 11px; width: auto; }
  .sn-nav .badge { display: none; }
  /* hide divider and logout from bottom tab nav on mobile */
  .sn-nav-divider, .sn-nav-logout { display: none; }

  /* Content area clears both top bar (56px) and bottom nav (≈64px) */
  .app-main { padding: 76px 16px 100px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .pm-hero { flex-direction: column; text-align: center; align-items: center; }
  .page-title { font-size: 22px; }
  .player-main-v2 { padding: 24px 16px; }
}

@media (max-width: 560px) {
  .extras-row { flex-direction: column; align-items: stretch; }
  .speed-seg { overflow-x: auto; }
  .vol-area { width: 100%; }
  .vol-custom { width: 100%; }
}

@media (max-width: 480px) {
  .login-marquee { display: none; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   EMAIL VERIFICATION REMINDER (corner card)
   ========================================================= */
.email-verify-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid oklch(0.88 0.1 65);
  border-right: 3px solid oklch(0.72 0.14 65);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: oklch(0.45 0.12 65);
  font-size: 12px;
  animation: fade-in 0.3s ease;
}
[data-theme="dark"] .email-verify-banner {
  border-color: oklch(0.38 0.1 65);
  border-right-color: oklch(0.65 0.14 65);
  color: oklch(0.78 0.12 65);
}
.evb-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
}
.evb-resend-btn {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: right;
}
.evb-resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}
.evb-dismiss-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 2px;
}
.evb-dismiss-btn:hover { opacity: 1; }

/* Verified success toast */
.verified-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: oklch(0.35 0.1 160);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  animation: fade-in 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
