/* ── KADO CDC Health Check — mobile-first design system ──────────────────
   Type:  Merriweather (serif display) + PT Sans (body) — KADO's pairing
   Brand: deep olive #4e5e42, camel gold #dab788, charcoal on airy white
   Ratings map onto the brand: olive = Strong, gold = Watch, brick = Action
   Base styles target a ~360px phone; min-width queries enhance upward.
   ------------------------------------------------------------------------ */

:root {
  --bg:        #faf8f4;
  --surface:   #ffffff;
  --ink:       #2b2a26;
  --ink-soft:  #6b6a61;
  --olive:     #4e5e42;
  --olive-deep:#3b4832;
  --gold:      #dab788;
  --gold-deep: #a97e3f;
  --line:      #e8e3d8;

  --strong:    #4e5e42;  --strong-bg: #ecefe7;
  --watch:     #a97313;  --watch-bg:  #f7eeda;
  --action:    #a8443a;  --action-bg: #f6e5e1;

  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans:  "PT Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 940px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43,42,38,.04), 0 8px 28px rgba(43,42,38,.06);
}

*, *::before, *::after { box-sizing: border-box; }
/* Let grid/flex children shrink instead of forcing horizontal overflow. */
* { min-width: 0; }

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive); text-underline-offset: 2px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto; padding: .7rem 1.1rem;
  display: flex; align-items: center; gap: .7rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.brand .name { font-family: var(--serif); font-weight: 700; font-size: .95rem; line-height: 1.15; color: var(--olive); }
.brand .name small { display: block; font-family: var(--sans); font-weight: 400; font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--gold-deep); }
.header-spacer { flex: 1; }
.header-link { font-size: .88rem; color: var(--ink-soft); text-decoration: none; white-space: nowrap; padding: .4rem 0; }
.header-link:hover { color: var(--olive); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.75rem 1.1rem 3rem; }
.eyebrow { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin: 0 0 .8rem; }

h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(1.85rem, 8vw, 3rem); line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .6rem; overflow-wrap: break-word; }
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 34em; margin: 0 0 1.75rem; }

/* ── Card + form ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem;
}
label { display: block; font-weight: 700; font-size: .92rem; margin: 1.1rem 0 .4rem; }
label:first-child { margin-top: 0; }
select, input {
  font: inherit; width: 100%; padding: .8rem .85rem; border-radius: 10px;
  border: 1px solid #d8d2c5; background: #fdfcfa; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(78,94,66,.16); }

/* Searchable CDC combobox */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 20; left: 0; right: 0; margin: .35rem 0 0; padding: .3rem;
  list-style: none; max-height: 264px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.combo-opt {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .6rem .65rem; border-radius: 7px; cursor: pointer; font-size: .95rem;
}
.combo-opt .st { flex: none; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.combo-opt:hover, .combo-opt.active { background: var(--strong-bg); }
.combo-opt.active { outline: 2px solid var(--olive); outline-offset: -2px; }
.combo-empty, .combo-hint { padding: .6rem .65rem; color: var(--ink-soft); font-size: .85rem; }
.combo-hint { border-top: 1px solid var(--line); margin-top: .2rem; }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; border: none;
  background: var(--olive); color: #fff; padding: .85rem 1.2rem; border-radius: 10px;
  min-height: 46px; transition: background .15s, transform .05s;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
button:hover, .btn:hover { background: var(--olive-deep); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.btn-block { width: 100%; margin-top: 1.5rem; }

.reassure { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: 1.1rem; font-size: .85rem; color: var(--ink-soft); }
.reassure span::before { content: "✓"; color: var(--olive); font-weight: 700; margin-right: .35rem; }

.msg { margin-top: 1.1rem; font-size: .95rem; color: var(--ink-soft); }
.msg.sent { color: var(--olive); font-weight: 700; }
.hidden { display: none; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 1.75rem 1.1rem 3rem; color: var(--ink-soft); font-size: .85rem; border-top: 1px solid var(--line); }
.foot strong { font-family: var(--serif); color: var(--olive); font-weight: 700; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.report-head { margin-bottom: 1.25rem; }
.report-head h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); margin-bottom: .3rem; }
.report-meta { color: var(--ink-soft); font-size: .93rem; }
.verdict {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-top: 1rem; padding: .7rem .95rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
.verdict .lbl { font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft); }

.pill { display: inline-flex; align-items: center; gap: .4rem; flex: none; font-weight: 700; font-size: .82rem; padding: .25rem .7rem; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.pill.strong { color: var(--strong); background: var(--strong-bg); }
.pill.watch  { color: var(--watch);  background: var(--watch-bg); }
.pill.action { color: var(--action); background: var(--action-bg); }
.pill.na     { color: var(--ink-soft); background: #ece7dc; }
.pill.lg { font-size: .95rem; padding: .3rem .8rem; }

/* Legend */
.legend { margin-bottom: 1.25rem; }
.legend-keys { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin-bottom: .5rem; }
.legend .k { font-size: .74rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; }
.legend .k.strong { color: var(--strong); background: var(--strong-bg); }
.legend .k.watch  { color: var(--watch);  background: var(--watch-bg); }
.legend .k.action { color: var(--action); background: var(--action-bg); }
.legend .k.na     { color: var(--ink-soft); background: #ece7dc; }
.legend p { margin: 0; font-size: .82rem; color: var(--ink-soft); line-height: 1.5; }

.flip {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--action-bg); border: 1px solid #e6b5ad; border-left: 4px solid var(--action);
  color: #7d2e27; padding: .95rem 1.05rem; border-radius: 10px; margin-bottom: 1.5rem;
  font-size: .95rem;
}
.flip .ico { flex: none; font-size: 1.05rem; line-height: 1.35; }
.flip b { color: var(--action); }

.dims { display: flex; flex-direction: column; }
.dim { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.dim:first-child { border-top: none; padding-top: 0; }
.dim-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.dim .name { font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.25; overflow-wrap: break-word; }
.dim-val { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .55rem; margin: .55rem 0; }
.dim-val b { font-size: 1.15rem; }
.dim .muted { color: var(--ink-soft); font-size: .85rem; }
/* Metric explainer — a subtitle under the name */
.dim-desc { font-size: .8rem; color: var(--ink-soft); line-height: 1.5; margin: .3rem 0 .75rem; }
/* Bar-reading cue — sits directly under the track */
.track-hint { font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--gold-deep); margin: .4rem 0 0; }
.na-note { font-size: .8rem; color: var(--gold-deep); margin: .5rem 0 0; font-style: italic; }

/* Zone bar: Strong/Watch/Action bands. Caret above = this CDC; line = peer median. */
.zbar-wrap { position: relative; padding-top: 13px; }
.zbar { position: relative; height: 16px; border-radius: 5px; overflow: hidden; background: #eee; }
.zbar .zone { position: absolute; top: 0; bottom: 0; }
.zbar .zone.strong { background: #bcd0af; }
.zbar .zone.watch  { background: #eedaa4; }
.zbar .zone.action { background: #e6b1a8; }
/* Peer median: a clear dashed dark line through the bar. */
.zbar .zmedian { position: absolute; top: -1px; bottom: -1px; width: 0; transform: translateX(-1px);
  border-left: 2px dashed rgba(43,42,38,.85); }
/* This CDC: a solid caret sitting just above the bar, tip pointing down at the spot. */
.zmarker { position: absolute; top: 0; transform: translateX(-50%); width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--ink); }
.zbar-ends { display: flex; justify-content: space-between; font-size: .68rem; color: var(--ink-soft); margin-top: .25rem; }
/* Legend marker glyphs */
.lg-caret { color: var(--ink); }
.lg-line { color: rgba(43,42,38,.85); font-weight: 700; }

/* Methodology */
.method { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.method h2 { font-family: var(--serif); font-size: 1.05rem; color: var(--olive); margin: 0 0 .6rem; }
.method ul { margin: 0; padding-left: 1.1rem; }
.method li { font-size: .85rem; color: var(--ink-soft); line-height: 1.55; margin-bottom: .4rem; }
.method .src { font-size: .78rem; color: var(--ink-soft); margin: .8rem 0 0; }

.actions { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.75rem; }
.actions button { width: 100%; }
.actions .header-link { text-align: center; }
.disclaimer { margin-top: 1.5rem; font-size: .8rem; color: var(--ink-soft); line-height: 1.5; }

/* ── Motion ─────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(8px); animation: rise .5s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ── Enhance upward (tablet / desktop) ──────────────────────────────────── */
@media (min-width: 640px) {
  body { font-size: 17px; }
  .site-header .bar { padding: .8rem 1.25rem; }
  .brand img { width: 40px; height: 40px; }
  .brand .name { font-size: 1.02rem; }
  .wrap { padding: 2.5rem 1.25rem 4rem; }
  .foot { padding: 2rem 1.25rem 3rem; }
  .card { padding: 1.75rem; }

  .report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.25rem; }
  .verdict { flex-direction: column; align-items: flex-end; gap: .3rem; margin-top: 0; text-align: right; }

  .actions { flex-direction: row; align-items: center; }
  .actions button { width: auto; }
  .actions .header-link { text-align: left; }
}
