/*
 * Panel styles. Tokens follow the Precize dark design system
 * (precize_contexto/Skills/precize-design-system-dark.md): Preto Precize base,
 * Branco Precize text, one pink accent for the primary action and the current
 * place, panels separated by 1px hairlines, Inter for text and figures,
 * JetBrains Mono for ids and code.
 *
 * Layout: a fixed side navigation, a top bar with the page path and the
 * acting user, and the page. Below 960px the navigation becomes a drawer.
 */
:root {
  color-scheme: dark;
  --bg: #0A0709; /* Preto Precize */
  --side: #0E0A0C; /* navigation, one step off the base */
  --panel: #151012; /* cards */
  --panel-2: #1C1618; /* table heads, hover, inputs */
  --line: #2E2A26; /* hairlines and panel borders */
  --line-2: #3A3531; /* stronger hairline, focus rings on dark */
  --text: #F3F3F0; /* Branco Precize, never pure white */
  --text-2: #C6C2BB; /* secondary text */
  --muted: #8A8680; /* labels and captions */
  --accent: #FF007F; /* Rosa Precize: primary action, current place */
  --accent-soft: rgba(255, 0, 127, .12);
  --good: #0ca30c; /* status: good */
  --warn: #fab219; /* status: warning */
  --bad: #d03b3b; /* status: critical; never the brand pink */
  /* Chart series, validated for the dark panel (dataviz validator: lightness, chroma, CVD, contrast) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s-other: #6b645d;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 236px;
  --bar-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* `hidden` must win over display rules */
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); font-feature-settings: "tnum" 1; }
a { color: var(--text); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: var(--text-2); }
p { margin: 0 0 8px; }
ul { margin: 0 0 8px; padding-left: 18px; }
.mono, code { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); }
.brand { display: flex; align-items: baseline; gap: 6px; padding: 0 10px 18px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; font-size: 18px; }
.brand__dot { color: var(--accent); }
.brand__product { font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.nav { display: grid; gap: 2px; }
.nav__group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--text-2); position: relative; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav__badge { margin-left: auto; font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #0A0709; font-weight: 700; }
.side__foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.shell { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: var(--bar-h); display: flex; align-items: center; gap: 12px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  background: rgba(10, 7, 9, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span:last-child { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--line-2); }
.menu-btn { display: none; }
.account { display: flex; align-items: center; gap: 10px; }
.account__who { text-align: right; line-height: 1.25; }
.account__name { font-size: 13px; font-weight: 600; }
.account__role { font-size: 11px; color: var(--muted); }
.account select { width: auto; max-width: 220px; padding: 6px 8px; font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line-2); flex: none; }

.main { width: 100%; max-width: 1360px; padding-block: 24px 80px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.main:focus { outline: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(var(--side-w), 86vw); transform: translateX(-100%); transition: transform .18s ease; }
  .app.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .menu-btn { display: inline-grid; place-items: center; padding: 6px 8px; }
  .account__who { display: none; }
  .bar, .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* ---------- Page header, tabs, toolbars ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head__text { min-width: 0; flex: 1 1 420px; display: grid; gap: 6px; }
.page-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head p { color: var(--text-2); max-width: 78ch; margin: 0; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; overflow-x: auto; }
.tabs a, .tabs button { flex: none; padding: 9px 12px; border: 0; border-radius: 0; background: none; color: var(--muted); text-decoration: none; font-size: 13px; box-shadow: inset 0 -2px 0 transparent; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-bottom: 16px; }
.toolbar .field { min-width: 150px; }
.toolbar__sp { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 12px; font-size: 12px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* ---------- Cards and grids ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.card__head .muted { font-size: 12px; }
.card__body { padding: 14px 16px 16px; }
.card__body--flush { padding: 8px 0 4px; }
.cols { display: grid; gap: 16px; }
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols--3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols--1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cols--3-1, .cols--1-1-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .cols--2 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; }

/* KPI tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.kpi__label { font-size: 12px; color: var(--muted); }
.kpi__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__foot { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; }
.delta--up { color: var(--good); }
.delta--down { color: var(--bad); }
.delta--flat { color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type="date"] { color-scheme: dark; }
textarea { resize: vertical; min-height: 72px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hint { font-size: 12px; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: flex; gap: 6px; align-items: center; }
.checks input { width: auto; accent-color: var(--accent); }
.form-section { display: grid; gap: 12px; padding: 16px; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; }
.form-section__title { font-size: 13px; font-weight: 600; }
.form-section__title + .hint { margin-top: -8px; }

/* ---------- Buttons ---------- */
button, .btn { font: inherit; font-size: 13px; cursor: pointer; border-radius: 7px; padding: 7px 13px; border: 1px solid var(--line-2); background: transparent; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { background: var(--panel-2); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #0A0709; font-weight: 600; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.ghost { border-color: transparent; color: var(--text-2); }
button.small, .btn.small { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; background: var(--panel-2); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
tr.is-link { cursor: pointer; }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line-2); }
.cell-title { font-weight: 600; }
.cell-title a { text-decoration: none; }
.cell-title a:hover { text-decoration: underline; }
.cell-sub { font-size: 12px; color: var(--muted); }
.share { display: grid; grid-template-columns: minmax(40px, 1fr) 44px; align-items: center; gap: 8px; min-width: 120px; }
.share__track { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.share__fill { height: 100%; border-radius: 3px; background: var(--accent); }
.share__pct { font-size: 12px; color: var(--muted); text-align: right; }
.progress { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; margin-top: 6px; width: 140px; max-width: 100%; }
.progress > div { height: 100%; background: var(--text-2); }

/* ---------- Status chips: neutral by default, colored only for meaning ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip--active, .chip--approved, .chip--ok { color: var(--good); border-color: rgba(12, 163, 12, .45); }
.chip--in_review, .chip--pending, .chip--warn { color: var(--warn); border-color: rgba(250, 178, 25, .45); }
.chip--rejected, .chip--suspended, .chip--bad { color: var(--bad); border-color: rgba(208, 59, 59, .5); }
.chip--demo { color: var(--text-2); border-style: dashed; }
.chip--demo::before { display: none; }

/* ---------- Lists ---------- */
.list { display: grid; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; }
.list__item:first-child { border-top: 0; }
a.list__item:hover { background: var(--panel-2); }
.list__main { min-width: 0; flex: 1; }
.list__title { font-weight: 500; }
.list__sub { font-size: 12px; color: var(--muted); }
.list__value { font-variant-numeric: tabular-nums; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot--warn { background: var(--warn); }
.dot--bad { background: var(--bad); }
.dot--good { background: var(--good); }
.empty { color: var(--muted); padding: 18px 16px; }
.notice { border: 1px solid rgba(250, 178, 25, .4); background: rgba(250, 178, 25, .06); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.notice h3 { margin-top: 0; color: var(--text); }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .s1 { fill: var(--s1); } .chart .s2 { fill: var(--s2); } .chart .s3 { fill: var(--s3); } .chart .s4 { fill: var(--s4); }
.chart .s-other { fill: var(--s-other); } .chart .s-accent { fill: var(--accent); }
.chart .s-empty { fill: var(--line-2); }
.chart .hover-col { fill: rgba(255, 255, 255, .05); }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--s-other); }
.swatch.s1 { background: var(--s1); } .swatch.s2 { background: var(--s2); } .swatch.s3 { background: var(--s3); } .swatch.s4 { background: var(--s4); }
.swatch.s-accent { background: var(--accent); } .swatch.s-empty { background: var(--line-2); }
.tip { position: absolute; z-index: 5; pointer-events: none; background: #221B1E; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 150px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.tip__title { font-weight: 600; margin-bottom: 4px; }
.tip__row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip__row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.bars { display: grid; gap: 10px; }
.bars__row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(60px, 1.4fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.bars__label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bars__label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.bars__fill { height: 100%; border-radius: 4px; background: var(--accent); }
.bars__fill.s1 { background: var(--s1); } .bars__fill.s2 { background: var(--s2); } .bars__fill.s3 { background: var(--s3); } .bars__fill.s4 { background: var(--s4); } .bars__fill.s-other { background: var(--s-other); }
.bars__value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bars__value small { color: var(--muted); margin-left: 6px; font-size: 11px; }
.ratio { display: grid; gap: 8px; }
.ratio__bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--panel); }
.ratio__bar > div { height: 100%; }
.ratio__bar .person { background: var(--s-other); }
.ratio__bar .ai { background: var(--accent); }

/* ---------- Creative editor and preview ---------- */
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
.sticky { position: sticky; top: calc(var(--bar-h) + 16px); }
@media (max-width: 1000px) { .sticky { position: static; } }
.page-preview { background: #fbfaf7; color: #1d1b19; border-radius: 8px; padding: 20px; font: 15px/1.6 Georgia, serif; }
.page-preview .sr-only:not(.reveal) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.page-preview a { color: #8a1055; }
.page-preview .precize-ad { margin: 12px 0; padding: 12px 16px; border-left: 3px solid #1d1b19; }
.page-preview .precize-ad.reveal { outline: 2px dashed #FF007F; outline-offset: 4px; border-left-color: #FF007F; }
.page-preview .precize-ad__label { font: 600 11px/1.4 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; opacity: .7; margin: 0 0 6px; }
.page-preview .precize-ad__notice { font: 12px/1.4 system-ui, sans-serif; opacity: .7; }
.page-preview .precize-ad__title { margin: 0 0 6px; font-size: 17px; }
.page-preview .precize-ad ul { padding-left: 18px; margin: 0 0 8px; }
.page-preview .ghost { color: #8a8680; font-style: italic; }
pre.code, .reads-as pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 300px; overflow: auto; margin: 0; }
.snippet { white-space: pre; overflow-x: auto; font: 12px/1.6 var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; }
.issues { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.issues li { padding: 8px 10px; border-left: 3px solid var(--line-2); background: var(--panel-2); border-radius: 0 6px 6px 0; font-size: 13px; }
.issues li.error { border-left-color: var(--bad); }
.issues li.warning { border-left-color: var(--warn); }
.issues .field-name { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-right: 6px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.toast { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: #221B1E; border: 1px solid var(--line-2); border-left: 3px solid var(--good); padding: 10px 14px; border-radius: 8px; max-width: min(420px, calc(100% - 32px)); z-index: 50; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.toast--error { border-left-color: var(--bad); }
.loading { color: var(--muted); padding: 24px 0; }

/* Filter bars: every control the same height, so labels line up */
.toolbar input, .toolbar select { height: 36px; padding-block: 0; }
.toolbar .seg button { height: 34px; }

/* The preview is a publisher's light page: panel heading colors must not leak into it */
.page-preview h3, .page-preview strong, .page-preview p, .page-preview li { color: inherit; }
.page-preview .precize-ad__title { font-size: 17px; margin: 0 0 6px; }

@media (max-width: 960px) {
  .crumbs > :not(:last-child) { display: none; } /* phones: only the current page */
  .account select { max-width: 140px; }
}

/* Freshness of consolidated figures */
.chip--fresh { color: var(--text-2); font-weight: 500; }
.chip--fresh::before { background: var(--good); }

/* Progress bar */
.pbar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; min-width: 80px; }
.pbar > div { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.pbar--ok > div { background: var(--good); }

/* Campaign track */
.stepper { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.step { display: flex; gap: 10px; padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.step:first-child { border-left: 0; }
.step__dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.step__text { min-width: 0; }
.step__label { font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.step__agent { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--s1); border: 1px solid rgba(57, 135, 229, .45); border-radius: 999px; padding: 0 6px; }
.step__detail { font-size: 12px; color: var(--muted); }
.step--done .step__dot { background: rgba(12, 163, 12, .15); border-color: rgba(12, 163, 12, .5); color: var(--good); }
.step--current { background: var(--accent-soft); }
.step--current .step__dot { border-color: var(--accent); color: var(--accent); }
.step--running .step__dot { border-color: var(--s1); color: var(--s1); animation: pulse 1.2s ease-in-out infinite; }
.step--blocked .step__dot, .step--failed .step__dot { border-color: var(--warn); color: var(--warn); }
.step--failed .step__dot { border-color: var(--bad); color: var(--bad); }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .step--running .step__dot { animation: none; } }
@media (max-width: 760px) { .step { border-left: 0; border-top: 1px solid var(--line); } .step:first-child { border-top: 0; } }

/* Checklist and timeline */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); }
.checklist .ok .mark { color: var(--good); border-color: rgba(12, 163, 12, .5); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: 12px; }

/* Deck choice (Ad Creator) */
.decks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.deck { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 8px; align-content: start; background: var(--panel-2); }
.deck__angle { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.deck__title { font-weight: 600; }
.mark-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mark-toggle button { border: 0; border-radius: 0; padding: 2px 8px; font-size: 11px; }
.mark-toggle button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* Competition: bid histogram and floor curves */
.hist { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.hist > div { height: 100%; }
.hist .won { background: var(--accent); } .hist .lost { background: var(--s1); } .hist .below { background: var(--s-other); }
.floor-row { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); border-top: 1px dashed var(--warn); padding-top: 4px; }
.chart .curve { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .floor-mark { stroke-width: 1; stroke-dasharray: 3 3; }
.chart .floor-mark.now { stroke: var(--text-2); }
.chart .floor-mark.sim { stroke: var(--warn); }
input[type="range"] { accent-color: var(--accent); padding: 0; height: 36px; background: transparent; border: 0; }

/* Demo login (deployed server only): one centered card on the base colour. */
.login { min-height: 100vh; display: grid; place-items: center; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login__card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.login__card .brand { padding: 0; }
.login__card h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.login__error { margin: 0; min-height: 1.5em; color: var(--bad); font-size: 13px; }
.side__logout { margin-top: 10px; padding: 4px 10px; font-size: 12px; }

/* Long code lines scroll inside their block instead of widening the card (phone width). */
.card__body > *, .stack > * { min-width: 0; }
.snippet { max-width: 100%; }

/* Prompt Tester study matrix: one square per prompt, shaded by the strongest role (one hue, ordinal). */
.mx-wrap { max-height: 70vh; }
.mx td, .mx th { vertical-align: middle; }
.mx .mx-name { min-width: 180px; max-width: 320px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.mx thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; }
.mx thead th:first-child { left: 0; z-index: 3; }
.mx .mx-url { word-break: break-all; }
.mx-strip { display: flex; gap: 2px; flex-wrap: nowrap; }
.mx-cell { display: inline-block; width: 14px; height: 14px; border-radius: 2px; flex: none; vertical-align: middle; }
.mx-cell--c { background: var(--s1); }
.mx-cell--o { background: color-mix(in srgb, var(--s1) 55%, var(--panel)); }
.mx-cell--r { background: color-mix(in srgb, var(--s1) 22%, var(--panel)); }
.mx-cell--n { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.mx-cell--sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-num { width: 14px; height: 18px; padding: 0; border: 0; background: none; color: var(--muted); font: 9px/18px var(--mono); flex: none; cursor: pointer; text-align: center; overflow: visible; }
.mx-num--sel, .mx-num:hover { color: var(--accent); }
.mx-count { width: 14px; flex: none; font: 9px/12px var(--mono); color: var(--muted); text-align: center; }
.mx-totals td { border-top: 1px solid var(--line-2); }
.mx-removed .mx-name > div:first-child { text-decoration: line-through; opacity: .6; }
.mx-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); }
.mx-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mx-tools select, .mx-tools input[type="search"] { width: auto; max-width: 100%; }
.mx-pick { align-items: end; }
.mx-pick .field { flex: 1 1 260px; max-width: 520px; min-width: 0; }
.mx-tools .mx-pick select, .mx-pick select { width: 100%; }
.mx-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mx-check input { width: auto; }
