/* Adfix onboarding — same tokens as the audit app, so the internal tools read
   as one system rather than as two projects that happened at different times. */
:root {
  --ground: #F4F6F7;
  --panel: #FFFFFF;
  --ink: #101820;
  --ink-2: #414D57;
  --ink-3: #6E7A85;
  --rule: #D9DFE3;
  --rule-2: #E9EDEF;
  --acc: #0B6E7F;
  --acc-soft: #E2EEF0;
  --go: #2F7D4F;
  --cond: #9A6A00;
  --stop: #A33A2B;
  --tint: #EDF1F2;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0C1116; --panel: #141B22; --ink: #EAEEF1; --ink-2: #B4BFC8;
    --ink-3: #7E8B96; --rule: #26313A; --rule-2: #1E272F; --acc: #4FB6C6;
    --acc-soft: #14313A; --go: #63B587; --cond: #D3A43C; --stop: #DE7B69; --tint: #1A222A;
  }
}
:root[data-theme="dark"] {
  --ground: #0C1116; --panel: #141B22; --ink: #EAEEF1; --ink-2: #B4BFC8;
  --ink-3: #7E8B96; --rule: #26313A; --rule-2: #1E272F; --acc: #4FB6C6;
  --acc-soft: #14313A; --go: #63B587; --cond: #D3A43C; --stop: #DE7B69; --tint: #1A222A;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground); color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 2px solid var(--ink);
  background: var(--ground);
  position: sticky; top: 0; z-index: 20;
}
.topbar .inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--acc);
  white-space: nowrap; text-decoration: none;
}
.brand b { color: var(--ink); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  font: 600 12.5px/1 var(--mono); letter-spacing: .04em;
  color: var(--ink-2); text-decoration: none;
  border: 1px solid transparent; padding: 7px 11px;
}
.nav a:hover { color: var(--ink); border-color: var(--rule); }
.nav a[aria-current="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, label:focus-within {
  outline: 2px solid var(--acc); outline-offset: 2px;
}
.storemode, .who {
  font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--rule); padding: 4px 7px; white-space: nowrap;
}
.storemode[data-mode="shared"] { color: var(--go); border-color: var(--go); }
.who { text-transform: none; letter-spacing: .02em; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }

/* ---------- headings ---------- */
h1 {
  font: 700 clamp(26px, 4vw, 38px)/1.04 var(--display);
  letter-spacing: -.02em; margin: 30px 0 8px; text-wrap: balance;
}
h2 { font: 600 21px/1.2 var(--display); letter-spacing: -.01em; margin: 0; }
h3 { font: 600 16px/1.25 var(--display); margin: 0 0 6px; }
.eyebrow {
  font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--acc); margin: 26px 0 0;
}
.standfirst { font-size: 17px; color: var(--ink-2); max-width: 66ch; margin: 0 0 4px; }
.sechead {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin: 0 0 20px;
}
.sechead .note { font-size: 14px; color: var(--ink-3); }
section { margin-top: 44px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }

/* ---------- panels & buttons ---------- */
.panel { background: var(--panel); border: 1px solid var(--rule); padding: 20px 22px; }
.panel.hero { margin-top: 22px; }
.grid1 { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.cols > * { background: var(--panel); }

button.btn, a.btn {
  font: 600 13px/1 var(--mono); letter-spacing: .04em;
  background: var(--ink); color: var(--ground); border: 1px solid var(--ink);
  padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.btn:hover, a.btn:hover { background: var(--acc); border-color: var(--acc); color: var(--ground); }
button.btn.ghost, a.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
button.btn.ghost:hover, a.btn.ghost:hover { color: var(--ink); border-color: var(--acc); background: transparent; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.code {
  font: 600 12px/1.5 var(--mono); letter-spacing: .01em;
  background: var(--tint); color: var(--ink-2);
  padding: 1px 5px; border: 1px solid var(--rule-2);
}
.pill {
  font: 600 10.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; white-space: nowrap;
  background: var(--acc-soft); color: var(--acc);
}
.pill.go { background: transparent; color: var(--go); border: 1px solid var(--go); }
.pill.cond { background: transparent; color: var(--cond); border: 1px solid var(--cond); }
.pill.stop { background: transparent; color: var(--stop); border: 1px solid var(--stop); }
.pill.grey { background: var(--tint); color: var(--ink-3); }

/* ---------- role cards ---------- */
.rolecard {
  background: var(--panel); border: 0; cursor: pointer;
  padding: 20px 22px; text-align: left; font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 6px;
}
.rolecard:hover { background: var(--tint); }
.rname { font: 600 18px/1.2 var(--display); }
.rsub { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.rblurb { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.rmeta { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* ---------- module rows ---------- */
.modrow {
  background: var(--panel); padding: 15px 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
}
a.modrow:hover { background: var(--tint); }
.modrow.locked { opacity: .5; }
.mnum { font-size: 12px; color: var(--ink-3); width: 2.2em; flex: none; }
.mbody { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mtitle { font: 600 15.5px/1.3 var(--display); }
.msum { font-size: 13.5px; color: var(--ink-3); }
.mmeta { font-size: 11.5px; color: var(--ink-3); flex: none; }

/* ---------- progress ---------- */
.prog { display: flex; flex-direction: column; gap: 8px; }
.progbar { height: 10px; background: var(--tint); border: 1px solid var(--rule); }
.progbar span { display: block; height: 100%; background: var(--acc); transition: width .3s ease; }
.progmeta { font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- prose ---------- */
.prose { max-width: 72ch; margin-top: 30px; }
.prose p { margin: 0 0 16px; }
.bh { font: 600 17px/1.25 var(--display); margin: 30px 0 10px; }
.blist { margin: 0 0 16px; padding-left: 22px; }
.blist li { margin-bottom: 7px; }
.blist.tight li { margin-bottom: 3px; font-size: 14px; }
.readpanel { margin-top: 24px; border-left: 3px solid var(--acc); }
.readpanel .bh { margin-top: 0; }

.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--tint); border: 1px solid var(--rule);
  padding: 14px 16px; margin: 0 0 18px;
}
.callout.warn { border-color: var(--cond); background: transparent; }
.ctag {
  font: 600 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--acc); flex: none; padding-top: 2px;
}
.callout.warn .ctag { color: var(--cond); }
.callout div { flex: 1; }
.callout p:last-child { margin-bottom: 0; }

.tablewrap { overflow-x: auto; margin: 0 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td {
  text-align: left; vertical-align: top;
  padding: 9px 12px; border-bottom: 1px solid var(--rule-2);
}
th {
  font: 600 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--rule);
}
tbody tr:last-child td { border-bottom: 0; }
table.admin td { font-size: 14px; }

/* ---------- quiz ---------- */
.qblock {
  border: 1px solid var(--rule); background: var(--panel);
  padding: 18px 20px; margin: 0 0 1px;
}
/* A legend is positioned on the fieldset's border by default, so a question
   that wraps to two lines escapes the box. Floating it puts it back in normal
   flow; the options then clear it. Keeping fieldset/legend rather than a plain
   div matters — it is what tells a screen reader which question these radios
   belong to. */
.qblock legend {
  float: left; width: 100%;
  font: 600 16px/1.35 var(--display); padding: 0 0 12px;
  display: flex; gap: 10px; align-items: baseline;
}
.qblock .opt { clear: both; }
.qnum { font-size: 12px; color: var(--acc); flex: none; }
.opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 9px 11px; margin-bottom: 2px; cursor: pointer;
  border: 1px solid transparent;
}
.opt:hover { background: var(--tint); border-color: var(--rule-2); }
.opt input { margin-top: 4px; flex: none; accent-color: var(--acc); }
.opt span { font-size: 15px; }

.ansrow {
  background: var(--panel); padding: 16px 20px;
  display: flex; gap: 14px; align-items: flex-start;
}
.ansrow .pill { flex: none; }
.ansq { font: 600 15px/1.35 var(--display); margin: 0 0 6px; }
.ansrow p { margin: 0 0 5px; }
.why { color: var(--ink-2); border-left: 2px solid var(--rule); padding-left: 10px; margin-top: 8px !important; }
.ansrow.bad .why { border-left-color: var(--stop); }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--rule); margin-top: 60px; padding-top: 14px;
  font: 500 11px/1.5 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px 60px; }
  .topbar .inner { padding: 12px 16px; gap: 10px; }
  .nav { margin-left: 0; width: 100%; order: 3; }

  /* Stack the module row: status line first, then the title and summary across
     the full width. Left as a single flex line it squeezes the title into a
     three-word column, which is unreadable on a phone. */
  .modrow { flex-wrap: wrap; gap: 6px 10px; padding: 14px 16px; }
  .mnum { width: auto; order: 1; }
  .mmeta { order: 2; margin-left: auto; }
  .modrow .pill { order: 3; }
  .mbody { order: 4; flex: 1 0 100%; }
}

/* ---------- local-dev identity ---------- */
.idpanel { margin-top: 22px; border-left: 3px solid var(--cond); }
.idpanel .bh { margin-top: 0; }
.idpanel input[type=text] {
  font: 400 15px/1.4 var(--body);
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); padding: 9px 11px; min-width: 240px;
}

/* ---------- team lead picker ---------- */
.leadpanel { margin-top: 22px; border-left: 3px solid var(--acc); }
.leadpanel .bh { margin-top: 0; }
.leadpanel input[type=text],
#leadform input[type=text] {
  font: 400 15px/1.4 var(--body);
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); padding: 9px 11px; min-width: 240px;
}

/* ---------- dashboard ---------- */
.minibar {
  height: 6px; width: 110px; max-width: 100%;
  background: var(--tint); border: 1px solid var(--rule); margin-bottom: 5px;
}
.minibar span { display: block; height: 100%; background: var(--acc); }
table.admin th { white-space: nowrap; }
table.admin a { text-decoration: none; }
table.admin a:hover { text-decoration: underline; }
table.admin tbody tr:hover { background: var(--tint); }

@media (max-width: 760px) {
  /* Data tables don't shrink gracefully, and horizontal scrolling puts the
     column that matters most — the flags — off screen. So on a phone each
     table drops to the columns a lead actually scans. */
  .admin.roster th:nth-child(2), .admin.roster td:nth-child(2),   /* role */
  .admin.roster th:nth-child(3), .admin.roster td:nth-child(3),   /* lead */
  .admin.roster th:nth-child(5), .admin.roster td:nth-child(5),   /* attempts */
  .admin.roster th:nth-child(7), .admin.roster td:nth-child(7),   /* last active */
  .admin.modules th:nth-child(1), .admin.modules td:nth-child(1), /* index */
  .admin.modules th:nth-child(6), .admin.modules td:nth-child(6)  /* passed date */
  { display: none; }

  .admin th, .admin td { padding: 9px 8px; }
  .minibar { width: 72px; }
}

/* ---------- review ---------- */
.revmod {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
}
.revmod:first-of-type { border-top: 0; }
.revsrc { margin: -12px 0 14px; }
.qpool { margin-top: 4px; }
.qrev { background: var(--panel); padding: 16px 20px; }
.qrev .ansq { margin: 0 0 10px; }
.revopts { margin: 0 0 10px; padding-left: 26px; }
.revopts li { margin-bottom: 4px; color: var(--ink-3); }
.revopts li.right { color: var(--ink); font-weight: 600; }
.revopts li.right .pill { font-weight: 600; margin-left: 6px; }

/* ---------- print ----------
   Review pages are meant to be printed and marked up, so the chrome goes and
   the content reflows to the page rather than to the viewport. */
@media print {
  .topbar, .foot, .noprint, .btnrow { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .panel, .qrev, .grid1, .cols { background: #fff; border-color: #999; }
  .grid1 { gap: 0; }
  .revmod { break-before: page; border-top: 0; margin-top: 0; padding-top: 0; }
  .revmod:first-of-type { break-before: auto; }
  .qrev, .callout, table { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  .prose { max-width: none; }
  .pill { border: 1px solid #000 !important; color: #000 !important; background: #fff !important; }
  .code { background: #f2f2f2; border-color: #ccc; }
}
