/* Content Insights dashboard. One stylesheet for the sign-in page and the app.
   Ellipsend brand, dark mode. Tokens follow the Ellipsend Community site:
   Manrope, navy surfaces, indigo as the only accent, flat uppercase labels, no glows. */

:root {
  color-scheme: dark;
  --primary: #6366F1;
  --primary-hover: #4F51EE;
  --primary-subtle: rgba(99, 102, 241, 0.14);
  --primary-border: rgba(99, 102, 241, 0.35);
  --primary-text: #A5A8FF;          /* indigo that stays readable as text on navy */
  --primary-text-strong: #C7C9FF;

  --dark: #0B0F19;
  --dark-alt: #172033;
  --card: #121A2B;
  --card-2: #1A2340;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: #F4F6FE;
  --dim: #A6ACC8;
  --faint: #838AA8;

  --good: #4ADE80;
  --warning: #FBBF24;
  --danger: #F87171;
  --danger-wash: rgba(248, 113, 113, 0.1);
  --danger-border: rgba(248, 113, 113, 0.35);

  /* Chart colors: checked for color-blind separation and contrast on the card surface. */
  --series-1: #6366F1;
  --series-2: #DD6B20;
  --series-quiet: rgba(166, 172, 200, 0.34);
  --grid: rgba(255, 255, 255, 0.06);
  --axis: rgba(255, 255, 255, 0.16);

  --shadow-sm: 0 0.25rem 0.9rem -0.25rem rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 1.5rem 3.5rem -1rem rgba(0, 0, 0, 0.7);
  --r-sm: 0.65rem;
  --r-md: 0.85rem;
  --r-lg: 1.2rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --z-sticky: 20;
  --z-tooltip: 40;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--dark); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.55 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(99, 102, 241, 0.22), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(99, 102, 241, 0.1), transparent 40%),
    var(--dark);
}
/* The dot grid, fading out down the page. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(99, 102, 241, 0.16) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 60%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 60%);
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: var(--primary-text-strong); }
button, input { font-family: inherit; }
.muted { color: var(--dim); }
.small { font-size: 0.8125rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
::selection { background: rgba(99, 102, 241, 0.35); }

:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; border-radius: 6px; }

/* The signature Ellipsend label: small, uppercase, tracked. */
.kicker {
  display: inline-block; margin-bottom: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-text);
}

/* Buttons and fields */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--card); color: var(--text);
  font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--card-2); color: var(--text); }
.btn:active { background: var(--dark-alt); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--primary); border-color: transparent; color: #fff; }
.btn-primary:hover, .btn-primary:active { background: var(--primary-hover); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--dim); }
.btn-danger { background: var(--danger-wash); border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: var(--danger-border); color: #fff; }
.btn-quiet:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--dim); }
input[type="email"], input[type="password"], input[type="text"], input[type="number"] {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--dark-alt); color: var(--text); font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder { color: var(--faint); }
input:focus, input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.field + .field { margin-top: 16px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--faint); }

.notice { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.5; border: 1px solid transparent; }
.notice-error { background: var(--danger-wash); border-color: var(--danger-border); color: var(--danger); }
.notice-info { background: var(--primary-subtle); border-color: var(--primary-border); color: var(--primary-text-strong); }

/* Sign-in page */

.gate { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-box {
  width: 100%; max-width: 400px; padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.gate-box h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.gate-box .lede { margin: 8px 0 24px; color: var(--dim); font-size: 14px; }
.gate-box .btn { width: 100%; margin-top: 22px; min-height: 44px; }
.gate-box .notice { margin-top: 16px; }

/* App frame */

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(11, 15, 25, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; min-height: 64px; padding: 10px 20px;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { flex: none; border-radius: 8px; }
.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--dim); }
.status svg { flex: none; }
.status-good svg { color: var(--good); }
.status-late { color: var(--warning); }
.status-late svg { color: var(--warning); }

main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 36px 20px 90px; }
section + section { margin-top: 40px; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.section-head .spacer { margin-left: auto; }
.section-note { color: var(--dim); font-size: 14px; max-width: 72ch; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.hero h2 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.hero p { margin-top: 8px; color: var(--dim); font-size: 15px; max-width: 560px; }

/* Filters */

.filters { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.seg {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--dim); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.seg button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.seg button[aria-pressed="true"] { background: var(--primary-subtle); color: #fff; }
.seg button:focus-visible { outline-offset: -2px; }
.filter { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: 100%; }
.filter-label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }

/* Figures: one card, divided into cells */

.figures {
  display: flex; flex-wrap: wrap; gap: 1px; margin-top: 18px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.figure { flex: 1 1 160px; padding: 18px 20px; background: var(--card); }
.figure .label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.figure .value { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.figure .sub { margin-top: 4px; font-size: 12px; color: var(--dim); }

/* Charts */

.chart-card {
  margin-top: 14px; padding: 18px 20px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.chart-tools { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.chart-tools .spacer { margin-left: auto; }
.chart-tools .axis-name { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-wrap svg:focus-visible { outline-offset: 6px; }
.chart-wrap text { font: 600 11px "Manrope", system-ui, sans-serif; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart-wrap .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart-wrap .ref-line { stroke: var(--primary-border); stroke-width: 1; }
.chart-wrap .ref-label { fill: var(--primary-text); font-weight: 800; letter-spacing: 0.06em; }
.chart-wrap .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .line.quiet { stroke: var(--series-quiet); stroke-width: 1.5; }
.chart-wrap .line.s1 { stroke: var(--series-1); stroke-width: 2.5; }
.chart-wrap .line.s2 { stroke: var(--series-2); stroke-width: 2.5; }
.chart-wrap .fade-top { stop-color: var(--series-1); stop-opacity: 0.32; }
.chart-wrap .fade-bottom { stop-color: var(--series-1); stop-opacity: 0; }
.chart-wrap .dot { stroke: var(--card); stroke-width: 2; }
.chart-wrap .dot.s1 { fill: var(--series-1); }
.chart-wrap .dot.s2 { fill: var(--series-2); }
.chart-wrap .dot.quiet { fill: var(--dim); }
.chart-wrap .cross { stroke: var(--line-strong); stroke-width: 1; }
.chart-wrap .end-label { fill: var(--text); font-weight: 800; font-size: 12px; }
.chart-wrap .phase-mark { stroke: var(--line-strong); stroke-width: 1; }
.chart-wrap .phase-label { fill: var(--dim); font-weight: 700; }

.tooltip {
  position: absolute; z-index: var(--z-tooltip); pointer-events: none;
  min-width: 160px; max-width: 270px; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: 13px;
}
.tooltip .tip-head { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--dim); }
.tooltip .tip-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tip-row + .tip-row { margin-top: 3px; }
.tooltip .tip-value { font-weight: 800; font-variant-numeric: tabular-nums; }
.tooltip .tip-name { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.key { flex: none; width: 14px; height: 0; border-top: 2px solid var(--series-quiet); border-radius: 2px; }
.key.s1 { border-color: var(--series-1); }
.key.s2 { border-color: var(--series-2); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 12px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--dim); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.legend-item span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.legend-item[aria-pressed="true"] { background: var(--primary-subtle); border-color: var(--primary-border); color: #fff; font-weight: 700; }
.legend-static { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; font-size: 13px; font-weight: 600; color: var(--dim); }

.empty { margin-top: 14px; padding: 44px 20px; text-align: center; color: var(--dim); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.chart-card .empty { margin-top: 0; border: 0; padding: 36px 12px; }
.empty strong { display: block; margin-bottom: 6px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.empty p { max-width: 58ch; margin: 0 auto; font-size: 14px; }

/* Tables */

.table-scroll {
  margin-top: 14px; overflow-x: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.chart-card .table-scroll { margin-top: 0; background: transparent; border-radius: var(--r-md); box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: center; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; padding-left: 20px; }
tbody tr:last-child td { border-bottom: 0; }
td { font-weight: 600; }
thead th {
  padding: 0; background: rgba(0, 0, 0, 0.18);
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
thead th .th-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
  min-height: 52px; padding: 6px 10px; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  transition: color 0.15s var(--ease);
}
thead th:first-child .th-btn { justify-content: flex-start; padding-left: 20px; }
.th-lines { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; text-align: center; }
thead th .th-btn:hover { color: var(--text); }
thead th .th-btn:focus-visible { outline-offset: -3px; }
thead th[aria-sort] .th-btn { color: var(--primary-text-strong); }
thead th.plain { padding: 14px; }
thead th.plain:first-child { padding-left: 20px; }
td.num, th.num { font-variant-numeric: tabular-nums; }
td.none { color: var(--faint); font-weight: 500; }
td .aside { color: var(--dim); font-weight: 500; }
th.text, td.text { text-align: left; }
td.text { white-space: normal; min-width: 90px; font-weight: 500; }

.posts th:first-child { width: 34%; }
.posts tbody tr { cursor: pointer; transition: background-color 0.15s var(--ease); }
.posts tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.posts tbody tr:hover .cap { color: #fff; }
.post-cell { display: flex; align-items: center; gap: 12px; max-width: 460px; min-width: 230px; white-space: normal; color: inherit; text-decoration: none; }
.post-cell:hover { color: inherit; }
.post-words { flex: 1 1 auto; min-width: 0; }
.post-cell .cap { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.post-cell .meta { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--faint); }

/* Cover images. The tile shows on its own while loading or when Instagram has no image. */
.cover { flex: none; display: block; overflow: hidden; border-radius: 8px; background: var(--dark-alt); border: 1px solid var(--line-strong); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-small { width: 38px; height: 50px; }
.cover-large { width: 120px; height: 160px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }

/* Tags: flat uppercase text on a quiet border. No dots, no glow. */
.badge {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--dim);
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.6;
}
.badge-feed { border-color: rgba(221, 107, 32, 0.45); color: #F0A26B; }
.badge { flex: none; }
.badge-collab { border-color: rgba(74, 222, 128, 0.4); color: #86EFAC; }
.post-head .badge-collab { text-transform: none; letter-spacing: 0.02em; font-size: 11px; }
.badge-more { border-style: dashed; }

/* A tag's extra detail, shown on hover. Drawn above the page so the table cannot clip it. */
.tip {
  position: fixed; z-index: var(--z-tooltip); pointer-events: none; max-width: 280px; padding: 7px 10px;
  background: var(--card-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.45; white-space: normal;
}

/* Connections */
.connections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.connection { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.connection .label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.connection p { margin-top: 8px; color: var(--dim); font-size: 14px; max-width: 60ch; }
.connection p:first-of-type { color: var(--text); font-weight: 600; }
.connection p.problem { color: var(--warning); }
.connection .btn { margin-top: 14px; }
.connection .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.state { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.state-good { background: var(--good); }
.state-problem { background: var(--warning); }
.connect-result { margin-top: 14px; max-width: 80ch; }
.collab-note { margin-top: 14px; max-width: 80ch; }
.badge-floor { border-color: var(--primary-border); background: var(--primary-subtle); color: var(--primary-text-strong); }

.table-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Post page */

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; font-weight: 600; color: var(--dim); }
.back:hover { color: var(--text); }
.post-head { display: flex; gap: 16px 22px; flex-wrap: wrap; align-items: flex-start; }
.post-head .words { flex: 1 1 300px; min-width: 0; }
.post-head h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.post-head .meta { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 10px; color: var(--dim); font-size: 13px; }
.caption { margin-top: 12px; color: var(--dim); font-size: 14px; max-width: 72ch; white-space: pre-line; }
.caption.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-head .btn-quiet { margin-top: 6px; margin-left: -12px; }

.phases { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.phase-box { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.phase-box .label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.phase-box .value { margin-top: 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }

.reads-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end;
  margin-top: 14px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.reads-form .field + .field { margin-top: 0; }
.reads-form .btn { min-height: 42px; }
.reads-form + .notice { margin-top: 12px; }

/* Loading: shimmering blocks in the shape of what is coming. */
.skel {
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--card), var(--card-2), var(--card)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skel + .skel { margin-top: 16px; }
.skel-figures { height: 96px; }
.skel-chart { height: 340px; }
.skel-table { height: 420px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading { padding: 48px 0; text-align: center; color: var(--dim); }
.stale { opacity: 0.55; transition: opacity 0.15s var(--ease); }

@media (max-width: 760px) {
  .hide-narrow { display: none; }
  main { padding: 24px 14px 60px; }
  .topbar-in { padding: 10px 14px; }
  .brand h1 { font-size: 17px; }
  .hero h2 { font-size: 26px; }
  .seg button { padding: 0 10px; }
  .filters { gap: 10px 14px; }
  .figure { padding: 14px 16px; flex-basis: 140px; }
  .figure .value { font-size: 22px; }
  th, td { padding: 11px 10px; }
  th:first-child, td:first-child, thead th:first-child .th-btn { padding-left: 14px; }
  thead th .th-btn { padding: 6px 10px; }
  .post-cell { min-width: 200px; }
  .cover-large { width: 78px; height: 104px; }
  .post-head .words { flex-basis: 200px; }
  .post-head h2 { font-size: 22px; }
  .chart-card { padding: 16px 14px 14px; }
}

/* Live trials: the strip at the top of the overview. Built from the same tokens as the rest of the page,
   so it follows whatever colors those tokens hold. */

.live { margin-bottom: 28px; }
.live .section-head { margin-bottom: 10px; }
.live-row {
  margin-top: 10px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.live-head { display: flex; align-items: center; gap: 12px; }
.live-words { flex: 1 1 auto; min-width: 0; }
.live-cap { font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-ask { margin-bottom: 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warning); }
.live-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.live-body { margin-top: 14px; }
.live-body > * + * { margin-top: 10px; }
.btn-big { width: 100%; min-height: 56px; font-size: 16px; border-radius: var(--r-md); }
.live-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.live-links .btn-quiet { margin-left: -4px; }

.live-form { display: grid; gap: 12px; }
.live-form .field + .field { margin-top: 0; }
.live-form-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
input[type="datetime-local"], select {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--dark-alt); color: var(--text); font: inherit; font-size: 16px; /* 16px stops phones zooming in on focus */
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input[type="datetime-local"]:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }

/* Pulling numbers from Instagram: an indeterminate bar with its words underneath. */
.live-progress p { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--dim); }
.progress { position: relative; height: 8px; overflow: hidden; border-radius: 4px; background: var(--dark-alt); border: 1px solid var(--line); }
.progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 4px; background: var(--primary); animation: progress-slide 1.1s var(--ease) infinite; }
@keyframes progress-slide { from { left: -40%; } to { left: 100%; } }

.live-ok { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); font-size: 14px; line-height: 1.5; }
.live-check { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--good); color: var(--dark); font-weight: 800; }
.live-ok strong { color: var(--good); }
.live-undo-error { margin-top: 4px; color: var(--danger); }

.badge-note { border-style: dashed; }
.apify-line { margin-top: 28px; }

@media (max-width: 760px) {
  .live-row { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Competitors */
.competitors th:first-child { width: 20%; }
.competitors th, .competitors td { padding-left: 8px; padding-right: 8px; }
.competitors thead th.plain { padding: 14px 8px; }
.competitors .spark { width: 90px; }
.comp-cell { display: flex; flex-direction: column; gap: 2px; white-space: normal; min-width: 180px; }
.comp-cell > div:first-child { display: flex; align-items: center; gap: 8px; }
.comp-handle { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.comp-handle:hover { color: var(--primary-text-strong); }
.comp-cell .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 500; color: var(--faint); }
.comp-cell .meta .problem { color: var(--warning); }
.delta { font-variant-numeric: tabular-nums; font-weight: 700; }
.delta-up { color: var(--good); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--dim); }
.delta .aside { font-size: 12px; font-weight: 500; color: var(--dim); }
.spark-wrap { display: inline-flex; color: var(--primary-text); }
.spark { display: block; overflow: visible; }
.comp-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.comp-add input { flex: 1 1 240px; max-width: 360px; min-height: 34px; padding: 0 12px; font-size: 14px; }
#competitor-note { margin-top: 10px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 26px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
.tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); color: var(--dim); font-weight: 700; font-size: 13px; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab[aria-current="page"] { background: var(--primary-subtle); color: var(--primary-text-strong); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.section-head .spacer { margin-left: auto; }
@media (max-width: 640px) { .tabs { margin-left: -14px; margin-right: -14px; border-radius: 0; border-left: 0; border-right: 0; } .tab { padding: 0 12px; } }

/* An idle trial row is compact on wide screens: one line, button at the right. */
@media (min-width: 760px) {
  .live-row-idle { display: flex; align-items: center; gap: 18px; padding: 12px 18px; }
  .live-row-idle .live-head { flex: 1 1 auto; min-width: 0; }
  .live-row-idle .live-body { display: flex; align-items: center; gap: 6px; margin-top: 0; flex: none; }
  .live-row-idle .live-body > * + * { margin-top: 0; }
  .live-row-idle .btn-big { width: auto; min-height: 38px; padding: 0 16px; font-size: 13px; border-radius: var(--r-sm); }
  .live-row-idle .live-links { flex-wrap: nowrap; }
  .live-row-idle .live-links .btn-quiet { margin-left: 0; }
}

/* Stories on the Trials tab: one card per story, cuts as rows, versions side by side. */

.stories-wrap { margin-bottom: 28px; }
.unsorted { margin-bottom: 28px; }
.unsorted .live-meta a { color: var(--primary-text); }
.unsorted-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.unsorted-actions select { max-width: 100%; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  background: var(--dark-alt); color: var(--text); border: 1px solid var(--line-strong); font: inherit; font-size: 13px; }
.unsorted .notice { margin-top: 10px; }

.story { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.story > summary { list-style: none; cursor: pointer; }
.story > summary::-webkit-details-marker { display: none; }
.story-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.story-head::after { content: "▸"; flex: none; color: var(--faint); transition: transform 0.15s var(--ease); }
.story[open] > .story-head::after { transform: rotate(90deg); }
.story-words { flex: 1 1 auto; min-width: 0; }
.story-name { font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.story-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }

.cut-row { display: flex; gap: 14px; padding-top: 14px; }
.cut-label { flex: none; width: 74px; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.cut-letter { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--dark-alt); border: 1px solid var(--line-strong); font-weight: 800; }
.cut-promoted .cut-letter { background: var(--primary); border-color: transparent; color: #fff; }
.cut-leader .cut-letter { box-shadow: 0 0 0 2px var(--good); }
.vtiles { flex: 1 1 auto; min-width: 0; display: grid; gap: 8px; }
.vtile-wrap { display: grid; gap: 6px; }
.vtile { display: block; padding: 12px 16px; border-radius: var(--r-md); background: var(--dark-alt); border: 1px solid var(--line);
  color: inherit; text-decoration: none; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.vtile:hover { border-color: var(--line-strong); background: #1B2640; }
.vtile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vtile-promoted { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-border); background: linear-gradient(var(--primary-subtle), var(--primary-subtle)), var(--dark-alt); }
.vtile-leader { border-color: rgba(74, 222, 128, 0.6); box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35); background: linear-gradient(rgba(74, 222, 128, 0.07), rgba(74, 222, 128, 0.07)), var(--dark-alt); }
.vtile-leader .vt-stats .vt-stat:first-child .vt-value { color: var(--good); }
.vt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.vt-title { font-weight: 800; color: var(--text); }
.vt-open { margin-left: auto; color: var(--faint); font-size: 18px; line-height: 1; }
.vtile:hover .vt-open { color: var(--text); }
.vt-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px 18px; }
.vt-stat { display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; }
.vt-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.vt-value { font-size: 15px; font-weight: 700; }
.vt-value .aside { font-size: 12px; font-weight: 500; color: var(--faint); }
.vt-change { margin-top: 8px; color: var(--dim); line-height: 1.4; }
.vt-how { color: var(--faint); font-size: 11px; }
.badge-leader { border-color: rgba(74, 222, 128, 0.5); background: rgba(74, 222, 128, 0.1); color: #86EFAC; }
.story-best { font-size: 13px; color: var(--dim); }
.story-best-leader { font-weight: 700; color: #86EFAC; }

.older { margin-top: 18px; }
.older > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }

@media (max-width: 640px) {
  .cut-row { flex-direction: column; gap: 8px; }
  .cut-label { width: auto; flex-direction: row; align-items: center; gap: 8px; }
  .story-side .story-best { font-size: 12px; }
  .vt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
}

.promote-panel { margin-top: 18px; max-width: 640px; }
.promote-panel .live-form-buttons { margin-top: 8px; }
.promote-panel .notice { margin-top: 10px; }
.promote-panel label { display: grid; gap: 6px; }
.promote-panel input[type=datetime-local] { min-height: 38px; padding: 0 10px; border-radius: var(--r-sm); background: var(--dark-alt); color: var(--text); border: 1px solid var(--line-strong); font: inherit; }

.transcript-section { margin-top: 28px; }
.transcript { max-width: 72ch; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.transcript p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--text); }
.transcript p + p { margin-top: 12px; }

/* ---------- Review room (public/review.js) ---------- */

.rr-card {
  display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none; transition: border-color 0.15s var(--ease);
}
.rr-card:hover { border-color: var(--line-strong); color: var(--text); }
.rr-card-needs { border-color: var(--primary-border); }
.rr-card-words { flex: 1 1 auto; min-width: 0; }
.rr-card-title { font-weight: 700; letter-spacing: -0.01em; }
.rr-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.rr-letters { display: inline-flex; gap: 4px; }
.rr-mini {
  display: inline-flex; align-items: center; gap: 4px; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 7px;
  border: 1px solid var(--line-strong); font-size: 12px; font-weight: 800; color: var(--dim);
}
.rr-mini::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.rr-mini.rr-dot-approved::after, .rr-dot.rr-dot-approved { background: var(--good); }
.rr-mini.rr-dot-killed::after, .rr-dot.rr-dot-killed { background: var(--danger); }
.rr-mini.rr-dot-held::after, .rr-dot.rr-dot-held { background: var(--warning); }
.rr-mini.rr-dot-pending::after, .rr-dot.rr-dot-pending { background: var(--faint); }
.rr-setup { margin-top: 22px; color: var(--dim); }
.rr-setup summary { cursor: pointer; font-size: 13px; }
.rr-setup p { margin-top: 8px; }
.rr-setup .btn { margin-top: 10px; }
.rr-token { margin-top: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.rr-token code { display: block; word-break: break-all; font-size: 13px; color: var(--text); }

.rr-head { margin-bottom: 16px; }
.rr-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rr-title-row > div { flex: 1 1 260px; min-width: 0; }
.rr-title-row h2 { font-size: 20px; }
.rr-title-row .badge { margin-top: 6px; }
.rr-chips { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.rr-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.rr-chip:hover { border-color: var(--primary-border); }
.rr-chip-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rr-chip[disabled] { opacity: 0.4; cursor: default; }
.rr-chip b { font-weight: 800; }
.rr-chip-label { color: inherit; opacity: 0.85; }
.rr-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rr-chip-on .rr-dot { outline: 2px solid rgba(255, 255, 255, 0.5); }

.rr-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.rr-versions .kicker, .rr-notes .kicker, .rr-caption summary { display: block; margin: 0 0 8px; }
.rr-notes .kicker + .rr-note, .rr-notes .rr-none { margin-bottom: 14px; }
.rr-version-wrap { margin-bottom: 8px; }
.rr-version {
  width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); cursor: pointer;
}
.rr-version:hover { border-color: var(--line-strong); }
.rr-version-on { border-color: var(--primary-border); border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--card-2); }
.rr-version-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rr-changes { padding: 10px 12px 12px; background: var(--card); border: 1px solid var(--primary-border); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.rr-changes .kicker { margin-bottom: 6px; }
.rr-change { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin-top: 6px; }
.rr-changes p { margin-top: 8px; }
.rr-at {
  flex: none; display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 6px;
  border: 1px solid rgba(221, 107, 32, 0.5); background: rgba(221, 107, 32, 0.14); color: #F0A26B;
  font: inherit; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer;
}
.rr-at:hover { background: rgba(221, 107, 32, 0.26); }
.rr-at-none { border-color: var(--line-strong); background: transparent; color: var(--dim); cursor: default; }
.rr-note .rr-at { border-color: var(--primary-border); background: var(--primary-subtle); color: var(--primary-text-strong); }

.rr-player { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rr-stage { position: relative; width: 100%; max-width: 380px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.rr-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.rr-stage-label { position: absolute; top: 10px; left: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; pointer-events: none; }
.rr-timeline { width: 100%; max-width: 380px; }
.rr-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rr-controls .num { margin-left: auto; }
.rr-speeds { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; }
.rr-speed { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.rr-speed:hover { color: var(--text); }
.rr-speed-on { background: var(--primary-subtle); color: var(--primary-text-strong); }
.rr-bar-row { display: flex; align-items: center; gap: 6px; }
.rr-bar-row .rr-bar { flex: 1 1 auto; }
.rr-step { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; touch-action: none; user-select: none; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px; }
.rr-step:hover { background: var(--card-2); }
.rr-step:active { background: var(--primary-subtle); color: var(--primary-text-strong); }
.rr-bar { position: relative; height: 40px; cursor: pointer; outline: none; touch-action: none; user-select: none; }
.rr-bar-scrubbing { cursor: grabbing; }
.rr-buffered { position: absolute; left: 0; top: 17px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); width: 0; pointer-events: none; }
.rr-knob { position: absolute; top: 13px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--text); border: 2px solid var(--dark); box-sizing: border-box; pointer-events: none; transition: transform 0.1s var(--ease); }
.rr-bar:hover .rr-knob, .rr-bar-scrubbing .rr-knob { transform: scale(1.3); }
.rr-bar:focus-visible .rr-track { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35); }
.rr-track { position: absolute; left: 0; right: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.rr-progress { position: absolute; left: 0; top: 17px; height: 6px; border-radius: 3px; background: var(--primary); width: 0; pointer-events: none; }
.rr-mark-change { position: absolute; top: 7px; width: 9px; height: 9px; margin-left: -6px; transform: rotate(45deg); background: #DD6B20; border: 2px solid var(--dark); pointer-events: none; }
.rr-mark-note { position: absolute; top: 26px; width: 10px; height: 10px; margin-left: -7px; border-radius: 50%; background: var(--primary); border: 2px solid var(--dark); pointer-events: none; }
.rr-mark-done { opacity: 0.45; }
.rr-mark-pin { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--primary-text-strong); pointer-events: none; }
.rr-legend { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rr-key { width: 8px; height: 8px; display: inline-block; }
.rr-key-change { background: #DD6B20; transform: rotate(45deg); }
.rr-key-note { background: var(--primary); border-radius: 50%; }
.rr-hook { max-width: 380px; text-align: center; }

.rr-notes { display: flex; flex-direction: column; }
.rr-new { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; }
.rr-new-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rr-new-head .kicker { margin: 0; }
.rr-new-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rr-textarea {
  width: 100%; min-height: 64px; padding: 10px 12px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--dark-alt); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
.rr-textarea::placeholder { color: var(--faint); }
.rr-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.rr-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--primary-subtle); color: var(--primary-text-strong); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rr-pill-x { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--card-2); color: var(--primary-text-strong); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.rr-note { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; line-height: 1.45; }
.rr-note-done { opacity: 0.65; }
.rr-frame { flex: none; width: 48px; height: 85px; object-fit: cover; border-radius: 6px; background: #000; }
.rr-note-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rr-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-note .btn-quiet { align-self: flex-start; margin-left: -12px; }
.rr-caption { margin-top: 6px; }
.rr-caption summary { cursor: pointer; }
.rr-scope { display: inline-flex; gap: 4px; margin: 0 0 8px; padding: 3px; border-radius: 999px; background: var(--card-2); }
.rr-scope-btn { border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.rr-scope-on { background: var(--primary-subtle); color: var(--primary-text-strong); }
.rr-suggest { margin-top: 12px; }
.rr-suggest-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.rr-suggest-text { flex: 1 1 auto; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.rr-suggest-row .btn { flex: 0 0 auto; }
.rr-post-wrap, .rr-posted, .rr-flag { display: inline-flex; align-items: center; gap: 10px; }
.rr-flag { flex-wrap: wrap; }
.rr-flags { display: flex; flex-direction: column; gap: 4px; }
.rr-flag-quiet { opacity: 0.55; }
.rr-confirm-input { width: 130px; padding: 4px 8px; font-size: 12px; }
.rr-flag-quiet:hover, .rr-flag-quiet:focus-within { opacity: 1; }
.rr-story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.rr-story-actions .kicker { margin: 0 4px 0 0; }
.rr-modal-back { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 20, 0.7); }
.rr-modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 18px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--card); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.rr-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rr-modal-head h3 { margin: 0; }
.rr-pa-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.rr-pa-row { display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.rr-pa-row input { margin-top: 3px; }
.rr-pa-hook, .rr-pa-row .rr-textarea { grid-column: 2; }
.rr-pa-shared { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.rr-modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rr-modal-foot .muted { margin-right: auto; }
.rr-post-error { color: var(--danger); max-width: 320px; }

.rr-actions {
  position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 24px -20px -90px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgba(11, 15, 25, 0.92); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.rr-actions .btn { min-height: 44px; }
.rr-actions .spacer { margin-left: auto; }
.rr-approve { background: var(--good); border-color: transparent; color: #0B0F19; font-weight: 800; }
.rr-approve:hover { background: #86EFAC; color: #0B0F19; }
.rr-danger-text { color: var(--danger); }
.rr-danger { background: var(--danger); border-color: transparent; color: #0B0F19; }
.rr-confirm { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 1000px) {
  .rr-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .rr-notes { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rr-grid { display: flex; flex-direction: column; gap: 14px; }
  .rr-player { order: 0; }
  .rr-versions { order: 1; }
  .rr-notes { order: 2; }
  .rr-stage, .rr-timeline, .rr-hook { max-width: 100%; }
  .rr-stage { aspect-ratio: auto; height: min(70vh, 560px); }
  .rr-version-wrap { margin-bottom: 6px; }
  .rr-actions { margin: 20px -14px -60px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .rr-actions .btn { flex: 1 1 auto; padding: 0 10px; font-size: 13px; }
  .rr-actions .spacer { display: none; }
  .rr-title-row h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .rr-chip, .rr-card { transition: none; } }

/* Mac status pill and the job card above the player (public/review.js) */
.rr-mac { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; color: var(--dim); }
.rr-mac-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.rr-mac-green { border-color: rgba(74, 222, 128, 0.4); color: #86EFAC; }
.rr-mac-green .rr-mac-dot { background: var(--good); }
.rr-mac-red { border-color: var(--danger-border); background: var(--danger-wash); color: var(--danger); }
.rr-mac-red .rr-mac-dot { background: var(--danger); }
.rr-job { margin: 12px 0; padding: 12px 16px; background: var(--card); border: 1px solid var(--primary-border); border-radius: var(--r-lg); }
.rr-job-bad { border-color: var(--danger-border); }
.rr-job-good { border-color: rgba(74, 222, 128, 0.4); }
.rr-job-quiet { border-style: dashed; opacity: 0.85; }
.rr-job-cancel { margin-top: 10px; display: grid; gap: 6px; }
.rr-job-cancel .input { max-width: 480px; }
.rr-job-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.rr-job-line { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.rr-job-denial { margin: 4px 0 0; color: var(--warning); overflow-wrap: anywhere; }
.rr-job-steps { margin: 8px 0 0; }
.rr-job .btn { margin-top: 10px; }

/* Review room: dropped footage */
.rr-footage { margin: 0 0 16px; }
.rr-footage h3 { margin: 0 0 8px; font-size: 15px; }
.rr-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--primary-border); border-radius: var(--r-lg); }
.rr-foot.muted { opacity: 0.6; }
.rr-foot-file { flex: 1 1 100%; font-size: 13px; overflow-wrap: anywhere; }
.rr-foot-guess { font-size: 14px; }
.rr-foot-pick { max-width: 100%; }

/* M3b: failed posts and the cover step of the Post all modal */
.rr-story-wrap { display: flex; flex-direction: column; gap: 8px; }
.rr-failed { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid rgba(255, 99, 99, 0.45); border-radius: 12px; background: rgba(255, 99, 99, 0.08); }
.rr-failed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.rr-failed-text { flex: 1 1 auto; min-width: 0; }
.rr-modal-wide { width: min(720px, 100%); }
.rr-cover-main { display: grid; grid-template-columns: 180px 1fr; gap: 14px; margin: 12px 0; align-items: start; }
.rr-cover-pick { width: 180px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-strong); background: #000; }
.rr-cover-empty { display: flex; align-items: center; justify-content: center; }
.rr-cover-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rr-cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 4px 0 8px; }
.rr-cover-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: none; color: inherit; cursor: pointer; font: inherit; font-size: 11px; }
.rr-cover-opt:disabled { cursor: wait; opacity: 0.7; }
.rr-cover-opt img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.rr-cover-opt.rr-cover-on { border-color: var(--primary); }
@media (max-width: 560px) { .rr-cover-main { grid-template-columns: 1fr; } .rr-cover-pick { width: 140px; } }
.rr-job-actions { display: flex; gap: 8px; margin-top: 8px; }
/* Review list sections (2026-11-01) and posted / flagged marks on the letter chips */
.rr-group { margin: 14px 0; }
.rr-group > summary { cursor: pointer; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 11px; margin-bottom: 8px; }
.rr-group-hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rr-mini.rr-mini-posted { color: var(--good); }
.rr-mini.rr-mini-flagged { color: var(--danger); }
.rr-chip-mark { font-size: 11px; color: var(--good); margin-left: 4px; }
.rr-chip-mark.rr-chip-flag { color: var(--danger); }
.badge-danger { border-color: var(--danger); color: var(--danger); }

/* Stories board, room tabs, Body and Card (M4) */
.rr-board { display: grid; grid-template-columns: repeat(7, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; overflow-x: auto; align-items: start; padding-bottom: 10px; }
.rr-board-filters { margin-top: 12px; }
.rr-col { min-width: 0; padding: 0 0 10px; margin: 0; } /* margin 0 beats the global section + section gap, which dropped every column after Idea 40px */
.rr-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 8px 2px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); background: var(--dark);
  border-bottom: 1px solid var(--line);
}
.rr-col-toggle { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rr-col-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.rr-col-empty { padding: 6px 2px; }
.rr-bcard { margin-bottom: 8px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.rr-bcard-title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.rr-bcard-sub { margin-top: 2px; }
.rr-bcard-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rr-bcard-line { margin-top: 8px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rr-bcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rr-bmenu { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.rr-bmenu .kicker { flex: 1 0 100%; margin: 0; }
.rr-bcard .rr-job-cancel { margin-top: 10px; }
.rr-bcard .rr-job-cancel .input { width: 100%; }
.rr-stagebadge { color: var(--dim); }
.rr-card-side .rr-stagebadge { opacity: 0.8; }
.rr-newidea { margin-top: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.rr-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rr-form-wide { grid-column: 1 / -1; }
.rr-newidea select, .rr-pane select { width: 100%; min-height: 42px; padding: 0 10px; border-radius: var(--r-md); background: var(--dark-alt); color: var(--text); border: 1px solid var(--line-strong); font: inherit; font-size: 14px; }
.rr-newidea .rr-job-actions { margin-top: 12px; }
@media (max-width: 760px) {
  .rr-board { display: block; overflow: visible; }
  /* Sticky only on the phone layout, where the board does not scroll sideways and the page is the scroller.
     On desktop the board's overflow-x makes it the sticky container, which pushed every header 56px down
     onto the first card (and less far in short columns). */
  .rr-col-head { position: sticky; top: 52px; z-index: 2; }
}

.rr-roomtabs { margin: 12px 0 0; }
.rr-roomtabs .tab { flex: 1 1 0; }
.rr-tab-off { opacity: 0.45; cursor: default; flex-direction: column; gap: 0; }
.rr-tab-off:hover { background: transparent; color: var(--dim); }
.rr-stageline { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.rr-head .rr-chips { margin-top: 12px; }

.rr-pane { max-width: 760px; padding-bottom: 20px; }
.rr-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.rr-pane-head:first-child { margin-top: 4px; }
.rr-pane-head h3 { font-size: 16px; }
.rr-block { margin-top: 14px; }
.rr-block .kicker { margin-bottom: 6px; }
.rr-move { font-size: 16px; line-height: 1.5; }
.rr-para { white-space: pre-wrap; margin: 0 0 12px; line-height: 1.6; overflow-wrap: anywhere; }
.rr-facts, .rr-sources { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.rr-sources a { color: var(--primary-text); overflow-wrap: anywhere; }
.rr-fn { padding: 0 2px; border: 0; background: transparent; color: var(--primary-text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rr-fn:hover { color: var(--primary-text-strong); text-decoration: underline; }
.rr-missing { margin: 0; }
.rr-textarea-tall { min-height: 280px; }
.rr-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rr-row .kicker { margin: 0; align-self: center; }
.rr-val { line-height: 1.5; overflow-wrap: anywhere; }
.rr-val a { color: var(--primary-text); }
.rr-trigs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rr-actual { margin-top: 12px; }
.rr-notion { margin-top: 14px; }
.rr-fieldset { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.rr-check { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 500; color: var(--text); }
.rr-check input { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 560px) { .rr-row { grid-template-columns: 1fr; } }

/* Numbers tab: the table scrolls sideways inside its own block, never the page. */
.rr-num-line { margin: 4px 0 6px; line-height: 1.6; }
.rr-num-promote { margin: 0 0 10px; }
.badge-promote { border-color: var(--primary-border); background: var(--primary-subtle); color: var(--primary-text-strong); font-weight: 700; }
.rr-num-scroll { max-width: 100%; overflow-x: auto; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.rr-num-table { min-width: 460px; }
.rr-num-table th[scope="row"] { text-align: left; font-weight: 600; padding-left: 14px; }
.rr-num-table th[scope="col"] { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); font-weight: 600; }
.rr-num-table td { padding: 10px; }
.rr-num-sub { font-weight: 400; margin-top: 2px; }
.rr-num-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .rr-num-scroll { scroll-behavior: auto; } }

/* Film (M5 c): the filming board, phone-sized. Base 18px, lines 1.45. */
.rr-film { font-size: 18px; line-height: 1.45; max-width: 860px; overflow-wrap: anywhere; }
.rr-film-h { margin: 28px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.rr-film-bend { background: var(--primary-subtle); border: 1px solid var(--primary-border); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0; font-size: 19px; }
.rr-film-bend b, .rr-film-keep b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-text-strong); }
.rr-film-dont { background: var(--danger-wash); border: 2px solid var(--danger-border); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0; }
.rr-film-dont-h { display: block; margin-bottom: 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--danger); }
.rr-film-dont ul, .rr-film-keep ul { margin: 0; padding-left: 1.2em; }
.rr-film-dont li { margin: 4px 0; font-weight: 600; }
.rr-film-keep { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 10px 14px; margin: 12px 0; }
.rr-film-keep li { margin: 3px 0; }
.rr-film-scroll { max-width: 100%; overflow-x: auto; }
.rr-film-table { width: 100%; border-collapse: collapse; }
.rr-film-table th, .rr-film-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 17px; }
.rr-film-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); font-weight: 600; }
.rr-film-table tbody th { font-weight: 700; }
.rr-film-table a { color: var(--primary-text); font-weight: 700; }
.rr-film-sub { display: block; font-size: 14px; color: var(--dim); font-weight: 400; }
.rr-film-cuts th[scope="row"] { white-space: nowrap; }
.rr-film-plain { margin: 0 0 8px; font-size: 19px; }
.rr-film-beats { padding-left: 1.4em; margin: 10px 0; }
.rr-film-beats li { margin: 6px 0; }
.rr-film-card { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 12px 14px; margin: 14px 0; }
.rr-film-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.rr-film-code { display: inline-block; padding: 2px 10px; border-radius: var(--r-sm); background: var(--primary); color: #fff; font-weight: 800; font-size: 17px; }
.rr-film-meta { font-size: 15px; color: var(--dim); }
.rr-film-hook { border-width: 2px; }
.rr-film-hooktext { margin: 4px 0; font-size: 28px; line-height: 1.25; font-weight: 800; }
.rr-film-take { background: var(--primary-subtle); border: 2px solid var(--primary-border); }
.rr-film-prompt { margin: 4px 0 10px; font-size: 21px; font-weight: 600; }
.rr-film-starter { margin: 8px 0; padding-left: 12px; border-left: 5px solid var(--primary); font-size: 24px; line-height: 1.3; font-weight: 800; }
.rr-film-line { margin: 8px 0; font-size: 22px; line-height: 1.4; }
.rr-film-lb { display: inline-block; min-width: 2.2em; margin-right: 6px; font-size: 15px; font-weight: 800; color: var(--dim); }
.rr-film-cut { margin: 12px 0; padding: 8px 12px; border: 2px dashed var(--warning); border-radius: var(--r-sm); color: var(--warning); font-size: 17px; font-weight: 700; text-align: center; }
.rr-film-note { margin: 8px 0 0; font-size: 16px; color: var(--dim); font-style: italic; }
.rr-film-picks { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.rr-film-pick { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; min-height: 52px; padding: 8px 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--card); color: var(--dim); font: inherit; font-weight: 700; cursor: pointer; }
.rr-film-pick:hover { color: var(--text); }
.rr-film-pick[aria-selected="true"] { background: var(--primary-subtle); border-color: var(--primary-border); color: var(--primary-text-strong); }
.rr-film-pick:focus-visible, .rr-film-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rr-film-title { font-size: 24px; line-height: 1.2; margin: 4px 0 8px; }
.rr-filmpane { max-width: 860px; }
@media (max-width: 560px) { .rr-film-hooktext { font-size: 26px; } }
