/* Selected GOV.UK Frontend patterns, adapted from miaow-web.
   See GOVUK-LICENSE.txt. No framework CSS or JavaScript is loaded. */
@font-face {
  font-family: "GDS Transport";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/light-94a07e06a1-v2.woff2") format("woff2");
}
@font-face {
  font-family: "GDS Transport";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/bold-b542beb274-v2.woff2") format("woff2");
}
:root {
  --text: #0b0c0c;
  --muted: #505a5f;
  --line: #b1b4b6;
  --blue: #1d70b8;
  --green: #00703c;
  --red: #ca3535;
  --focus: #ffdd00;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 1.1875rem/1.31579 "GDS Transport", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: .15em; }
a:hover { color: #003078; text-decoration-thickness: 3px; }
a:focus-visible {
  outline: 3px solid transparent;
  color: var(--text);
  background: var(--focus);
  box-shadow: 0 -2px var(--focus), 0 4px var(--text);
  text-decoration: none;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 15px; top: 15px; z-index: 5; padding: 10px; background: var(--focus); color: var(--text); }
.topbar { background: var(--blue); color: #fff; }
.header-inner { max-width: 960px; margin: auto; min-height: 70px; display: flex; align-items: center; }
.brand { color: #fff; font-size: 1.875rem; font-weight: 700; text-decoration: none; }
.brand:hover { color: #fff; text-decoration: underline; }
main { max-width: 960px; margin: 0 auto; padding: 50px 0 60px; }
main:focus { outline: none; }
.kicker { margin: 0 0 10px; color: var(--muted); font-size: 1.5rem; }
h1 { max-width: 700px; margin: 0 0 30px; font-size: 3rem; line-height: 1.04167; font-weight: 700; }
.sub { max-width: 650px; margin: 0 0 30px; }
.upload { max-width: 630px; min-height: 260px; border: 2px dashed var(--line); background: #f3f2f1; display: grid; place-items: center; cursor: pointer; }
.upload:hover, .upload.over { border-color: var(--blue); background: #e8f1f8; }
.upload:focus-visible { outline: 3px solid var(--focus); border: 2px solid var(--text); }
.upload-inner { padding: 30px; text-align: center; }
.upload-mark { font-size: 2rem; font-weight: 700; margin-bottom: 15px; }
.upload strong { display: table; margin: 0 auto 15px; }
.upload span { display: block; }
.file-hint { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.button {
  position: relative;
  display: inline-block;
  padding: 8px 15px 7px;
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 0 #002d18;
  font: inherit;
  cursor: pointer;
}
.button:hover, .upload:hover .button { background: #005a30; }
.button:focus-visible, .upload:focus-visible .button { outline: 3px solid var(--focus); border-color: var(--text); background: var(--focus); color: var(--text); box-shadow: 0 2px 0 var(--text); }
.button:active { top: 2px; box-shadow: none; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 30px; }
.viewport, .side, .chart, .result-image { border: 1px solid var(--line); }
.panel-head { min-height: 50px; padding: 12px 15px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 700; }
.panel-head b { color: #144e81; background: #d2e2f1; padding: 3px 7px; font-size: .875rem; }
.canvas-wrap { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; background: #f3f2f1; }
canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.scanline { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--blue); animation: scan 1.9s linear infinite; pointer-events: none; }
@keyframes scan { to { top: 100%; } }
.side { align-self: start; padding-bottom: 20px; }
.stage-list { margin: 0; padding: 5px 15px 20px; list-style: none; font-size: 1rem; }
.stage-list li { display: flex; gap: 10px; padding: 12px 0; color: var(--muted); border-bottom: 1px solid #d8dadb; }
.stage-list li::before { content: "○"; }
.stage-list li.active { color: var(--blue); font-weight: 700; }
.stage-list li.active::before { content: "◉"; }
.stage-list li.done { color: var(--green); }
.stage-list li.done::before { content: "✓"; }
.progress-block { padding: 0 15px; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: .875rem; }
.track, .metric-bar { height: 8px; background: #e5e6e7; overflow: hidden; }
.fill { width: 0; height: 100%; background: var(--blue); transition: width .18s linear; }
.error { border: 5px solid var(--red); padding: 25px; max-width: 630px; }
.error-code { color: var(--red); font-size: 1rem; font-weight: 700; margin: 0 0 15px; }
.error h2 { margin: 0 0 20px; font-size: 2.25rem; }
.error p { margin-bottom: 25px; }
.result-image { margin-bottom: 30px; }
.result-head { margin-bottom: 30px; padding: 35px; background: var(--red); color: #fff; text-align: center; }
.cat-mode .result-head { background: var(--green); }
.result-head .kicker { color: #fff; font-size: 1.1875rem; }
.result-head h2 { margin: 0; }
.result-yes { display: block; font-size: 5rem; line-height: 1.1; }
.result-diagnosis { display: block; margin-top: 10px; font-size: 2.25rem; line-height: 1.15; }
.confidence { margin-top: 25px; }
.confidence small { display: block; margin-bottom: 5px; font-size: 1rem; }
.confidence strong { font-size: 2.25rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px; margin-bottom: 30px; }
.metric { padding: 15px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-name { margin: 0; font-size: 1rem; font-weight: 700; min-height: 2.7em; }
.metric-value { margin: 10px 0 15px; font-size: 2.25rem; font-weight: 700; }
.metric-bar i { display: block; width: 0; height: 100%; background: var(--blue); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.chart { min-width: 0; }
.chart-body { height: 230px; padding: 20px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.grid-line, .radar-grid { fill: none; stroke: #b1b4b6; stroke-width: 1; }
.plot-line { fill: none; stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plot-fill { fill: #1d70b81a; }
.radar { fill: #1d70b826; stroke: var(--blue); stroke-width: 2; }
.axis-label { fill: var(--muted); font: 9px "GDS Transport", Arial, sans-serif; }
.actions { display: flex; }
@media (min-width: 781px) {
  .result-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; margin-bottom: 30px; }
  .result-overview .result-image, .result-overview .result-head { min-width: 0; margin-bottom: 0; }
  .result-overview .canvas-wrap { height: 320px; min-height: 0; }
  .result-overview canvas { max-height: 320px; }
  .result-overview .result-head { display: flex; flex-direction: column; justify-content: center; padding: 30px; }
}
@media (max-width: 1020px) {
  main, .header-inner { margin-left: 30px; margin-right: 30px; }
}
@media (max-width: 780px) {
  .workspace, .charts { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  main, .header-inner { margin-left: 15px; margin-right: 15px; }
  main { padding-top: 30px; }
  .header-inner { min-height: 60px; }
  h1 { font-size: 2rem; line-height: 1.1; }
  .kicker { font-size: 1.125rem; }
  .upload { min-height: 240px; }
  .canvas-wrap { min-height: 240px; }
  .result-head { padding: 25px 15px; }
  .result-yes { font-size: 3.5rem; }
  .result-diagnosis, .error h2 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .scanline { animation: none; top: 50%; }
  .fill { transition: none; }
}

.upload-disclaimer { max-width: 630px; margin: 20px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
