/* Misto website. Neutral light (warm, cream-tinted) and dark (deep navy) tokens, hairline borders instead of shadows,
   pill controls, one inverted solid button. The accents are Chicago Bears navy (#0B162A) and orange (#E64100), used
   sparingly: orange for what is on or chosen, blue for focus, cream and navy for selected tabs. */
@font-face {
  font-family: "Inter"; src: url("/static/inter.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #fbfaf7; --panel: #fff; --raised: #f3f1ee; --fg: #0b162a;
  --muted: rgba(11, 22, 42, .66); --quiet: rgba(11, 22, 42, .54);
  --line: rgba(11, 22, 42, .12); --line-soft: rgba(11, 22, 42, .07); --line-strong: rgba(11, 22, 42, .24);
  --word: invert(1); /* the lettering artwork is white */
  /* Bears navy and orange (the owner's choice) lead; a navy-tinted blue for focus, a lighter orange and a warm white beside them. */
  --navy: #0b162a; --blue: #2a4a7f; --orange: #e64100; --amber: #ff8a3d; --cream: #f7efe3; --on-accent: #0b162a;
  --accent: linear-gradient(115deg, var(--amber), var(--orange) 45%, var(--blue));
  /* Controls: "on" fill and its mark; the selected tab; focus. Light: orange-ink on white, navy tabs. */
  --control: var(--orange); --on-control: #fff; --tab-on: var(--navy); --on-tab: var(--cream);
  --focus: var(--blue); --ring: rgba(42, 74, 127, .28);
  --ok: #13744a; --ok-bg: rgba(19, 116, 74, .09); --warn: #8a5300; --warn-bg: rgba(200, 120, 0, .1);
  --danger: #c0303b; --danger-bg: rgba(192, 48, 59, .08);
  --radius: 1rem; --radius-sm: .75rem; --max: 78rem; --gutter: 16px; --top: 84px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
/* Dark: chosen (data-theme="dark", the default), or System with the device in dark mode. Same tokens twice: CSS
   can't share a block between a selector and a media query. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b162a; --panel: #111e36; --raised: #182843; --fg: #f5f2ec;
  --muted: rgba(245, 242, 236, .66); --quiet: rgba(245, 242, 236, .52);
  --line: rgba(220, 230, 255, .1); --line-soft: rgba(220, 230, 255, .06); --line-strong: rgba(220, 230, 255, .2);
  --word: none; --focus: #8fb8ea; --ring: rgba(143, 184, 234, .34);
  --control: var(--orange); --on-control: #fff; --tab-on: var(--cream); --on-tab: var(--navy);
  --ok: #5fd39a; --ok-bg: rgba(95, 211, 154, .12); --warn: #ffc069; --warn-bg: rgba(255, 192, 105, .1);
  --danger: #ff7a7a; --danger-bg: rgba(255, 122, 122, .12);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #0b162a; --panel: #111e36; --raised: #182843; --fg: #f5f2ec;
    --muted: rgba(245, 242, 236, .66); --quiet: rgba(245, 242, 236, .52);
    --line: rgba(220, 230, 255, .1); --line-soft: rgba(220, 230, 255, .06); --line-strong: rgba(220, 230, 255, .2);
    --word: none; --focus: #8fb8ea; --ring: rgba(143, 184, 234, .34);
    --control: var(--orange); --on-control: #fff; --tab-on: var(--cream); --on-tab: var(--navy);
    --ok: #5fd39a; --ok-bg: rgba(95, 211, 154, .12); --warn: #ffc069; --warn-bg: rgba(255, 192, 105, .1);
    --danger: #ff7a7a; --danger-bg: rgba(255, 122, 122, .12);
  }
}
html { background: var(--bg); }
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: rgba(246, 247, 249, .78); margin-left: 4px; }
.theme-toggle:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.theme-toggle .icon { width: 19px; height: 19px; }
/* "Stage": the always-dark hero and showcase surfaces. */
.stage {
  color-scheme: dark; --bg: #070f1d; --panel: #0d1830; --raised: #15233c; --fg: #f5f2ec;
  --muted: rgba(246, 247, 249, .66); --quiet: rgba(246, 247, 249, .5);
  --line: rgba(255, 255, 255, .1); --line-soft: rgba(255, 255, 255, .06); --line-strong: rgba(255, 255, 255, .22);
  --word: none; --focus: #8fb8ea; --ring: rgba(143, 184, 234, .34); --control: var(--orange); --on-control: #fff;
  --tab-on: var(--cream); --on-tab: var(--navy); background: var(--bg); color: var(--fg);
}
@media (min-width: 640px) { :root { --gutter: 2rem; } }
@media (min-width: 1024px) { :root { --gutter: 3rem; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0; min-height: 100dvh; padding-top: var(--top); display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); font: 400 16px/1.6 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.025em; font-weight: 600; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); letter-spacing: -.04em; font-weight: 650; line-height: 1.04; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; word-break: break-all; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 40; padding: 10px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 600; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.quiet { color: var(--quiet); }
.small { font-size: .875rem; }
.eyebrow { display: block; margin: 0 0 .5em; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.lead { font-size: 1.0625rem; line-height: 1.55; color: var(--muted); max-width: 42rem; }

/* ---- buttons: the inverted solid pill, a ghost pill, small and wide ---- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--bg); background: var(--fg);
  border: 1px solid var(--fg); border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .18s, border-color .18s, color .18s, opacity .18s;
}
@media (hover: hover) { button:hover, .btn:hover { transform: translateY(-1px); opacity: .9; } }
button:active, .btn:active { transform: scale(.98); }
button.ghost, .btn.ghost { color: var(--fg); background: transparent; border-color: var(--line-strong); }
@media (hover: hover) { button.ghost:hover, .btn.ghost:hover { background: var(--raised); opacity: 1; } }
button.danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
@media (hover: hover) { button.danger:hover { background: var(--danger-bg); opacity: 1; } }
button.small, .btn.small { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
button.small .icon, .btn.small .icon { width: 18px; height: 18px; }
button.wide, .btn.wide { width: 100%; min-height: 48px; }
button.icon-only { width: 40px; height: 40px; min-height: 40px; padding: 0; color: #fff; background: rgba(7, 8, 11, .62); border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); }
@media (pointer: coarse) { button.small, .btn.small { min-height: 44px; } button.icon-only { width: 44px; height: 44px; } }

/* ---- forms ---- */
form { margin: 0 0 12px; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
label { display: block; margin: 0 0 18px; font-weight: 600; font-size: .875rem; color: color-mix(in srgb, var(--fg) 78%, transparent); }
input, select, textarea {
  display: block; width: 100%; min-height: 48px; margin-top: 8px; padding: 11px 16px; font: inherit; font-size: 1rem; font-weight: 400;
  color: var(--fg); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, background-color .15s, box-shadow .2s var(--ease);
}
input::placeholder { color: var(--quiet); }
/* Dropdowns drawn like the rest (no browser chrome): the chevron is two gradients (images are blocked by the page
   policy), in the text color so it follows light and dark. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
select:hover { border-color: var(--line-strong); }
select option { color: var(--fg); background: var(--panel); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--focus); background-color: var(--panel); box-shadow: 0 0 0 4px var(--ring); }
input[type="file"] { padding: 7px 8px; font-size: .9rem; color: var(--muted); }
input[type="file"]::file-selector-button { margin-right: 12px; min-height: 32px; padding: 4px 14px; font: inherit; font-weight: 600; color: var(--fg); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
textarea { font-family: var(--mono); font-size: .85rem; resize: vertical; }
form.inline select { display: inline-block; width: auto; margin: 0; min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 999px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.form-aside { margin: -6px 0 22px; text-align: right; font-size: .875rem; }
.form-aside a { font-weight: 600; text-decoration-color: currentColor; }
.notice, .error { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: .925rem; }
.notice { color: var(--ok); background: var(--ok-bg); }
.error { color: var(--danger); background: var(--danger-bg); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); color: var(--muted); font-size: .925rem; }
.callout .icon { margin-top: 1px; }
.callout.warn { color: var(--fg); background: var(--warn-bg); border-color: transparent; }
.callout.warn .icon { color: var(--warn); }
.callout.ok { color: var(--fg); background: var(--ok-bg); border-color: transparent; }
.callout.ok .icon { color: var(--ok); }
.badge { display: inline-block; white-space: nowrap; padding: 2px 10px; font-size: .75rem; font-weight: 600; border-radius: 999px; color: var(--muted); background: var(--raised); border: 1px solid var(--line); }
.badge.on { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--quiet); font-size: .8125rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---- the floating pill navigation (always a dark capsule, like the stage) ---- */
.topbar { position: fixed; top: 12px; left: 0; right: 0; z-index: 30; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.pill-nav {
  --word: none; position: relative; display: flex; align-items: center; gap: 2px; max-width: 100%; padding: 6px; pointer-events: auto;
  color: #f6f7f9; background: rgba(22, 23, 26, .86); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .55);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.brand-orb { width: 28px; height: 28px; }
.brand-word { width: auto; height: 18px; filter: var(--word); }
.pill-nav .brand { min-height: 44px; padding: 0 12px 0 6px; border-radius: 999px; }
.pill-links { display: none; align-items: center; gap: 2px; }
.pill-links a, .nav-sheet a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; color: rgba(246, 247, 249, .72); font-size: .925rem; font-weight: 500; text-decoration: none; transition: color .15s, background-color .15s; }
.pill-links a:hover, .nav-sheet a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.pill-links a[aria-current], .nav-sheet a[aria-current] { color: #090a0e; background: #f6f7f9; font-weight: 600; }
.pill-cta, button.pill-cta { min-height: 44px; padding: 8px 18px; margin-left: 6px; font-size: .925rem; color: #090a0e; background: #f6f7f9; border: 1px solid #f6f7f9; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 600; text-decoration: none; white-space: nowrap; }
form.signout { margin: 0; }
.nav-menu { position: static; }
.nav-menu summary { list-style: none; display: grid; place-items: center; width: 44px; min-height: 44px; margin-left: 2px; border-radius: 999px; color: #f6f7f9; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: rgba(255, 255, 255, .1); }
.nav-sheet { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: grid; gap: 2px; padding: 8px; border-radius: 1.5rem; background: #17181b; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); }
.nav-sheet a { width: 100%; }
@media (max-width: 759px) {
  .pill-nav { width: 100%; }
  .pill-nav .brand { margin-right: auto; }
}
@media (min-width: 760px) {
  .pill-links { display: flex; }
  .pill-nav .brand { margin-right: 6px; }
  .nav-menu { display: none; }
}

/* ---- footer ---- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
/* "What Misto is not." — as nuvio.tv: the heading beside a readable column, between soft dividers. */
.legal-block { display: grid; gap: 1.25rem 3rem; padding: clamp(2.5rem, 1.5rem + 3vw, 4rem) 0; border-bottom: 1px solid var(--line-soft); }
@media (min-width: 760px) { .legal-block { grid-template-columns: minmax(0, 18rem) 1fr; } }
.legal-block h2 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; color: var(--fg); }
.legal-block p { margin: 0 0 .875rem; max-width: 68ch; font-size: .9375rem; line-height: 1.6; color: var(--muted); }
.legal-block p:last-child { margin-bottom: 0; }
.legal-block a, .footer-links a { color: var(--muted); }
.legal-block a:hover, .footer-links a:hover { color: var(--fg); }
.footer-main { display: grid; gap: 20px; padding: 28px 0 36px; text-align: center; }
@media (min-width: 760px) { .footer-main { grid-template-columns: minmax(160px, 220px) 1fr; align-items: center; gap: 32px; text-align: left; } }
.footer-brand .brand { justify-content: center; }
@media (min-width: 760px) { .footer-brand .brand { justify-content: flex-start; } }
.footer-brand p { margin: 4px 0 0; font-size: .8125rem; color: var(--quiet); }
.footer-brand p:first-of-type { margin-top: 10px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
@media (min-width: 560px) { .footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .footer-links { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.footer-links a { font-size: .8125rem; text-decoration: none; transition: color .15s; }
/* Reading pages (Legal, Licenses). */
.prose { max-width: 72ch; }
.prose section { margin: 0 0 36px; }
.prose h2 { font-size: 1.25rem; margin: 0 0 12px; }
.prose p, .prose li { line-height: 1.65; color: var(--muted); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
ul.credit-list { list-style: none; padding: 0; display: grid; gap: 12px; margin: 18px 0 0; }
ul.credit-list li.card { margin: 0; padding: 16px 20px; }
ul.credit-list h3 { margin: 0 0 4px; font-size: 1rem; }
ul.credit-list h3 a { color: var(--fg); }
ul.credit-list p { margin: 0; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
fieldset.avatar-picker { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.avatar-picker legend { padding: 0 6px; font-weight: 600; font-size: .875rem; }
.avatar-cat { flex-basis: 100%; margin: 8px 0 0; text-transform: capitalize; }
label.avatar-choice { position: relative; margin: 0; cursor: pointer; display: grid; justify-items: center; gap: 4px; font-weight: 500; font-size: .75rem; }
label.avatar-choice input { position: absolute; opacity: 0; }
label.avatar-choice img, label.avatar-choice .avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid transparent; }
label.avatar-choice input:checked + img, label.avatar-choice input:checked + .avatar { border-color: var(--control); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--control); }
label.avatar-choice input:focus-visible + img, label.avatar-choice input:focus-visible + .avatar { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="color"] { width: 64px; height: 40px; padding: 2px; }

/* ---- signed out: narrow sign-in column, reading pages ---- */
.auth { width: 100%; max-width: calc(28rem + 2 * var(--gutter)); margin: 0 auto; padding: clamp(48px, 11vh, 120px) var(--gutter) 40px; }
.auth > h1 { margin-bottom: .3em; font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem); }
.auth > .lead { margin-bottom: 32px; }
/* Sign In / Join: one centered card with one big Sign in with Nuvio button (nuvio.tv's sign-in, Misto's look). */
.auth.signin { max-width: calc(30rem + 2 * var(--gutter)); }
.signin-card { text-align: center; padding: clamp(28px, 6vw, 44px) clamp(20px, 5vw, 36px); }
.signin-card h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); margin: 12px 0 .3em; }
.signin-card .lead { margin: 0 0 24px; }
.signin-card form { margin: 0 0 12px; }
.signin-lock { display: inline-flex; color: var(--muted); }
.signin-lock .icon { width: 30px; height: 30px; }
.signin-btn { min-height: 52px; font-size: 1.05rem; }
.signin-alt { text-align: center; margin: 20px 0 8px; }
.auth.signin .fine { text-align: center; }
.setup-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.setup-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.setup-list h2 { margin: 0 0 4px; }
.invite-link code { display: block; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); word-break: break-all; font-size: .9rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.auth > p:not([class]) { color: var(--muted); }
.help { margin-top: 20px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.help summary { font-weight: 500; color: var(--fg); }
.fine { margin: 28px 0 0; font-size: .8125rem; color: var(--quiet); max-width: 26rem; }
.page { padding-top: clamp(40px, 9vh, 96px); padding-bottom: 40px; max-width: calc(52rem + 2 * var(--gutter)); }
.page > .lead { margin-bottom: 36px; }
ol.steps { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 14px; counter-reset: step; }
ol.steps > li { position: relative; padding-left: 64px; counter-increment: step; }
ol.steps > li::before { content: counter(step); position: absolute; left: 20px; top: 21px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: .8125rem; font-weight: 700; }
@media (min-width: 640px) { ol.steps > li { padding-left: 72px; } ol.steps > li::before { left: 24px; top: 25px; } }
ol.steps h2 { font-size: 1.125rem; }
ol.steps p { color: var(--muted); }
ol.steps p:last-child { margin: 0; }
.keybox { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); }
.key { font-size: 1.05rem; letter-spacing: .06em; }
.codes { columns: 2; gap: 24px; padding: 16px 16px 16px 2.2em; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); }
.codes li { padding: 2px 0; }
.codes code { font-size: .95rem; }
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; font-size: .78rem; color: var(--quiet); }
.stepper li { flex: 1; padding-top: 8px; border-top: 3px solid var(--line); }
.stepper li[aria-current] { color: var(--fg); font-weight: 600; border-image: var(--accent) 1; }

/* ---- landing ---- */
.hero { position: relative; overflow: hidden; margin-top: calc(var(--top) * -1); padding-top: calc(var(--top) + clamp(40px, 8vh, 88px)); text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60rem 30rem at 50% -6rem, rgba(255, 255, 255, .08), transparent 70%),
    radial-gradient(28rem 20rem at 50% 9rem, rgba(240, 140, 67, .16), rgba(44, 95, 158, .12) 50%, transparent 75%);
}
.hero-inner { position: relative; }
.hero-lockup { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 20px); margin: 0 0 clamp(28px, 4vw, 44px); }
.hero-orb { width: clamp(64px, 12vw, 104px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 18px 48px rgba(255, 130, 80, .35)); animation: float 9s ease-in-out infinite; }
/* the h1 keeps its "misto" text for screen readers and shows the lettering artwork */
.hero-word { width: clamp(150px, 28vw, 260px); aspect-ratio: 742 / 149; margin: 0; background: url("/static/wordmark.png") center / contain no-repeat; filter: var(--word); text-indent: 110%; white-space: nowrap; overflow: hidden; }
.hero-title { max-width: 15ch; margin: 0 auto 22px; font-size: clamp(2.6rem, 1.2rem + 5.4vw, 5.25rem); font-weight: 650; line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.hero-lead { max-width: 40rem; margin: 0 auto 32px; font-size: clamp(1.0625rem, .95rem + .45vw, 1.25rem); line-height: 1.6; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-cta .btn { min-height: 48px; padding: 12px 24px; }
@media (max-width: 559px) { .hero-cta .btn { flex: 1 1 100%; } }
.hero-note { margin: 20px auto 0; max-width: 36rem; font-size: .8125rem; color: var(--quiet); }
@keyframes float { 50% { transform: translateY(-6px); } }
.tv-mock { max-width: 60rem; margin: clamp(48px, 7vw, 80px) auto 0; padding: 10px 10px 0; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 1.5rem 1.5rem 0 0; background: linear-gradient(#1a1c22, #0e1015); }
.tv-screen { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 22px 22px 0 0; border-radius: 1rem 1rem 0 0; background: radial-gradient(40rem 16rem at 70% 0, rgba(44, 95, 158, .16), transparent 70%), #090c13; text-align: left; }
.tv-rail { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.dot.on { background: var(--accent); box-shadow: 0 0 0 4px rgba(240, 140, 67, .18); }
.tv-label { margin: 0 0 10px; font-size: .8125rem; font-weight: 600; color: var(--fg); }
.tv-row { display: grid; gap: 10px; margin-bottom: 22px; }
.tv-row.posters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tv-row.wides { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.tv-row span { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); }
.tv-row.posters span { aspect-ratio: 2 / 3; }
.tv-row.wides span { aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 12px; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .9); border-radius: 10px 10px 0 0; border-bottom: 0; }
.tv-row.wides b { font-size: .68rem; font-weight: 600; color: rgba(255, 255, 255, .6); }
.tv-row.posters span:nth-child(n+5), .tv-row.wides span:nth-child(n+3) { display: none; }
@media (min-width: 640px) {
  .tv-row.posters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tv-row.wides { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tv-row.posters span:nth-child(n+5), .tv-row.wides span:nth-child(n+3) { display: block; }
  .tv-row.wides span:nth-child(n+3) { display: flex; }
}
.tv-row i { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.tv-row i::after { content: ""; position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #fff; }
.p20::after { width: 20%; } .p30::after { width: 30%; } .p50::after { width: 50%; } .p60::after { width: 60%; } .p70::after { width: 70%; } .p90::after { width: 90%; }
.c1 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #47306e, #1a1530); }
.c2 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #1f4a55, #101d24); }
.c3 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #6b3b1f, #24151a); }
.c4 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #5d2346, #1d1222); }
.c5 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #26385f, #111826); }
.c6 { background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 55%), linear-gradient(160deg, #34452c, #141a12); }
.platforms { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; margin: 0; padding: 22px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.platforms > span { display: inline-flex; align-items: center; gap: 8px; }
.platforms > span + span::before { content: "·"; margin-right: 6px; color: var(--quiet); }
.platforms .icon { width: 18px; height: 18px; color: var(--quiet); }
@media (max-width: 559px) { .platforms { flex-direction: column; } .platforms > span + span::before { display: none; } }

.band { padding: clamp(72px, 10vw, 128px) 0; }
.band + .band { padding-top: 0; }
.section-head { max-width: 44rem; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2, .band h2 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.5rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.05; }
.section-head p { color: var(--muted); font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); margin: 0; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: clamp(56px, 8vw, 104px); }
.feature:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 72px; } .feature.flip .feature-copy { order: 2; } }
.feature-copy h3 { font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.25rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.08; }
.feature-copy p { color: var(--muted); font-size: 1.0625rem; max-width: 30rem; margin: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.feature-visual { border: 1px solid var(--line); border-radius: 1.25rem; padding: 14px; min-height: 240px; }
@media (min-width: 640px) { .feature-visual { padding: 20px; } }
.mock-mv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; aspect-ratio: 16 / 9; min-height: 0; }
.tile { display: flex; align-items: flex-end; padding: 10px 12px; border-radius: 10px; font-size: .8rem; font-weight: 600; color: rgba(255, 255, 255, .92); border: 2px solid transparent; }
.tile.t1 { background: linear-gradient(135deg, #1d2b4f, #3a2251); }
.tile.t2 { background: linear-gradient(135deg, #12392f, #1e2b45); }
.tile.t3 { background: linear-gradient(135deg, #4a2a17, #2b1d3c); }
.tile.t4 { background: linear-gradient(135deg, #262a33, #3c2531); }
.tile.audio { border-color: var(--amber); }
.mock-guide { display: grid; gap: 8px; align-content: center; }
.g-row { display: grid; grid-template-columns: 48px repeat(5, minmax(0, 1fr)); gap: 6px; }
.g-ch, .g-p { padding: 10px; border-radius: 8px; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.g-ch { font-weight: 700; color: var(--fg); text-align: center; padding: 10px 4px; }
.g-p.w1 { grid-column: span 1; } .g-p.w2 { grid-column: span 2; } .g-p.w3 { grid-column: span 3; } .g-p.w4 { grid-column: span 4; }
.g-p.now { color: var(--fg); border-color: color-mix(in srgb, var(--orange) 55%, transparent); background: color-mix(in srgb, var(--orange) 16%, var(--raised)); }
.mock-sync { display: flex; flex-wrap: wrap; gap: 10px; align-content: center; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.mock-backups { display: grid; gap: 8px; align-content: center; }
.b-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.b-row b { color: var(--fg); font-weight: 600; }
.b-tag { font-size: .75rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.cards3 { display: grid; gap: 16px; }
@media (min-width: 800px) { .cards3 { grid-template-columns: repeat(3, 1fr); } }
.pillar { padding: 28px; }
.pillar .icon { box-sizing: content-box; width: 22px; height: 22px; padding: 11px; margin-bottom: 20px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.pillar h3 { font-size: 1.25rem; letter-spacing: -.03em; }
.pillar p { color: var(--muted); margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 72px; } }
.split p { color: var(--muted); font-size: 1.0625rem; max-width: 36rem; }
.closing .wrap { max-width: calc(46rem + 2 * var(--gutter)); text-align: center; }
.closing-orb { width: 72px; height: 72px; margin-bottom: 20px; }
.closing p { color: var(--muted); font-size: 1.0625rem; margin: 0 auto 32px; }

/* ---- cards, tables, lists ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
@media (min-width: 640px) { .card { padding: 24px; } }
.card > h2 { margin-bottom: .75em; }
.card > ul:not([class]) { margin: 0; padding-left: 1.2em; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; min-width: 300px; }
/* phones: each table row becomes a short block, its first cell as the heading and the actions underneath */
@media (max-width: 639px) {
  .table-wrap { margin: 0; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: block; padding: 0; border: 0; }
  .table-wrap td:first-child { flex-basis: 100%; color: var(--fg); font-weight: 600; }
  .table-wrap td:last-child { flex-basis: 100%; }
  .table-wrap .actions-cell { display: flex; justify-content: flex-start; min-width: 0; padding-top: 6px; }
  .table-wrap .actions-cell form.inline { flex: 1 1 100%; }
  .table-wrap .actions-cell form.inline select { flex: 1 1 30%; min-width: 0; }
}
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0 0 16px; }
dl.facts dt { color: var(--quiet); font-size: .875rem; }
dl.facts dd { margin: 0; font-size: .95rem; }
.split dl.facts { margin: 0; }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: .95rem; }
ul.rows > li:first-child { padding-top: 0; }
ul.rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 559px) { ul.rows > li { flex-direction: column; } }
.card ul.rows + p { margin-top: 18px; }
.row-title { font-weight: 600; }
.grid2 { display: grid; gap: 16px; margin-bottom: 16px; }
.stack { display: grid; gap: 16px; max-width: 46rem; }
.stack form:last-child { margin-bottom: 0; }
.stack .card > form.inline + form.inline, .stack .card > form + form { margin-top: 8px; }
@media (min-width: 1100px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .icon { box-sizing: content-box; width: 26px; height: 26px; padding: 14px; color: var(--fg); margin-bottom: 14px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); }
.empty h2 { color: var(--fg); font-size: 1.25rem; }
.empty p { max-width: 28rem; margin: 0 auto; }
.narrow { max-width: 34rem; }
.nuvio-wait > p:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pair-code { margin: 0 0 20px; }
.pair-code code { display: block; text-align: center; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: clamp(1.75rem, 1.4rem + 2vw, 2.5rem); font-weight: 650; letter-spacing: .1em; padding: 16px 12px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); word-break: normal; }

/* ---- the dashboard: sections beside the page (a left column from 960px, pill tabs on phones) ---- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
.side { min-width: 0; }
.side-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.side-head p { margin: 0; line-height: 1.3; min-width: 0; }
.side-user { display: block; font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-house { display: block; color: var(--muted); font-size: .8125rem; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: .925rem; font-weight: 500; transition: background-color .15s, color .15s; }
.side-nav a:hover { color: var(--fg); background: var(--raised); }
.side-nav .icon { width: 18px; height: 18px; }
.nav-group { display: none; }
.content { min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 28px; }
.page-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); margin-bottom: .2em; }
.page-head .lead { margin: 0; font-size: 1rem; }
/* Misto's orb beside a page title (Sports): the logo's own artwork and glow, never a sports-only mark. */
.page-head h1.with-orb { display: flex; align-items: center; gap: .32em; }
.title-orb { width: 1em; height: 1em; flex: none; filter: drop-shadow(0 6px 16px rgba(240, 140, 67, .3)); }
.page-actions { display: flex; gap: 8px; }
.content > .card, .content > section, .content > .grid2, .household-block > .card, .household-block > .empty { margin-bottom: 16px; }
.content > .callout, .content > .tabs, .content > .notice, .content > .error { margin-bottom: 16px; }
@media (max-width: 959px) {
  .side-nav ul { display: flex; gap: 6px; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
  .side-nav ul::-webkit-scrollbar { display: none; }
  .side-nav li { scroll-snap-align: start; }
  .side-nav a { border: 1px solid var(--line); background: var(--panel); }
  .side-nav a[aria-current="page"] { color: var(--on-tab); background: var(--tab-on); border-color: var(--tab-on); font-weight: 600; }
  .page-head { margin-top: 20px; }
}
@media (min-width: 960px) {
  .dash { grid-template-columns: 236px minmax(0, 1fr); gap: 56px; padding-top: 32px; }
  .side { position: sticky; top: calc(var(--top) + 16px); align-self: start; max-height: calc(100dvh - var(--top) - 32px); overflow-y: auto; }
  .side-head { padding: 12px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .side-nav ul { display: grid; gap: 1px; }
  .side-nav a { min-height: 36px; padding: 7px 14px; }
  .side-nav a[aria-current="page"] { color: var(--fg); background: var(--raised); font-weight: 600; box-shadow: inset 3px 0 0 var(--control), inset 0 0 0 1px var(--line); }
  .nav-group { display: block; margin: 18px 14px 6px; font-size: .75rem; font-weight: 600; color: var(--quiet); }
  .page-head { margin-top: 0; }
}

/* ---- signed-in pages ---- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat { display: grid; grid-template-areas: "i" "n" "l"; gap: 0; padding: 18px; text-decoration: none; transition: border-color .18s, transform .25s var(--ease); }
@media (hover: hover) { .stat:hover { border-color: var(--line-strong); transform: translateY(-2px); } }
.stat .icon { grid-area: i; width: 18px; height: 18px; margin-bottom: 22px; color: var(--quiet); }
.stat-l { grid-area: l; margin-top: 8px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.stat-n { grid-area: n; font-size: clamp(2rem, 1.6rem + 1vw, 2.5rem); font-weight: 650; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.quick-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.quick p:last-child { margin: 0; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 18px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; font-size: .925rem; }
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--on-tab); background: var(--tab-on); font-weight: 600; }
/* Profiles: every profile in view (a second row when they don't fit), never scrolled sideways. */
.tabs[aria-label="Profiles"] { flex-wrap: wrap; overflow: visible; border-radius: 1.4rem; }
.tabs[aria-label="Profiles"] a { padding: 6px 14px; }
.tabs[aria-label="Profiles"] a:has(.avatar) { padding-left: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.filters label { margin: 0; }
.filters .search { position: relative; flex: 1 1 220px; }
.filters .search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--quiet); }
.filters .search input { margin: 0; padding-left: 46px; border-radius: 999px; }
.filters select { margin: 0; border-radius: 999px; width: auto; padding-right: 36px; }

.poster-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 20px 14px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
@media (min-width: 640px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 18px; } }
.title-card { position: relative; min-width: 0; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--raised), var(--panel)); border: 1px solid var(--line); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
@media (hover: hover) { .title-card:hover .poster img { transform: scale(1.03); } }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.5rem; font-weight: 650; letter-spacing: -.03em; color: var(--quiet); }
.poster.small { width: 72px; flex: none; border-radius: 10px; }
.poster.small .poster-fallback { font-size: 1.05rem; }
@media (min-width: 640px) { .poster.small { width: 84px; } }
.title-meta { padding-top: 10px; }
.title-meta h3 { font-size: .925rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title-meta p { margin: 0; font-size: .8125rem; }
form.corner { position: absolute; top: 6px; right: 6px; }
@media (hover: hover) and (pointer: fine) {
  form.corner { opacity: 0; transition: opacity .15s; }
  .title-card:hover form.corner, form.corner:focus-within { opacity: 1; }
}

.row-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.row-card { display: flex; gap: 16px; align-items: flex-start; padding: 14px; }
@media (min-width: 640px) { .row-card { padding: 16px; } }
.row-main { flex: 1 1 180px; min-width: 0; }
.row-main h3 { margin: 4px 0 4px; font-size: 1.0625rem; overflow-wrap: anywhere; }
.row-main p { margin: 0 0 4px; }
.row-card > form.inline { flex: none; }
@media (max-width: 559px) { .row-card { flex-wrap: wrap; } .row-card > form.inline { margin-left: 88px; } .row-main { flex-basis: calc(100% - 88px); } }
.progress-line { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
progress { flex: 1; max-width: 360px; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--raised); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--raised); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.episodes { margin-top: 6px; }
.episodes summary { min-height: 40px; color: var(--muted); font-size: .9rem; }
.episodes ul { list-style: none; margin: 0; padding: 0; }
.episodes li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.episodes li > span:first-child { font-weight: 600; min-width: 72px; }
.episodes li form { margin-left: auto; }

.profile-grid, .tv-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
/* A household has a few TVs: they share the row rather than leave an empty column. */
.tv-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.addon-list + form { margin-top: 22px; }
.profile-head, .tv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head h2, .tv-head h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.profile-head p, .tv-head p { margin: 0; }
.tv-head .tv-status { margin-left: auto; }
details.rename { margin-top: 12px; }
details.rename summary { cursor: pointer; color: var(--muted); font-size: .875rem; }
details.rename form { margin-top: 10px; }
li.addon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
li.addon-row:last-child { border-bottom: 0; }
li.addon-row.off .addon-name { opacity: .6; }
.addon-name { display: grid; gap: 2px; flex: 1 1 14rem; min-width: 0; }
.addon-name strong { overflow-wrap: anywhere; }
li.addon-row .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
li.session { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
li.session:last-child { border-bottom: 0; }
.avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; letter-spacing: -.02em; }
.avatar.small { width: 36px; height: 36px; font-size: .8125rem; }
.avatar.tiny { width: 22px; height: 22px; font-size: .6rem; margin-right: 8px; }
.avatar.large { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar.custom { background: var(--raised); color: var(--muted); border: 1px dashed var(--line-strong); }
.profile-preview { display: flex; align-items: center; gap: 18px; padding: 16px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.profile-preview strong { font-size: 1.125rem; overflow-wrap: anywhere; }
.profile-preview p { margin: 2px 0 0; }
label.avatar-url { flex-basis: 100%; margin: 4px 0 0; }
.avatar-picker .error, .avatar-note { flex-basis: 100%; margin: 0; }
.avatar { overflow: hidden; color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Profile colors (Nuvio's avatar colors, nearest match). */
.avatar.tone0 { background: #1E88E5; } .avatar.tone1 { background: #E53935; } .avatar.tone2 { background: #43A047; }
.avatar.tone3 { background: #FB8C00; } .avatar.tone4 { background: #8E24AA; } .avatar.tone5 { background: #00ACC1; }
.avatar.tone6 { background: #F45392; } .avatar.tone7 { background: #7957BD; } .avatar.tone8 { background: #FDD835; color: #1b1b1b; }
.avatar.tone9 { background: #6D4C41; }
.tabs a .avatar.tiny { display: inline-grid; }
.tv-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.mini-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--raised); }
.mini-stats dt { font-size: .75rem; line-height: 1.3; color: var(--quiet); }
.mini-stats dd { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.profile-links a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; font-size: .9rem; text-decoration: none; }
.profile-links a:hover { text-decoration: underline; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: .95rem; }

.record-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.record-head h3 { margin-bottom: 2px; }
.record-head p { margin: 0; }
.record { padding-bottom: 10px; }
.record details { margin-top: 10px; border-top: 1px solid var(--line-soft); }
.record summary { font-size: .925rem; }
.table-card h3 .muted { font-weight: 400; }

.link-card { margin-bottom: 16px; }
.big-code { margin: 0 0 20px; }
.big-code code { display: block; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: clamp(2rem, 1.4rem + 4vw, 3.25rem); font-weight: 650; letter-spacing: .12em; text-align: center; padding: 18px 12px; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line-strong); word-break: normal; }
.code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .15em; text-transform: uppercase; text-align: center; }

/* ---- one TV's settings ---- */
.tv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
dl.facts.row { display: flex; flex-wrap: wrap; gap: 6px 24px; }
dl.facts.row dt { align-self: center; }
dl.facts.row dd { margin-right: 8px; white-space: nowrap; }
dl.facts.row > div { display: flex; align-items: baseline; gap: 10px; }
.content > .tabs + .tabs { margin-top: -6px; }
.setting-list { display: grid; margin: 8px 0 20px; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 13rem); align-items: center; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
/* A switch needs only its own width: the text gets the rest. */
.setting-row:has(> input.switch) { grid-template-columns: minmax(0, 1fr) auto; }
.setting-row:last-child { border-bottom: 0; }
.setting-row label { display: grid; gap: 3px; margin: 0; min-width: 0; }
.setting-label { font-weight: 600; }
.setting-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.setting-notes .badge { white-space: normal; }
.setting-row select, .setting-row input { width: 100%; margin: 0; }
.setting-row :disabled { opacity: .55; }
@media (max-width: 560px) { .setting-row { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.setting-row input[type="checkbox"].switch { width: 44px; justify-self: end; }
@media (max-width: 560px) { .setting-row input[type="checkbox"].switch { justify-self: start; } }
/* Groups inside a settings section: a quiet heading over a hairline; "Advanced" groups fold away. */
.setting-group { margin: 0 0 8px; }
.setting-group > h3, details.setting-group > summary { margin: 22px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: .8125rem; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--quiet); }
.setting-group:first-child > h3 { margin-top: 6px; }
details.setting-group > summary { min-height: 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.setting-group > summary::-webkit-details-marker { display: none; }
details.setting-group > summary::after { content: "Show"; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--focus); }
details.setting-group[open] > summary::after { content: "Hide"; }
.setting-group .setting-list { margin: 0 0 6px; }
li.change { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
li.change:last-child { border-bottom: 0; }
.change-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.change-head form { margin-left: auto; }
ul.change-lines { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
fieldset.checks { border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 16px 6px; margin: 0 0 18px; }
fieldset.checks legend { padding: 0 6px; font-weight: 600; font-size: .875rem; }
label.check { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 500; color: var(--fg); }
/* Checkboxes, radios and switches drawn in Misto's colors (no browser pink): an outlined box that fills with the
   orange "on" color; the mark is a rotated border, so it needs no images. */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none; display: inline-grid; place-content: center; flex: none;
  width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 6px;
  transition: background-color .15s, border-color .15s, box-shadow .2s var(--ease);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: solid var(--on-control); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform .15s var(--ease); }
input[type="radio"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-control); transform: scale(0); transition: transform .15s var(--ease); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--control); border-color: var(--control); }
input[type="checkbox"]:checked::after, input[type="radio"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="radio"]:checked::after { transform: scale(1); }
input[type="checkbox"]:hover:not(:disabled), input[type="radio"]:hover:not(:disabled) { border-color: var(--control); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--ring); border-color: var(--focus); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
/* A switch: a checkbox with class "switch" (On/Off settings). */
input[type="checkbox"].switch { width: 44px; height: 26px; border-radius: 999px; place-content: center start; padding: 0 3px; background: var(--raised); }
input[type="checkbox"].switch::after { width: 18px; height: 18px; margin: 0; border: 0; border-radius: 50%; background: var(--muted); transform: none; transition: transform .2s var(--ease), background-color .15s; }
input[type="checkbox"].switch:checked { background: var(--control); }
input[type="checkbox"].switch:checked::after { background: var(--on-control); transform: translateX(17px); }
input[type="range"] { accent-color: var(--control); min-height: 0; padding: 0; background: none; border: 0; }
label.check input { margin: 0; }
.copy-form .grid2 { gap: 0 16px; }
.card h3 { margin: 18px 0 8px; font-size: 1rem; }

/* Integrations and Sports */
.int-row { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.int-row:last-child { border-bottom: 0; }
.int-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.int-head h3 { margin: 0 0 2px; }
.int-head p { margin: 0; }
.int-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
form.key-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; flex: 1 1 18rem; }
form.key-form input { flex: 1 1 12rem; width: auto; margin: 0; }
.checks-list label.check { align-items: flex-start; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line-soft); }
.checks-list label.check:last-child { border-bottom: 0; }
label.setting-check > span:not(.badge) { display: grid; gap: 2px; flex: 1; }
label.check strong + .muted { font-weight: 400; }
/* Section and league order: a card per section, dragged by its handle (pointer events, so touch works too). */
ol.order-list { display: grid; gap: 6px; margin: 10px 0 12px; padding: 0; list-style: none; counter-reset: order; }
li.order-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); counter-increment: order; transition: box-shadow .2s var(--ease), border-color .15s, transform .2s var(--ease); }
li.order-item:hover { border-color: var(--line-strong); }
li.order-item.dragging { position: relative; z-index: 2; border-color: var(--control); box-shadow: 0 10px 28px rgba(11, 22, 42, .18), 0 0 0 1px var(--control); transition: none; }
li.order-item.moved { animation: settle .45s var(--ease); }
@keyframes settle { from { background: color-mix(in srgb, var(--control) 14%, var(--panel)); } }
.order-list.is-dragging { user-select: none; cursor: grabbing; }
.drag-handle { display: grid; place-items: center; flex: none; width: 28px; height: 40px; border-radius: 8px; cursor: grab; touch-action: none; color: var(--quiet); }
.drag-handle:hover { background: var(--raised); color: var(--fg); }
.drag-handle span, .drag-handle span::before, .drag-handle span::after { display: block; width: 12px; height: 2px; border-radius: 2px; background: currentColor; }
.drag-handle span { position: relative; }
.drag-handle span::before, .drag-handle span::after { content: ""; position: absolute; left: 0; }
.drag-handle span::before { top: -5px; } .drag-handle span::after { top: 5px; }
.order-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--raised); overflow: hidden; }
.order-mark img { width: 30px; height: 30px; object-fit: contain; }
.order-mark.builtin { color: var(--control); }
.order-mark.builtin .icon { width: 20px; height: 20px; }
.order-mark.initials { font-size: .75rem; font-weight: 700; color: var(--muted); }
.order-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.order-name::before { content: counter(order) "  "; white-space: pre; color: var(--quiet); font-weight: 500; font-variant-numeric: tabular-nums; }
li.order-item .row-actions { flex: none; gap: 4px; }
button.icon-move { width: 36px; min-height: 36px; padding: 0; font-size: 1rem; }
button.icon-move:disabled { opacity: .35; cursor: default; transform: none; }
@media (pointer: coarse) { button.icon-move { width: 44px; min-height: 44px; } }
.sports-form { max-width: 46rem; }
.sports-form > button[type="submit"]:last-child { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
