:root {
  --paper: #f2efe6;
  --paper-bright: #fffdf6;
  --ink: #161712;
  --muted: #66685f;
  --line: #c9c5b8;
  --signal: #ee5b2b;
  --signal-dark: #a62e0b;
  --verified: #087b70;
  --verified-soft: #d9ece5;
  --warning: #f2c94c;
  --shadow: 0 18px 60px rgba(30, 31, 25, .10);
  --display: "Iowan Old Style", "Songti SC", "STSong", serif;
  --body: "Avenir Next", "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 23, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 23, 18, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: var(--body);
}

button, input, select { font: inherit; }
button, select, input {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper-bright);
}
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--signal) 55%, transparent);
  outline-offset: 3px;
}

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.15'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 3px solid var(--ink);
}
.masthead__brand { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper-bright);
  background: var(--ink);
  font: 700 24px/1 var(--display);
  transform: rotate(-7deg);
}
.kicker, .section-number, footer {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.masthead h1 {
  margin: 1px 0 0;
  font: 700 clamp(30px, 4vw, 48px)/.95 var(--display);
  letter-spacing: -.04em;
}
.masthead__status { display: flex; align-items: stretch; gap: 10px; }
.status-stamp, .user-chip {
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 12px;
}
.status-stamp span, .status-stamp strong { display: block; }
.status-stamp span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.status-stamp strong { margin-top: 3px; }
.user-chip a { color: inherit; font-weight: 800; }

.quality-banner {
  width: min(1520px, calc(100% - 48px));
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--signal-dark);
  background: #fbe2d6;
}
.quality-banner__flag {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: white;
  background: var(--signal-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.quality-banner p { margin: 0; font-size: 13px; }
.is-hidden { display: none !important; }

main, footer { width: min(1520px, calc(100% - 48px)); margin-inline: auto; }
.hero-ledger {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(620px, 2.2fr);
  gap: 50px;
  padding: 70px 0 58px;
}
.hero-ledger__intro h2 {
  margin: 14px 0 18px;
  font: 700 clamp(38px, 5vw, 72px)/.97 var(--display);
  letter-spacing: -.055em;
}
.hero-ledger__intro > p:last-child {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.75;
}
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-content: start;
  border-top: 2px solid var(--ink);
}
.ledger-item {
  min-height: 148px;
  padding: 18px 14px 14px 0;
  border-bottom: 1px solid var(--ink);
  animation: ledger-in .45s both;
}
.ledger-item:nth-child(4n + 2),
.ledger-item:nth-child(4n + 3),
.ledger-item:nth-child(4n + 4) { padding-left: 14px; border-left: 1px solid var(--line); }
.ledger-item__label { color: var(--muted); font-size: 11px; font-weight: 700; }
.ledger-item__value {
  margin-top: 13px;
  font: 700 clamp(28px, 3.4vw, 48px)/1 var(--display);
  letter-spacing: -.05em;
}
.ledger-item__denominator { margin-top: 9px; color: var(--muted); font-size: 11px; }
.ledger-placeholder { padding: 30px 0; color: var(--muted); }
@keyframes ledger-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.comparison-section, .user-section {
  padding: 52px 0 70px;
  border-top: 1px solid var(--ink);
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-heading h2, .filter-rail h2 {
  margin: 8px 0 0;
  font: 700 clamp(30px, 4vw, 52px)/1 var(--display);
  letter-spacing: -.04em;
}
.section-note { max-width: 360px; color: var(--muted); font-size: 13px; }
.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}
.comparison-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.comparison-table th, .comparison-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.comparison-table th {
  color: var(--muted);
  background: #e7e3d8;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.comparison-table th:first-child, .comparison-table td:first-child { text-align: left; }
.comparison-table tbody tr { cursor: pointer; transition: background .18s ease; }
.comparison-table tbody tr:hover { background: var(--verified-soft); }
.comparison-table tbody tr.is-disabled {
  cursor: default;
  color: var(--muted);
}
.comparison-table tbody tr.is-disabled:hover { background: transparent; }
.user-comparison-table { min-width: 1480px; }
.user-comparison-table-wrap { max-height: 620px; }
.user-comparison-table thead {
  position: sticky;
  z-index: 1;
  top: 0;
}
.sortable-comparison-table th { padding: 0; }
.comparison-sort-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 18px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.sortable-comparison-table th:first-child .comparison-sort-button {
  justify-content: flex-start;
}
.comparison-sort-button::after {
  width: 10px;
  color: var(--muted);
  content: "↕";
  font-size: 11px;
}
.comparison-sort-button[data-direction="asc"]::after {
  color: var(--ink);
  content: "↑";
}
.comparison-sort-button[data-direction="desc"]::after {
  color: var(--ink);
  content: "↓";
}
.comparison-sort-button:hover { color: var(--ink); background: #dedacf; }
.comparison-sort-button:active { transform: translateY(1px); }
.route-name { font-weight: 800; }
.route-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.analytics-section {
  padding: 52px 0 70px;
  border-top: 1px solid var(--ink);
}
.analytics-section .section-heading h2 {
  margin: 8px 0 0;
  font: 700 clamp(30px, 4vw, 52px)/1 var(--display);
  letter-spacing: -.04em;
}
.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}
.chart-card {
  min-width: 0;
  padding: 28px 28px 20px;
  border-radius: 24px;
  background: #f0efeb;
}
.chart-card h3 {
  margin: 8px 0 3px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.chart-badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px dashed #b0afa9;
  border-radius: 999px;
  color: #8f8e88;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.chart-sub {
  min-height: 34px;
  margin: 0 0 8px;
  color: #8f8e88;
  font-size: 11.5px;
  line-height: 1.45;
}
.chart-source {
  margin: 8px 0 0;
  color: #c6c5bf;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
}
.mono-chart {
  display: block;
  width: 100%;
  min-height: 340px;
  overflow: visible;
}
.chart-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.mono-chart text { font-family: "Avenir Next", "Noto Sans SC", "PingFang SC", sans-serif; }
.mono-chart [data-style] { cursor: pointer; }
.mono-chart [data-style]:focus { outline: none; }
.mono-chart [data-style]:focus text:first-of-type {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}
.chart-peak-label {
  paint-order: stroke;
  stroke: #f0efeb;
  stroke-width: 4px;
}
.chart-card__toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.series-limit {
  color: #8f8e88;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
}
.chart-series-controls {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}
.series-control {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}
.series-control > span {
  padding-top: 7px;
  color: #8f8e88;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.series-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.series-options button {
  min-height: 28px;
  padding: 4px 8px;
  border-color: #c6c5bf;
  border-radius: 999px;
  background: #f0efeb;
  color: #8f8e88;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.series-options button[aria-pressed="true"] {
  border-color: #1c1c1a;
  color: #f0efeb;
  background: #1c1c1a;
}
.series-selection-note {
  margin: 0 0 8px;
  color: #8f8e88;
  font-size: 9px;
  font-weight: 700;
}
.series-selection-note.is-warning {
  color: #1c1c1a;
  text-decoration: underline;
}
.metric-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 8px 0 2px;
  padding: 4px;
  border: 1px solid #d5d4ce;
  border-radius: 12px;
  background: #e5e4de;
}
.metric-selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: #8f8e88;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#trend-metric-note {
  font-size: 9px;
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
}
#trend-metric-note.is-warning {
  color: #1c1c1a;
  text-decoration: underline;
}
.metric-tabs button {
  min-height: 30px;
  padding: 5px 10px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: #8f8e88;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.metric-tabs button[aria-pressed="true"] {
  border-color: #1c1c1a;
  color: #f0efeb;
  background: #1c1c1a;
}
.trend-chart-grid {
  display: block;
  margin-top: 16px;
}
.trend-metric-panel {
  min-width: 0;
  padding: 14px 14px 8px;
  border: 1px solid #d5d4ce;
  border-radius: 16px;
  background: #ebeae5;
}
.trend-metric-panel:only-child {
  grid-column: 1 / -1;
}
.trend-metric-panel--combined {
  padding: 18px 18px 10px;
}
.trend-metric-panel--combined .chart-scroll {
  max-width: 1100px;
  margin-inline: auto;
}
.trend-metric-panel h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.trend-metric-summary {
  min-height: 0;
  margin: 3px 0 4px;
  color: #8f8e88;
  font-size: 10px;
  line-height: 1.4;
}
.trend-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0 6px;
}
.trend-kpi {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px 13px 10px;
  overflow: hidden;
  border: 1px solid #d5d4ce;
  border-radius: 10px;
  background: #f3f2ed;
}
.trend-kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-color);
  content: "";
}
.trend-kpi__label {
  color: #8f8e88;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.trend-kpi__value {
  color: #1c1c1a;
  font: 700 21px/1.1 var(--display);
  letter-spacing: -.025em;
}
.trend-kpi__detail {
  color: #8f8e88;
  font-size: 9px;
  font-weight: 700;
}
.trend-metric-chart {
  min-height: 320px;
}
.trend-combined-chart {
  min-height: 400px;
}
.trend-recharts-root {
  min-width: 0;
  min-height: 420px;
  margin-top: 10px;
}
.trend-console-chart {
  min-width: 0;
}
.trend-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 4px;
}
.trend-group-key,
.trend-display-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.trend-group-key > span,
.trend-display-toolbar > span {
  color: #8f8e88;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.trend-group-key > div,
.trend-display-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.trend-display-toolbar > div { justify-content: flex-end; }
.trend-group-key__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6a6963;
  font-size: 9px;
  font-weight: 700;
}
.trend-group-key__item i {
  display: block;
  width: 18px;
  border-top: 2px solid #6a6963;
}
.trend-display-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 4px 8px;
  border-color: #d5d4ce;
  border-radius: 7px;
  color: #55554f;
  background: #f3f2ed;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.trend-display-toolbar button:hover {
  border-color: var(--metric-color);
  color: var(--metric-color);
}
.trend-display-toolbar button svg {
  width: 13px;
  height: 13px;
  color: var(--metric-color);
}
.trend-recharts-frame {
  width: 100%;
  height: 350px;
  min-width: 0;
}
.trend-recharts-frame .recharts-wrapper,
.trend-recharts-frame svg {
  outline: none;
}
.trend-recharts-frame .recharts-legend-item-text {
  color: #55554f !important;
  font-weight: 700;
}
.trend-recharts-tooltip {
  min-width: 190px;
  padding: 10px 11px;
  border: 1px solid #d5d4ce;
  border-radius: 7px;
  color: #1c1c1a;
  background: #fffdf6;
  box-shadow: 0 8px 24px rgba(30, 31, 25, .12);
  font-size: 10px;
}
.trend-recharts-tooltip > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}
.trend-recharts-tooltip__row {
  display: grid;
  grid-template-columns: 8px minmax(80px, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.trend-recharts-tooltip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.trend-recharts-tooltip__row b {
  font-variant-numeric: tabular-nums;
}
.trend-recharts-tooltip__row small {
  grid-column: 2 / -1;
  color: #8f8e88;
  text-align: right;
}
.trend-recharts-footnote {
  margin: 7px 0 0;
  color: #b0afa9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}
.chart-fade { animation: chart-fade .8s ease both; }
.chart-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: chart-pop .5s cubic-bezier(.2, .7, .3, 1.3) both;
}
.chart-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: chart-draw 1.1s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes chart-fade { from { opacity: 0; } }
@keyframes chart-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }

.video-workbench {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 34px;
  padding: 52px 0 90px;
  border-top: 1px solid var(--ink);
}
.filter-rail { align-self: start; position: sticky; top: 18px; }
.filter-rail__heading { position: relative; margin-bottom: 22px; }
.text-button {
  position: absolute;
  right: 0;
  bottom: 2px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid;
  background: transparent;
  font-size: 12px;
}
#filter-form { display: grid; gap: 15px; }
#filter-form > label, .filter-pair label { display: grid; gap: 6px; }
#filter-form label > span, fieldset legend {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
input, select { width: 100%; min-height: 42px; padding: 9px 10px; }
fieldset {
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}
.radio-row input { width: auto; min-height: auto; accent-color: var(--signal); }
.filter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.apply-button {
  min-height: 46px;
  border-color: var(--ink);
  color: white;
  background: var(--ink);
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--signal);
  cursor: pointer;
}

.evidence-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.evidence-column { min-width: 0; }
.evidence-toolbar p {
  min-width: 220px;
  flex: 1;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.evidence-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}
.evidence-display-control {
  display: grid;
  grid-template-columns: auto minmax(112px, auto);
  align-items: center;
  gap: 6px;
}
.evidence-display-control > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}
.evidence-display-control select {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  padding: 5px 28px 5px 8px;
  font-size: 11px;
}
.evidence-display-control--size {
  grid-template-columns: auto 68px;
}
.evidence-display-control--size select { min-width: 68px; }
.pagination { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.pagination button { padding: 7px 9px; cursor: pointer; }
.pagination button:disabled { opacity: .35; cursor: default; }
.video-groups { display: grid; gap: 28px; }
.video-groups--ungrouped { gap: 0; }
.style-group__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.style-group__heading h3 {
  margin: 0;
  font: 700 27px/1.1 var(--display);
}
.style-group__heading span { color: var(--muted); font-size: 11px; }
.video-list { display: grid; gap: 8px; }
.video-row {
  display: grid;
  grid-template-columns: 156px minmax(290px, 1fr) minmax(390px, 1.35fr);
  min-height: 220px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 6px 6px 0 #d8d3c7;
}
.video-frame {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  background: #24251f;
}
.video-row:not(.is-expanded) .video-frame {
  height: 220px;
  align-self: start;
}
.video-row.is-expanded .video-frame {
  min-height: 300px;
  max-height: 420px;
  align-self: start;
}
.video-frame video { width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.video-unavailable { padding: 20px; color: #d5d2c8; text-align: center; font-size: 12px; }
.video-primary, .video-metrics { padding: 13px 14px; }
.video-primary { border-right: 1px solid var(--line); }
.video-primary__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.video-primary__title { min-width: 0; }
.video-detail-toggle {
  flex: none;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.video-detail-toggle:hover,
.video-detail-toggle:focus-visible {
  border-color: var(--ink);
  background: #f3f0e7;
}
.video-metrics {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}
.video-metrics__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}
.video-metrics__heading span:last-child {
  font-weight: 600;
  letter-spacing: .03em;
}
.video-primary h4 {
  display: -webkit-box;
  margin: 0 0 5px;
  overflow: hidden;
  font: 700 16px/1.25 var(--display);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.video-primary p { margin: 0; }
.product-id { color: var(--muted); font: 9px/1.35 ui-monospace, monospace; }
.route-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0; }
.video-row:not(.is-expanded) .route-tags {
  max-height: 24px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.tag {
  flex: none;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eeebe1;
  font-size: 9px;
}
.tag--signal { border-color: var(--signal); color: var(--signal-dark); background: #fbe2d6; }
.tag--market { border-color: #9b7a35; color: #72561d; background: #f4ead1; }
.tag--verified {
  border-color: var(--verified);
  color: var(--verified);
  background: var(--verified-soft);
}
.task-id { color: var(--muted); font: 10px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
.video-identity {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.video-row:not(.is-expanded) .video-identity__row:nth-child(n + 6) {
  display: none;
}
.video-identity__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}
.video-identity dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.video-identity dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 9px/1.4 ui-monospace, monospace;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-row.is-expanded .video-identity dd { white-space: normal; }
.video-identity a {
  color: var(--signal-dark);
  font-family: var(--sans);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.metric-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.video-row:not(.is-expanded) .metric-block:nth-child(n + 5) { display: none; }
.video-row.is-expanded .metric-blocks {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metric-block {
  min-width: 0;
  padding: 8px;
  border-top: 2px solid var(--ink);
  background: #f3f0e7;
}
.metric-block strong { display: block; font: 700 18px/1 var(--display); }
.metric-block span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-block--verified { border-color: var(--verified); }
.metric-block--missing { border-color: var(--line); }
.coverage-ledger {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}
.video-row:not(.is-expanded) .coverage-ledger { display: none; }
.coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 43px;
  border-bottom: 1px solid var(--line);
}
.coverage-row__copy { min-width: 0; }
.coverage-row__copy strong {
  display: block;
  font-size: 10px;
  font-weight: 800;
}
.coverage-row__copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font: 9px/1.4 ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coverage-row__status {
  padding: 3px 6px;
  border: 1px solid currentColor;
  font-size: 9px;
  font-weight: 800;
}
.coverage-row__status.is-verified { color: var(--verified); }
.coverage-row__status.is-warning { color: #956b00; }
.coverage-row__status.is-missing { color: var(--muted); }
.video-evidence-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.prompt-disclosure { min-width: 0; }
.prompt-summary-bar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.prompt-summary-bar > strong {
  font-size: 10px;
  font-weight: 800;
}
.prompt-length {
  margin-left: auto;
  color: var(--muted);
  font: 9px/1.4 ui-monospace, monospace;
  white-space: nowrap;
}
.video-row:not(.is-expanded) .prompt-length { display: none; }
.precheck { min-width: 0; }
.precheck-summary-bar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.precheck-status {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.precheck-status strong { color: var(--verified); }
.precheck-toggle {
  flex: none;
  padding: 5px 8px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.precheck-empty { color: var(--muted); font-size: 10px; }
.detail-float {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  width: min(780px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 48px));
  padding: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 14px 14px 0 rgb(28 28 26 / 24%);
}
.detail-float[hidden] { display: none; }
.detail-float__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
  border-bottom: 3px solid var(--ink);
}
.detail-float__eyebrow {
  margin: 0 0 6px;
  color: var(--verified);
  font: 800 10px/1.3 ui-monospace, monospace;
  letter-spacing: .08em;
}
.detail-float__header h2 {
  margin: 0;
  font: 700 clamp(24px, 4vw, 38px)/1 var(--display);
}
.detail-float__header p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.detail-float__icon-close {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font: 24px/1 sans-serif;
  cursor: pointer;
}
.detail-float__icon-close:hover,
.detail-float__icon-close:focus-visible {
  color: white;
  background: var(--ink);
}
.detail-float__context {
  margin: 0;
  padding: 12px 24px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 10px/1.5 ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-float__content {
  display: block;
  width: 100%;
  min-height: 180px;
  margin: 0;
  padding: 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  resize: none;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: #eeebe1;
  font: 12px/1.75 ui-monospace, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  cursor: text;
  user-select: text;
}
.detail-float__content:focus {
  outline: 3px solid color-mix(in srgb, var(--signal) 55%, transparent);
  outline-offset: -3px;
}
.detail-float__content::selection {
  color: white;
  background: var(--verified);
}
.detail-float__actions {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  border-top: 1px solid var(--ink);
}
.detail-float__actions span {
  color: var(--muted);
  font-size: 10px;
}
.detail-float__actions button {
  padding: 7px 14px;
  border: 1px solid var(--ink);
  color: white;
  background: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.empty-state, .login-gate {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 40px;
  border: 1px dashed var(--muted);
  color: var(--muted);
  text-align: center;
}
.login-gate a {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 0 40px;
  border-top: 3px solid var(--ink);
}
footer p { margin: 0; }

@media (max-width: 1100px) {
  .hero-ledger { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .trend-combined-chart { min-height: 400px; }
  .video-workbench { grid-template-columns: 1fr; }
  .filter-rail { position: static; }
  .video-row { grid-template-columns: 190px 1fr; }
  .video-metrics { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .video-primary { border-right: 0; }
}

@media (max-width: 760px) {
  .masthead, main, footer, .quality-banner { width: min(100% - 24px, 1520px); }
  .masthead { align-items: flex-start; gap: 18px; }
  .masthead__status { display: grid; }
  .brand-mark { width: 48px; height: 48px; }
  .hero-ledger { padding-top: 46px; gap: 30px; }
  .chart-card { padding: 20px 14px 16px; }
  .chart-card__toolbar { display: grid; }
  .series-control { grid-template-columns: 1fr; }
  .series-control > span { padding-top: 0; }
  .metric-selection-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  #trend-metric-note { text-align: left; }
  .trend-chart-toolbar { align-items: flex-start; flex-direction: column; }
  .mono-chart { min-width: 620px; min-height: 370px; }
  .ledger-grid { grid-template-columns: 1fr 1fr; }
  .ledger-item:nth-child(odd) { padding-left: 0; border-left: 0; }
  .ledger-item:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
  .video-workbench { grid-template-columns: 1fr; }
  .filter-rail { position: static; }
  .video-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }
  .video-row:not(.is-expanded) .video-frame,
  .video-row.is-expanded .video-frame {
    width: 100%;
    height: 280px;
    min-height: 280px;
    max-height: 280px;
  }
  .video-primary { border-bottom: 1px solid var(--line); }
  .video-identity__row { grid-template-columns: 104px minmax(0, 1fr); }
  .metric-blocks,
  .video-row.is-expanded .metric-blocks {
    grid-template-columns: 1fr 1fr;
  }
  .precheck-summary-bar { align-items: flex-start; padding: 10px 0; }
  .detail-float {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
    box-shadow: 7px 7px 0 rgb(28 28 26 / 24%);
  }
  .detail-float__header { padding: 18px 16px 14px; }
  .detail-float__context { padding: 10px 16px; }
  .detail-float__content {
    min-height: 140px;
    padding: 18px 16px;
  }
  .detail-float__actions { padding: 10px 16px; }
  .detail-float__actions span { display: none; }
  .evidence-toolbar, .section-heading, footer { align-items: flex-start; flex-direction: column; }
  .evidence-toolbar__controls {
    width: 100%;
    justify-content: flex-start;
  }
  .evidence-display-control {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .pagination {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Content operations dashboard refresh */
:root {
  --paper: #f6f7f9;
  --paper-bright: #ffffff;
  --ink: #181a1f;
  --muted: #68707b;
  --line: #e1e5ea;
  --signal: #c2410c;
  --signal-dark: #9a3412;
  --verified: #0f766e;
  --verified-soft: #e6f4f1;
  --warning: #d97706;
  --shadow: 0 12px 36px rgba(24, 26, 31, .07);
  --display: "Avenir Next", "Noto Sans SC", "PingFang SC", sans-serif;
  --body: "Avenir Next", "Noto Sans SC", "PingFang SC", sans-serif;
  --sans: var(--body);
}

body {
  background:
    radial-gradient(circle at 8% -10%, rgba(79, 70, 229, .055), transparent 28rem),
    var(--paper);
}

.page-grain { opacity: .035; }

.masthead {
  width: min(1440px, calc(100% - 48px));
  min-height: 78px;
  padding: 14px 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.masthead__brand { gap: 12px; }

.brand-mark {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #252832, #111318);
  box-shadow: 0 7px 16px rgba(24, 26, 31, .14);
  font: 700 18px/1 var(--display);
  transform: none;
}

.kicker,
.section-number {
  color: #767e89;
  font-size: 10px;
  letter-spacing: .12em;
}

.masthead h1 {
  margin-top: 4px;
  font: 750 clamp(22px, 2.1vw, 29px)/1.08 var(--display);
  letter-spacing: -.035em;
}

.status-stamp,
.user-chip {
  display: grid;
  min-height: 48px;
  align-content: center;
  padding: 8px 12px;
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
  box-shadow: none;
}

.status-stamp strong { font-size: 11px; }
.user-chip { font-size: 11px; }

.quality-banner,
main,
footer {
  width: min(1440px, calc(100% - 48px));
}

.quality-banner {
  border-color: #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
}

.dashboard-overview {
  padding: 38px 0 42px;
}

.overview-heading,
.dashboard-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.overview-heading { margin-bottom: 22px; }

.overview-heading h2,
.dashboard-section-heading h2 {
  max-width: 840px;
  margin: 7px 0 0;
  font: 750 clamp(27px, 3vw, 42px)/1.08 var(--display);
  letter-spacing: -.045em;
}

.overview-heading > p,
.section-note {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.ledger-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  border: 0;
}

.ledger-item {
  position: relative;
  min-width: 0;
  min-height: 126px;
  padding: 15px 14px 13px !important;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 13px;
  background: var(--paper-bright);
  box-shadow: 0 4px 16px rgba(24, 26, 31, .035);
}

.ledger-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #c7cdd5;
  content: "";
}

.ledger-item[data-tone="success"]::before { background: var(--verified); }
.ledger-item[data-tone="commerce"]::before { background: var(--signal); }
.ledger-item[data-tone="reach"]::before { background: #0891b2; }

.ledger-item__label {
  color: #525a65;
  font-size: 10px;
  font-weight: 750;
}

.ledger-item__value {
  margin-top: 13px;
  overflow: hidden;
  font: 750 clamp(23px, 2.2vw, 31px)/1 var(--display);
  letter-spacing: -.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-item__denominator {
  min-height: 15px;
  margin-top: 8px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-coverage-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-bright);
  box-shadow: 0 4px 16px rgba(24, 26, 31, .035);
}

.data-coverage-card__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.data-coverage-card__heading h3 {
  margin: 7px 0 0;
  font: 750 20px/1.15 var(--display);
}

.data-coverage-card__heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.data-coverage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.data-coverage-item {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f5f7f8;
}

.data-coverage-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.data-coverage-item strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-coverage-item b {
  color: var(--verified);
  font: 750 12px/1 var(--display);
}

.data-coverage-item__track {
  height: 4px;
  margin: 8px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e5e9;
}

.data-coverage-item__track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--verified);
}

.data-coverage-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font: 8px/1.4 ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-coverage-item.is-unavailable b { color: #a16207; }
.data-coverage-item.is-unavailable .data-coverage-item__track i {
  background: #d6a541;
}

.ledger-item__meter {
  position: absolute;
  right: 14px;
  bottom: 11px;
  left: 14px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.ledger-item__meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4f46e5;
}

.ledger-item[data-tone="success"] .ledger-item__meter i {
  background: var(--verified);
}

.ledger-item[data-tone="commerce"] .ledger-item__meter i {
  background: var(--signal);
}

.analytics-section,
.dimension-section {
  padding: 40px 0 54px;
  border-top: 1px solid var(--line);
}

.section-heading { margin-bottom: 22px; }

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: 18px;
}

.dashboard-card,
.dimension-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}

.dashboard-card { padding: 21px; }

.dashboard-card__header,
.trend-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.dashboard-card h3,
.trend-dashboard-card h3 {
  margin: 8px 0 5px;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.dashboard-card__header p,
.chart-sub {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.dashboard-card__hint {
  max-width: 150px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #66707c;
  background: #f2f4f6;
  font-size: 9px;
  line-height: 1.45;
  text-align: right;
}

.chart-badge {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  color: #4f46e5;
  background: #eeedff;
  font-size: 8px;
}

.content-funnel { min-height: 376px; padding-top: 12px; }
.funnel-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }

.funnel-stage {
  position: relative;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f2;
}

.funnel-stage:last-child { border-bottom: 0; }

.funnel-stage__heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}

.funnel-stage__index {
  color: #9aa1aa;
  font: 700 9px/1 ui-monospace, monospace;
}

.funnel-stage__heading strong { font-size: 12px; }
.funnel-stage__heading b {
  font: 750 19px/1 var(--display);
  letter-spacing: -.03em;
}

.funnel-stage__track {
  height: 13px;
  margin: 8px 0 0 38px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf0f3;
}

.funnel-stage__track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width .5s ease;
}

.funnel-stage:nth-child(2) .funnel-stage__track i { background: #0f766e; }
.funnel-stage:nth-child(3) .funnel-stage__track i { background: #2563eb; }
.funnel-stage:nth-child(4) .funnel-stage__track i { background: #c2410c; }

.funnel-stage__detail {
  margin: 6px 0 0 38px;
  color: var(--muted);
  font-size: 9px;
}

.style-ranking-chart {
  display: grid;
  min-height: 376px;
  padding-top: 7px;
}

.style-rank-row { border-bottom: 1px solid #edf0f2; }
.style-rank-row:last-child { border-bottom: 0; }

.style-rank-row__button {
  display: grid;
  width: 100%;
  min-height: 57px;
  grid-template-columns: minmax(138px, .9fr) 96px minmax(100px, 1.2fr) minmax(300px, 1.4fr);
  align-items: center;
  gap: 13px;
  padding: 8px 5px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.style-rank-row__button:hover {
  background: #f7f8fa;
  transform: translateX(2px);
}

.style-rank-row__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.style-rank-row__identity i {
  color: #9aa1aa;
  font: 700 9px/1 ui-monospace, monospace;
  font-style: normal;
}

.style-rank-row__identity strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-rank-row__result { display: grid; gap: 3px; }
.style-rank-row__result strong { font-size: 14px; }
.style-rank-row__result small { color: var(--muted); font-size: 8px; }

.style-rank-row__bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.style-rank-row__bar i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c2410c, #f59e0b);
}

.style-rank-row__commerce {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  color: #606873;
  font-size: 8px;
  white-space: nowrap;
}

.trend-dashboard-card { margin-top: 18px; padding: 23px; }

.trend-dashboard-header { align-items: center; }

.trend-scope-summary {
  display: grid;
  max-width: 520px;
  gap: 5px;
  text-align: right;
}

.trend-scope-summary span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.trend-scope-summary strong {
  color: #414852;
  font-size: 10px;
  line-height: 1.45;
}

.trend-control-panel {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid #e5e8ec;
  border-radius: 12px;
  background: #f8f9fa;
}

.chart-series-controls {
  grid-template-columns: 1fr 1.35fr;
  gap: 18px;
  margin: 0;
}

.series-control {
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px;
}

.series-control > span {
  color: #69717c;
  font-size: 8px;
}

.series-options button {
  border-color: #d9dee4;
  background: white;
  color: #59616c;
}

.series-options button[aria-pressed="true"],
.metric-tabs button[aria-pressed="true"] {
  border-color: #262a31;
  color: white;
  background: #262a31;
}

.metric-selection-heading { color: #69717c; }

.metric-tabs {
  gap: 4px;
  padding: 4px;
  border-color: #e0e4e8;
  background: #eef1f4;
}

.metric-tabs button {
  flex: 1 1 auto;
  color: #646c77;
}

.series-selection-note { margin: 8px 0 0; color: #737b85; }

.trend-metric-panel,
.trend-metric-panel--combined {
  padding: 16px 0 0;
  border: 0;
  background: transparent;
}

.trend-metric-panel h4 { font-size: 15px; }
.trend-metric-summary { color: #747c86; }

.trend-kpi-strip {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
}

.trend-kpi {
  border-color: #e4e7eb;
  background: #fafbfc;
}

.trend-kpi__value { color: var(--ink); font-family: var(--display); }
.trend-recharts-root { min-height: 410px; }
.trend-recharts-frame { height: 360px; }

.trend-group-key > span,
.trend-display-toolbar > span,
.trend-kpi__label { color: #747c86; }

.trend-display-toolbar button {
  border-color: #e1e5e9;
  color: #4f5762;
  background: white;
}

.trend-recharts-tooltip {
  border-color: #dfe3e8;
  border-radius: 10px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 32px rgba(24, 26, 31, .12);
}

.trend-recharts-footnote {
  color: #8a929c;
  letter-spacing: .01em;
  text-transform: none;
}

.trend-view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 17px 0 12px;
  padding-top: 14px;
  border-top: 1px solid #e4e7eb;
}

.trend-view-heading > div {
  display: grid;
  gap: 2px;
}

.trend-view-heading span,
.trend-series-legend__heading > span {
  color: #747c86;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.trend-view-heading strong {
  color: #20242a;
  font-size: 14px;
}

.trend-view-heading p {
  max-width: 520px;
  margin: 0;
  color: #747c86;
  font-size: 10px;
  text-align: right;
}

.trend-series-legend {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  background: #f6f8fa;
}

.trend-series-legend__heading {
  display: grid;
  align-content: start;
  gap: 2px;
  padding-top: 4px;
}

.trend-series-legend__heading small {
  color: #8a929c;
  font-size: 9px;
}

.trend-series-legend__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-height: 100px;
  overflow: auto;
  overscroll-behavior: contain;
}

.trend-series-legend__button,
.trend-series-legend__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  color: #4f5762;
  background: white;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.trend-series-legend__button i,
.trend-recharts-tooltip__line {
  display: block;
  width: 18px;
  border-top: 2px solid var(--series-color);
}

.trend-series-legend__button[data-period="previous"] i,
.trend-recharts-tooltip__line.is-previous {
  border-top-style: dashed;
}

.trend-series-legend__button:hover,
.trend-series-legend__button:focus-visible {
  border-color: var(--series-color, #9ca3af);
  outline: none;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, .1);
}

.trend-series-legend__button.is-active {
  border-color: #6b7280;
  background: #eef1f4;
  box-shadow: inset 0 0 0 1px #6b7280;
}

.trend-series-legend__button.is-dimmed { opacity: .32; }

.trend-series-legend__reset {
  border-style: dashed;
  color: #c2410c;
  background: transparent;
}

.trend-small-multiples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.trend-focus-chart { margin-top: 12px; }

.trend-facet {
  min-width: 0;
  padding: 13px 13px 9px;
  border: 1px solid #e1e5e9;
  border-radius: 11px;
  background: #fafbfc;
}

.trend-facet.is-focus {
  padding: 16px 16px 10px;
  background: white;
}

.trend-facet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 35px;
  margin-bottom: 4px;
}

.trend-facet__header h5 {
  margin: 0;
  color: #20242a;
  font-size: 12px;
}

.trend-facet.is-focus .trend-facet__header h5 { font-size: 14px; }

.trend-facet__header p {
  margin: 2px 0 0;
  color: #8a929c;
  font-size: 9px;
}

.trend-facet__type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  color: #5d6671;
  background: white;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.trend-facet__type:hover {
  border-color: var(--metric-color);
  color: var(--metric-color);
}

.trend-facet__type svg {
  width: 12px;
  height: 12px;
  color: var(--metric-color);
}

.trend-facet-frame {
  width: 100%;
  height: 232px;
  min-width: 0;
}

.trend-facet.is-focus .trend-facet-frame { height: 360px; }

.trend-facet-frame .recharts-wrapper,
.trend-facet-frame svg { outline: none; }

.trend-facet .trend-recharts-tooltip {
  max-width: min(330px, 74vw);
}

.trend-recharts-tooltip__line {
  align-self: center;
  width: 12px;
}

.dimension-section { padding-bottom: 58px; }
.dimension-card { padding: 6px; }

.dimension-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eef1f4;
}

.dimension-tabs button {
  min-height: 36px;
  padding: 7px 15px;
  border: 0;
  border-radius: 7px;
  color: #606975;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.dimension-tabs button[aria-selected="true"] {
  color: #181a1f;
  background: white;
  box-shadow: 0 2px 7px rgba(24, 26, 31, .08);
}

.dimension-panel[hidden] { display: none; }
.dimension-panel { padding-top: 6px; }

.comparison-table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 0;
  border-radius: 11px;
  box-shadow: none;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 15px;
  border-bottom-color: #edf0f2;
}

.comparison-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #707985;
  background: #f7f8fa;
}

.comparison-sort-button {
  min-height: 42px;
  padding: 10px 15px;
}

.comparison-sort-button:hover { background: #edf0f3; }
.comparison-table tbody tr:hover { background: #f0f7f6; }

.video-workbench {
  padding-top: 50px;
  border-top-color: var(--line);
}

.filter-rail h2,
.style-group__heading h3 {
  font-family: var(--display);
}

.apply-button {
  border-radius: 8px;
  box-shadow: none;
}

.video-row {
  border-color: var(--line);
  border-radius: 13px;
  box-shadow: 0 7px 24px rgba(24, 26, 31, .06);
}

.detail-float {
  border-color: #cbd1d8;
  border-radius: 13px;
  background: white;
  box-shadow: 0 22px 58px rgba(24, 26, 31, .22);
}

.detail-float__header { border-bottom: 1px solid var(--line); }
.detail-float__content { background: #f7f8fa; }
.detail-float__actions { border-top-color: var(--line); }

@media (max-width: 1180px) {
  .ledger-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .data-coverage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insight-grid { grid-template-columns: 1fr; }
  .content-funnel { min-height: 0; }
  .style-ranking-chart { min-height: 0; }
}

@media (max-width: 760px) {
  .masthead,
  main,
  footer,
  .quality-banner {
    width: min(100% - 24px, 1440px);
  }

  .masthead {
    min-height: 0;
    align-items: flex-start;
    padding: 12px 0;
  }

  .masthead__status { gap: 6px; }
  .status-stamp,
  .user-chip { min-height: 42px; padding: 6px 9px; }

  .dashboard-overview { padding: 29px 0 34px; }

  .overview-heading,
  .dashboard-section-heading,
  .trend-dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .overview-heading > p,
  .section-note { max-width: none; }

  .ledger-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .data-coverage-card__heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .data-coverage-card__heading > p { text-align: left; }
  .data-coverage-grid { grid-template-columns: 1fr 1fr; }
  .ledger-item { min-height: 116px; }
  .ledger-item__value { font-size: 24px; }

  .analytics-section,
  .dimension-section { padding: 32px 0 40px; }
  .dashboard-card,
  .trend-dashboard-card { padding: 16px; }

  .dashboard-card__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-card__hint { max-width: none; text-align: left; }

  .style-rank-row__button {
    grid-template-columns: minmax(120px, 1fr) 78px;
    gap: 7px 12px;
    padding: 9px 3px;
  }

  .style-rank-row__bar { grid-column: 1 / -1; }
  .style-rank-row__commerce {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .trend-scope-summary { max-width: none; text-align: left; }
  .trend-control-panel { padding: 11px; }
  .chart-series-controls { grid-template-columns: 1fr; gap: 10px; }
  .series-control { grid-template-columns: 1fr; }
  .metric-tabs button { flex-basis: calc(25% - 4px); }
  .trend-kpi-strip { grid-template-columns: 1fr 1fr; }
  .trend-kpi { min-height: 80px; padding: 10px; }
  .trend-recharts-root { min-height: 360px; }
  .trend-recharts-frame { height: 300px; }
  .trend-view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .trend-view-heading p { max-width: none; text-align: left; }
  .trend-series-legend { grid-template-columns: 1fr; }
  .trend-series-legend__heading { display: flex; gap: 8px; }
  .trend-small-multiples { grid-template-columns: 1fr; }
  .trend-facet-frame { height: 250px; }
  .trend-facet.is-focus .trend-facet-frame { height: 300px; }

  .dimension-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dimension-tabs button {
    padding-inline: 9px;
    white-space: nowrap;
  }

  .dimension-panel { padding-top: 3px; }
  .comparison-table-wrap { max-height: 420px; }
}

/* Phase A: shared analysis time context */
.analysis-context {
  position: sticky;
  top: 0;
  z-index: 60;
  width: min(1440px, calc(100% - 48px));
  margin: 12px auto 0;
  padding: 14px 16px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 32px rgba(24, 26, 31, .08);
  backdrop-filter: blur(18px);
}

.analysis-context__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 11px;
}

.analysis-context__heading h2 {
  margin: 4px 0 0;
  font-size: 17px;
  letter-spacing: -.02em;
}

.analysis-context__heading > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.analysis-time-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.analysis-time-form[aria-busy="true"] { opacity: .7; }

.analysis-time-form > label {
  display: grid;
  flex: 0 1 auto;
  gap: 5px;
}

.analysis-time-form > label > span {
  color: #6e7681;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.analysis-time-form input[type="date"],
.analysis-time-form select {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  padding: 6px 8px;
  border-color: #d9dee4;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
}

.analysis-time-form select[name="time_basis"] { min-width: 180px; }

.date-presets {
  display: flex;
  flex: 1 1 250px;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #eef1f4;
}

.date-presets button {
  min-height: 28px;
  flex: 1 1 auto;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  color: #646c77;
  background: transparent;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.date-presets button[aria-pressed="true"] {
  color: #181a1f;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 26, 31, .08);
}

.analysis-time-form .partial-toggle {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #d9dee4;
  border-radius: 8px;
  background: #fff;
}

.analysis-time-form .partial-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: #c2410c;
}

.analysis-time-form .partial-toggle span {
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.analysis-apply-button {
  min-height: 34px;
  padding: 6px 13px;
  border-color: #252a31;
  border-radius: 8px;
  color: white;
  background: #252a31;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.analysis-apply-button:disabled { cursor: wait; opacity: .55; }

.analysis-context__status {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #edf0f2;
  color: #68717c;
  font-size: 9px;
}

.analysis-context__status strong { color: #353b44; }
.analysis-context__status .is-warning { color: #b42318; }

.ledger-item { min-height: 145px; }

.ledger-item__delta {
  margin-top: 6px;
  font-size: 8px;
  font-weight: 750;
}

.ledger-item__delta.is-positive,
.trend-kpi__detail.is-positive { color: #0f766e; }

.ledger-item__delta.is-negative,
.trend-kpi__detail.is-negative { color: #b42318; }

.ledger-item__delta.is-neutral,
.trend-kpi__detail.is-neutral { color: #7a838e; }

@media (max-width: 1180px) {
  .analysis-time-form { flex-wrap: wrap; }
  .date-presets { flex-basis: 100%; }
}

@media (max-width: 760px) {
  .analysis-context {
    position: static;
    width: calc(100% - 24px);
    padding: 13px 12px;
  }

  .analysis-context__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .analysis-context__heading > p { text-align: left; }
  .analysis-time-form { display: grid; grid-template-columns: 1fr 1fr; }
  .date-presets { grid-column: 1 / -1; }
  .analysis-time-form > label { min-width: 0; }
  .analysis-time-form input[type="date"],
  .analysis-time-form select {
    width: 100%;
    min-width: 0;
  }

  .analysis-time-form > label:nth-of-type(3),
  .analysis-time-form .partial-toggle,
  .analysis-apply-button {
    grid-column: 1 / -1;
  }

  .analysis-context__status {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .ledger-item { min-height: 138px; }
}
