/* Analyzer — one hand-written stylesheet. No CDN, no build step.
   Tokens match the chart palette in includes/viz.php so charts and chrome
   read as one system. */

:root {
  --surface:    #ffffff;
  --page:       #f9f9f7;
  --sunken:     #f4f4f1;
  --ink:        #0b0b0b;
  --ink-2:      #52514e;
  --muted:      #898781;
  --line:       #e6e5df;
  --line-2:     #d5d4cc;
  --accent:     #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash:#eef4fd;
  --good:       #0ca30c;
  --warn:       #fab219;
  --bad:        #d03b3b;
  --sidebar:    #16181d;
  --sidebar-2:  #9aa1ad;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(11,11,11,.05), 0 8px 24px -12px rgba(11,11,11,.12);
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.55 var(--sans);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75rem; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* ---------------- Shell ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo-mark { font-size: 20px; color: #7fb0f2; }
.sidebar .brand b { font-size: 16px; letter-spacing: -.01em; }
.sidebar .brand small { display: block; color: var(--sidebar-2); font-size: 11px; }
.sidebar nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sidebar nav .label {
  color: #6b7280; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; padding: 14px 10px 6px; font-weight: 600;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 1px;
  color: #d7dae0; font-size: 14px; text-decoration: none;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.on { background: var(--accent); color: #fff; font-weight: 500; }
.sidebar nav a .ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.sidebar .foot {
  border-top: 1px solid rgba(255,255,255,.08); padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .foot .avatar { background: var(--accent); }
.sidebar .foot .who { flex: 1; min-width: 0; }
.sidebar .foot .who b { display: block; font-size: 13px; color: #fff; }
.sidebar .foot .who span { font-size: 11px; color: var(--sidebar-2); }
.sidebar .foot a { color: var(--sidebar-2); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 64px; max-width: 1360px; width: 100%; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 32px;
  background: var(--accent-wash); color: var(--accent-ink);
  font-size: 12px; font-weight: 600;
}

/* ---------------- Cards ---------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }

  /* The sidebar becomes a drawer rather than disappearing — without this the
     app has no navigation at all on a phone. */
  .navtoggle { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .18s ease-out;
    box-shadow: 0 0 40px rgba(0,0,0,.3); height: 100vh;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body:not(.nav-open) .nav-backdrop { display: none; }

  .topbar { gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .topbar .sub { display: none; }
  .topsearch input, .topsearch input:focus { width: 130px; }
  .split { grid-template-columns: 1fr; }
  .ask-form { flex-direction: column; }
  .ask-form button { width: 100%; }
  .chartswitch { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ---------------- Stat tiles ---------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.tile .label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.tile .value { font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tile .value.good { color: var(--good); }
.tile .value.bad  { color: var(--bad); }

/* ---------------- Buttons & forms ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: #f0c9c9; }
.btn.danger:hover { background: #fdf1f1; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=file], select, textarea {
  width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; font-size: 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; font-family: inherit; }
textarea.mono { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,120,214,.15);
}
label.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; color: var(--ink); }
label.check input { width: auto; margin: 3px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }

/* ---------------- Tables ---------------- */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td {
  padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top; white-space: nowrap;
}
table.grid thead th {
  background: var(--sunken); color: var(--ink-2); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; z-index: 1;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fbfbfa; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .null { color: #b9b7b0; font-style: italic; }
table.grid td.wrap, table.grid th.wrap { white-space: normal; min-width: 220px; }
.tablewrap.tall { max-height: 560px; overflow-y: auto; }

/* ---------------- Badges ---------------- */

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--ink-2);
}
.badge.ok    { background: #e8f7e8; color: #146914; }
.badge.warn  { background: #fdf3dd; color: #8a5d00; }
.badge.bad   { background: #fbeaea; color: #99201f; }
.badge.info  { background: var(--accent-wash); color: var(--accent-ink); }
.tbadge {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  font: 600 10.5px/1.6 var(--mono); letter-spacing: .02em;
}

/* ---------------- Flash & callouts ---------------- */

.flash { margin-bottom: 18px; display: grid; gap: 10px; }
.flash div {
  padding: 11px 15px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.flash .ok   { background: #edf9ed; border-color: #c7e8c7; color: #146914; }
.flash .warn { background: #fdf7e7; border-color: #f0dfae; color: #7d5600; }
.flash .bad  { background: #fceded; border-color: #f0c9c9; color: #99201f; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 8px; padding: 13px 16px; margin-bottom: 18px; font-size: 14px;
}
.callout.warn { border-left-color: var(--warn); background: #fffdf6; }
.callout.bad  { border-left-color: var(--bad);  background: #fffafa; }

.empty {
  text-align: center; padding: 56px 24px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface);
}
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: .6; }
.empty h3 { color: var(--ink); }

/* ---------------- Charts ---------------- */

.viz-svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.viz-empty { padding: 44px; text-align: center; color: var(--muted); font-size: 14px; }
.viz-note { color: var(--muted); font-size: 12.5px; margin: 10px 2px 0; }
.viz-kpi { padding: 44px 20px; text-align: center; }
.viz-kpi-value { font-size: 56px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.viz-kpi-label { color: var(--muted); font-size: 14px; margin-top: 10px; }

.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.chart-card .chart-head { padding: 15px 18px 6px; }
.chart-card .chart-head h3 { margin: 0 0 2px; }
.chart-card .chart-body { padding: 6px 14px 16px; }

/* ---------------- Ask (chat) ---------------- */

.ask-form { display: flex; gap: 10px; align-items: flex-start; }
.ask-form textarea { min-height: 52px; margin: 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.suggest button {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.suggest button:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }

.answer { font-size: 15px; line-height: 1.6; margin-bottom: 4px; }
.sqlbox {
  background: #14161a; color: #dfe4ea; border-radius: 8px; padding: 13px 15px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word; margin: 0;
}
details.sql-details { margin-top: 14px; }
details.sql-details summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0;
  list-style: none; user-select: none;
}
details.sql-details summary::-webkit-details-marker { display: none; }
details.sql-details summary::before { content: "▸ "; }
details.sql-details[open] summary::before { content: "▾ "; }

.history-item {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px; font-size: 13.5px; background: var(--surface);
}
.history-item a { display: block; color: var(--ink); }
.history-item .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------------- Insights ---------------- */

.insight {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
}
.insight.warning { border-left-color: var(--bad); }
.insight.notable { border-left-color: var(--accent); }
.insight.info    { border-left-color: var(--line-2); }
.insight h4 { margin: 0 0 5px; font-size: 14.5px; }
.insight p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.insight .meta { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

/* ---------------- Column profile ---------------- */

.colcard {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; background: var(--surface);
}
.colcard .top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.colcard .top b { font-size: 14px; }
.colcard .orig { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.colcard dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 12.5px; }
.colcard dt { color: var(--muted); }
.colcard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.colcard .bars { margin-top: 11px; display: grid; gap: 5px; }
.colcard .bars .row { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; font-size: 12px; }
.colcard .bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.colcard .bars .track { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.colcard .bars .fill { height: 100%; background: var(--accent); border-radius: 3px; }

.meter { height: 6px; border-radius: 4px; background: #dbeafe; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--accent); }

/* ---------------- Heatmaps (correlation & pivot) ---------------- */

table.grid.heatmap th.rowhead {
  background: var(--sunken); color: var(--ink-2); font-weight: 600;
  position: sticky; left: 0; z-index: 2; text-align: left; white-space: nowrap;
}
table.grid.heatmap thead th { white-space: nowrap; }
table.grid.heatmap th.rot { height: 104px; vertical-align: bottom; padding: 6px 2px; width: 44px; }
table.grid.heatmap th.rot > span {
  display: block; transform-origin: bottom left; transform: translateX(14px) rotate(-60deg);
  white-space: nowrap; font-weight: 600; text-transform: none; letter-spacing: 0;
}
table.grid.heatmap td.cell {
  text-align: right; font-variant-numeric: tabular-nums;
  min-width: 58px; border-bottom: 2px solid var(--surface); border-right: 2px solid var(--surface);
}
table.grid.heatmap td.cell.null { background: var(--sunken); color: var(--muted); }
table.grid.heatmap tbody tr:hover { background: transparent; }
table.grid.heatmap tfoot td, table.grid.heatmap tfoot th {
  background: var(--sunken); border-top: 1px solid var(--line-2); font-variant-numeric: tabular-nums; text-align: right;
}

.ramp-legend { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.ramp-legend i { width: 20px; height: 11px; border-radius: 2px; display: inline-block; }
.ramp-legend span:first-child { margin-right: 6px; }
.ramp-legend span:last-child { margin-left: 6px; }

.viz-legend {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  margin: 10px 4px 0; font-size: 12.5px; color: var(--ink-2);
}
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.viz-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
/* The dash colour arrives inline as border-top-color, so the swatch matches its series. */
.viz-legend i.dashed {
  height: 0; width: 16px; border-radius: 0;
  border-top: 3px dashed; background: none;
}

.steps li.skip { color: var(--muted); }
.steps li.skip::before { content: "· "; font-weight: 700; }

/* ---------------- Pager ---------------- */

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; font-size: 13.5px; }
.pager a, .pager span { padding: 5px 11px; border-radius: 7px; }
.pager a { border: 1px solid var(--line-2); background: var(--surface); }
.pager .off { color: var(--muted); }
.pager .pos { color: var(--muted); }

/* ---------------- Topbar search & mobile navigation ---------------- */

.topbar-title { min-width: 0; }
.navtoggle {
  display: none; font-size: 19px; line-height: 1; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 11px; color: var(--ink);
}
.navtoggle:hover { background: var(--sunken); }

.topsearch { margin: 0; }
.topsearch input {
  margin: 0; width: 210px; padding: 7px 12px; border-radius: 20px;
  background: var(--sunken); border-color: transparent; font-size: 13.5px;
}
.topsearch input:focus { background: var(--surface); width: 280px; }
@media (max-width: 1180px) { .topsearch input { width: 150px; } }

.nav-backdrop {
  position: fixed; inset: 0; background: rgba(11,11,11,.42);
  z-index: 40; border: 0; padding: 0;
}
.nav-backdrop[hidden] { display: none; }

/* ---------------- Result controls ---------------- */

.chartswitch {
  display: inline-flex; border: 1px solid var(--line-2);
  border-radius: 8px; overflow: hidden; background: var(--surface);
}
.chartswitch a {
  padding: 5px 10px; font-size: 12.5px; color: var(--ink-2);
  border-right: 1px solid var(--line); text-decoration: none; white-space: nowrap;
}
.chartswitch a:last-child { border-right: 0; }
.chartswitch a:hover { background: var(--sunken); text-decoration: none; }
.chartswitch a.on { background: var(--accent); color: #fff; font-weight: 500; }

.followups {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.followups .label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-right: 2px;
}
.followups button {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.followups button:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }

.tiny-link {
  font-size: 12px; line-height: 1; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px;
}
.tiny-link:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-wash); text-decoration: none; }

.chart-edit { padding: 12px 18px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.chart-edit label { font-size: 12px; color: var(--muted); }
.chart-edit input, .chart-edit select { margin-top: 3px; padding: 6px 10px; font-size: 13px; }

/* ---------------- Public shared board ---------------- */

body.shared { display: block; padding: 0; background: var(--page); }
.shared-wrap { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }
.shared-head {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.shared-head h1 { font-size: 25px; margin: 0; }
.shared-head .sub { color: var(--muted); margin: 5px 0 0; }
.shared-brand { margin-left: auto; display: flex; align-items: center; gap: 10px; text-align: right; }
.shared-brand .logo-mark { font-size: 21px; color: var(--accent); }
.shared-brand b { display: block; font-size: 14px; }
.shared-brand small { color: var(--muted); font-size: 11.5px; }
.shared-foot {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; text-align: center;
}

/* ---------------- Auth & installer ---------------- */

body.plain { background: var(--page); display: grid; place-items: start center; padding: 6vh 20px 60px; }
.auth, .installer { width: 100%; max-width: 460px; }
.installer { max-width: 620px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.brand-lockup .logo-mark {
  font-size: 26px; color: var(--accent); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; width: 46px; height: 46px;
  display: grid; place-items: center;
}
.brand-lockup h1 { margin: 0; font-size: 21px; }
.brand-lockup .sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.auth .card, .installer .card { box-shadow: var(--shadow); }
.auth .alt { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.demo-creds {
  margin-top: 16px; font-size: 12.5px; color: var(--ink-2);
  background: var(--sunken); border-radius: 8px; padding: 11px 13px;
}
.demo-creds b { font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13.5px; }
.steps li { padding: 7px 12px; border-radius: 7px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line); }
.steps li.ok::before  { content: "✓ "; color: var(--good); font-weight: 700; }
.steps li.bad { background: #fceded; border-color: #f0c9c9; color: #99201f; }
.steps li.bad::before { content: "✗ "; font-weight: 700; }
.ok-card { border-color: #c7e8c7; }

/* ---------------- Utility ---------------- */

.stack { display: grid; gap: 16px; }
.inline-form { display: inline; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line);
}
.split { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }

@media print {
  .sidebar, .topbar, .btn, .suggest, .pager { display: none !important; }
  .content { padding: 0; }
  .card, .chart-card { break-inside: avoid; box-shadow: none; }
}
