/* Styles specific to the match tool. Loaded in addition to styles.css, which
   owns the suite-wide tokens, typography and footer chrome. Kept separate so
   the shared stylesheet stays the shared stylesheet. */

/* ===== Layout ===== */
.match { max-width: 980px; margin: 0 auto; padding: 24px 20px 48px; }

/* `hidden` has to win over any display rule we set below. Without this, giving
   an element display:inline-block silently defeats the attribute and the element
   stays on screen while the JS believes it is hidden. */
[hidden] { display: none !important; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
/* The numbered badge is drawn by .num, so the list's own marker would show the
   number twice. ::marker needs killing separately from list-style in some
   engines. */
.steps > li { list-style: none; }
.steps > li::marker { content: none; }

.step {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg2);
  padding: 20px;
}
/* A step that cannot be used yet reads as dimmed rather than disappearing, so
   the shape of the whole task stays visible from the start. */
.step[data-locked] { opacity: 0.45; pointer-events: none; }

.step h2 { font-size: 17px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.step .num {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg4); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hint { color: var(--dim); margin: 0 0 14px; max-width: 62ch; }
.hint a { color: var(--accent); }
.note {
  color: var(--dim); font-size: 13px; margin: 10px 0 0;
  border-left: 2px solid var(--bg4); padding-left: 10px; max-width: 62ch;
}

/* ===== Fields ===== */
.field { display: grid; gap: 6px; max-width: 340px; }
.field > span { font-size: 13px; color: var(--ink2); }
.field select {
  background: var(--bg3); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 9px 10px; font-family: var(--font-ui); font-size: 14px;
}

/* ===== Dropzone ===== */
.dropzone {
  border: 1px dashed var(--bg4); border-radius: 8px;
  background: var(--bg); padding: 28px 20px;
  display: grid; gap: 6px; justify-items: center; text-align: center;
  cursor: pointer; transition: border-color 120ms, background 120ms;
}
.dropzone.is-over, .dropzone:hover { border-color: var(--accent); background: var(--bg3); }
.dz-main { color: var(--ink2); font-size: 15px; }
.dz-sub { color: var(--faint); font-size: 12px; max-width: 46ch; }

.file-status {
  margin-top: 12px; padding: 10px 12px; border-radius: 6px;
  background: var(--bg3); font-size: 13px; color: var(--ink2);
}
.file-status.is-ok { border-left: 3px solid var(--green); }
.file-status.is-error { border-left: 3px solid var(--red); color: var(--ink); }
.file-status .warn { display: block; margin-top: 6px; color: var(--dim); font-size: 12px; }

/* ===== Preview + marquee ===== */
.stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; }
.stage canvas {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 6px; cursor: crosshair;
}
.marquee {
  position: absolute; pointer-events: none;
  border: 1px solid var(--accent);
  background: rgba(88, 166, 255, 0.12);
}

/* ===== Results ===== */
.results { margin-top: 32px; }
.results h2 { font-size: 20px; margin: 0 0 16px; }
.results h3 { font-size: 15px; margin: 28px 0 6px; }

.confidence {
  border-radius: 6px; padding: 12px 14px; margin-bottom: 20px;
  background: var(--bg2); border-left: 3px solid var(--bg4);
}
.confidence.is-high { border-left-color: var(--green); }
.confidence.is-medium { border-left-color: #d29922; }
.confidence.is-low, .confidence.is-none { border-left-color: var(--red); }
.conf-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.confidence ul { margin: 8px 0 0; padding-left: 18px; color: var(--dim); font-size: 13px; }

.finding {
  border: 1px solid var(--rule); border-left-width: 3px;
  border-radius: 6px; padding: 14px; margin-bottom: 12px; background: var(--bg2);
}
.finding.is-good { border-left-color: var(--green); }
.finding.is-info { border-left-color: var(--accent); }
.finding.is-warning { border-left-color: #d29922; }
.finding.is-error { border-left-color: var(--red); }
.finding h4 { margin: 0 0 6px; font-size: 15px; }
.finding p { margin: 0 0 8px; color: var(--ink2); max-width: 68ch; }
.finding p:last-child { margin-bottom: 0; }

/* The teaching line is the point of the tool, not decoration. It stays visible
   and legible rather than hiding behind a tooltip or a disclosure triangle. */
.finding .teach, .finding .fix { font-size: 13px; color: var(--dim); }
.finding .teach span, .finding .fix span {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); margin-right: 8px;
}

.numbers { border-collapse: collapse; margin-top: 10px; min-width: 320px; }
.numbers th, .numbers td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rule); }
.numbers th { font-weight: 500; color: var(--ink2); font-size: 14px; }
.mono { font-family: var(--font-mono); font-size: 14px; }

.basis { margin-top: 20px; color: var(--dim); font-size: 13px; }
.basis summary { cursor: pointer; color: var(--ink2); }

.action {
  margin-top: 22px; padding: 10px 16px;
  background: var(--bg3); color: var(--ink);
  border: 1px solid var(--bg4); border-radius: 6px;
  font-family: var(--font-ui); font-size: 14px; cursor: pointer;
}
.action:hover { border-color: var(--accent); }

/* ===== Accessibility ===== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 560px) {
  .match { padding: 16px 14px 40px; }
  .step { padding: 16px; }
}
