/* ==========================================================================
   Media Hub — "editorial cinema" design
   References: Mubi, Criterion Channel, Apple TV app, Letterboxd.
   Rules: neutral black, ONE accent colour, real artwork does the talking,
   hairlines instead of glows, serif display + mono metadata, quiet motion.
   ========================================================================== */
:root {
  --bg: #0b0b0c;
  --bg-2: #101012;
  --card: #151517;
  --card-hover: #1b1b1e;
  --line: #222226;
  --line-2: #2f2f35;
  --text: #ededeb;
  --muted: #8b8b90;
  --faint: #5c5c62;
  --accent: #ff5b2e;          /* cinema-ticket vermilion, used sparingly */
  --accent-ink: #160a06;
  --accent-2: var(--accent);
  --sp: #1ed760;
  --nf: #e50914;
  --good: #4ade80;
  --warn: #f5b84a;
  --bad: #f87171;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.8);
  --sidebar: 236px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {     /* paper & ink */
  --bg: #f3f0e8;
  --bg-2: #ece8de;
  --card: #fbf9f4;
  --card-hover: #ffffff;
  --line: #ddd7c9;
  --line-2: #cbc4b3;
  --text: #171512;
  --muted: #6b665c;
  --faint: #9a9488;
  --accent: #d9411c;
  --accent-ink: #fff;
  --shadow: 0 18px 40px -26px rgba(40, 30, 10, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* film grain: a whisper of texture so flat blacks feel like a screen, not a template */
body::before {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-2%, 1%); } 50% { transform: translate(1%, -2%); } 75% { transform: translate(2%, 2%); } }
:root[data-theme="light"] body::before { opacity: .07; mix-blend-mode: multiply; }

/* 3D particle wave behind the top of every page, fading out downwards */
#bg3d {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: .55;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 85%); mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 85%);
}
:root[data-theme="light"] #bg3d { opacity: .35; filter: invert(1); }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 18px; gap: 2px;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 12px 26px; font-family: var(--serif); font-size: 28px; letter-spacing: -.01em; line-height: 1; }
.brand-mark { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); font-size: 0; transform: translateY(-3px); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.brand i { font-style: italic; color: var(--muted); }
.nav { position: relative; display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: 14.5px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--text); background: var(--card); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.nav a.spotify-link:hover svg, .nav a.spotify-link.active svg { color: var(--sp); }
.nav a.netflix-link:hover svg { color: var(--nf); }
.nav-label { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 8px; }
.sidebar .spacer { flex: 1; }
.services a { font-size: 13px; padding: 7px 12px; }
#service-links a.active { color: var(--text); background: var(--card); }

/* ---------- main ---------- */
main { position: relative; z-index: 1; margin-left: var(--sidebar); padding: 0 40px 140px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 16px 0; margin: 0 -40px; padding-inline: 40px;
  background: linear-gradient(var(--bg) 55%, transparent); }
.search { flex: 1; position: relative; max-width: 520px; }
.search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); outline: none; transition: border-color .2s, background .2s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--line-2); background: var(--card); }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; color: var(--faint); }
.icon-btn { border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* type */
h1 { font: 400 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.015em; margin: 18px 0 10px; }
h1 em, h2 em { font-style: italic; color: var(--muted); }
#view { counter-reset: sec; }
h2 { counter-increment: sec; display: flex; align-items: baseline; gap: 14px; margin: 52px 0 16px; padding-top: 16px; border-top: 1px solid var(--line);
  font: 400 30px/1.1 var(--serif); letter-spacing: -.01em; }
h2::before { content: counter(sec, decimal-leading-zero); font: 500 11px/1 var(--mono); letter-spacing: .1em; color: var(--accent); transform: translateY(-12px); }
h2 small { margin-left: auto; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
h2 small a { color: var(--muted); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color .2s, border-color .2s; }
h2 small a:hover { color: var(--text); border-color: var(--accent); }
.lead { color: var(--muted); margin: 0 0 8px; max-width: 62ch; }
.lead.small { font-size: 13px; }
.kicker, .eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
code { font: 12.5px var(--mono); }

/* ---------- hero (featured film) ---------- */
.hero { position: relative; min-height: 460px; margin: 4px 0 0; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: var(--bgimg, none) center 25% / cover; opacity: 0; transform: scale(1.06);
  transition: opacity 1.2s var(--ease), transform 9s linear; }
.hero-bg.on { opacity: 1; transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8,8,9,.92) 0%, rgba(8,8,9,.65) 38%, rgba(8,8,9,0) 75%), linear-gradient(0deg, rgba(8,8,9,.85), transparent 45%); }
.hero-txt { padding: 44px 46px; max-width: 640px; color: #f2f1ee; }
.hero .kicker { color: rgba(242,241,238,.7); display: flex; gap: 10px; align-items: center; }
.hero .kicker b { color: var(--accent); font-weight: 500; }
.hero h1 { font-size: clamp(48px, 6.4vw, 92px); margin: 14px 0 12px; color: #fff; }
.hero p { color: rgba(242,241,238,.78); margin: 0 0 24px; font-size: 15.5px; max-width: 54ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .meta-line { font: 500 12px/1 var(--mono); letter-spacing: .06em; color: rgba(242,241,238,.6); margin: 0 0 18px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-dots { position: absolute; right: 26px; bottom: 26px; display: flex; gap: 6px; }
.hero-dots button { width: 22px; height: 3px; border: 0; padding: 0; border-radius: 2px; background: rgba(255,255,255,.25); cursor: pointer; transition: background .3s, width .3s; }
.hero-dots button.on { background: #fff; width: 38px; }
.hero.plain { min-height: 340px; background: radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%), var(--card); }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--text); background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--text); }
.btn.big { padding: 12px 20px; font-size: 14.5px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sp { background: var(--sp); border-color: var(--sp); color: #04140a; }
.btn.nf { background: transparent; border-color: var(--nf); color: #fff; }
.hero .btn { background: #fff; border-color: #fff; color: #0b0b0c; }
.hero .btn.ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(8px); }
.hero .btn.ghost:hover { border-color: #fff; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn svg { width: 16px; height: 16px; }

/* ---------- bento (home) ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.bento a, .bento .cell { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px 18px 16px;
  min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; transition: border-color .25s, background .25s, transform .35s var(--ease); }
.bento a:hover { border-color: var(--line-2); background: var(--card-hover); transform: translateY(-2px); }
.bento .big { grid-column: span 2; }
.bento .eyebrow { display: flex; justify-content: space-between; }
.bento .num { font: 400 54px/1 var(--serif); letter-spacing: -.02em; }
.bento .num small { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em; margin-left: 6px; }
.bento b { font-weight: 600; }
.bento .go { position: absolute; right: 16px; bottom: 14px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted);
  transition: background .25s, color .25s, border-color .25s, transform .35s var(--ease); }
.bento a:hover .go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
.bento .go svg { width: 14px; height: 14px; }
.bento .sp-cell .eyebrow { color: var(--sp); }
.bento .tv-cell::after { content: "LIVE"; position: absolute; top: 16px; right: 16px; font: 600 10px/1 var(--mono); letter-spacing: .12em; color: #fff; background: var(--accent); padding: 4px 6px; border-radius: 3px; }
.bento .tv-cell .eyebrow { justify-content: flex-start; }

/* ---------- posters ---------- */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; }
.poster { scroll-snap-align: start; display: block; }
.poster .art { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  transition: transform .45s var(--ease), border-color .3s; }
.poster.square .art { aspect-ratio: 1; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .4s; }
.poster:hover .art { transform: translateY(-4px); border-color: var(--line-2); }
.poster:hover img { transform: scale(1.04); }
.poster .fallback { position: absolute; inset: 0; display: grid; place-items: center; font: 400 52px var(--serif); color: var(--faint);
  background: repeating-linear-gradient(135deg, var(--card) 0 10px, var(--bg-2) 10px 20px); }
.poster .t { font-weight: 600; font-size: 14px; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .s { color: var(--muted); font: 500 11.5px/1.4 var(--mono); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.5); }
.progress i { display: block; height: 100%; background: var(--accent); }
.play-badge { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
  background: var(--sp); color: #04140a; opacity: 0; transform: translateY(8px); transition: .3s var(--ease); }
.poster:hover .play-badge, .sp-card.on .play-badge { opacity: 1; transform: none; }
.sp-card.on .art { border-color: var(--sp); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center;
  transition: background .2s, border-color .2s; }
.tile:hover { background: var(--card-hover); border-color: var(--line-2); }
.tile .ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); color: var(--text); font-size: 18px; }
.tile .ico svg { width: 18px; height: 18px; }
.tile b { display: block; font-weight: 600; }
.tile span { color: var(--muted); font-size: 13px; }
.sp-ico { color: var(--sp) !important; border-color: color-mix(in srgb, var(--sp) 40%, transparent) !important; }
.nf-ico { color: var(--nf) !important; font: 700 22px/1 var(--serif) !important; border-color: color-mix(in srgb, var(--nf) 40%, transparent) !important; }

/* ---------- catalog ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 18px; }
.chip { border: 1px solid var(--line); background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted); transition: .2s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters select, .filters input[type=search] { border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 7px 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, background .2s; }
.entry:hover { border-color: var(--line-2); background: var(--card-hover); }
.entry header { display: flex; gap: 10px; align-items: flex-start; }
.entry h3 { margin: 0; font: 400 22px/1.15 var(--serif); flex: 1; }
.entry h3 a:hover { color: var(--accent); }
.entry p { margin: 0; color: var(--muted); font-size: 13.5px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font: 500 10.5px/1.6 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.tag.cost { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.entry footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font: 500 11.5px var(--mono); color: var(--faint); }
.fav { background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--faint); padding: 2px; }
.fav.on { color: var(--accent); }

/* ---------- radio: a tuner, not a card grid ---------- */
.radios { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.radio { position: relative; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; padding: 14px 16px; cursor: pointer;
  text-align: left; display: flex; gap: 12px; align-items: center; transition: background .2s; }
.radio:hover { background: var(--card); }
.radio .dot { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2);
  font: 600 10.5px/1 var(--mono); letter-spacing: .02em; color: var(--muted); transition: .2s; }
.radio .rt { flex: 1; min-width: 0; }
.radio .rt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio small { display: block; color: var(--faint); font: 500 11px var(--mono); letter-spacing: .03em; }
.radio.playing { background: var(--card); }
.radio.playing .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.radio.playing .rt b { color: var(--text); }
.radios.strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; color: var(--accent); }
.eq i, .now-art i { width: 3px; background: currentColor; border-radius: 1px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2), .now-art i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3), .now-art i:nth-child(3) { animation-delay: -.6s; }
.now-art i:nth-child(4) { animation-delay: -.15s; }
.radio.playing .eq { display: flex; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ---------- now-playing bar ---------- */
.player { position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 35; display: none; align-items: center; gap: 14px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.player.show { display: flex; animation: up .5s var(--ease); }
@keyframes up { from { transform: translateY(100%); } }
.now-art { width: 42px; height: 42px; border-radius: 6px; flex: none; display: flex; gap: 3px; align-items: flex-end; justify-content: center; padding: 11px;
  background: var(--accent); color: var(--accent-ink); }
.player .now { flex: 1; min-width: 0; }
.player .now b, .player .now span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .now b { font: 400 22px/1.1 var(--serif); }
.player .now span { color: var(--muted); font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.player .icon-btn.play { background: var(--text); color: var(--bg); border-color: var(--text); border-radius: 50%; width: 40px; height: 40px; }
.player input[type=range] { width: 120px; accent-color: var(--accent); }

/* ---------- tables / status ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
td code { word-break: break-all; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font: 600 10.5px/1.6 var(--mono); letter-spacing: .05em; text-transform: uppercase; border: 1px solid; }
.badge.organized, .badge.up { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.badge.review, .badge.waiting, .badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge.duplicate { color: var(--muted); border-color: var(--line-2); }
.badge.error, .badge.down { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 130px; }
.stat b { font: 400 36px/1 var(--serif); display: block; }
.stat span { color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 22px; color: var(--muted); font-size: 14px; }
.empty a { color: var(--text); border-bottom: 1px solid var(--accent); }
.empty code, .panel code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; color: var(--text); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.skeleton { height: 240px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--card-hover), var(--card)); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- spotify ---------- */
.sp-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; margin-top: 18px; }
.sp-player { height: 452px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.sp-frame { width: 100%; border: 0; border-radius: 12px; display: block; background: #121212; }
.sp-side { display: flex; flex-direction: column; gap: 12px; }
.sp-paste { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.sp-paste label { font: 400 22px var(--serif); }
.sp-paste input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); outline: none; }
.sp-paste input:focus { border-color: var(--sp); }
.sp-paste small { color: var(--bad); }
.sp-search { margin-bottom: 6px; }
.sp-connect { display: grid; gap: 12px; justify-items: start; }
.sp-connect .steps a { color: var(--text); border-bottom: 1px solid var(--sp); }
.sp-cid { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-cid input { width: 320px; max-width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); font-family: var(--mono); outline: none; }
.sp-cid input:focus { border-color: var(--sp); }
.sp-cid small { color: var(--bad); width: 100%; }
.sp-dock { position: fixed; z-index: 45; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; }
.sp-dock[hidden] { display: none; }
.sp-dock .sp-frame { flex: 1; height: 100%; border-radius: 0; }
.sp-dock.big .dock-bar { display: none; }
.sp-dock.big .sp-frame { border-radius: 12px; }
.sp-dock.mini { right: 20px; bottom: 20px; width: 360px; height: 190px; background: #121212; border: 1px solid #2a2a2a; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); animation: up .5s var(--ease); }
body:has(.player.show) .sp-dock.mini { bottom: 86px; }
.dock-bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sp); background: #121212; }
.dock-bar button { background: none; border: 0; color: #888; cursor: pointer; font-size: 13px; }
.dock-bar button:hover { color: #fff; }

/* ---------- live TV ---------- */
.tv-stage { aspect-ratio: 16 / 9; max-height: 62vh; width: 100%; margin-top: 18px; border-radius: 12px; border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, var(--card) 0 12px, var(--bg-2) 12px 24px); display: grid; place-items: center; }
.tv-hint { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.tv-dock { position: fixed; z-index: 44; background: #000; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.tv-dock[hidden] { display: none; }
.tv-dock video { flex: 1; width: 100%; height: 100%; min-height: 0; background: #000; display: block; }
.tv-dock.big .tv-bar { display: none; }
.tv-dock.mini { left: calc(var(--sidebar) + 20px); bottom: 20px; width: 360px; height: 232px; border: 1px solid #2a2a2a; box-shadow: 0 30px 60px -20px rgba(0,0,0,.85); animation: up .5s var(--ease); }
body:has(.player.show) .tv-dock.mini { bottom: 86px; }
.tv-bar { color: #eee !important; }
.tv-bar b { color: var(--accent); }
.tv-msg { position: absolute; inset: auto 0 0 0; padding: 10px 14px; font: 500 12px var(--mono); color: #ddd; background: linear-gradient(transparent, rgba(0,0,0,.85)); pointer-events: none; }
.tv-msg[hidden] { display: none; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ch { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--card); transition: border-color .2s, background .2s, transform .35s var(--ease); }
.ch:hover { border-color: var(--line-2); background: var(--card-hover); transform: translateY(-2px); }
.ch.on { border-color: var(--accent); }
.ch-logo { aspect-ratio: 16 / 10; border-radius: 6px; background: #0e0e10; display: grid; place-items: center; overflow: hidden; margin-bottom: 9px; }
.ch-logo img { max-width: 72%; max-height: 64%; object-fit: contain; }
.ch-logo span { font: 400 30px var(--serif); color: var(--faint); }
.ch-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.chip small { font: 500 10px var(--mono); opacity: .6; margin-left: 4px; }

/* ---------- videos (YouTube) ---------- */
.yt-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #000; display: block; }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 16px; margin-top: 8px; }
.vid-row { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.vid { display: block; }
.vid-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.vid:hover .vid-thumb img { transform: scale(1.05); }
.vid-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; opacity: 0; transition: opacity .25s; }
.vid-play svg { width: 44px; height: 44px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }
.vid:hover .vid-play { opacity: 1; }
.vid.on .vid-thumb { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vid-t { font-weight: 600; font-size: 14px; line-height: 1.35; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid-s { color: var(--faint); font: 500 11px/1.5 var(--mono); letter-spacing: .02em; margin-top: 4px; }
.ch-chip { display: inline-flex; align-items: center; gap: 7px; padding-left: 5px; }
.ch-chip img { width: 20px; height: 20px; border-radius: 50%; }
.ch-chip .x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 10px; padding: 0 0 0 2px; opacity: 0; transition: opacity .2s; }
.ch-chip:hover .x { opacity: 1; }
.yt-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 18px; }
.yt-add input { flex: 1; min-width: 240px; max-width: 460px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); outline: none; }
.yt-add input:focus { border-color: var(--line-2); }
.yt-add small { color: var(--muted); width: 100%; }

/* ---------- this week (weekly curator) ---------- */
.weekly { list-style: none; counter-reset: wk; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); border-top: 1px solid var(--line); }
.weekly li { counter-increment: wk; display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.weekly li::before { content: counter(wk, decimal-leading-zero); font: 400 26px/1 var(--serif); color: var(--faint); }
.weekly li .tag { display: none; }
.weekly b { font-weight: 600; } .weekly b a:hover { color: var(--accent); }
.weekly p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* ---------- padel ---------- */
.live-badge { position: absolute; top: 8px; left: 8px; z-index: 1; font: 700 10.5px/1 var(--mono); letter-spacing: .1em; color: #fff; background: #e5141e; padding: 5px 7px; border-radius: 3px; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .65; } }
.nav a.is-live::after { content: "LIVE"; margin-left: auto; font: 700 9.5px/1 var(--mono); letter-spacing: .1em; color: #fff; background: #e5141e; padding: 4px 6px; border-radius: 3px; animation: blink 1.6s ease-in-out infinite; }
.padel-banner { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 16px 60px 16px 18px; border: 1px solid #e5141e; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(229,20,30,.14), transparent 60%), var(--card); transition: background .2s; }
.padel-banner .live-badge { position: static; }
.padel-banner b { font: 400 24px/1.1 var(--serif); }
.padel-banner span:not(.live-badge):not(.go) { color: var(--muted); font-size: 13.5px; }
.padel-banner .go { position: absolute; right: 16px; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; }
.padel-banner .go svg { width: 14px; height: 14px; }
.padel-banner:hover .go { background: #e5141e; border-color: #e5141e; color: #fff; }

/* ---------- journal: essentials + search ---------- */
.news-search { position: relative; max-width: 640px; margin: 18px 0 6px; }
.news-search input { width: 100%; padding: 13px 16px 13px 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-size: 15.5px; outline: none; }
.news-search input:focus { border-color: var(--accent); }
.news-search svg { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 18px; color: var(--muted); }
.journal-cols { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 14px; }
.essentials { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; border-top: 2px solid var(--accent); padding-top: 12px; }
.ess-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ess-head .kicker { color: var(--accent); }
.ess-time { font: 500 11px var(--mono); color: var(--faint); }
a.ess { display: grid !important; grid-template-columns: auto 1fr; gap: 12px; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important;
  background: transparent !important; padding: 14px 0; transform: none !important; }
.ess-n { font: 400 26px/1 var(--serif); color: var(--faint); }
a.ess h3 { font: 600 15px/1.35 var(--sans) !important; margin: 0 0 5px; }
a.ess p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ess-meta { margin-top: 6px; font: 500 10.5px var(--mono); letter-spacing: .03em; color: var(--faint); }
.journal-cols .lead-story { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 1100px) { .journal-cols { grid-template-columns: 1fr; } .essentials { position: static; max-height: none; } }

/* ---------- in-app reader ---------- */
.reader { position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar); z-index: 50; background: var(--bg); overflow-y: auto; transform: translateX(100%); transition: transform .45s var(--ease); }
.reader.open { transform: none; }
body.reading main { visibility: hidden; }
.reader-bar { position: sticky; top: 0; padding: 14px 24px; background: linear-gradient(var(--bg) 70%, transparent); z-index: 1; }
.reader-page { max-width: 720px; margin: 0 auto; padding: 10px 24px 120px; }
.reader-page h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.05; margin: 14px 0 22px; }
.reader-page p { font-size: 18px; line-height: 1.75; margin: 0 0 18px; color: color-mix(in srgb, var(--text) 88%, transparent); }
.reader-page p.li { margin-left: 8px; }
.reader-page h3 { font: 400 28px/1.2 var(--serif); margin: 34px 0 12px; }
.reader-page blockquote { border-left: 2px solid var(--accent); margin: 24px 0; padding: 4px 0 4px 20px; font: italic 400 24px/1.4 var(--serif); }
.reader-img { width: 100%; border-radius: 10px; margin: 0 0 26px; border: 1px solid var(--line); }
.add-chip { color: var(--accent); border-style: dashed; }
.add-chip input { background: none; border: 0; outline: none; width: 130px; font-size: 13px; color: var(--text); }

/* ---------- AI recap ---------- */
.recap { max-width: 860px; }
.recap-head { padding: 26px 0 6px; }
.recap-title { border-top: 0 !important; padding-top: 0 !important; margin: 12px 0 14px !important; font-size: clamp(32px, 4vw, 48px) !important; counter-increment: none !important; }
.recap-title::before { display: none; }
.recap-intro { font: 400 22px/1.5 var(--serif); color: var(--text); margin: 0; }
.recap-items { display: grid; gap: 18px; }
.recap-item { border-left: 2px solid var(--line-2); padding: 2px 0 2px 18px; }
.recap-item h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.recap-item p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.recap-src { display: inline-block; margin-top: 6px; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.recap-sec:first-of-type .recap-item { border-left-color: var(--accent); }
.recap-item.has-img { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.recap-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.recap-sec#showcase .recap-items, .recap-sec .recap-items:has(.has-img:nth-child(3)) { gap: 22px; }
.model3d { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #111; }
.model3d iframe { width: 100%; height: 100%; border: 0; }
.recap .media-stage { margin-bottom: 16px; }
.trend-chip { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
@media (max-width: 700px) { .recap-item.has-img { grid-template-columns: 1fr; } }
.recap-sources { margin-top: 30px; color: var(--faint); font-size: 13px; } .recap-sources summary { cursor: pointer; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 860px) { .reader { left: 0; bottom: 64px; } .reader-page p { font-size: 17px; } }

/* ---------- journal ---------- */
.art-card { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); transition: border-color .2s, background .2s, transform .35s var(--ease); }
.art-card:hover { border-color: var(--line-2); background: var(--card-hover); transform: translateY(-2px); }
.art-card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.art-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.art-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.art-card:hover .art-img img { transform: scale(1.04); }
.art-body { padding: 14px 16px 16px; }
.art-meta { display: flex; gap: 10px; flex-wrap: wrap; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.art-meta b { color: var(--accent); font-weight: 600; }
.art-card h3 { margin: 0; font: 400 22px/1.2 var(--serif); }
.art-card p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lead-story { grid-template-columns: 1.4fr 1fr; margin: 6px 0 16px; }
.lead-story .art-img { aspect-ratio: auto; min-height: 340px; }
.lead-story .art-body { padding: 28px; align-self: end; }
.lead-story h3 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; }
.lead-story p { -webkit-line-clamp: 5; font-size: 15px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.art-card.noimg .art-body { padding-top: 18px; }
@media (max-width: 860px) { .lead-story { grid-template-columns: 1fr; } .lead-story .art-img { min-height: 220px; } .lead-story .art-body { padding: 18px; } }

/* ---------- in-hub apps ---------- */
.apps { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar); z-index: 30; background: var(--bg); flex-direction: column; }
body.in-app .apps { display: flex; animation: fade .35s var(--ease); }
body.in-app main { visibility: hidden; height: 100vh; overflow: hidden; }
.apps-tabs { display: flex; gap: 2px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.apps-tabs a { padding: 7px 14px; border-radius: 6px; color: var(--muted); font-size: 13.5px; font-weight: 500; position: relative; transition: .2s; }
.apps-tabs a:hover { color: var(--text); background: var(--card); }
.apps-tabs a.on { color: var(--text); background: var(--card); box-shadow: inset 0 -2px 0 var(--accent); }
.apps-tabs a.live:not(.on)::after { content: ""; position: absolute; top: 7px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.apps-reload { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; }
.apps-reload:hover { color: var(--text); border-color: var(--line-2); }
.apps-frames { flex: 1; position: relative; }
.app-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; visibility: hidden; }
.app-frame.on { visibility: visible; }

/* ---------- install page ---------- */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.install-grid h2 { border-top: 0; padding-top: 0; margin: 0 0 12px; counter-increment: none; }
.install-grid h2::before { display: none; }
.qr { background: #fff; padding: 12px; border-radius: 8px; width: max-content; margin: 6px 0 14px; }
.steps { padding-left: 20px; color: var(--muted); } .steps li { margin: 6px 0; } .steps b { color: var(--text); }

/* ---------- motion (quiet) ---------- */
#view.enter > * { animation: rise .7s var(--ease) both; }
#view.enter > *:nth-child(2) { animation-delay: .05s; } #view.enter > *:nth-child(3) { animation-delay: .1s; }
#view.enter > *:nth-child(4) { animation-delay: .15s; } #view.enter > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
.fx { opacity: 0; transform: translateY(16px); }
.fx.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 40ms); }
.hero h1 .w { display: inline-block; animation: word .9s var(--ease) both; animation-delay: calc(var(--w) * 70ms + .15s); }
@keyframes word { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx { opacity: 1; transform: none; }
  #bg3d { display: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .radios.strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .sidebar { inset: auto 0 0 0; width: auto; height: 64px; flex-direction: row; padding: 6px 4px; border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); }
  .nav { display: contents; }
  .brand, .sidebar .spacer, .sidebar .nav.services, .nav a.hide-sm, .nav-label, .nav a.netflix-link, .nav a[data-page="learn"], .nav a[data-page="organizer"] { display: none; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 2px; flex: 1; text-align: center; }
  .nav a.active::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 2px; }
  .nav a span { white-space: nowrap; }
  main { margin-left: 0; padding: 0 16px 150px; }
  .topbar { margin: 0 -16px; padding-inline: 16px; }
  .hero { min-height: 420px; } .hero-txt { padding: 28px 22px; } .hero-dots { display: none; }
  .bento { grid-template-columns: 1fr 1fr; } .bento .big { grid-column: span 2; } .bento .num { font-size: 42px; }
  .row { grid-auto-columns: 128px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .cards { grid-template-columns: 1fr; }
  .radios, .radios.strip { grid-template-columns: 1fr 1fr; }
  .player { left: 0; bottom: 64px; padding: 10px 14px; } .player input[type=range] { display: none; }
  .sp-top { grid-template-columns: 1fr; }
  .sp-dock.mini { left: 12px; right: 12px; width: auto; bottom: 76px; }
  .tv-dock.mini { left: 12px; right: 12px; width: auto; height: auto; aspect-ratio: 16 / 10; bottom: 76px; }
  .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apps { left: 0; bottom: 64px; }
  h2 { font-size: 26px; }
}

.journal-cols .lead-story h3 { font-size: clamp(26px, 2.4vw, 34px); }
.journal-cols .lead-story .art-img { min-height: 280px; }

.ch-name .hd { font: 600 9px/1 var(--mono); letter-spacing: .06em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: 2px 4px; border-radius: 3px; vertical-align: 2px; }

.hero .btn { display: inline-flex !important; width: auto; min-height: 0; }
.hero .btn.art-card, .hero .btn.vid { border-radius: 8px; padding: 12px 20px; transform: none; }
.hero h1.long { font-size: clamp(34px, 3.6vw, 54px); line-height: 1.05; }
.hero-bg { background-position: center; }

/* ================= phone: ☰ menu instead of the bottom bar ================= */
.menu-btn, .nav-backdrop { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: grid; flex: none; }
  .sidebar { inset: 0 auto 0 0 !important; width: min(300px, 84vw) !important; height: auto !important; flex-direction: column !important;
    padding: max(18px, env(safe-area-inset-top)) 14px 18px !important; border-top: 0 !important; border-right: 1px solid var(--line) !important;
    justify-content: flex-start !important; background: var(--bg) !important; overflow-y: auto; transform: translateX(-105%); transition: transform .35s var(--ease); z-index: 60; }
  body.nav-open .sidebar { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.6); }
  .nav { display: flex !important; }
  .brand, .nav-label, .sidebar .nav.services, .nav a.hide-sm, .nav a.netflix-link, .nav a[data-page="learn"], .nav a[data-page="organizer"] { display: flex !important; }
  .nav-label { display: block !important; }
  .sidebar .spacer { display: block !important; min-height: 16px; }
  .nav a { flex-direction: row !important; gap: 12px !important; font-size: 15px !important; padding: 11px 12px !important; flex: none !important; text-align: left !important; }
  .nav a.active::before { left: -14px !important; right: auto !important; top: 10px !important; bottom: 10px !important; width: 2px !important; height: auto !important; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  main { padding-bottom: 110px !important; }
  .topbar { padding-top: max(12px, env(safe-area-inset-top)) !important; }
  .player { bottom: 0 !important; padding-bottom: max(10px, env(safe-area-inset-bottom)) !important; }
  .sp-dock.mini, .tv-dock.mini { bottom: max(16px, env(safe-area-inset-bottom)) !important; }
  body:has(.player.show) .sp-dock.mini, body:has(.player.show) .tv-dock.mini { bottom: 84px !important; }
  .apps, .reader { bottom: 0 !important; }
}

/* offline apps page */
.off-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.off-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.off-head { display: flex; gap: 14px; align-items: center; }
.off-head img { width: 56px; height: 56px; border-radius: 13px; }
.off-head h2 { border: 0 !important; padding: 0 !important; margin: 4px 0 0 !important; counter-increment: none !important; font-size: 28px !important; }
.off-head h2::before { display: none; }
.off-head .tag { margin-left: auto; }
.off-server { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.off-server code { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.off-card > .btn:last-child { align-self: flex-start; }

/* way out of the in-hub apps (phone) */
.apps-nav { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; height: 34px; padding: 0 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; flex: none; }
.apps-nav:hover { border-color: var(--line-2); }
.apps-menu { display: none; }
.apps-tabs { overflow-x: auto; scrollbar-width: none; }
.apps-tabs a { white-space: nowrap; }
@media (max-width: 860px) {
  .apps-menu { display: inline-block; }
  .apps-tabs { padding-top: max(10px, env(safe-area-inset-top)); gap: 6px; }
  .apps-nav span { display: none; }
  .apps { z-index: 50; }
}

.player .now .np { color: var(--text); font: 500 12.5px var(--sans); letter-spacing: 0; text-transform: none; }

/* ---- album tap-to-play */
.poster[data-nd-album].on .play-badge { opacity: 1; transform: none; background: var(--accent); color: var(--accent-ink); }
.poster[data-nd-album].on .art { border-color: var(--accent); }
.poster.loading .art { opacity: .6; }
#next { display: none; }
.player.album #next { display: grid; }

/* ---- toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- tasks */
.push-help { margin: 14px 0 6px; max-width: 640px; }
.push-help .btn { margin-top: 8px; }
.push-ok a { color: var(--text); }
.task-add { display: flex; gap: 10px; margin: 18px 0 10px; max-width: 720px; }
.task-add input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); outline: none; font-size: 16px; }
.task-add input:focus { border-color: var(--line-2); background: var(--card); }
.tasks { list-style: none; margin: 0; padding: 0; max-width: 720px; display: grid; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.tick { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; cursor: pointer; position: relative; }
.tick:hover { border-color: var(--accent); }
.task.done .tick { background: var(--accent); border-color: var(--accent); }
.task.done .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task-body { flex: 1; min-width: 0; }
.task-text { display: block; font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; padding-top: 2px; }
.task.done .task-text { color: var(--muted); text-decoration: line-through; }
.icon-btn.small { width: 32px; height: 32px; flex: none; }
.icon-btn.plus { font-size: 20px; color: var(--text); transition: transform .2s, color .2s, border-color .2s; }
.icon-btn.plus.open { border-color: var(--accent); color: var(--accent); transform: rotate(45deg); }
.rems { display: flex; flex-wrap: wrap; gap: 6px; }
.rems:not(:empty) { margin-top: 8px; }
.rem-chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); padding: 4px 4px 4px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.rem-chip small { color: var(--muted); }
.rem-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 6px; }
.remind-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.remind-menu > small { width: 100%; color: var(--muted); font-size: 12.5px; }
.chip { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--accent); }
.chip.custom { position: relative; overflow: hidden; }
.chip.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- notes */
.note-head { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; max-width: 820px; }
.note-head .icon-btn { font-size: 20px; flex: none; text-decoration: none; }
.note-day { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-day b { font: 400 22px/1.2 var(--serif); }
.note-day small { color: var(--muted); font: 500 11.5px var(--mono); min-height: 14px; }
.note { display: block; width: 100%; max-width: 820px; min-height: 52vh; resize: vertical; padding: 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 16px; line-height: 1.6; font-family: inherit; outline: none; }
.note:focus { border-color: var(--line-2); }
.note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-width: 820px; }
.note-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); text-decoration: none; }
.note-card:hover { border-color: var(--line-2); }
.note-card span { color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }

/* Spotify charts */
.sp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.sp-tabs a.chip { text-decoration: none; margin-left: auto; border-color: var(--sp); color: var(--sp); }
.sp-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.sp-track { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; min-width: 0; }
.sp-track:hover { background: var(--bg-2); }
.sp-track.on { background: var(--bg-2); box-shadow: inset 3px 0 0 var(--sp); }
.sp-track .n { width: 22px; text-align: right; font: 600 13px var(--mono); color: var(--muted); flex: none; }
.sp-track .cv { width: 44px; height: 44px; border-radius: 4px; background: var(--bg-2); overflow: hidden; flex: none; }
.sp-track .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-track .tt { flex: 1; min-width: 0; display: grid; }
.sp-track .tt b, .sp-track .tt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-track .tt b { font-size: 14.5px; font-weight: 600; }
.sp-track .tt small { color: var(--muted); font-size: 12.5px; }
.sp-track .e { display: inline-block; font: 700 9px var(--mono); font-style: normal; background: var(--muted); color: var(--bg); border-radius: 2px; padding: 1px 3px; margin-right: 5px; vertical-align: 1px; }
.sp-track .d { font: 12px var(--mono); color: var(--muted); flex: none; }
.poster.round .art { border-radius: 50%; }
.poster.round .t, .poster.round .s { text-align: center; }
@media (max-width: 600px) { .sp-tracks { grid-template-columns: 1fr; max-height: 460px; } .sp-track .d { display: none; } }

/* Note Task */
.nt-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 2px 0 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; }
.nt-tabs a { padding: 7px 18px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.nt-tabs a.on { background: var(--text); color: var(--bg); }
.icon-btn.plus.clock svg { width: 20px; height: 20px; }
.icon-btn.plus.clock.open { transform: none; }
.chip.at-time { display: inline-flex; align-items: center; gap: 6px; border-color: var(--accent); font-weight: 600; }
.chip.at-time input { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; min-width: 84px; }

/* Note Task v2: lists, optional alarm when adding, daily alarms, missed alarms, inline edit */
.nt-lists { display: flex; gap: 6px; margin: -4px 0 10px; }
.nt-lists small { font: 600 11px var(--mono); margin-left: 2px; opacity: .8; }
.task-add { display: block; }
.task-add-row { display: flex; gap: 8px; }
.task-add-row input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); outline: none; font-size: 16px; color: var(--text); }
.task-add-row input:focus { border-color: var(--line-2); background: var(--card); }
.clock-toggle { width: 46px; height: auto; flex: none; color: var(--muted); }
.clock-toggle svg { width: 20px; height: 20px; }
.clock-toggle.open { color: var(--accent); border-color: var(--accent); }
.add-alarm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; animation: fadeUp .2s var(--ease); }
.add-alarm[hidden] { display: none; }
.add-alarm small { width: 100%; }
.chip.daily { display: inline-flex; align-items: center; gap: 6px; }
.chip.daily input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.rem-chip.daily { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.rem-chip.missed { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.task.late { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.task-text { cursor: text; }
.task-edit { width: 100%; font: inherit; font-size: 15.5px; padding: 4px 8px; margin: -3px 0; border-radius: 6px; border: 1px solid var(--accent); background: var(--bg-2); color: var(--text); outline: none; }
.tick { transition: transform .15s var(--ease), background .2s, border-color .2s; }
.tick:active { transform: scale(.85); }
.task { transition: opacity .3s, border-color .2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Today (home) */
.today { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr; gap: 12px; margin-top: 18px; }
.t-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px 16px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.t-card > a.eyebrow { display: flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.t-card > a.eyebrow b { color: var(--accent); font-weight: 700; }
.t-card > a.eyebrow svg { width: 14px; height: 14px; margin-left: auto; }
.skeleton.small { height: 90px; margin: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--muted); cursor: pointer; }
.linkish:hover { color: var(--text); }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-ico { font-size: 44px; line-height: 1; }
.wx-t { font: 400 52px/1 var(--serif); letter-spacing: -.02em; }
.wx-now small { color: var(--muted); font-size: 13px; }
.wx-line { margin: 0; font-size: 13.5px; color: var(--muted); }
.wx-line.warn { color: var(--warn); }
.wx-hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.wx-hours span { display: grid; justify-items: center; gap: 2px; font-size: 18px; }
.wx-hours small { font: 500 11px var(--mono); color: var(--muted); }
.wx-hours b { font-size: 13px; font-weight: 600; }
.t-city { display: flex; gap: 8px; }
.t-city input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 16px; outline: none; }
.t-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.t-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14.5px; transition: opacity .3s; }
.t-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-list li.late span { color: var(--bad); }
.t-list li.done { opacity: .35; text-decoration: line-through; }
.t-list .tick { width: 20px; height: 20px; flex: none; }
.t-card .more { font-size: 13px; color: var(--muted); }
.t-quick { display: flex; gap: 6px; margin-top: auto; }
.t-quick input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 16px; outline: none; }
.t-quick input:focus { border-color: var(--line-2); }
#t-side { padding: 0; gap: 0; overflow: hidden; }
.t-mini { display: grid; gap: 4px; padding: 13px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); min-width: 0; }
.t-mini:last-child { border-bottom: 0; }
.t-mini:hover { background: var(--card-hover); }
.t-mini b { font-weight: 600; font-size: 15px; }
.t-mini span:not(.eyebrow) { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-mini .clamp { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 900px) { .today { grid-template-columns: 1fr 1fr; } #t-side { grid-column: 1 / -1; } }
@media (max-width: 600px) { .today { grid-template-columns: 1fr; } }
.wx-tomorrow { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.wx-tomorrow > div { display: flex; align-items: center; gap: 10px; }
.wx-tomorrow b { font-size: 17px; font-weight: 600; }
.wx-tomorrow small { display: block; color: var(--muted); font-size: 12.5px; }
.wx-ico.sm { font-size: 30px; }

/* accounts */
body.locked > *:not(#auth) { visibility: hidden; }
#auth { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.auth-card { width: min(380px, 100%); display: grid; gap: 10px; }
.auth-logo { font: 400 30px var(--serif); margin-bottom: 12px; }
.auth-logo i { color: var(--muted); }
.auth-card h1 { margin: 0; }
.auth-card form, .acc { display: grid; gap: 10px; }
.auth-card input, .acc input { padding: 13px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 16px; outline: none; }
.auth-card input:focus, .acc input:focus { border-color: var(--accent); }
.auth-err { color: var(--bad); min-height: 1em; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; max-width: 900px; }
.acc .btn { justify-self: start; }
.acc-users { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acc-users li { display: flex; align-items: center; gap: 10px; }
.acc-users small { color: var(--muted); margin-left: auto; }
.acc-users button { margin-left: auto; }
.acc-users .danger { color: var(--bad); border-color: var(--bad); width: auto; padding: 0 10px; }
.acc-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.share-box { max-width: 900px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; font: 500 14px var(--mono); }
.share-box .btn.ghost { justify-self: start; }

/* reader: the sentences that answer the headline */
.reader-page strong.hl { font-weight: 700; color: var(--text); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 24%, transparent) 62%); }

/* the menu scrolls when it is taller than the window (PC; the phone menu already scrolls) */
@media (min-width: 861px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
}

/* Pronote */
.pn-login { max-width: 560px; }
.pn-head a, .pn-foot a { color: var(--muted); }
.pn-warn { color: var(--warn); }
.nt-tabs small { font: 600 11px var(--mono); color: var(--accent); margin-left: 3px; }
.pn-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.pn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-left: 4px; vertical-align: 1px; }
.pn-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 720px; }
.pn-lessons li { display: flex; gap: 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; }
.pn-lessons li.canceled { opacity: .75; border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); border-left-color: var(--bad); }
.pn-lessons li.canceled .pn-l > b { text-decoration: line-through; }
.pn-lessons li.changed { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.pn-t { display: grid; align-content: start; min-width: 50px; font-family: var(--mono); }
.pn-t b { font-size: 15px; } .pn-t small { color: var(--muted); font-size: 12px; }
.pn-l { display: grid; gap: 3px; min-width: 0; }
.pn-l b { font-size: 15.5px; } .pn-l span { color: var(--muted); font-size: 13.5px; }
.pn-l .pn-status { color: var(--bad); font-weight: 600; }
.pn-lessons li.changed .pn-status { color: var(--warn); }
.pn-tag { font: 600 10px var(--mono); text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.pn-hw { margin: 4px 0 0; color: var(--text); font-size: 14.5px; line-height: 1.45; white-space: pre-line; }
.task.done .pn-hw { color: var(--muted); }
.pn-overall { display: inline-grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-top: 4px; }
.pn-overall b { font: 400 44px/1 var(--serif); } .pn-overall small { color: var(--muted); }
.pn-avgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pn-avg { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pn-avg span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-avg b { font: 600 16px var(--mono); grid-row: span 2; align-self: center; }
.pn-avg small { color: var(--muted); font-size: 12px; }
.pn-grades { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 720px; }
.pn-grades li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pn-grades li > b { font: 600 18px var(--mono); min-width: 64px; } .pn-grades li > b small { font-size: 12px; color: var(--muted); }
.pn-grades li div { display: grid; min-width: 0; } .pn-grades li div small { color: var(--muted); font-size: 12.5px; }
.good { color: var(--good) !important; } .bad { color: var(--bad) !important; }
