/*
 * The signed-in app: clip board, setup, billing, forms, admin.
 * Sits on base.css (tokens, type, buttons, fields, chips, menus, toast, skeleton).
 * Same world as the public pages: ink field, bone type, amber for the win and the one action.
 */
[hidden] { display: none !important; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.9em; }
.app h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -0.03em; }
.app h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.02em; margin: var(--s-6) 0 var(--s-3); }
.app h3 { font-size: 1.05rem; letter-spacing: -0.01em; font-variation-settings: 'wdth' 106; font-weight: 750; }
.app p { margin: 0.5em 0; }
.section-note { color: var(--bone-2); max-width: 62ch; }
.sub { color: var(--bone-3); font-size: 0.85rem; }
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.danger { color: var(--bone-3); }

/* ------------------------------------------------------------ top bar --- */
/* Desktop: a slim bar, wordmark left, the four places, then one account menu.
   Phone: the bar keeps only the wordmark; the four places and "More" become a fixed tab bar. */
.rail {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--s-5);
  height: 56px; padding: 0 var(--gutter);
  background: var(--ink); border-bottom: 1px solid var(--line);
}
.rail .wordmark { display: inline-flex; align-items: center; min-height: var(--tap); margin-right: var(--s-2); }
.rail nav { display: flex; align-items: stretch; align-self: stretch; gap: var(--s-1); }
.rail nav a:not(.btn) {
  display: inline-flex; align-items: center; padding: 0 var(--s-4);
  font: 500 0.93rem var(--text); color: var(--bone-2); text-decoration: none;
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.rail nav a:not(.btn):hover { color: var(--bone); background: rgba(238, 231, 216, 0.04); }
.rail nav a[aria-current='page'] { color: var(--bone); box-shadow: inset 0 -2px 0 var(--amber); }
.rail nav a:not(.btn):focus-visible { outline-offset: -3px; }
.rail nav .count-pill { margin-left: 6px; height: 20px; min-width: 20px; font-size: 0.72rem; }
.rail nav .btn { align-self: center; }
.rail:not(:has(.acct)) nav { margin-left: auto; }
.acct { margin-left: auto; position: relative; align-self: center; }
.acct > summary { border-color: transparent; color: var(--bone-2); font-weight: 500; }
.acct > summary:hover, .acct[open] > summary { color: var(--bone); }
.acct > summary::after { content: ''; width: 7px; height: 7px; margin-left: 2px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--t) var(--ease); }
.acct[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.acct:has([aria-current='page']) > summary { color: var(--bone); }
.acct-ico, .lbl-m { display: none; }
.acct-list { right: 0; top: calc(100% + 6px); width: 220px; }
.acct-list .acct-admin { display: none; }
.acct-list .signout { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.acct-list .linkish { text-decoration: none; color: var(--bone-2); }
.acct-list .linkish:hover { color: var(--danger); }
.acct-list a[aria-current='page'] { color: var(--amber-2); }

@media (max-width: 720px) {
  .signed-in { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .signed-in .rail { height: 52px; }
  .signed-in .rail nav {
    position: fixed; left: 0; right: 20%; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink-2); border-top: 1px solid var(--line);
  }
  .signed-in .rail nav a[href='/admin'] { display: none; }
  .signed-in .rail nav a:not(.btn), .acct > summary {
    flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0; min-height: 64px;
    font: 600 0.72rem/1 var(--text); letter-spacing: 0.02em; text-align: center;
  }
  .signed-in .rail nav a[aria-current='page'] { box-shadow: inset 0 2px 0 var(--amber); background: var(--ink-3); }
  .signed-in .rail nav a::before, .acct-ico {
    content: ''; display: block; width: 24px; height: 24px; background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  }
  .rail nav a[href='/app'] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M10 9.5v5l4.2-2.5z'/%3E%3C/svg%3E"); }
  .rail nav a[href='/app/shorts'] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='7' y='3' width='10' height='18' rx='2'/%3E%3Cpath d='M11 10v4l3-2z'/%3E%3C/svg%3E"); }
  .rail nav a[href='/app/setup'] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 7h9M19 7h1M4 17h1M11 17h9'/%3E%3Ccircle cx='16' cy='7' r='2.2'/%3E%3Ccircle cx='8' cy='17' r='2.2'/%3E%3C/svg%3E"); }
  .rail nav a[href='/app/billing'] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='2'/%3E%3Cpath d='M3 10.5h18M7 15h3'/%3E%3C/svg%3E"); }
  .acct-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='19' cy='12' r='1.8'/%3E%3C/svg%3E"); }
  .acct {
    position: fixed; right: 0; bottom: 0; z-index: 60; width: 20%; margin: 0;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink-2); border-top: 1px solid var(--line);
  }
  .acct > summary { height: 100%; width: 100%; border: 0; border-radius: 0; background: none; }
  .acct > summary::after { display: none; }
  .acct[open] > summary { background: var(--ink-3); }
  .acct:has([aria-current='page']) { box-shadow: inset 0 2px 0 var(--amber); }
  .lbl-d { display: none; }
  .lbl-m { display: inline; }
  .acct-list { position: fixed; right: var(--s-2); left: auto; top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); width: min(260px, calc(100vw - 16px)); }
  .acct-list .acct-admin { display: flex; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------ surfaces --- */
.spot { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-lg); position: relative; }
.pad { padding: clamp(16px, 3vw, 24px); }
.board, .narrow, .wide { padding: clamp(24px, 4vw, 40px) var(--gutter) var(--s-7); margin: 0 auto; }
.board { max-width: 1480px; }
.narrow { max-width: 860px; }
.wide { max-width: 1280px; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-4); margin-bottom: var(--s-5); }
.board-title { min-width: 0; }
.board-head .btn { flex: none; }
.count { color: var(--bone-3); margin: var(--s-2) 0 0 !important; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.count:empty { display: none; }
.app .form { max-width: 760px; margin-top: var(--s-4); }
.flash { max-width: 760px; }
.flash.token .secret { display: block; word-break: break-all; font-size: 0.95rem; padding: 10px 12px; margin-top: 8px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); user-select: all; }
/* A saved or applied confirmation is a toast: it fades by itself and never pushes the page down. */
.app .flash[role='status']:not(.token):not(.made-code) {
  position: fixed; left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; margin: 0;
  max-width: min(92vw, 460px); background: var(--ink-4); border-color: var(--line-2); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  animation: toast-life 8s var(--ease) both;
}
@media (max-width: 720px) { .signed-in .flash[role='status']:not(.token):not(.made-code) { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.check label { display: flex; align-items: center; gap: var(--s-3); font-weight: 500; font-size: 1rem; color: var(--bone); cursor: pointer; min-height: var(--tap); }

/* ------------------------------------------------------------- filters --- */
.filters { margin: 0 0 var(--s-5); display: grid; gap: var(--s-1); justify-items: start; }
.filters > .seg { width: min(100%, 520px); }
.filters > .seg label > span { min-height: 42px; font-size: 0.9rem; }
.more-filters { width: 100%; }
.more-filters summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: var(--tap);
  font: 600 0.9rem var(--text); color: var(--bone-2);
}
.more-filters summary:hover { color: var(--bone); }
.more-filters summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: var(--r-sm); }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after, .menu > summary::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform var(--t) var(--ease); }
.more-filters[open] summary::after, .menu[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.filter-rail { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); padding: var(--s-2) 0 var(--s-4); }
.filter-rail .field { flex: 1 1 150px; max-width: 220px; }
.filter-rail .field-num { flex-basis: 120px; max-width: 150px; }
.filter-rail .field:has(#f-sort) { flex-basis: 210px; max-width: 250px; }
.filter-rail label { font-size: var(--fs-xs); color: var(--bone-3); font-weight: 500; }
input[type='date']::-webkit-calendar-picker-indicator { filter: invert(0.9); }
.filter-rail input[type='date'] { font: 400 0.95rem/1.2 var(--text); min-width: 0; }
.reset { margin-left: auto; min-height: var(--tap); }
.show-all { display: inline-flex; align-items: center; gap: 9px; min-height: var(--tap); cursor: pointer; font-size: 0.92rem !important; color: var(--bone) !important; }
.show-all input { width: 18px; height: 18px; }
.board .reels { margin-bottom: var(--s-5); }

/* ------------------------------------------------------------ clip card --- */
/* The poster is the card. Under it the win is the headline, set like a film slate:
   the win amount in heavy expanded numerals, the multiplier beside it in amber. */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5) var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.card:hover, .card:focus-within { border-color: var(--line-2); }
.card.is-open { grid-column: span 2; border-color: rgba(255, 178, 63, 0.45); }
.card:has(details.menu[open]) { z-index: 30; }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; overflow: hidden; background: #0a0908; }
.stage img, .stage video { width: 100%; height: 100%; object-fit: cover; }
.stage img { transition: transform 500ms var(--ease), opacity var(--t) var(--ease); }
.card:hover .stage img { transform: scale(1.025); }
.stage video { object-fit: contain; background: #000; }
.play { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: transparent; display: grid; place-items: center; border-radius: inherit; }
.play::after {
  content: ''; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(14, 13, 12, 0.78); box-shadow: 0 0 0 1px rgba(238, 231, 216, 0.55);
  transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.play::before { content: ''; position: absolute; z-index: 1; margin-left: 4px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--bone); transition: border-color var(--t) var(--ease); }
.play:hover::after, .play:focus-visible::after { transform: scale(1.1); background: var(--amber); box-shadow: 0 0 0 4px rgba(14, 13, 12, 0.7), 0 0 0 6px var(--amber); }
.play:hover::before, .play:focus-visible::before { border-left-color: var(--amber-ink); }
.play:focus-visible { outline: 2px solid var(--amber); outline-offset: -4px; }
.chip {
  position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r-xs);
  font: 700 0.7rem/1 var(--text); letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(14, 13, 12, 0.88); color: var(--bone); border: 1px solid rgba(238, 231, 216, 0.22);
}
.chip-win::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.chip-review { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.chip-hidden { color: var(--bone-2); border-style: dashed; }
.chip-reaction, .chip-maybe, .chip-upload { color: var(--bone-2); }
.card.state-hidden .stage img { opacity: 0.4; filter: grayscale(0.7); }
.stage .dur { position: absolute; right: var(--s-3); bottom: var(--s-3); z-index: 2; font: 650 0.78rem/1 var(--text); font-variant-numeric: tabular-nums; background: rgba(14, 13, 12, 0.88); padding: 5px 7px; border-radius: var(--r-xs); pointer-events: none; }
.xtag {
  position: absolute; top: 16px; right: 16px; z-index: 3; pointer-events: none;
  font: 850 0.98rem/1 var(--display); font-variation-settings: 'wdth' 118; font-variant-numeric: tabular-nums;
  background: var(--amber); color: var(--amber-ink); padding: 8px 10px 7px; border-radius: var(--r-sm);
}
.xtag-held { background: var(--bone); color: var(--ink); }
.xtag-quiet { background: rgba(14, 13, 12, 0.88); color: var(--bone); box-shadow: 0 0 0 1px var(--line-2); }

.card-body { flex: 1 0 auto; display: grid; align-content: start; gap: 0; padding: var(--s-4) var(--s-4) 0; }
.slate { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--s-3); }
.win { font-size: clamp(1.85rem, 2.4vw, 2.2rem); font-weight: 900; font-variation-settings: 'wdth' 125; }
.win.na { font: 600 1rem/1.3 var(--text); color: var(--bone-3); letter-spacing: 0; padding: 6px 0; }
.mult { font-size: 1.3rem; color: var(--amber); }
.ident { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); margin: var(--s-2) 0 0 !important; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--bone-2); }
.ident .game { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ident .ch-name { color: var(--bone-3); }
.ident .ch-name::before { content: ''; display: inline-block; width: 1px; height: 0.9em; margin-right: var(--s-3); background: var(--line-2); vertical-align: -1px; }
.meta { margin: 6px 0 0 !important; color: var(--bone-3); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.card .status { position: relative; margin: var(--s-3) 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--bone-2); }
.card .status.is-busy { color: var(--amber-2); }
.card .status.is-ok { color: var(--bone); }
.card .status.is-busy, .card .status.is-ok { padding-left: 16px; }
.card .status.is-busy::before, .card .status.is-ok::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.card .status.is-busy::before { animation: waiting 1.6s ease-out infinite; }
.card .status.is-bad { color: var(--danger); }
.card .status b { color: var(--bone); font-weight: 650; }
.card .status .linkish { min-height: 32px; color: var(--amber-2); }
/* One main action and one menu. The menu opens over the cards below, never moving the grid. */
.actions { position: relative; display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-4); margin-top: auto; }
.actions .short-form { display: contents; }
.actions .primary { flex: 1 1 0; min-width: 0; min-height: 46px; justify-content: center; font-weight: 700; }
.actions .primary[aria-busy='true'] { opacity: 0.7; cursor: progress; }
.actions .menu { position: static; flex: 0 0 auto; }
.actions .menu > summary { min-height: 46px; min-width: 112px; }
.actions .held-row { flex: 1 0 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-2); }
.actions .held-row .btn { min-height: var(--tap); padding: 0 10px; }
.actions .menu-list { left: var(--s-4); right: var(--s-4); top: calc(100% - 8px); }
.actions .menu-list.up { top: auto; bottom: calc(100% - 8px); }
.menu-list [data-send-open] { color: var(--amber-2); }
.board .card .rw-panel { padding: 0 var(--s-4) var(--s-4); margin-top: 0; border-top: 0; }
.grid-empty { color: var(--bone-2); }
.more { display: flex; justify-content: center; padding-top: var(--s-5); }
.card-skel { display: grid; gap: var(--s-3); align-content: start; padding-bottom: var(--s-5); overflow: hidden; }
.skel-stage { display: block; aspect-ratio: 16 / 9; background: var(--ink-3); }
.card-skel .skel-line { margin: 0 var(--s-4); }
.skel-line.w40 { width: 40%; height: 26px; }
.skel-line.w55 { width: 55%; }
.skel-line.w70 { width: 70%; }
.card.enter { animation: deal 0.42s var(--ease) both; }
@keyframes deal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.empty { max-width: 640px; margin: var(--s-5) 0; padding: var(--s-5); }
.empty-drawing { width: 200px; height: auto; margin: -6px 0 var(--s-2) -12px; }
.board-empty { padding-top: var(--s-5); }
.drawing .d { fill: none; stroke: var(--bone); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.drawing .d.thin { stroke-width: 1.1; opacity: 0.5; }
.drawing .d.a { stroke: var(--amber); stroke-width: 2.2; opacity: 1; }
.empty h2 { margin-top: 0; font-size: 1.5rem; }
.empty p { color: var(--bone-2); margin-bottom: 1.2em; }

/* ------------------------------------------------------------ channels --- */
.chan-list { list-style: none; padding: 0 var(--s-5); margin: var(--s-5) 0; }
.chan { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: center; padding: var(--s-3) 0; min-height: 64px; border-top: 1px solid var(--line); }
.chan:first-child { border-top: 0; }
.chan-name { min-width: 0; overflow-wrap: anywhere; }
.chan-name .badge { margin-left: var(--s-2); vertical-align: 2px; }
.chan-status { color: var(--bone-2); font-size: 0.92rem; }
.chan .linkish { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-2); }
.chan-empty { padding: var(--s-5) 0 0; }
.add-chan { margin-top: var(--s-5); }
.message .empty-state { padding-top: var(--s-6); }
.message .empty-state h1 { font-size: var(--fs-2xl); }

/* --------------------------------------------------------------- admin --- */
.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 1.6rem 0; border-block: 1px solid var(--line); }
.tally div { padding: 16px 16px 16px 0; }
.tally div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.tally dt { font-size: 0.8rem; color: var(--bone-3); }
.tally dd { margin: 4px 0 0; font: 850 2rem/1.05 var(--display); font-variation-settings: 'wdth' 110; font-variant-numeric: tabular-nums; }
.tally dd .sub { display: block; font: 500 0.8rem/1.4 var(--text); margin-top: 4px; }
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  /* a shadow at the right edge while there is more table to scroll to */
  background: linear-gradient(90deg, var(--ink-2) 30%, rgba(21, 20, 17, 0)) left / 40px 100% no-repeat local,
              linear-gradient(270deg, var(--ink-2) 30%, rgba(21, 20, 17, 0)) right / 40px 100% no-repeat local,
              linear-gradient(270deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)) right / 18px 100% no-repeat scroll,
              var(--ink-2);
}
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th { text-align: left; font-size: 0.78rem; color: var(--bone-3); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: rgba(238, 231, 216, 0.025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.err, td.note { color: var(--bone-2); max-width: 34ch; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; grid-template-columns: none; }
.inline-form .field { min-width: 220px; }

/* ------------------------------------------------------------ minimums --- */
.rule, .chan-rule { display: grid; gap: 16px; margin-top: 1.2rem; }
.presets legend { font-weight: 600; font-size: 0.9rem; color: var(--bone-2); margin-bottom: 10px; padding: 0; }
.presets { align-items: center; }
.presets label > span { font-family: var(--display); font-weight: 800; font-variation-settings: 'wdth' 112; font-variant-numeric: tabular-nums; }
.presets label > input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.presets .custom { display: none; align-items: center; gap: 6px; }
.presets:has(input[value='custom']:checked) .custom { display: inline-flex; }
.presets .custom input { width: 110px; min-height: 40px; }
.presets .unit { color: var(--bone-3); font-weight: 600; }
.preview { margin: 0; color: var(--bone-2); min-height: 1.5em; font-variant-numeric: tabular-nums; }
.preview-big { color: var(--bone); font: 600 1.08rem/1.45 var(--text); padding: 14px 16px; border-radius: var(--r-sm); background: var(--ink); border: 1px solid var(--line); }
.chan-rules { display: grid; gap: 16px; }
.chan-rule h3 { font-size: 1.2rem; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 11rem; gap: 12px 16px; align-items: end; }
.rule-row .btn { width: 100%; }
@media (max-width: 640px) { .rule-row { grid-template-columns: 1fr; } }
/* English captions: a fourth field makes the per-channel row a 2 x 2 grid. */
.rule-row.has-cc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rule-row.has-cc .btn { justify-self: stretch; }
@media (max-width: 640px) { .rule-row.has-cc { grid-template-columns: 1fr; } }
.cc-field legend { font-weight: 600; font-size: 0.9rem; color: var(--bone-2); margin-bottom: 10px; padding: 0; }
.cc-field[disabled] label { cursor: not-allowed; opacity: 0.55; }
.cc-field + .hint { margin-top: -8px; }
.card .cc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.card .cc .lang { font-size: 0.8rem; color: var(--bone-3); }
.card .transcript { font-size: 0.86rem; color: var(--bone-2); }
.card .transcript summary { cursor: pointer; color: var(--bone-3); font-size: 0.8rem; width: fit-content; }
.card .transcript summary:hover { color: var(--bone); }
.card .transcript p { margin: 6px 0 0; line-height: 1.45; max-height: 9.5em; overflow: auto; }
/* Captions being re-rendered after an edit (src/rerender.js). */
.card .cc-busy { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--amber-2); margin-top: 2px; }
.card .cc-busy::before, .ed-state.is-busy::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: waiting 1.6s ease-out infinite; flex: none; }


/* ------------------------------------------------------------- billing --- */
.eyebrow { font-size: 0.8rem; font-weight: 600; color: var(--bone-3); margin: 0 0 4px !important; }
.back { margin: 0 0 10px !important; font-size: 0.9rem; }
.back a { color: var(--bone-2); }
.back a::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.flag { display: inline-block; font-size: 0.74rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; background: rgba(255, 122, 102, 0.12); color: #ffd4cc; border: 1px solid rgba(255, 122, 102, 0.45); }

.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 14px 16px; margin: 18px 0; border-radius: var(--r); border: 1px solid; max-width: 860px; }
.plan-banner p { margin: 0 !important; max-width: 62ch; }
.plan-banner-amber { border-color: rgba(255, 178, 63, 0.5); background: rgba(255, 178, 63, 0.08); }
.plan-banner-warn { border-color: rgba(255, 122, 102, 0.5); background: rgba(255, 122, 102, 0.07); }
.board .plan-banner, .board .steps { margin-top: 0; }

.plan-card { margin-top: 1.2rem; }
.plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app h2.plan-name { margin: 0; font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.plan-name .tag { vertical-align: 6px; }
.plan-tally { margin: 1.2rem 0 0.4rem; }
.plan-tally dd { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 650; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--bone); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bone-3); }
.state-active::before { background: var(--bone); }
.state-ending, .state-grace { border-color: rgba(255, 178, 63, 0.55); }
.state-ending::before, .state-grace::before { background: var(--amber); }
.state-expired, .state-revoked { border-color: rgba(255, 122, 102, 0.5); color: #ffd4cc; }
.state-expired::before, .state-revoked::before { background: var(--danger); }

.pay-form { display: grid; gap: 22px; margin-top: 1rem; }
.pay-form legend { font-weight: 600; font-size: 0.9rem; color: var(--bone-2); margin-bottom: 10px; padding: 0; }
.plan-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-picks legend { grid-column: 1 / -1; }
.plan-picks label > span { display: grid; gap: 2px; align-content: start; min-height: 0; height: 100%; padding: 14px 16px; border-radius: var(--r); }
.plan-picks b { font: 800 1.15rem/1.1 var(--display); font-variation-settings: 'wdth' 112; }
.pick-price { font: 850 1.6rem/1.1 var(--display); font-variation-settings: 'wdth' 110; font-variant-numeric: tabular-nums; margin-top: 6px; }
.pick-price .per { font: 500 0.9rem var(--text); color: inherit; opacity: 0.7; }
.pick-price s { font: 500 0.95rem var(--text); opacity: 0.6; }
.pick-sub { font-size: 0.86rem; opacity: 0.75; }
.plan-picks label > input:checked + span { background: var(--ink-3); color: var(--bone); border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); font-weight: 400; }
/* One plan: its name, price and what it includes, where the plan picker was. */
.plan-line-one { display: grid; gap: 4px; margin: 0 !important; }
.plan-line-one b { font: 800 1.15rem/1.1 var(--display); font-variation-settings: 'wdth' 112; }
.plan-line-one .pick-price { margin-top: 0; }
.pay-picks .on { color: inherit; opacity: 0.7; font-weight: 500; margin-left: 4px; }
.total { margin: 0 !important; font-size: 1.05rem; }
.total b { font: 850 1.5rem var(--display); font-variation-settings: 'wdth' 110; font-variant-numeric: tabular-nums; margin: 0 6px; }

.invoice h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.invoice h1 .amt { color: var(--amber); font-variant-numeric: tabular-nums; }
.pay-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; margin-top: 1.4rem; align-items: start; }
.qr-box { padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.qr { width: 100%; max-width: 220px; height: auto; border-radius: var(--r-sm); }
.qr-box .sub { margin: 0 !important; }
.pay-facts { margin: 0; display: grid; gap: 0; }
.fact { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.fact:first-child { border-top: 0; padding-top: 0; }
.fact:last-child { padding-bottom: 0; }
.fact dt { font-size: 0.82rem; color: var(--bone-3); padding-top: 0.4em; }
.fact dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.92rem; word-break: break-all; }
.amount-big { font: 850 1.7rem/1 var(--display); font-variation-settings: 'wdth' 110; font-variant-numeric: tabular-nums; color: var(--amber); }
.fact-copy .btn { margin-left: auto; }
[data-countdown] { font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: center; margin-top: 16px; }
.pay-status p { margin: 0 !important; }
.pay-status .sub { grid-column: 2; }
.pay-status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 var(--amber-glow); animation: waiting 1.6s ease-out infinite; }
[data-state='paid'] .pay-status { border-color: rgba(255, 178, 63, 0.55); }
[data-state='paid'] .pay-status .dot { animation: none; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-glow); }
[data-state='expired'] .pay-status .dot, [data-state='replaced'] .pay-status .dot { animation: none; background: var(--bone-3); }
[data-state='underpaid'] .pay-status .dot { animation: none; background: var(--danger); }
@keyframes waiting { 0% { box-shadow: 0 0 0 0 rgba(255, 178, 63, 0.45); } 100% { box-shadow: 0 0 0 12px rgba(255, 178, 63, 0); } }
.pay-rules { margin: 20px 0 0; padding-left: 1.1rem; color: var(--bone-2); display: grid; gap: 6px; max-width: 70ch; font-size: 0.93rem; }

.flag-form { display: grid; gap: 6px; min-width: 220px; }
.flag-form select, .flag-form input, .revoke-form input { min-height: 36px; padding: 6px 10px; font-size: 0.88rem; }
.revoke-form { flex-wrap: nowrap; }
.revoke-form input { width: 130px; }
.check-inline { display: flex !important; align-items: center; gap: 10px; min-height: 46px; color: var(--bone) !important; font-weight: 500 !important; }
.app .grant-form { max-width: none; }

@media (max-width: 720px) {
  .pay-grid { grid-template-columns: 1fr; }
  .qr-box { justify-self: stretch; }
  .fact { grid-template-columns: 1fr; }
  .fact-copy .btn { margin-left: 0; }
}
@media (max-width: 480px) {
  .plan-picks { grid-template-columns: 1fr; }
  .plan-top { flex-direction: column-reverse; }
}
/* Hidden labels inside a scrolling table stay inside it, not on the page. */
.flag-form, .revoke-form { position: relative; }
/* Billing admin tables scroll sideways on a phone instead of crushing to one word per line. */
.billing-admin .table-wrap table { min-width: 760px; }
.billing-admin td:first-child, .billing td:first-child { white-space: nowrap; }

/* ------------------------------------------------ setup and first run --- */
.back-setup { max-width: 860px; margin: 0 auto !important; padding: clamp(18px, 3vw, 28px) var(--gutter) 0; }
.back-setup + section { padding-top: 12px; }
.steps { margin: 20px 0 28px; max-width: 860px; }
.steps-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.steps-head h2 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin: 0; }
.steps-bar { flex: 0 1 180px; height: 6px; margin: 0; border-radius: 99px; background: var(--ink-3); overflow: hidden; }
.steps-bar span { display: block; height: 100%; background: var(--amber); border-radius: inherit; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 12px; }
.step a { display: grid; gap: 2px; padding: 10px 12px; margin: -6px 0; border-radius: var(--r); color: var(--bone); text-decoration: none; min-height: 44px; }
.step a:hover { background: rgba(238, 231, 216, 0.05); }
.step a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.step a span { color: var(--bone-2); font-size: 0.92rem; }
.step-num { width: 28px; height: 28px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 800 0.85rem var(--display); color: var(--bone-2); }
.step-todo .step-num { border-color: var(--amber); color: var(--amber); }
.step-waiting .step-num { border-style: dashed; }
.step-mark { width: 28px; height: 28px; margin-top: 4px; }
.step-mark circle { fill: var(--amber); }
.step-mark path { fill: none; stroke: var(--amber-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step-done a b { color: var(--bone-2); }
.setup > h1 { margin-bottom: 24px; }
.setup-block { margin: 0 0 44px; scroll-margin-top: 88px; }
.setup-block > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.block-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line-2); display: grid; place-items: center; font: 800 0.9rem var(--display); color: var(--amber); }
.setup-block .rule + .rule { margin-top: 14px; }
.setup-block .rule legend { font-weight: 650; margin-bottom: 10px; }
.cc-setup-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
.cc-setup-fields .check label { min-height: 36px; }
.cc-setup-fields select { max-width: 20rem; }
/* Layout (src/layout-prefs.js): picture tiles, one small 9:16 frame per choice. Setup and the Short editor. */
.lp-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 18px; }
.lp-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.lp-group legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.lp-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-tile { position: relative; flex: 0 0 auto; width: 104px; display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink); cursor: pointer; text-align: center; font-size: 0.84rem; line-height: 1.2; color: var(--bone-2); }
.lp-tile > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lp-tile:hover { border-color: rgba(238, 231, 216, 0.4); color: var(--bone); }
.lp-tile:has(input:checked) { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; color: var(--bone); font-weight: 650; }
.lp-tile:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 2px; }
.lp-tile:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.lp-pic { width: 50px; height: 89px; display: block; }
.lp-pic .lp-bg { fill: #2a2722; }
.lp-pic .lp-cam { fill: #3b4a5c; }
.lp-pic .lp-head { fill: #8fa3b8; }
.lp-pic .lp-game { fill: #4a2f3a; }
.lp-pic .lp-reel { fill: #7a5566; }
.lp-pic .lp-cap { fill: var(--bone); }
.lp-pic .lp-amt { fill: var(--amber); }
.lp-pic .lp-meme { fill: #e8e2d4; stroke: #0e0d0c; stroke-width: 0.8; }
.lp-switch label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.lp-switch input { accent-color: var(--amber); width: 18px; height: 18px; }
@media (max-width: 480px) { .lp-tile { width: calc((100% - 16px) / 3); } }
.how-to { margin: 0 0 16px; padding-left: 1.3em; color: var(--bone-2); max-width: 62ch; display: grid; gap: 6px; }
.how-to b { color: var(--bone); font-weight: 650; }
.plan-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-line p { margin: 0; }
.more-box { margin-top: 12px; }
.more-box summary, .advanced summary { cursor: pointer; width: fit-content; color: var(--bone-2); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.more-box summary:hover, .advanced summary:hover { color: var(--bone); }
.more-box[open] summary { margin-bottom: 8px; }
.advanced summary { font: 750 1.05rem var(--display); font-variation-settings: 'wdth' 110; color: var(--bone); }
.advanced .hint { margin-top: 0; }
.adv-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.adv-list li + li { border-top: 1px solid var(--line); }
.adv-list a { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--bone); text-decoration: none; }
.adv-list a::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-top: 1.6px solid var(--bone-3); border-right: 1.6px solid var(--bone-3); transform: rotate(45deg); flex: none; }
.adv-list a:hover { color: var(--amber-2); }

.fmt { margin: 4px 0 16px; }
.fmt legend { font-weight: 650; margin-bottom: 10px; font-size: 0.9rem; }
.fmt .hint { flex: 1 1 100%; margin: 6px 0 0; }

/* ----------------------------------------------------------- referrals --- */
.ref-share { margin: 18px 0 0; }
.ref-link { margin: 0 0 14px !important; }
.ref-link code { display: block; font-size: clamp(0.95rem, 2.4vw, 1.15rem); word-break: break-all; padding: 12px 14px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); user-select: all; }
.code { font-family: var(--display); letter-spacing: 0.04em; color: var(--amber-2); }
.referrals h2 { margin-top: 36px; }

/* ------------------------------------------------------ billing: codes --- */
.code-field { margin: 4px 0 14px; max-width: 420px; }
.code-field .row { flex-wrap: nowrap; }
.code-field input { text-transform: uppercase; flex: 1 1 auto; min-width: 0; }
.code-ok { color: var(--amber-2); }
.error-inline { color: var(--danger); font-size: 0.88rem; margin: 6px 0 0; }

/* Sound sliders (auto edit): native range inputs, 44 px tall to touch, amber for the moving part only. */
.snd { display: grid; gap: 16px; }
.snd-row { display: grid; gap: 4px; }
.snd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.snd-head label { font-weight: 600; font-size: 0.93rem; }
.snd-val { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--amber-2); min-width: 5.5ch; text-align: right; }
.snd input[type='range'] { width: 100%; height: 44px; margin: 0; background: transparent; accent-color: var(--amber); cursor: pointer; touch-action: manipulation; }
.snd input[type='range']:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: var(--r-sm); }
.snd input[type='range']:disabled { cursor: not-allowed; opacity: 0.45; }
.snd-ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--bone-3); margin-top: 4px; }

/* ------------------------------------------------ polish pass (27 Sep) --- */
/* The board's steps card ends in one clear next action. */
.steps-cta { margin: 18px 0 0; }

/* One box for every code (src/codes.js): trial, promo or referral. Same look as the Billing field. */
.code-box { margin: 14px 0 0; max-width: 460px; }
.code-box .row { display: flex; gap: 8px; flex-wrap: nowrap; }
.code-box input { text-transform: uppercase; flex: 1 1 auto; min-width: 0; }
.code-box .btn, .code-field .btn { min-height: 44px; }
/* The discount or trial on the account right now, and a code applied at sign-in. */
.bonus-line { max-width: 760px; margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(255, 178, 63, 0.55); border-radius: var(--r-sm); background: var(--ink-2); color: var(--bone); }
.bonus-line b { color: var(--amber-2); margin-right: 6px; }
.bonus-offer p { margin: 0; }
.bonus-offer .bonus-head { color: var(--amber-2); font: 800 clamp(1.3rem, 4.5vw, 1.6rem)/1.15 var(--display); letter-spacing: -0.02em; margin-bottom: 4px; }
.code-flash { border-color: rgba(255, 178, 63, 0.55); }
/* Discord is offered, not asked for. */
.steps-optional { margin: 10px 0 0; font-size: 0.92rem; color: var(--bone-3); display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.steps-optional a { color: var(--bone); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 640px) { .steps-bar { display: none; } }
/* Start: the one screen after signing in with no plan. */
.start .start-lede { margin: 6px 0 4px; max-width: 62ch; color: var(--bone-2); }
.start .start-lede b { color: var(--bone); }
.start .start-later { margin: 0 0 18px; }
/* Admin: a code's share link with a copy button. */
.copy-link { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-link code { word-break: break-all; }

/* ------------------------------------------- polish pass 2 (27 Sep) --- */
/* Clip length on Setup: four stacked rows, name over description, instead of chips that
   ran the name into its description and hid the selected one's text. */
.clip-length { display: grid; gap: 8px; }
.clip-length legend { font-weight: 650; margin-bottom: 10px; font-size: 0.9rem; padding: 0; }
.clip-length .len-opt > span { justify-content: start; text-align: left; display: grid; gap: 2px; justify-items: start; min-height: 0; width: 100%; padding: 12px 14px; border-radius: var(--r); text-align: left; }
.clip-length .len-opt b { font-weight: 650; color: var(--bone); }
.clip-length .len-hint { font-size: 0.86rem; color: var(--bone-3); }
.clip-length .len-opt > input:checked + span { background: var(--ink-3); color: var(--bone); border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); font-weight: 400; }
.clip-length .len-opt > input:checked + span .len-hint { color: var(--bone-2); }
/* A settings form's secondary link sits beside its Save as text, not as a second button. */
.row-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--bone-2); font-weight: 600; margin-left: 6px; }
.row-link:hover { color: var(--bone); }
.how-box { margin: 0 0 14px; }
.how-box .how-to { margin-top: 4px; }
/* The code box typed in capitals, but its hint reads as a sentence. */
.code-box input::placeholder, .code-field input::placeholder { text-transform: none; }
/* Setup: an even rhythm between blocks, and each block's cards spaced the same. */
.setup-block { margin-bottom: 52px; }
.setup-block > .spot + .spot, .setup-block > form + form { margin-top: 14px; }
.setup-block > h2 .opt { font-size: 0.7em; font-weight: 500; font-family: var(--text); font-variation-settings: 'wdth' 100; letter-spacing: 0; }

/* ------------------------------------------------- 29 Sep navigation pass --- */
/* Settings: a row of jumps to each part of the long page, sticky under the rail. */
.jump {
  position: sticky; top: 64px; z-index: 10; display: flex; gap: 6px; margin: 4px 0 28px; padding: 10px 0;
  background: var(--ink); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 99px; color: var(--bone-2); font-size: 0.9rem; font-weight: 550; text-decoration: none;
}
.jump a:hover { color: var(--bone); border-color: rgba(238, 231, 216, 0.5); }
.setup-lede { color: var(--bone-2); font-size: 1.05rem; max-width: 52ch; margin: 0 0 28px !important; }
.setup-group { scroll-margin-top: 140px; }
.group-label { margin: 8px 0 18px !important; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.8rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone-3); }
.setup-block { scroll-margin-top: 140px; }
/* Before the first steps are done, the clip and Short settings wait folded under them. */
.later { margin: 0 0 16px; }
.later > summary, .advanced > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; min-height: 44px; list-style-position: outside; }
.later > summary { font: 750 1.05rem var(--display); font-variation-settings: 'wdth' 110; color: var(--bone); }
.later > summary .opt, .advanced > summary .opt { font: 500 0.85rem var(--text); color: var(--bone-3); font-variation-settings: normal; }
.later[open] > summary { margin-bottom: 22px; }
.later .setup-block:last-child { margin-bottom: 0; }
.adv-list a { padding: 10px 0; }
.adv-list a b { display: block; font-weight: 650; }
.adv-list a span { display: block; color: var(--bone-3); font-size: 0.86rem; margin-top: 2px; }
.adv-list a > b + span { flex: 1 1 auto; }
.adv-list a { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
.adv-list a::after { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* Billing: the referral program as one quiet card at the end. */
.ref-teaser { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 44px; }
.ref-teaser h2 { margin: 0 0 4px; font-size: 1.15rem; }
.ref-teaser .section-note { margin: 0; }
.start-after { margin-top: 16px; }

/* Admin: its own tab row, the same on every admin page. */
.subnav {
  display: flex; gap: 4px; margin: 10px 0 8px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  color: var(--bone-2); font-weight: 550; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--bone); }
.subnav a[aria-current='page'] { color: var(--bone); border-bottom-color: var(--amber); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: var(--ink); font-size: 0.75rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.admin-home h2, .billing-admin h2 { scroll-margin-top: 88px; }
.admin-home h3 { margin: 1.6em 0 0.6em; }
.all-clear { padding: 14px 18px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.admin-home .plan-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.row-menu > summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-weight: 600; font-size: 0.88rem; color: var(--bone-2); list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { color: var(--bone); }
.row-menu[open] > summary { margin-bottom: 8px; }
.add-streamer { margin: 0 0 14px; }
.make-code h3 { margin: 0 0 12px; }
.make-code { margin-bottom: 18px; }
.code-more { flex-basis: 100%; }
.code-more > .inline-form { margin-top: 4px; }
/* Folded sections say they open: a small chevron after the label, turned when open. */
.more-box > summary, .later > summary, .advanced > summary { list-style: none; }
.more-box > summary::-webkit-details-marker, .later > summary::-webkit-details-marker, .advanced > summary::-webkit-details-marker { display: none; }
.more-box > summary::after, .later > summary::after, .advanced > summary::after {
  content: ''; flex: none; align-self: center; width: 7px; height: 7px; margin-left: 4px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t) var(--ease);
}
.more-box[open] > summary::after, .later[open] > summary::after, .advanced[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.later > summary::after, .advanced > summary::after { order: 3; margin-left: auto; }
.later > summary .opt, .advanced > summary .opt { order: 2; }
.code-more > summary { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.code-more > summary .opt { font-weight: 500; font-size: 0.85rem; color: var(--bone-3); }
.add-streamer > summary { padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); gap: 10px; }
@media (max-width: 640px) { .subnav { flex-wrap: wrap; overflow: visible; } .subnav a { padding: 0 10px; } }

/* Mark your layout, the block on Settings (src/screen-layout-views.js settingsBlock). */
.mk-rows { list-style: none; margin: 0; padding: 4px 20px; }
.mk-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; flex-wrap: wrap; }
.mk-row + .mk-row { border-top: 1px solid var(--line); }
.mk-row-name { display: grid; gap: 2px; min-width: 0; }

.fb-setting { margin-top: 14px; }

/* Small screens: the board and forms. */
@media (max-width: 860px) { .card.is-open { grid-column: auto; } }
@media (max-width: 640px) {
  .filter-rail .field, .filter-rail .field-num { flex: 1 1 calc(50% - 8px); max-width: none; }
  .reset { margin-left: 0; }
  .chan { grid-template-columns: minmax(0, 1fr) auto; }
  .chan-status { grid-column: 1; grid-row: 2; }
  .chan .inline { grid-column: 2; grid-row: 1 / span 2; }
  .tally div + div { border-left: 0; padding-left: 0; }
  .filters > .seg { width: 100%; }
  .filters > .seg label > span { padding: 0 6px; font-size: 0.86rem; }
  .board-head .btn { min-height: var(--tap); }
}

/* ===================================================================== */
/* Round 2: first run, settings layout, billing. Later rules win on purpose. */
/* ===================================================================== */
.signed-in .acct > summary::after { display: none; }
@media (min-width: 721px) { .signed-in .acct > summary::after { display: inline-block; } }

/* First-run checklist: real state, one amber button, gone when the steps are done. */
.checklist { list-style: none; margin: var(--s-5) 0 var(--s-6); padding: var(--s-1) var(--s-5); display: grid; }
.check-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4) 0; }
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-text { display: grid; gap: 2px; min-width: 0; }
.check-text b { font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.check-text span { color: var(--bone-2); font-size: 0.92rem; }
.check-text b .badge { font-weight: 650; }
.check-done .check-text b { color: var(--bone-2); }
.check-row .step-num, .check-row .step-mark { margin-top: 0; }
@media (max-width: 560px) {
  .check-row { grid-template-columns: 28px minmax(0, 1fr); }
  .check-row .btn { grid-column: 2; justify-self: start; }
  .checklist { padding-inline: var(--s-4); }
}
/* The board's own steps card shares the look. */
.steps { max-width: 760px; margin: 0 0 var(--s-5); }
.steps-head h2 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
.steps-bar { height: 4px; }
.step-list { gap: var(--s-1); }
.step a { margin: 0; padding: var(--s-2) var(--s-3); }

/* Settings: a quiet index beside the sections on a wide screen, wrapped pills on a phone. */
.setup-main { min-width: 0; }
.setup > h1 { margin-bottom: var(--s-4); }
.setup-lede { margin: 0 0 var(--s-5) !important; }
.setup-block { margin: 0 0 var(--s-6); scroll-margin-top: 84px; }
.setup-block > h2 { margin: 0 0 var(--s-2); }
.setup-block > .section-note { margin: 0 0 var(--s-4); }
.setup-main > .setup-block:not(:first-child), .setup-main > .setup-group, .setup-main > .later { }
.group-label { margin: var(--s-6) 0 var(--s-4) !important; }
.block-num { width: 28px; height: 28px; font-size: 0.85rem; }
.jump { position: static; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-5); padding: 0; background: none; border: 0; overflow: visible; }
.jump a { min-height: 40px; }
@media (min-width: 900px) {
  .setup-wide { max-width: 1080px; }
  .setup-wide .setup-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
  .setup-wide .jump { position: sticky; top: 80px; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; }
  .setup-wide .jump a { border: 0; border-radius: var(--r-sm); justify-content: flex-start; padding: 0 var(--s-3); color: var(--bone-2); }
  .setup-wide .jump a:hover { background: rgba(238, 231, 216, 0.05); color: var(--bone); }
  .setup-wide .setup-main { max-width: 760px; }
}
.setup .spot.pad { border-radius: var(--r-lg); }
.fb-setting { margin-top: var(--s-6); }

/* Billing: one plan card, sections split by hairlines. */
.pay-form { gap: 0; padding: 0; margin-top: var(--s-4); }
.pay-form > :not(input[type='hidden']) { padding: var(--s-4) var(--s-5); }
.pay-form > * + :not(input[type='hidden']) { border-top: 1px solid var(--line); }
.plan-line-one { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--s-1) var(--s-4); padding-block: var(--s-5) !important; }
.plan-line-one b { font-size: 1.3rem; }
.plan-line-one .pick-price { font-size: 2.1rem; text-align: right; }
.plan-line-one .pick-sub { grid-column: 1 / -1; max-width: 56ch; opacity: 1; color: var(--bone-2); font-size: 0.92rem; }
.pay-form fieldset { min-width: 0; margin: 0; border: 0; }
.pay-form .kinds legend { margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--bone); }
.code-field { max-width: none; margin: 0; }
.code-field .row { max-width: 440px; }
.total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-2); font-size: 1rem; }
.total b { font-size: 2.1rem; margin: 0 var(--s-1) 0 0; }
.pay-go { padding-top: 0 !important; border-top: 0 !important; margin-top: calc(var(--s-3) * -1); }
.pay-how { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); color: var(--bone-2); font-size: 0.9rem; }
.pay-how li { counter-increment: s; position: relative; padding-left: 36px; min-height: 28px; }
.pay-how li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; font: 800 0.78rem var(--display); color: var(--amber); }
.pay-how b { display: block; color: var(--bone); font-weight: 650; }
.pay-form > .pay-how { border-top: 1px solid var(--line); }
.pay-how-inv { margin: var(--s-5) 0 0; padding: var(--s-4) 0; border-block: 1px solid var(--line); }
@media (max-width: 720px) {
  .pay-how { grid-template-columns: 1fr; gap: var(--s-3); }
  .pay-form > :not(input[type='hidden']) { padding: var(--s-4); }
  .plan-line-one .pick-price { font-size: 1.8rem; }
}
.claim-pay { margin-top: var(--s-4); }
.claim-pay > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 52px; padding: 0 var(--s-5); cursor: pointer; font-weight: 600; color: var(--bone-2); list-style: none; }
.claim-pay > summary::-webkit-details-marker { display: none; }
.claim-pay > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--t) var(--ease); flex: none; }
.claim-pay[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.claim-pay > summary:hover { color: var(--bone); }
.claim-body { padding: 0 var(--s-5) var(--s-5); }
.claim-form { display: grid; gap: var(--s-3); max-width: 520px; justify-items: start; margin-top: var(--s-3); }
.claim-form .field { width: 100%; }
@media (max-width: 720px) { .claim-pay > summary { padding: 0 var(--s-4); } .claim-body { padding: 0 var(--s-4) var(--s-4); } }

.plan-card { margin-top: var(--s-4); }
.plan-tally { margin: var(--s-4) 0 var(--s-2); }
.invoice h1 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); }
.pay-grid { margin-top: var(--s-5); }
.pay-status { margin-top: var(--s-4); }
.pay-rules { margin-top: var(--s-5); }
.pay-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.pay-picks label > span { width: 100%; padding: 0 8px; font-size: 0.88rem; }
.pay-form .field { gap: var(--s-2); }
.pay-how-inv b { display: inline; }


/* ===================================================================== */
/* Round 3: empty states, stacked row cards, touch sizes.                 */
/* ===================================================================== */
/* Empty board: a ghost of the clip card, so it is clear what will be here. */
.empty-art { max-width: 640px; padding-top: var(--s-5); }
.ghost-card { width: min(100%, 320px); margin-bottom: var(--s-3); border: 1px dashed var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.ghost-stage { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--ink-2); border-bottom: 1px dashed var(--line-2); }
.ghost-play { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; }
.ghost-play::after { content: ''; position: absolute; left: 17px; top: 13px; border-style: solid; border-width: 8px 0 8px 12px; border-color: transparent transparent transparent var(--bone-3); }
.ghost-body { display: flex; align-items: baseline; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.ghost-win { font-size: 1.5rem; color: var(--bone-3); opacity: 0.55; }
.ghost-x { font-size: 1.05rem; color: var(--amber); opacity: 0.5; }
.board-empty .drawing { max-width: 100%; }

/* Tables become stacked row cards on a phone (ui.js adds .stack-rows and a data-label to every cell). */
@media (max-width: 700px) {
  .table-wrap.stack { overflow: visible; background: none; border: 0; border-radius: 0; }
  table.stack-rows, table.stack-rows tbody { display: block; min-width: 0 !important; }
  table.stack-rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack-rows tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); padding: var(--s-4); margin-bottom: var(--s-3); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); }
  table.stack-rows tbody tr:hover td { background: none; }
  table.stack-rows td { display: block; min-width: 0; padding: 0; border: 0; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; }
  table.stack-rows td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone-3); }
  table.stack-rows td { grid-column: span 2; }
  table.stack-rows td.num { grid-column: span 1; }
  table.stack-rows td:first-child, table.stack-rows td[colspan], table.stack-rows td.acts, table.stack-rows td.note, table.stack-rows td.err { grid-column: 1 / -1; }
  table.stack-rows td:empty { display: none; }
  table.stack-rows td.acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
  table.stack-rows td.acts:empty { display: none; }
}
@media (pointer: coarse) {
  .row-menu > summary { min-height: var(--tap); }
  .linkish { min-height: var(--tap); }
  .more-filters summary { min-height: var(--tap); }
}

/* Billing: claim error sits under its field; the invoice's calm second route. */
.claim-form .field-error { margin: 0; }
.app .pay-alt { margin: var(--s-3) 0 0; max-width: 62ch; color: var(--bone-2); font-size: var(--fs-sm); }
