:root {
  --accent: #8B5CF6;
  --bg: #0B0B0F;
  --surface: #15151C;
  --surface-2: #1E1E28;
  --surface-3: #2A2A36;
  --text: #F5F5F7;
  --muted: #A1A1AE;
  --faint: #6B6B78;
  --line: rgba(255,255,255,.08);
  --radius: 10px;
  --nav-h: 64px;
  --mini-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; object-fit: cover; object-position: center; background: var(--surface-3); }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
#app { display: grid; height: 100%; width: 100%; max-width: 100vw; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
#app > * { min-width: 0; }
.sidebar { display: none; }
#main { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; padding-top: var(--safe-t); }
#view { padding: 0 16px 24px; max-width: 1400px; margin: 0 auto; min-height: 100%; }
.tabbar { display: flex; width: 100%; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: linear-gradient(to top, #000 55%, rgba(0,0,0,.92)); border-top: 1px solid var(--line); }
.tabbar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.tabbar a.active { color: var(--text); }

@media (min-width: 900px) {
  #app { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px; padding: 8px 8px 0; }
  .sidebar { display: flex; flex-direction: column; gap: 8px; grid-row: 1; min-height: 0; }
  #main { grid-row: 1; grid-column: 2; background: var(--surface); border-radius: var(--radius); }
  #view { padding: 0 28px 32px; }
  .tabbar { display: none; }
  #player-bar { grid-column: 1 / -1; }
}
.side-box { background: var(--surface); border-radius: var(--radius); padding: 14px 10px; }
.side-box.grow { flex: 1; overflow-y: auto; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; color: #fff; }
.side-nav a { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.side-nav a:hover, .side-nav a.active { color: var(--text); }
.side-nav a.active { background: var(--surface-2); }
.side-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 700; padding: 4px 12px 10px; }
.side-show { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; }
.side-show:hover { background: var(--surface-2); }
.side-show img { width: 44px; height: 44px; border-radius: 6px; }
.side-show b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-show small { color: var(--muted); font-size: 12px; }
.side-empty { color: var(--muted); font-size: 13px; padding: 4px 12px; line-height: 1.5; }

/* ---------- Header / top ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 8px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--accent); color: #fff; }

/* ---------- Sections ---------- */
.section { margin-top: 26px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-h h2 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.section-h a, .link-btn { color: var(--muted); font-size: 13px; font-weight: 700; }
.section-h a:hover { color: var(--text); text-decoration: underline; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 8px; }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.quick a { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; height: 56px; font-weight: 700; font-size: 13px; transition: background .15s; }
.quick a:hover { background: var(--surface-3); }
.quick img { width: 56px; height: 56px; }
.quick span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-right: 8px; }

.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; }
.row-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .row-scroll { grid-auto-columns: 180px; margin: 0; padding: 0 0 4px; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }

.card { scroll-snap-align: start; display: block; padding: 10px; margin: -10px; border-radius: 10px; transition: background .2s; position: relative; min-width: 0; }
@media (hover: hover) { .card:hover { background: var(--surface-2); } .card:hover .card-play { opacity: 1; transform: translateY(0); } }
.card .cover { width: 100%; aspect-ratio: 1; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.card b { display: block; margin-top: 10px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.card-play { position: absolute; right: 18px; top: calc(100% - 118px); opacity: 0; transform: translateY(8px); transition: .2s; }
.card .prog { margin-top: 8px; }
@media (hover: none) { .card-play { display: none; } }

/* ---------- Buttons ---------- */
.play-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .1s, filter .15s; flex: none; }
.play-btn:hover { filter: brightness(1.1); transform: scale(1.04); }
.play-btn:active { transform: scale(.96); }
.play-btn svg { width: 24px; height: 24px; }
.play-btn.lg { width: 56px; height: 56px; }
.play-btn.lg svg { width: 28px; height: 28px; }
.play-btn.sm { width: 34px; height: 34px; box-shadow: none; }
.play-btn.sm svg { width: 18px; height: 18px; }
.play-btn.ghost { background: var(--text); color: #000; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: color .15s, background .15s; flex: none; }
.icon-btn:hover { color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 20px; height: 20px; }
.outline-btn { padding: 7px 16px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35); font-weight: 700; font-size: 13px; }
.outline-btn:hover { border-color: var(--text); }
.outline-btn.on { border-color: var(--accent); color: var(--accent); }
.primary-btn { padding: 13px 28px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; }

/* ---------- Progress ---------- */
.prog { height: 3px; background: rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); width: 0; }

/* ---------- Show header ---------- */
.hero { margin: 0 -16px; padding: calc(56px + var(--safe-t)) 16px 20px; margin-top: calc(-1 * var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--hero, #333), transparent); opacity: .65; z-index: -1; }
.hero .cover { width: 220px; height: 220px; border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,.55); }
.hero-text { width: 100%; }
.hero-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.75); }
.hero h1 { font-size: 26px; line-height: 1.12; margin: 6px 0; letter-spacing: -.02em; }
.hero .by { color: rgba(255,255,255,.75); font-size: 14px; font-weight: 600; }
.back-btn { position: absolute; top: calc(10px + var(--safe-t)); left: 8px; background: rgba(0,0,0,.4); color: #fff; }
@media (min-width: 900px) {
  .hero { margin: 0 -28px; padding: 64px 28px 24px; flex-direction: row; align-items: flex-end; gap: 24px; }
  .hero .cover { width: 232px; height: 232px; }
  .hero h1 { font-size: 48px; margin: 8px 0 12px; }
  .back-btn { display: none; }
}
.actions { display: flex; align-items: center; gap: 14px; padding: 8px 0 4px; }
.actions .spacer { flex: 1; }
.desc { color: var(--muted); line-height: 1.55; font-size: 14px; margin: 14px 0 0; white-space: pre-line; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Episode rows ---------- */
.ep-list { margin-top: 8px; }
.ep { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); position: relative; }
.ep.no-cover { grid-template-columns: 1fr; }
.ep .ep-cover { width: 64px; height: 64px; border-radius: 6px; }
@media (min-width: 900px) { .ep { grid-template-columns: auto 1fr; padding: 16px 12px; margin: 0 -12px; border-radius: 8px; border-top-color: transparent; } .ep:hover { background: var(--surface-2); } .ep .ep-cover { width: 104px; height: 104px; } }
.ep-body { min-width: 0; }
.ep-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-title:hover { text-decoration: underline; }
.ep.current .ep-title { color: var(--accent); }
.ep-show { color: var(--muted); font-size: 13px; margin-top: 2px; display: block; }
.ep-desc { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.ep-meta { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ep-meta .prog { width: 64px; }
.ep-meta .done { color: var(--accent); display: flex; align-items: center; gap: 4px; font-weight: 600; }
.ep-meta .done svg { width: 16px; height: 16px; }
.ep-foot .spacer { flex: 1; }

/* ---------- Episode page ---------- */
.ep-page-head { display: flex; gap: 16px; align-items: center; padding-top: calc(60px + var(--safe-t)); margin-top: calc(-1 * var(--safe-t)); }
.ep-page-head .cover { width: 112px; height: 112px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ep-page { isolation: isolate; }
.ep-page h1 { font-size: 24px; line-height: 1.2; margin: 18px 0 6px; letter-spacing: -.01em; }
@media (min-width: 900px) { .ep-page-head { padding-top: 48px; } .ep-page-head .cover { width: 160px; height: 160px; } .ep-page { isolation: isolate; }
.ep-page h1 { font-size: 34px; } }

/* ---------- Search ---------- */
.search-box { display: flex; align-items: center; gap: 10px; background: var(--text); color: #111; border-radius: 8px; padding: 0 14px; height: 46px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: #111; min-width: 0; }
.search-box svg { color: #333; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.cat { position: relative; height: 96px; border-radius: 8px; overflow: hidden; padding: 12px; font-weight: 800; font-size: 17px; text-align: left; }
.cat img { position: absolute; width: 70px; height: 70px; right: -10px; bottom: -6px; transform: rotate(22deg); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }

/* ---------- Library ---------- */
.lib-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.lib-item img { width: 60px; height: 60px; border-radius: 6px; }
.lib-item b { display: block; font-size: 15px; }
.lib-item small { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; line-height: 1.6; }
.empty svg { width: 48px; height: 48px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Player bar ---------- */
#player-bar { display: none; }
#player-bar.show { display: block; }
.mini { position: relative; margin: 0 8px 6px; height: var(--mini-h); border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px; background: var(--mini-bg, var(--surface-3)); overflow: hidden; cursor: pointer; }
.mini .cover { width: 44px; height: 44px; border-radius: 4px; }
.mini-text { flex: 1; min-width: 0; }
.mini-text b, .mini-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text b { font-size: 13px; }
.mini-text small { font-size: 12px; color: rgba(255,255,255,.7); }
.mini .prog { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; }
.mini .prog i { background: #fff; }
.mini .icon-btn { color: #fff; }
.desk-player { display: none; }
@media (min-width: 900px) {
  .mini { display: none; }
  .desk-player { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr); align-items: center; height: 76px; padding: 0 8px; gap: 16px; }
  .dp-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .dp-left .cover { width: 56px; height: 56px; border-radius: 6px; cursor: pointer; }
  .dp-left b, .dp-left a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dp-left b { font-size: 14px; }
  .dp-left a { font-size: 12px; color: var(--muted); }
  .dp-left a:hover { color: var(--text); text-decoration: underline; }
  .dp-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .dp-controls { display: flex; align-items: center; gap: 14px; }
  .dp-scrub { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .dp-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
  .dp-right input[type=range] { width: 100px; }
}
.speed-btn { font-weight: 800; font-size: 13px; min-width: 40px; height: 32px; color: var(--muted); border-radius: 6px; }
.speed-btn:hover { color: var(--text); }

/* Range slider */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--text) var(--p), rgba(255,255,255,.25) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--text) var(--p), rgba(255,255,255,.25) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4px; opacity: 0; transition: opacity .15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb, .fp input[type=range]::-webkit-slider-thumb { opacity: 1; }
input[type=range]:hover::-moz-range-thumb, .fp input[type=range]::-moz-range-thumb { opacity: 1; }
input[type=range]:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), rgba(255,255,255,.25) var(--p)); }

/* ---------- Full player ---------- */
#full-player { position: fixed; inset: 0; z-index: 40; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); visibility: hidden; }
#full-player.open { transform: translateY(0); visibility: visible; }
.fp { height: 100%; display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 24px calc(20px + var(--safe-b));
  background: linear-gradient(to bottom, var(--fp, #333) 0%, #121216 78%); max-width: 560px; margin: 0 auto; }
@media (min-width: 900px) { #full-player { background: rgba(0,0,0,.6); backdrop-filter: blur(10px); } .fp { border-radius: 16px; height: auto; margin-top: 4vh; max-height: 92vh; } }
.fp-top { display: flex; align-items: center; justify-content: space-between; text-align: center; }
.fp-top small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.fp-top b { font-size: 13px; }
.fp-art { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; min-height: 0; }
.fp-art .cover { width: min(100%, 52vh, 420px); aspect-ratio: 1; height: auto; border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.6); transition: transform .3s; }
.fp-art.paused .cover { transform: scale(.92); }
.fp-info { display: flex; align-items: center; gap: 12px; }
.fp-info > div { flex: 1; min-width: 0; }
.fp-info h2 { margin: 0; font-size: 21px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp-info a { color: rgba(255,255,255,.72); font-size: 15px; display: block; margin-top: 4px; }
.fp-scrub { margin-top: 18px; }
.fp-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; margin-top: 2px; }
.fp-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.fp-controls .icon-btn { width: 52px; height: 52px; color: #fff; }
.fp-controls .icon-btn svg { width: 34px; height: 34px; }
.fp-controls .play-btn { width: 68px; height: 68px; background: #fff; color: #000; }
.fp-controls .play-btn svg { width: 32px; height: 32px; }
.fp-controls .speed-btn { color: #fff; font-size: 15px; width: 52px; }
.fp-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.fp-bottom .icon-btn { color: rgba(255,255,255,.8); }
.fp-bottom .icon-btn.on { color: var(--accent); }
.sleep-left { font-size: 11px; color: var(--accent); font-weight: 700; }

/* ---------- Sheet ---------- */
#sheet { position: fixed; inset: 0; z-index: 60; display: none; }
#sheet.open { display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade .2s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface-2); border-radius: 16px 16px 0 0; padding: 8px 8px calc(12px + var(--safe-b)); max-height: 80vh; overflow-y: auto; animation: up .25s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 900px) { .sheet-panel { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: 420px; border-radius: 14px; animation: fade .2s; } }
.sheet-grip { width: 36px; height: 4px; background: var(--surface-3); border-radius: 4px; margin: 4px auto 10px; }
.sheet-head { display: flex; gap: 12px; align-items: center; padding: 6px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head img { width: 48px; height: 48px; border-radius: 6px; }
.sheet-head b { display: block; font-size: 15px; }
.sheet-head small { color: var(--muted); font-size: 13px; }
.sheet-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; text-align: left; }
.sheet-item:hover { background: var(--surface-3); }
.sheet-item svg { color: var(--muted); }
.sheet-item.on { color: var(--accent); }
.sheet-item.on svg { color: var(--accent); }
.sheet-title { padding: 8px 12px 10px; font-weight: 800; font-size: 17px; }
.sheet-note { padding: 6px 12px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--mini-h) + 24px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--text); color: #000; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { #toast { bottom: 100px; } }

/* ---------- Login ---------- */
.login { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px; text-align: center;
  background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%), var(--bg); }
.login .brand-mark { width: 72px; height: 72px; border-radius: 18px; }
.login .brand-mark svg { width: 44px; height: 44px; }
.login h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.login p { margin: 0; color: var(--muted); max-width: 320px; line-height: 1.5; }
.login .ms { display: flex; align-items: center; gap: 12px; background: #fff; color: #222; padding: 12px 22px; border-radius: 6px; font-weight: 600; }
.login .err { color: #F87171; font-size: 13px; max-width: 360px; }

/* ---------- Skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
.spin { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

#auth-banner { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 85; display: flex; align-items: center; gap: 12px;
  background: #2A2A36; border: 1px solid var(--accent); color: var(--text); padding: 8px 8px 8px 14px; border-radius: 10px; font-size: 13px; max-width: calc(100vw - 24px); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#auth-banner button { background: var(--accent); color: #fff; font-weight: 700; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
