/* ─────────────────────────────────────────────
   FLORA Expert Badge - playbook
   Flat colours only. No gradients, no glows.
   ───────────────────────────────────────────── */

:root {
  --bg:        #FFFFFF;
  --surface:   #F7F7F5;
  --surface-2: #EFEFEC;
  --border:    #E2E2DD;
  --border-2:  #CFCFC8;
  --text:      #0E0E0E;
  --muted:     #6A6A63;
  --accent:    #0E0E0E;
  --accent-fg: #FFFFFF;
  --good:      #1B6E45;
  --good-bg:   #E8F2EC;
  --bad:       #A83B24;
  --bad-bg:    #F7EAE6;
  --sans: "Haffer", "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Haffer Mono", "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --wrap: 880px;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0C0C0C;
  --surface:   #151514;
  --surface-2: #1D1D1B;
  --border:    #262624;
  --border-2:  #3A3A37;
  --text:      #F2F2EF;
  --muted:     #8E8E86;
  --accent:    #F2F2EF;
  --accent-fg: #0C0C0C;
  --good:      #64C295;
  --good-bg:   #13251C;
  --bad:       #E08066;
  --bad-bg:    #2A1712;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0C0C0C;
    --surface:   #151514;
    --surface-2: #1D1D1B;
    --border:    #262624;
    --border-2:  #3A3A37;
    --text:      #F2F2EF;
    --muted:     #8E8E86;
    --accent:    #F2F2EF;
    --accent-fg: #0C0C0C;
    --good:      #64C295;
    --good-bg:   #13251C;
    --bad:       #E08066;
    --bad-bg:    #2A1712;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--border-2); }
a:hover { text-decoration-color: var(--text); }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 80px; }

/* ── sticky bar ─────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.bar-in {
  max-width: var(--wrap); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px;
}
.bar-id { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mark {
  width: 18px; height: 18px; flex-shrink: 0;
  background: var(--text); border-radius: 4px; position: relative;
}
.mark::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 4px; height: 4px; background: var(--bg);
  box-shadow: 8px 0 0 var(--bg), 0 8px 0 var(--bg), 8px 8px 0 var(--bg);
}
.bar-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.bar-progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; min-width: 40px; }
.fill { height: 100%; width: 0%; background: var(--text); border-radius: 3px; transition: width .25s ease; }
.count { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.ghost {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
.ghost:hover { color: var(--text); border-color: var(--border-2); }

/* ── hero ───────────────────────────────────── */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 20px;
}
h1 {
  font-size: clamp(38px, 7vw, 62px); line-height: 1.02;
  letter-spacing: -0.035em; font-weight: 600; margin-bottom: 22px;
}
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 60ch; }
.lede strong { color: var(--text); font-weight: 500; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { opacity: .85; background: var(--accent); }
.btn.sm { padding: 8px 14px; font-size: 13px; }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 48px; background: var(--border); border: 1px solid var(--border);
}
.stat { background: var(--bg); padding: 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat .n { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ── sections ───────────────────────────────── */
section { padding: 64px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-head .num {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px;
}
h2 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.025em; font-weight: 600; line-height: 1.1; }
.when {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; margin-left: auto;
}
.sec-sub { color: var(--muted); font-size: 16px; margin-bottom: 30px; max-width: 68ch; }
.sec-sub strong { color: var(--text); font-weight: 500; }

h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 6px; }

/* ── facts ──────────────────────────────────── */
.facts { border-top: 1px solid var(--border); }
.facts > div {
  display: grid; grid-template-columns: 170px 1fr; gap: 20px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.facts dt { font-size: 13px; color: var(--muted); font-family: var(--mono); padding-top: 2px; }
.facts dd { font-size: 15px; }
.facts dd.warn { color: var(--bad); }
.facts dd strong { font-weight: 600; }

.raw { margin-top: 28px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.raw summary {
  cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 500;
  list-style: none; user-select: none;
}
.raw summary::-webkit-details-marker { display: none; }
.raw summary::before { content: "▸ "; color: var(--muted); }
.raw[open] summary::before { content: "▾ "; }
.raw blockquote { padding: 0 18px 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.raw blockquote p { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.raw blockquote strong { color: var(--text); }
.raw .src { font-size: 12px; margin-bottom: 0; }

/* ── audit ──────────────────────────────────── */
.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.audit-col { background: var(--bg); padding: 22px; }
.audit-col h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; font-weight: 500; }
.tag.ok { background: var(--good-bg); color: var(--good); }
.tag.no { background: var(--bad-bg); color: var(--bad); }
.audit-col ul { list-style: none; }
.audit-col li { font-size: 14px; padding: 7px 0 7px 22px; position: relative; border-bottom: 1px solid var(--border); line-height: 1.45; }
.audit-col li:last-child { border-bottom: none; }
.audit-col.done li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 600; }
.audit-col.gap li::before { content: "×"; position: absolute; left: 2px; color: var(--bad); font-weight: 600; font-size: 16px; }
.req { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.verdict { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.verdict strong { color: var(--text); font-weight: 600; }

/* ── steps ──────────────────────────────────── */
.steps { list-style: none; counter-reset: s; }
.step {
  display: grid; grid-template-columns: 32px 1fr; gap: 14px;
  padding: 22px 0; border-top: 1px solid var(--border);
}
.step:last-child { border-bottom: 1px solid var(--border); }
.step .body { min-width: 0; }
.step .body p { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.step .body p:last-child { margin-bottom: 0; }
.step .body p strong { color: var(--text); font-weight: 600; }
.step .body a { color: var(--text); }
.step .one { font-size: 15px; color: var(--text) !important; }

.check { display: block; padding-top: 2px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check span {
  display: block; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--border-2); background: var(--bg);
  position: relative; transition: background .12s, border-color .12s;
}
.check span::after {
  content: ""; position: absolute; left: 7px; top: 3px;
  width: 5px; height: 10px; border: solid var(--accent-fg);
  border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
  transition: transform .12s;
}
.check input:checked + span { background: var(--text); border-color: var(--text); }
.check input:checked + span::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.step.is-done .body h3 { text-decoration: line-through; text-decoration-thickness: 1px; }
.step.is-done { opacity: .5; }

.chip {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); color: var(--muted); border-radius: 4px; padding: 3px 7px;
  vertical-align: middle; margin-left: 6px; font-weight: 500;
}

ul.tight { list-style: none; margin: 8px 0 10px; }
ul.tight li { font-size: 14px; color: var(--muted); padding: 5px 0 5px 16px; position: relative; line-height: 1.5; }
ul.tight li::before { content: "-"; position: absolute; left: 0; color: var(--border-2); }
ul.tight li strong { color: var(--text); font-weight: 600; }

code {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface-2); padding: 2px 5px; border-radius: 4px;
}

.note { font-size: 13px !important; padding: 10px 12px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
.warn-line { color: var(--bad) !important; font-size: 14px !important; }

/* ── plans ──────────────────────────────────── */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 14px 0; }
.plan { background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.plan.pick { background: var(--surface); }
.pn { font-size: 13px; font-weight: 600; }
.pp { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pp i { font-size: 12px; font-weight: 400; font-style: normal; color: var(--muted); }
.pd { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pv { font-size: 11px; font-family: var(--mono); margin-top: auto; padding-top: 8px; color: var(--muted); }
.pv.good { color: var(--good); }
.pv.bad { color: var(--bad); }

/* ── callouts ───────────────────────────────── */
.callout { border: 1px solid var(--text); border-radius: 12px; padding: 22px; margin: 8px 0 32px; }
.callout.soft { border-color: var(--border); background: var(--surface); margin: 28px 0 0; }
.callout h3 { margin-bottom: 10px; }
.callout p { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.callout p:last-child { margin-bottom: 0; }
.callout .test { color: var(--text); font-size: 15px; padding: 12px 14px; background: var(--surface); border-radius: 8px; }
.callout.soft .test { background: var(--bg); }

/* ── rubric ─────────────────────────────────── */
.rubric { border-top: 1px solid var(--border); margin: 14px 0; }
.rb {
  display: grid; grid-template-columns: 44px 130px 1fr; gap: 14px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.rbn { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.rbl { font-size: 14px; font-weight: 600; color: var(--text); }
.rbd { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ── copy box ───────────────────────────────── */
.copybox { position: relative; margin: 10px 0; }
.copybox pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 60px 14px 14px; white-space: pre-wrap; word-break: break-word; color: var(--text);
}
.copy {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 11px; padding: 5px 9px;
  border: 1px solid var(--border-2); background: var(--bg); color: var(--muted);
  border-radius: 5px; cursor: pointer;
}
.copy:hover { color: var(--text); }
.copy.ok { color: var(--good); border-color: var(--good); }

/* ── link slots ─────────────────────────────── */
.linkslots { display: grid; gap: 6px; margin-top: 12px; }
.slot { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: center; }
.slot label { font-size: 12px; font-family: var(--mono); color: var(--muted); }
.slot input {
  font-family: var(--mono); font-size: 12px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); width: 100%;
}
.slot input:focus { outline: none; border-color: var(--text); }
.slot input.filled { border-color: var(--good); }

/* ── pitch editor ───────────────────────────── */
.editor { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.editor-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
}
.counter { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.editor textarea {
  width: 100%; border: none; resize: vertical; display: block;
  padding: 18px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.65;
  background: var(--bg); color: var(--text);
}
.editor textarea:focus { outline: none; }
.editor-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border);
}
.hint { font-size: 12px; color: var(--muted); }

/* ── links ──────────────────────────────────── */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.lcard { background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.lcard:hover { background: var(--surface); }
.lt { font-size: 14px; font-weight: 500; }
.lu { font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all; }

/* ── footer ─────────────────────────────────── */
footer { border-top: 1px solid var(--border); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 64px; }
.foot-in p { font-size: 13px; color: var(--muted); max-width: 62ch; }
.reset-row { margin-top: 18px; }

/* ── responsive ─────────────────────────────── */
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .audit-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .slot { grid-template-columns: 1fr; gap: 4px; }
  .rb { grid-template-columns: 40px 1fr; gap: 10px; }
  .rbd { grid-column: 2; }
  .when { margin-left: 0; }
  .bar-title { display: none; }
  main { padding: 0 18px 60px; }
  .bar-in { padding: 12px 18px; }
  .foot-in { padding: 28px 18px 48px; }
  .hero { padding: 48px 0 40px; }
  section { padding: 48px 0; }
}

@media print {
  .bar, .cta-row, .ghost, .copy, .editor-foot { display: none; }
  body { font-size: 12px; }
  section { page-break-inside: avoid; border-bottom: 1px solid #ccc; }
}

/* ═══════════ multi-badge additions ═══════════ */

/* hub cards */
.hub { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); margin-top: 8px; }
.hcard { background: var(--bg); padding: 20px 22px; display: grid; grid-template-columns: 34px 1fr auto; gap: 16px; align-items: start; text-decoration: none; }
.hcard:hover { background: var(--surface); }
.hrank { font-family: var(--mono); font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 0; text-align: center; }
.hbody h3 { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hbody p { font-size: 14px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.hmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 3px 8px; }
.pill.hot { background: var(--good-bg); color: var(--good); }
.pill.cost { background: var(--bad-bg); color: var(--bad); }
.hprog { text-align: right; min-width: 74px; }
.hprog .hp { font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hprog .htrack { height: 4px; width: 68px; background: var(--surface-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.hprog .hfill { height: 100%; width: 0; background: var(--text); border-radius: 2px; }
.hdone { color: var(--good) !important; }

/* per-badge nav */
.badgenav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.badgenav a { font-family: var(--mono); font-size: 11px; text-decoration: none; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.badgenav a:hover { color: var(--text); border-color: var(--border-2); }
.badgenav a.on { background: var(--text); color: var(--accent-fg); border-color: var(--text); }

/* requirement checklist table */
.reqs { border-top: 1px solid var(--border); margin: 14px 0 0; }
.reqrow { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: start; }
.reqrow .rs { font-size: 15px; font-weight: 600; line-height: 1.3; }
.reqrow .rs.yes { color: var(--good); }
.reqrow .rs.no { color: var(--bad); }
.reqrow .rt { font-size: 14px; line-height: 1.5; }
.reqrow .rt em { color: var(--muted); font-style: normal; display: block; font-size: 13px; margin-top: 2px; }

@media (max-width: 720px) {
  .hcard { grid-template-columns: 28px 1fr; }
  .hprog { grid-column: 2; text-align: left; margin-top: 4px; }
  .hprog .htrack { margin-left: 0; }
}
