/* The verification report (layouts/railcheck/report.html, static/foras-labs/report.js): a cover, a one-page
   executive summary, then the full report. Readable on screen, printable as A4. Colours follow
   _graphic_identity/colors.md: violet = holds, pink = breaks, amber = this rule set (attention), grey = unknown;
   the cover's lines are the simulator's train colours (the route each train takes). */
body.report {
  --holds: #8d40a7; --breaks: #f4539c; --breaks-text: #e40f6f; --mark: #f3be18;   /* from _graphic_identity/palette.css */
  --r1: #0a55f5; --r2: #10b950; --r3: #8e949b;                                    /* the trains: blue, green, silver */
}
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.report { --holds: #8969cf; --breaks-text: #f4539c; } }
html[data-theme="dark"] body.report { --holds: #8969cf; --breaks-text: #f4539c; }

.rp { max-width: 1000px; }
.rp-eyebrow { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0; }

/* cover */
.rp-cover { padding: 18px 0 8px; }
.rp-cover > .rp-eyebrow { display: none; }   /* the breadcrumb says it on screen; print shows this instead */
.rp-cover h1 { font-size: clamp(48px, 9vw, 104px); line-height: .92; letter-spacing: -.045em; font-weight: 800; margin: 14px 0 12px; }
/* the purpose of the page under the title, set like the status page's lede (status.css .st-lede) */
.rp-lede { max-width: 720px; color: var(--muted); font-size: 18px; margin: 0 0 8px; }
.rp-sub { font: 14px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0; }
.rp-map { display: block; width: 100%; height: auto; margin: 26px 0 10px; }
.rp-map path { fill: none; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.rp-map .r1 { stroke: var(--r1); } .rp-map .r2 { stroke: var(--r2); } .rp-map .r3 { stroke: var(--r3); }
.rp-map .sig { fill: var(--ink); }
.rp-map .stop-o { stroke: var(--ink); stroke-width: 22; stroke-linecap: round; }
.rp-map .stop-i { stroke: var(--paper); stroke-width: 13; stroke-linecap: round; }
.rp-map text { font: 15px var(--mono); fill: var(--ink); letter-spacing: .04em; }
.rp-map .rl { font-weight: 700; font-size: 17px; }
.rp-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 18px 0 0; border-top: 2px solid var(--ink); }
.rp-meta div { padding: 10px 14px 10px 0; border-bottom: 1px dotted var(--line); }
.rp-meta dt { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rp-meta dd { margin: 4px 0 0; font-size: 14px; }
.rp-cover .fl-actions { margin-top: 20px; }
.rp-pick { font: 12px var(--mono); color: var(--muted); margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.rp-pick label { display: inline-flex; gap: 5px; align-items: center; color: var(--ink); cursor: pointer; }

/* the executive summary: an A4 sheet on screen, one page in print */
.rp-exec { border: 1px solid var(--line); border-radius: 12px; padding: 30px 34px; margin: 34px 0 10px; background: var(--paper); }
.rp-exec > header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.rp-verdict { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.02em; margin: 18px 0 20px; font-weight: 700; }
.rp-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rp-chip { border: 1px solid var(--line); border-top: 5px solid var(--muted); border-radius: 6px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; }
.rp-chip.ok { border-top-color: var(--holds); } .rp-chip.bad { border-top-color: var(--breaks); }
.rp-chip .mk { grid-row: span 3; font: 700 15px var(--mono); }
.rp-chip.ok .mk { color: var(--holds); } .rp-chip.bad .mk { color: var(--breaks-text); }
.rp-chip b { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 400; }
.rp-chip .v { font: 600 15px var(--mono); }
.rp-chip .n { font-size: 12px; color: var(--muted); }
.rp-bigs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0 18px; border-top: 1px dotted var(--muted); border-bottom: 1px dotted var(--muted); }
.rp-big { padding: 12px 12px 12px 0; }
.rp-big b { display: block; font: 700 clamp(30px, 4.4vw, 46px)/1 var(--mono); letter-spacing: -.04em; }
.rp-big b small { font-size: .45em; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.rp-big span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rp-props { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.rp-props li { font-size: 12.5px; line-height: 1.3; border-left: 4px solid var(--muted); padding: 4px 8px; background: var(--wash); border-radius: 0 4px 4px 0; }
.rp-props li b { font: 700 12px var(--mono); margin-right: 6px; }
.rp-props li span { display: block; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.rp-props li.ok { border-left-color: var(--holds); } .rp-props li.ok span { color: var(--holds); }
.rp-props li.bad { border-left-color: var(--breaks); } .rp-props li.bad span { color: var(--breaks-text); }
.rp-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; }
.rp-cols h3 { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px; }
.rp-cols ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.rp-cols li + li { margin-top: 6px; }
.rp-exec > footer { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); font: 11px/1.5 var(--mono); color: var(--muted); }

/* the full report */
.rp-sec { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 18px; }
/* section numbers: a square centred on the heading's text, not sitting on its baseline */
.rp-sec h2 { font-size: 22px; margin: 0 0 12px; display: flex; gap: 14px; align-items: center; }
.rp-sec h2 span { font: 700 13px/1 var(--mono); color: var(--paper); background: var(--ink); border-radius: 4px; padding: 5px 7px;
  min-width: 25px; text-align: center; flex: none; }
.rp-sec h3 { font-size: 15px; margin: 18px 0 6px; }
.rp-sec h3 span { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-left: 8px; }
.rp-sec p, .rp-sec li { font-size: 15px; line-height: 1.55; }
.rp-req { margin-bottom: 14px; } .rp-req.off { opacity: .55; }
.rp-req .fl-code { white-space: pre-wrap; min-height: 0; max-height: none; }   /* as tall as its clauses, no more (sim.css sets 220px for the panel) */
.rp-reading { font-size: 13.5px !important; color: var(--muted); }
.rp-tr { margin-top: 14px; }
.rp-witname { font: 600 11px var(--mono) !important; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 2px; }
.rp-wit .rp-trace { margin-top: 2px; }
.rp-wit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; align-items: start; }
.rp-trace { font-size: 14px; margin: 4px 0; }
.rp-note { font-size: 13.5px !important; color: var(--muted); }
.fl-table td.num { font: 12px var(--mono); white-space: nowrap; }
.fl-table td.mx { font: 11px var(--mono); text-align: center; color: var(--muted); }
.fl-table td.mx b { color: var(--holds); text-transform: uppercase; letter-spacing: .06em; }
.report .fl-table tr.ok .res { color: var(--holds); } .report .fl-table tr.bad .res { color: var(--breaks-text); }
.rp-mk { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; font: 700 13px var(--mono); color: #fff; }
.rp-mk.ok { background: var(--holds); } .rp-mk.bad { background: var(--breaks); } .rp-mk.unk { background: var(--muted); }

/* figure 1: the property landscape (32 rule sets × 7 properties), after a contributions grid */
.rp-fig { margin: 8px 0 22px; }
.rp-land { display: grid; grid-template-columns: 30px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; align-items: center; }
.rp-land .rl { font: 700 11px var(--mono); }
.rp-land i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 3px; font: 700 10px var(--mono); font-style: normal; color: #fff; }
.rp-land i.ok { background: var(--holds); } .rp-land i.bad { background: var(--breaks); }
.rp-land i.cur { outline: 2px solid var(--mark); outline-offset: 1px; }
.rp-land .cl { font: 9px var(--mono); color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; padding-top: 4px; }
.rp-land .cl.cur { color: var(--ink); font-weight: 700; }
.rp-legend { font: 11px var(--mono); color: var(--muted); display: flex; gap: 14px; align-items: center; margin: 10px 0 6px; flex-wrap: wrap; }
.rp-legend .sw { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 3px; margin-right: -8px; font-size: 9px; color: #fff; vertical-align: -2px; }
.rp-legend .sw.ok { background: var(--holds); } .rp-legend .sw.bad { background: var(--breaks); }
.rp-legend .sw.cur { outline: 2px solid var(--mark); outline-offset: 1px; }
.rp-fig figcaption { font-size: 13.5px; color: var(--muted); }
.rp-fig figcaption b { font: 600 12px var(--mono); text-transform: uppercase; color: var(--ink); }

@media (max-width: 720px) {
  .rp-exec { padding: 20px 18px; }
  .rp-strip, .rp-bigs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-cols { grid-template-columns: 1fr; }
  .rp-land { overflow-x: auto; grid-template-columns: 26px repeat(var(--cols), 14px); }
}

/* print: A4, page numbers, the cover and the summary on pages of their own; or the summary alone */
@page { size: A4; margin: 15mm 14mm 17mm;
  @bottom-left { content: "Verification report · Station"; font: 8pt ui-monospace, Menlo, monospace; color: #6a6f78; }
  @bottom-right { content: counter(page) " / " counter(pages); font: 8pt ui-monospace, Menlo, monospace; color: #6a6f78; } }
@page :first { @bottom-left { content: none; } @bottom-right { content: none; } }
@media print {
  .site-head, .site-foot, .fl-sitemap, .rp-noprint, .rp > .fl-eyebrow { display: none !important; }
  html, body { background: #fff !important; color: #14161a; }
  body.report { --holds: #8d40a7; --breaks-text: #e40f6f; --ink: #14161a; --paper: #fff; --muted: #6a6f78; --line: #e4e5e8; --wash: #f6f6f4; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp { max-width: none; padding: 0; margin: 0; }
  .rp-cover > .rp-eyebrow { display: block; }
  .rp-cover { min-height: 255mm; display: flex; flex-direction: column; justify-content: center; break-after: page; }
  .rp-exec { border: 0; padding: 0; margin: 0; break-after: page; font-size: 92%; }
  .rp-exec .rp-verdict { margin: 12px 0 14px; font-size: 22px; }
  .rp-sec h2, .rp-sec h3 { break-after: avoid; }
  .fl-table tr, .rp-tr, .rp-req, .rp-fig, .rp-chip { break-inside: avoid; }
  .rp-land .cl { font-size: 7pt; }
  a { color: inherit; text-decoration: none; }
  body.print-exec .rp-cover, body.print-exec .rp-body { display: none !important; }
  body.print-exec .rp-exec { break-after: auto; }
}
