/* Message & Error Explainer. Colours are the other tools' tokens (copied exactly),
   so the platform reads as one; the timeline uses the fixed status colours, each
   with a shape of its own and a label, never colour alone. */

:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f3f2ee;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --good-ink: #006300; --warning-ink: #8a5a00; --critical-ink: #b3261e; --critical: #d03b3b;
  --accent: #2a78d6; --focus: #2a78d6;
  --grid: #e1e0d9; --axis: #c3c2b7; --series-1: #2a78d6;
  --st-critical: #d03b3b; --st-serious: #ec835a; --st-warning: #fab219; --st-info: #898781;
  --band: #e8e7e1; --band-2: #dddcd4; --armed: #2a78d6;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 2px 8px rgba(11, 11, 11, 0.04);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --border: rgba(255, 255, 255, 0.10);
    --good-ink: #0ca30c; --warning-ink: #fab219; --critical-ink: #e66767;
    --accent: #3987e5; --focus: #6da7ec;
    --grid: #2c2c2a; --axis: #383835; --series-1: #3987e5; --shadow: none;
    --band: #2c2c2a; --band-2: #383835; --armed: #3987e5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --good-ink: #0ca30c; --warning-ink: #fab219; --critical-ink: #e66767;
  --accent: #3987e5; --focus: #6da7ec;
  --grid: #2c2c2a; --axis: #383835; --series-1: #3987e5; --shadow: none;
  --band: #2c2c2a; --band-2: #383835; --armed: #3987e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font);
             font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
body.loading .layout { visibility: hidden; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { overflow-wrap: anywhere; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
          flex-wrap: wrap; padding: 10px 20px; background: var(--surface);
          border-bottom: 1px solid var(--border); }
.back { color: var(--accent); text-decoration: none; white-space: nowrap; }
.back:hover { text-decoration: underline; }
.brand { min-width: 0; }
.brand h1 { font-size: 16px; font-weight: 650; margin: 0; }
.subtitle { margin: 0; color: var(--ink-2); font-size: 13px; }
.actions { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; border: 1px solid var(--border);
       background: var(--surface); border-radius: 8px; padding: 5px 11px; cursor: pointer;
       white-space: nowrap; text-decoration: none; color: inherit; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 2px 8px; font-size: 12.5px; }
.actions select { width: auto; margin-top: 0; padding: 5px 8px; }

.layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 16px;
          padding: 16px 20px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 12px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 6px; }
.card h3 { font-size: 13.5px; margin: 14px 0 4px; color: var(--ink-2); }
.results { display: grid; gap: 16px; min-width: 0; }
.form { position: sticky; top: 70px; max-height: calc(100vh - 86px); overflow: auto; }
@media (max-width: 900px) { .form { position: static; max-height: none; } }
#copter-bar { margin-bottom: 12px; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
legend, label { font-weight: 600; font-size: 13px; padding: 0; }
.form h2 label { font-size: 15px; font-weight: 650; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label { display: block; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); }
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
#query { font-size: 14px; padding: 8px 10px; border-width: 1.5px; border-color: var(--axis); }
#query:focus { border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.muted { color: var(--ink-2); }
.error-box { margin-top: 10px; padding: 8px 10px; border-radius: 8px; color: var(--critical-ink);
             border: 1px solid var(--critical); }
.examples { margin-top: 6px; gap: 6px; }
.example { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--surface-2);
           border: 1px solid var(--border); border-radius: 99px; padding: 1px 9px; cursor: pointer;
           max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.example:hover { border-color: var(--accent); color: var(--ink); }

.drop { margin-top: 12px; border: 1.5px dashed var(--axis); border-radius: 10px; padding: 12px;
        display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drop.over { border-color: var(--accent); background: var(--surface-2); }
.drop .hint { flex-basis: 100%; }
.file-btn { cursor: pointer; }
.status { margin-top: 10px; font-size: 13px; }
.status p { margin: 2px 0; }
.status .ok { color: var(--good-ink); }
.status .warn { color: var(--warning-ink); }
.status .bad { color: var(--critical-ink); }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); }

.topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.topic { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 10px; border: 1px solid var(--border);
         border-radius: 99px; background: var(--surface-2); text-decoration: none; color: inherit; font-size: 13px; }
.topic:hover, .topic.on { border-color: var(--accent); }
.topic.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.topic .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* results */
.lead { margin: 0 0 6px; color: var(--ink-2); }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
.common { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 8px; }
.pick { display: grid; gap: 1px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
        text-decoration: none; color: inherit; background: var(--surface-2); min-width: 0;
        border-left: 4px solid var(--axis); text-align: left; cursor: pointer; }
.pick:hover { border-color: var(--accent); }
.pick .t { font-weight: 600; overflow-wrap: anywhere; }
.pick .m { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.pick.critical { border-left-color: var(--st-critical); }
.pick.blocker { border-left-color: var(--st-serious); }
.pick.warning { border-left-color: var(--st-warning); }

.said { font-family: var(--mono); font-size: 13.5px; margin: 0; overflow-wrap: anywhere; }
.said .blank { color: var(--accent); }
.xcard { border-left: 4px solid var(--axis); }
.xcard.critical { border-left-color: var(--st-critical); }
.xcard.blocker { border-left-color: var(--st-serious); }
.xcard.warning { border-left-color: var(--st-warning); }
.xcard-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.xcard-head h2 { margin: 0; font-size: 16px; }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0; }
.level { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; white-space: nowrap;
         border-radius: 99px; padding: 1px 9px; border: 1px solid var(--border); background: var(--surface-2); }
.level svg { width: 10px; height: 10px; flex: none; }
.level.critical svg { fill: var(--st-critical); }
.level.blocker svg { fill: var(--st-serious); }
.level.warning svg { fill: var(--st-warning); }
.level.info svg, .level.unknown svg { fill: var(--st-info); }
.tag { font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border);
       border-radius: 99px; padding: 0 7px; white-space: nowrap; font-weight: 500; }
.tag.fits { color: var(--good-ink); border-color: color-mix(in srgb, var(--good-ink) 40%, transparent); }
.tag.absent { color: var(--warning-ink); }
.means { margin: 8px 0 0; }
.causes { margin: 6px 0 0; padding-left: 0; list-style: none; counter-reset: cause; display: grid; gap: 8px; }
.cause { counter-increment: cause; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px;
         padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.cause::before { content: counter(cause); grid-row: 1 / span 4; font-weight: 700; color: var(--muted);
                 font-variant-numeric: tabular-nums; min-width: 14px; }
.cause.fits { border-color: color-mix(in srgb, var(--good-ink) 45%, transparent); }
.cause .what { font-weight: 600; }
.cause p { margin: 0; grid-column: 2; overflow-wrap: anywhere; }
.cause .k { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em;
            margin-right: 6px; }
.note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
        border-left: 4px solid var(--accent); background: var(--surface-2); font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: 13px; }
.also { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.also .said { display: inline; font-size: 12.5px; }
.plain { margin: 8px 0 0; padding-left: 18px; }
.plain li { margin: 3px 0; }

.params { border-collapse: collapse; width: 100%; font-size: 13px; }
.params td, .params th { text-align: left; vertical-align: top; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.params th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.params td.name { white-space: nowrap; }
.params td.value { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.params td.label { color: var(--ink-2); overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }

details.code { margin-top: 10px; }
details.code > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.site { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
pre.snippet { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
              border: 1px solid var(--border); overflow-x: auto; font-family: var(--mono); font-size: 12px;
              line-height: 1.4; tab-size: 4; }
pre.snippet .ln { color: var(--muted); user-select: none; display: inline-block; width: 4ch; text-align: right;
                  margin-right: 10px; }
pre.snippet .hit { background: color-mix(in srgb, var(--st-warning) 22%, transparent); display: inline-block; min-width: 100%; }

/* a log's report */
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.rlist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.ritem { border: 1px solid var(--border); border-left: 4px solid var(--axis); border-radius: 8px; min-width: 0; }
.ritem.critical { border-left-color: var(--st-critical); }
.ritem.blocker { border-left-color: var(--st-serious); }
.ritem.warning { border-left-color: var(--st-warning); }
.ritem > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 10px;
                   cursor: pointer; list-style: none; }
.ritem > summary::-webkit-details-marker { display: none; }
.ritem > summary:hover { background: var(--surface-2); }
.ritem .title { font-weight: 600; overflow-wrap: anywhere; }
.ritem .line { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; grid-column: 1; }
.ritem .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums;
               grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.ritem .body { padding: 2px 12px 12px; border-top: 1px solid var(--border); }
.ritem.flash { outline: 2px solid var(--focus); outline-offset: 1px; }
.fold > summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-top: 4px; }

/* the timeline */
.chart { margin: 10px 0 0; min-width: 0; }
.chart figcaption { font-size: 13px; margin-bottom: 4px; font-weight: 650; }
svg.plot { width: 100%; height: auto; display: block; overflow: visible; }
svg.plot .grid { stroke: var(--grid); stroke-width: 1; }
svg.plot .tick, svg.plot .lane-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.plot .lane-label { fill: var(--ink-2); }
svg.plot .armed { fill: var(--armed); }
svg.plot .mode { fill: var(--band); }
svg.plot .mode.alt { fill: var(--band-2); }
svg.plot .mode-label { fill: var(--ink-2); font-size: 10.5px; pointer-events: none; }
svg.plot .mark { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
svg.plot .mark.critical { fill: var(--st-critical); }
svg.plot .mark.blocker { fill: var(--st-serious); }
svg.plot .mark.warning { fill: var(--st-warning); }
svg.plot .mark.info, svg.plot .mark.unknown { fill: var(--st-info); }
svg.plot .hit { fill: transparent; cursor: pointer; }
svg.plot .hit:hover + .mark, svg.plot .hit:focus + .mark { stroke: var(--ink); }
svg.plot .mode-label, svg.plot .tick { pointer-events: none; }
.tooltip { position: fixed; z-index: 30; pointer-events: none; background: var(--surface);
           border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; font-size: 12.5px;
           box-shadow: var(--shadow); max-width: min(420px, 90vw); }
.tooltip b { font-variant-numeric: tabular-nums; }
.tooltip .tt-line { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

/* an explanation's own page, and the list of them all (pages.py) */
.brand .name { font-size: 16px; font-weight: 650; margin: 0; }
.brand .name a { color: inherit; text-decoration: none; }
.article { max-width: 860px; margin: 0 auto; padding: 16px 20px; }
.article h1 { font-size: 20px; line-height: 1.3; margin: 0; }
.article .card h2 { font-size: 15px; margin: 16px 0 6px; }
.article .card > h2:first-child { margin-top: 0; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.says { margin: 10px 0 0; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase;
        letter-spacing: .02em; }
.said-list { margin-top: 2px; list-style: none; padding-left: 0; }
.more .lead { margin-bottom: 10px; }
.page .about { max-width: 860px; margin: 0 auto; }
@media (max-width: 600px) { .article { padding: 12px; } }

.about { padding: 4px 20px 24px; color: var(--muted); font-size: 12.5px; }
.about a { color: var(--ink-2); }
@media (max-width: 900px) { .about { padding: 4px 12px 20px; } }
@media (max-width: 600px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .card { padding: 12px; }
  .ritem > summary { grid-template-columns: minmax(0, 1fr); }
  .ritem .when { grid-row: auto; grid-column: 1; text-align: left; }
}
