/* ============================================================
   GI HORMONE MATCHER — component stylesheet.

   Lifted VERBATIM from the approved prototype. Every rule is prefixed
   with the root class `.hmatch` so nothing here leaks onto a page and no
   page rule reaches in. Scoping is the ONLY change: not one colour,
   size or font-size has been altered. The header sizes in particular
   (thead th 15px, td.name 16px, .prompt .q 19px, .done .score 40px)
   were set deliberately on review and are untouched.

   The prototype's `body` rule carried the font stack and ink colour for
   its content; those move onto `.hmatch` itself, which is the component
   root — same values, same effect.

   Three additions required by the build prompt, marked below: the row
   focus ring (§4.5), the reserved quiz height (§4.6), and the tab
   semantics (§4.3) which need no new visual values because `.tab.on`
   already carries the selected look.
   ============================================================ */

.hmatch, .hmatch * { box-sizing: border-box; }

.hmatch {
  background: #FFFFFF;
  color: #111111;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.hmatch .wrap { max-width: 980px; margin: 0 auto; }
.hmatch h1 { font-size: 21px; margin: 0 0 4px; }
.hmatch .sub { font-size: 14px; margin: 0 0 18px; }

.hmatch .tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.hmatch button.tab {
  font: inherit; font-size: 14px; font-weight: 700;
  padding: 9px 18px; border-radius: 9px; cursor: pointer;
  background: #FFFFFF; color: #111111; border: 2px solid #B8B8B8;
}
.hmatch button.tab.on { background: #E8F4F8; border-color: #2E7C9A; }

/* ---------- compare table ---------- */
.hmatch .tablewrap { overflow-x: auto; }
.hmatch table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.hmatch th, .hmatch td { text-align: left; padding: 12px 14px; font-size: 13px; vertical-align: top; }
.hmatch thead th {
  font-size: 15px; font-weight: 700; letter-spacing: .01em;
  padding-bottom: 10px;
  border-bottom: 2px solid #D8D2C7; white-space: nowrap;
}
.hmatch tbody tr { cursor: pointer; }
.hmatch tbody tr + tr td { border-top: 1px solid #EDE8DF; }
.hmatch tbody tr:hover td, .hmatch tbody tr:focus-visible td { background: #FAF7F1; }
.hmatch tbody tr.on td { background: #FAF7F1; }
.hmatch td.name { font-weight: 700; font-size: 16px; white-space: nowrap; }
.hmatch .swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 8px; vertical-align: middle;
}
.hmatch tbody tr.on td.name { box-shadow: inset 4px 0 0 0 currentColor; }
.hmatch .dim { opacity: .38; }

.hmatch .logic {
  margin-top: 14px; border-radius: 10px; padding: 13px 15px;
  border: 2px solid #C9922A; background: #FFF1D2;
}
.hmatch .logic .h { font-size: 13px; font-weight: 700; letter-spacing: .02em; margin-bottom: 4px; }
.hmatch .logic .b { font-size: 14px; }

.hmatch .hint { font-size: 12px; margin-top: 10px; }

/* ---------- match mode ---------- */
.hmatch .prompt {
  border: 2px solid #D8D2C7; border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px;
}
.hmatch .prompt .k { font-size: 13px; font-weight: 700; letter-spacing: .02em; margin-bottom: 8px; }
.hmatch .prompt .q { font-size: 19px; font-weight: 700; line-height: 1.35; }

.hmatch .choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 720px) { .hmatch .choices { grid-template-columns: 1fr 1fr; } }
.hmatch button.choice {
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 14px 10px; border-radius: 10px; cursor: pointer;
  background: #FFFFFF; color: #111111; border: 2px solid #B8B8B8;
}
.hmatch button.choice:disabled { cursor: default; }
.hmatch button.choice.right { background: #EFF4EC; border-color: #4B7B3F; }
.hmatch button.choice.wrong { background: #FAEDEC; border-color: #B4362F; }

.hmatch .feedback { margin-top: 14px; border-radius: 10px; padding: 13px 15px; border: 2px solid #B8B8B8; }
.hmatch .feedback.right { border-color: #4B7B3F; background: #EFF4EC; }
.hmatch .feedback.wrong { border-color: #B4362F; background: #FAEDEC; }
.hmatch .feedback .v { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.hmatch .feedback .t { font-size: 14px; }

.hmatch .bar { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.hmatch .prog { font-size: 13px; font-weight: 700; }
.hmatch button.next {
  font: inherit; font-size: 14px; font-weight: 700;
  padding: 9px 20px; border-radius: 9px; cursor: pointer;
  background: #E8F4F8; color: #111111; border: 2px solid #2E7C9A;
}
.hmatch .done { text-align: center; padding: 30px 20px; }
.hmatch .done .score { font-size: 40px; font-weight: 700; }
.hmatch .done .msg { font-size: 15px; margin: 8px 0 18px; }

.hmatch .hidden { display: none; }

.hmatch .locked { border: 2px solid #B4362F; background: #FAEDEC; border-radius: 10px; padding: 13px 15px; margin-top: 20px; }
.hmatch .locked .h { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.hmatch .locked ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.hmatch .locked li { margin-bottom: 4px; }

/* §4.5 — the rows are keyboard-reachable, so the focus ring has to be
   visible against the row's hover/selected background. The prototype
   only changed the cell background on focus, which is the same colour
   the hover state uses and so reads as nothing when tabbing. */
.hmatch tbody tr:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(10, 132, 255, 0.55);
}
.hmatch button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.35);
}

/* §4.6 — reserve the quiz region's height so switching questions and
   revealing feedback cannot shift the choice buttons under the pointer.
   A floor only: nothing is clipped if the content runs taller. */
.hmatch .quizbody { min-height: 430px; }
@media (max-width: 720px) { .hmatch .quizbody { min-height: 560px; } }
