/* Thura — media server UI */
:root {
  --accent: #f0a92c;
  --accent-ink: #16130a;
  --bg: #0b0c10;
  --bg-2: #111319;
  --bg-3: #171a22;
  --bg-4: #1e2230;
  --line: #262b38;
  --line-soft: #1c202b;
  --ink: #f2f4f8;
  --ink-2: #aab1c2;
  --ink-3: #6f778a;
  --danger: #f2545b;
  --good: #4ecb8d;
  --warn: #f0a92c;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .4);
  --header-h: 60px;
  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  --bg: #f4f5f8; --bg-2: #ffffff; --bg-3: #eef0f5; --bg-4: #e3e7ef;
  --line: #d8dde8; --line-soft: #e6eaf2;
  --ink: #14161c; --ink-2: #4a5162; --ink-3: #7b8399;
  --shadow: 0 18px 48px rgba(20, 24, 40, .14);
  --shadow-sm: 0 4px 14px rgba(20, 24, 40, .10);
}
:root[data-theme="oled"] { --bg: #000; --bg-2: #08090c; --bg-3: #0e1015; --bg-4: #14171f; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #313749; }

/* ------------------------------------------------------------ boot */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 22px;
  justify-items: center; background: var(--bg); z-index: 999;
}
.boot-mark { width: 54px; height: 54px; color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.shell.no-nav { grid-template-columns: 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--bg-2);
  border-right: 1px solid var(--line-soft); display: flex; flex-direction: column;
  padding: 14px 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 18px 18px; }
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand b { font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: .3px; }

.nav { flex: 1; overflow-y: auto; padding: 0 10px; }
.nav-group { margin-bottom: 18px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3);
  font-weight: 600; padding: 6px 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer;
  border: 0; background: none; width: 100%; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-3); color: var(--ink); }
.nav-item.active { background: var(--bg-4); color: var(--ink); }
.nav-item.active .icon { color: var(--accent); }
.nav-item .icon { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.nav-foot { padding: 10px 12px 0; border-top: 1px solid var(--line-soft); margin: 0 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.topbar.scrolled { border-bottom-color: var(--line-soft); background: color-mix(in srgb, var(--bg) 94%, transparent); }
.topbar .spacer { flex: 1; }
.search-box { position: relative; flex: 0 1 380px; }
.search-box input {
  width: 100%; height: 36px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--bg-2); padding: 0 14px 0 36px; font-size: 14px; transition: border-color .15s, background .15s;
}
.search-box input:focus { outline: none; border-color: var(--accent); background: var(--bg-3); }
.search-box .icon { position: absolute; left: 11px; top: 9px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search-box kbd {
  position: absolute; right: 10px; top: 8px; font: 500 11px var(--mono); color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--bg-3);
}

.page { padding: 8px 26px 96px; min-height: 60vh; }
.page.flush { padding-top: 0; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .13s, border-color .13s, transform .08s;
}
.btn:hover { background: var(--bg-4); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.icon-only.sm { width: 31px; }
.btn.round { border-radius: 999px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .x { opacity: .7; font-size: 15px; line-height: 1; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px;
  background: var(--bg-4); font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: var(--ink-2); text-transform: uppercase;
}
.tag.hdr { background: linear-gradient(90deg, #b98a2a, #f0c778); color: #1c1503; }
.tag.accent { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }

/* ------------------------------------------------------------ forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field > small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); padding: 0 12px; font-size: 14px; transition: border-color .13s;
}
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%236f778a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input:focus { outline: none; border-color: var(--accent); }
.input.invalid { border-color: var(--danger); }
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 7px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 40px; height: 23px; border-radius: 999px; background: var(--bg-4);
  border: 1px solid var(--line); position: relative; transition: background .16s, border-color .16s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--ink-3); transition: transform .16s, background .16s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); background: #fff; }
.switch .label { font-size: 14px; }
.switch .label small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------ rows + cards */
.hub { margin: 26px 0 6px; }
.hub-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.hub-head h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.hub-head .more { font-size: 13px; color: var(--ink-3); font-weight: 600; cursor: pointer; }
.hub-head .more:hover { color: var(--accent); }

.row-wrap { position: relative; }
.row {
  display: grid; grid-auto-flow: column; gap: 16px; overflow-x: auto; scroll-behavior: smooth;
  padding: 4px 0 14px; scrollbar-width: none; scroll-snap-type: x proximity;
}
.row::-webkit-scrollbar { display: none; }
.row.poster { grid-auto-columns: 168px; }
.row.wide { grid-auto-columns: 300px; }
.row.square { grid-auto-columns: 176px; }
.row-nav {
  position: absolute; top: 0; bottom: 18px; width: 46px; border: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--bg) 20%, transparent); color: var(--ink);
  display: grid; place-items: center; opacity: 0; transition: opacity .18s; z-index: 3;
}
.row-nav.right { right: -8px; background: linear-gradient(270deg, var(--bg) 20%, transparent); }
.row-nav.left { left: -8px; }
.row-wrap:hover .row-nav { opacity: 1; }
.row-nav[disabled] { opacity: 0 !important; pointer-events: none; }

.grid { display: grid; gap: 20px 16px; }
.grid.poster { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.square { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid.photo { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.card { position: relative; cursor: pointer; scroll-snap-align: start; }
.card .art {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-3);
  box-shadow: var(--shadow-sm); transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s;
}
.card.poster .art { aspect-ratio: 2 / 3; }
.card.wide .art { aspect-ratio: 16 / 9; }
.card.square .art { aspect-ratio: 1 / 1; }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art .ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3);
  background: linear-gradient(150deg, var(--bg-4), var(--bg-2));
}
.card:hover .art { transform: translateY(-4px) scale(1.014); box-shadow: var(--shadow); }
.card:hover .play-badge { opacity: 1; transform: scale(1); }

.play-badge {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: color-mix(in srgb, var(--accent) 92%, transparent); color: var(--accent-ink);
  display: grid; place-items: center; opacity: 0; transform: scale(.8);
  transition: opacity .16s, transform .16s; box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.play-badge svg { width: 22px; height: 22px; margin-left: 3px; }

.card .meta { padding: 9px 2px 0; }
.card .meta .t {
  font-size: 13.5px; font-weight: 600; line-height: 1.32; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.55); }
.card .progress i { display: block; height: 100%; background: var(--accent); }
.card .badges { position: absolute; top: 7px; right: 7px; display: flex; gap: 4px; flex-direction: column; align-items: flex-end; }
.card .unwatched {
  width: 0; height: 0; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 34px 34px 0; border-color: transparent var(--accent) transparent transparent;
}
.card .unwatched span {
  position: absolute; top: 3px; right: -32px; font-size: 10px; font-weight: 800; color: var(--accent-ink);
  transform: rotate(0deg);
}
.card .card-actions {
  position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 5px; opacity: 0;
  transition: opacity .15s;
}
.card:hover .card-actions { opacity: 1; }
.mini-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(12,13,17,.82); color: #fff; backdrop-filter: blur(6px);
}
.mini-btn:hover { background: var(--accent); color: var(--accent-ink); }
.mini-btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; margin: 0 -26px 8px; min-height: 460px; display: flex; align-items: flex-end; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 55%, transparent) 46%, transparent 78%),
    linear-gradient(0deg, var(--bg) 3%, transparent 62%);
}
.hero-inner { position: relative; padding: 46px 26px 34px; max-width: 780px; }
.hero h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.06; margin: 0 0 10px; letter-spacing: -1px; font-weight: 800; }
.sub { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--ink-2); font-size: 13.5px; margin-bottom: 12px; }
.sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); flex: none; }
.hero .summary { color: var(--ink-2); font-size: 14.5px; max-width: 620px; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------ detail */
.detail { display: grid; grid-template-columns: 260px 1fr; gap: 34px; margin-top: -70px; position: relative; z-index: 2; }
.detail .poster-col img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.detail .poster-col .ph { width: 100%; aspect-ratio: 2/3; border-radius: var(--radius-lg); background: var(--bg-3); }
.detail-meta dl { display: grid; grid-template-columns: 132px 1fr; gap: 9px 16px; margin: 0; font-size: 13.5px; }
.detail-meta dt { color: var(--ink-3); font-weight: 600; }
.detail-meta dd { margin: 0; color: var(--ink-2); }

.section { margin-top: 34px; }
.section > h3 { font-size: 15px; font-weight: 700; margin: 0 0 14px; letter-spacing: .01em; }

.ep-list { display: flex; flex-direction: column; gap: 8px; }
.ep {
  display: grid; grid-template-columns: 172px 1fr auto; gap: 16px; align-items: start;
  padding: 10px; border-radius: var(--radius); cursor: pointer; transition: background .13s;
}
.ep:hover { background: var(--bg-2); }
.ep .thumb { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-3); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .n { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.ep h4 { margin: 2px 0 5px; font-size: 14.5px; font-weight: 650; }
.ep p { margin: 0; font-size: 13px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep .right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font-size: 12px; color: var(--ink-3); }

.track-list { display: flex; flex-direction: column; }
.track {
  display: grid; grid-template-columns: 34px 1fr auto auto; gap: 14px; align-items: center;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.track:hover { background: var(--bg-2); }
.track.playing { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.track .num { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.track .dur { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13px; }

.people { display: grid; grid-auto-flow: column; grid-auto-columns: 108px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.person { text-align: center; }
.person .av {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center;
  background: var(--bg-3); font-size: 26px; font-weight: 700; color: var(--ink-3);
}
.person .n { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.person .r { font-size: 11.5px; color: var(--ink-3); }

/* ------------------------------------------------------------ toolbar / filters */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 16px;
  position: sticky; top: var(--header-h); background: var(--bg); z-index: 20;
}
.toolbar h1 { font-size: 23px; margin: 0 8px 0 0; font-weight: 800; letter-spacing: -.4px; }
.toolbar .spacer { flex: 1; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; }

.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle button { width: 34px; height: 31px; border: 0; background: var(--bg-2); color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.view-toggle button.on { background: var(--bg-4); color: var(--accent); }
.view-toggle svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ menus / modals */
.menu {
  position: fixed; min-width: 214px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 300;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0;
  background: none; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: var(--ink-2);
}
.menu button:hover { background: var(--bg-4); color: var(--ink); }
.menu button.danger { color: var(--danger); }
.menu button .icon { width: 16px; height: 16px; }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .head { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 7px 10px 4px; font-weight: 700; }

.scrim { position: fixed; inset: 0; background: rgba(4,5,8,.72); backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; padding: 24px; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); width: min(560px, 100%); max-height: 88vh; overflow: auto; animation: pop .16s ease-out;
}
.modal.wide { width: min(880px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal header { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.modal header h2 { font-size: 17px; margin: 0; font-weight: 700; }
.modal header .spacer { flex: 1; }
.modal .body { padding: 4px 22px 18px; }
.modal footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 500; pointer-events: none; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 9px; padding: 11px 15px; box-shadow: var(--shadow); font-size: 13.5px;
  max-width: 380px; animation: toastIn .2s ease-out; pointer-events: auto;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--good); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } }

/* ------------------------------------------------------------ auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; overflow: hidden; }
.auth-page::before {
  content: ''; position: absolute; inset: -20%;
  background: radial-gradient(45% 45% at 22% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
              radial-gradient(40% 40% at 82% 78%, #2a5bd733, transparent 70%);
  filter: blur(30px);
}
.auth-card { position: relative; width: min(430px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding: 0 0 18px; }
.auth-card h1 { font-size: 21px; margin: 0 0 6px; text-align: center; font-weight: 750; }
.auth-card .lede { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-bottom: 22px; }
.auth-error { background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: #ffb3b6; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

.profiles { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.profile { text-align: center; cursor: pointer; border: 0; background: none; padding: 0; }
.profile .av {
  width: 104px; height: 104px; border-radius: 14px; display: grid; place-items: center;
  font-size: 38px; font-weight: 700; color: #14161c; margin-bottom: 10px;
  border: 3px solid transparent; transition: border-color .15s, transform .15s;
}
.profile:hover .av { border-color: var(--accent); transform: translateY(-3px); }
.profile .n { font-size: 14px; font-weight: 600; }
.profile .lock { font-size: 11.5px; color: var(--ink-3); }

.pin-input { display: flex; gap: 9px; justify-content: center; margin: 8px 0 16px; }
.pin-input input {
  width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3);
}

/* ------------------------------------------------------------ misc */
.empty { text-align: center; padding: 68px 20px; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; margin-bottom: 14px; opacity: .5; }
.empty h3 { margin: 0 0 7px; font-size: 16.5px; color: var(--ink-2); font-weight: 650; }
.empty p { margin: 0 auto 18px; max-width: 400px; font-size: 13.5px; line-height: 1.6; }

.skeleton { background: linear-gradient(100deg, var(--bg-3) 30%, var(--bg-4) 50%, var(--bg-3) 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -220% 0; } }

.panel { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; }
.panel > h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; }
.panel > .lede { color: var(--ink-3); font-size: 13px; margin: 0 0 18px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 15px 17px; }
.stat .v { font-size: 25px; font-weight: 750; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:hover td { background: var(--bg-2); }

.avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #14161c; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 17px; border-radius: 11px; }

.bar { height: 7px; border-radius: 4px; background: var(--bg-4); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 44px 24px; text-align: center;
  color: var(--ink-3); transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
.dropzone svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }

.upload-row { display: grid; grid-template-columns: 1fr 160px 90px 34px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.upload-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.now-playing {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; height: 78px; z-index: 60;
  background: color-mix(in srgb, var(--bg-2) 96%, transparent); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: 280px 1fr 280px;
  align-items: center; gap: 18px; padding: 0 18px;
}
.now-playing .np-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.now-playing .np-item img { width: 52px; height: 52px; border-radius: 7px; object-fit: cover; }
.now-playing .np-item .t { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing .np-item .s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing .np-mid { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.now-playing .np-controls { display: flex; align-items: center; gap: 6px; }
.now-playing .np-seek { display: flex; align-items: center; gap: 9px; width: 100%; max-width: 520px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.now-playing .np-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.shell.has-np .page { padding-bottom: 120px; }

input[type="range"].slider { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: var(--bg-4); flex: 1; cursor: pointer; }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
input[type="range"].slider::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); }

/* ------------------------------------------------------------ photo lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(4,5,8,.96); z-index: 400; display: grid; grid-template-rows: auto 1fr auto; }
.lightbox .lb-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--ink-2); }
.lightbox .lb-stage { display: grid; place-items: center; overflow: hidden; position: relative; }
.lightbox .lb-stage img { max-width: 94vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox .lb-nav:hover { background: rgba(255,255,255,.16); }
.lightbox .lb-nav.prev { left: 20px; } .lightbox .lb-nav.next { right: 20px; }
.lightbox .lb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 18px; scrollbar-width: none; }
.lightbox .lb-strip::-webkit-scrollbar { display: none; }
.lightbox .lb-strip img { width: 74px; height: 50px; object-fit: cover; border-radius: 5px; opacity: .45; cursor: pointer; transition: opacity .15s; }
.lightbox .lb-strip img.on { opacity: 1; outline: 2px solid var(--accent); }

/* ------------------------------------------------------------ watch together */
.wt-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; height: calc(100vh - var(--header-h) - 40px); }
.wt-chat { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); overflow: hidden; }
.wt-chat .msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wt-msg { font-size: 13.5px; }
.wt-msg .who { font-weight: 700; font-size: 12.5px; }
.wt-msg.system { color: var(--ink-3); font-style: italic; font-size: 12.5px; }
.wt-chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-soft); }
.wt-members { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .detail { grid-template-columns: 1fr; margin-top: 0; }
  .detail .poster-col { max-width: 190px; }
  .hero { margin: 0 -16px 8px; min-height: 340px; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .now-playing { left: 0; grid-template-columns: 1fr auto; }
  .now-playing .np-right { display: none; }
  .ep { grid-template-columns: 120px 1fr; }
  .ep .right { grid-column: 2; flex-direction: row; }
  .wt-layout { grid-template-columns: 1fr; height: auto; }
}
@media (max-width: 620px) {
  .grid.poster { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .row.poster { grid-auto-columns: 132px; }
  .row.wide { grid-auto-columns: 250px; }
  .search-box kbd { display: none; }
  .toolbar h1 { font-size: 19px; }
}
.nav-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 39; }
@media (min-width: 1001px) { .nav-scrim, .menu-btn { display: none; } }
