/* Citrines Apex Leadership. Layout: one calm centred column for the survey (one question per screen);
   a wide card grid for admin reports. Brand colours: navy #060032, royal blue #19134E,
   sunrise orange #E57626, lemon yellow #E4D01E. */
:root {
  --bg: #F6F5F9; --surface: #FFFFFF; --ink: #15122E; --muted: #5C5975; --line: #E2E0EB;
  --navy: #19134E; --navy-deep: #060032; --navy-ink: #FFFFFF;
  --accent: #2C2585; --accent-ink: #FFFFFF; --accent-soft: #ECEAF8;
  --orange: #E57626; --yellow: #E4D01E; --eyebrow: #B4561B;
  --bd: #C2453B; --pl: #A8508F; --av: #7C8695; --mg: #B07F12; --pp: #3B78B5; --op: #8B5A2B; --tb: #1E8466;
  --normal: #3B78B5; --pressure: #D04A3E;
  --warn-bg: #FFF3DA; --warn-ink: #6E4A00; --ok-bg: #E2F3EC; --ok-ink: #165E48; --bad-bg: #FCE8E6; --bad-ink: #8E2A22;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Open Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0C0A1C; --surface: #16132C; --ink: #ECEAF6; --muted: #A5A2BF; --line: #2B2849;
  --navy: #060032; --navy-deep: #04001F; --navy-ink: #ECEAF6;
  --accent: #ABA4F6; --accent-ink: #0C0A1C; --accent-soft: #231F47; --eyebrow: #F0A267;
  --bd: #EE7A6F; --pl: #D88BC2; --av: #9AA4B3; --mg: #E0B44A; --pp: #78AEE3; --op: #CD9867; --tb: #4CC29C;
  --normal: #78AEE3; --pressure: #EE7A6F;
  --warn-bg: #382A0B; --warn-ink: #F2D38C; --ok-bg: #12352A; --ok-ink: #8FE0C2; --bad-bg: #3A1714; --bad-ink: #F3A79F; color-scheme: dark;
} }
@media print { :root {
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #15122E; --muted: #4A4766; --line: #D6D4E2; --navy: #19134E; --navy-ink: #FFFFFF;
  --accent: #2C2585; --accent-ink: #FFFFFF; --accent-soft: #ECEAF8; --eyebrow: #B4561B;
  --bd: #C2453B; --pl: #A8508F; --av: #7C8695; --mg: #B07F12; --pp: #3B78B5; --op: #8B5A2B; --tb: #1E8466; --normal: #3B78B5; --pressure: #D04A3E; color-scheme: light;
} }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); }
h3 { font-size: 1.05rem; }
p, ul, ol { margin: 0; }
a { color: var(--accent); }
button, select, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.wide { max-width: 1180px; }
.wrap.narrow { max-width: 480px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.top { background: var(--navy); color: var(--navy-ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 108px; height: auto; display: block; }
.brand span { border-left: 1px solid rgb(255 255 255 / .25); padding-left: 12px; }
.brand b { font-family: var(--display); font-weight: 600; font-size: 1rem; display: block; line-height: 1.2; }
.brand small { opacity: .75; font-size: .8rem; display: block; }
.appfoot { padding: 0 0 32px; font-size: .8rem; color: var(--muted); text-align: center; }
.adminnav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.adminnav a, .adminnav button { color: var(--navy-ink); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; background: none; border: 0; cursor: pointer; opacity: .8; }
.adminnav a:hover, .adminnav button:hover { opacity: 1; background: rgb(255 255 255 / .1); }
.adminnav a[aria-current="page"] { opacity: 1; background: rgb(255 255 255 / .16); }
.adminnav form { margin: 0; }

main { padding-block: 28px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 3.5vw, 28px); display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack { display: grid; gap: 16px; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--eyebrow); }
.lead { color: var(--muted); max-width: 62ch; }
.small { font-size: .85rem; color: var(--muted); }
label.field { font-weight: 600; display: grid; gap: 8px; }
select, textarea, input[type="text"], input[type="password"], input[type="number"] { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px 14px; }
textarea { min-height: 96px; resize: vertical; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad-bg); border-color: transparent; color: var(--bad-ink); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 6px; }
.note { padding: 12px 14px; border-radius: 10px; font-size: .92rem; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.bad { background: var(--bad-bg); color: var(--bad-ink); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); }
.assure { display: grid; gap: 8px; font-size: .9rem; color: var(--muted); padding: 0; list-style: none; }
.assure li { display: flex; gap: 10px; }
.assure li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: .6em; }
.instructions { margin: 0; padding: 14px 16px 14px 34px; background: var(--accent-soft); border-radius: 10px; display: grid; gap: 4px; font-size: .95rem; }
.recall { font-size: .88rem; color: var(--muted); font-style: italic; margin-bottom: -8px; }

/* Question screen */
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; border: 1.5px solid var(--line); background: var(--surface); padding: 12px 14px; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--accent); }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .k { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scale .opt { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 6px; font-size: .92rem; }
.opt.notobs { border-style: dashed; color: var(--muted); }
.opts .opt.notobs { margin-top: 6px; }
.opt.notobs[aria-pressed="true"] { color: var(--ink); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 12px; text-align: center; }
.extra { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 14px; }
.extra span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.extra small { color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Review */
.review { list-style: none; padding: 0; display: grid; }
.review li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review li.parthead { display: block; border: 0; padding: 14px 0 0; }
.review .t { font-size: .85rem; color: var(--muted); }
.review .a { font-weight: 600; }
.review .ex { font-size: .88rem; color: var(--muted); font-style: italic; }
.review button { grid-row: 1 / span 3; grid-column: 2; align-self: center; }
.thanks { text-align: center; justify-items: center; padding-block: 44px; }
.thanks svg { color: var(--tb); }

/* Admin */
.rhead { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.tablewrap { overflow-x: auto; padding: 6px 8px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
td.num { font-variant-numeric: tabular-nums; }
tr.sel td { background: var(--accent-soft); }
td a.rowlink { color: var(--ink); font-weight: 700; text-decoration: none; }
td a.rowlink:hover { text-decoration: underline; }
td form { display: inline; margin: 0; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input[type="text"] { width: auto; flex: 1 1 200px; padding: 7px 10px; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.pill.on { background: var(--ok-bg); color: var(--ok-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.grid-settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
table.compact th, table.compact td { padding: 7px 10px; }
tfoot td { color: var(--muted); font-size: .85rem; border-bottom: 0; }
tfoot tr:first-child td { border-top: 2px solid var(--line); }
.tablewrap.inner { padding: 0; }
.card, .cohort { min-width: 0; }
.kpis b { overflow-wrap: anywhere; }
.kpis { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.kpis div { display: grid; }
.kpis b { font-family: var(--display); font-size: 1.8rem; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.kpis span { font-size: .85rem; color: var(--muted); }
.flag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.flag.harm { background: var(--bad-bg); color: var(--bad-ink); }
.flag.dominant, .flag.infrequent { background: var(--warn-bg); color: var(--warn-ink); }
.editor { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.editor td { white-space: normal; }
.editor code { overflow-wrap: anywhere; }
textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92rem; line-height: 1.6; min-height: 480px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.downloads { border: 2px solid var(--accent); }
.dlgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.dlgrid > div { display: grid; gap: 6px; align-content: start; }
.dlgrid span { font-size: .85rem; color: var(--muted); }
.dlmodal { position: fixed; inset: 0; z-index: 50; background: rgb(6 0 50 / .7); display: grid; place-items: center; padding: 16px; }
.dlmodal .inner { background: #FFFFFF; border-radius: 12px; padding: 14px; max-width: 100%; max-height: 100%; overflow: auto; display: grid; gap: 10px; }
.dlmodal .stage { width: 1600px; height: 900px; transform-origin: top left; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details[open] summary { margin-bottom: 10px; }

/* Report */
.report { display: grid; gap: 16px; }
.banner { background: var(--navy); color: var(--navy-ink); border-radius: 14px; padding: 22px clamp(18px, 3.5vw, 28px); display: grid; gap: 6px; }
.banner h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.banner p { opacity: .85; font-size: .95rem; }
.banner .eyebrow { color: inherit; opacity: .8; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.row.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.stylecard { border-top: 5px solid var(--c); }
.stylecard .tag { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; text-transform: uppercase; padding: 6px 14px; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.stylecard .big { font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--c); line-height: 1; font-variant-numeric: tabular-nums; }
.stylecard .sub { font-size: .85rem; color: var(--muted); }
.stylecard .desc { font-size: .93rem; }
.figrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chartwrap { overflow-x: auto; padding-top: 18px; }
.chart { min-width: 560px; display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)); gap: 0 6px; align-items: end; }
.chart .axis { display: grid; grid-template-rows: repeat(5, 1fr); height: 200px; font-size: .72rem; color: var(--muted); text-align: right; padding-right: 6px; font-variant-numeric: tabular-nums; }
.chart .axis span { transform: translateY(-50%); }
.chart .col { position: relative; height: 200px; display: flex; gap: 5px; justify-content: center; align-items: flex-end; background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 40px); border-bottom: 1px solid var(--muted); }
.chart .bar { width: 38%; max-width: 34px; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.chart .bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .72rem; white-space: nowrap; padding-bottom: 2px; font-variant-numeric: tabular-nums; }
.chart .lbl { grid-row: 2; font-size: .78rem; text-align: center; padding-top: 6px; line-height: 1.25; }
.chart .lbl small { display: block; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); }
.list { list-style: none; padding: 0; display: grid; gap: 8px; font-size: .93rem; }
.list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; }
.list li::before { content: "•"; color: var(--muted); font-weight: 700; text-align: center; }
.list.good li::before { content: "✓"; color: var(--tb); }
.list.bad li::before { content: "✕"; color: var(--bd); }
.list.warn li::before { content: "!"; color: var(--pressure); }
.numlist { list-style: none; padding: 0; display: grid; gap: 12px; counter-reset: n; }
.numlist li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; counter-increment: n; font-size: .93rem; }
.numlist li::before { content: counter(n); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.numlist b { display: block; }
.numlist span { color: var(--muted); }
.path { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.path div { flex: 1 1 110px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: .85rem; font-weight: 600; display: grid; align-content: center; }
.path .from { background: color-mix(in srgb, var(--c1) 16%, transparent); color: var(--c1); }
.path .to { background: color-mix(in srgb, var(--tb) 16%, transparent); color: var(--tb); }
.path small { display: block; font-weight: 400; color: var(--muted); }
.freq { display: grid; gap: 10px; }
.frow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 120px 48px; gap: 10px; align-items: center; font-size: .9rem; }
.frow .id { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.frow .track { height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.frow .fill { height: 100%; border-radius: 4px; }
.frow .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.frow small { display: block; font-size: .76rem; color: var(--muted); }
.frow.low .id, .frow.low .v { color: var(--pressure); }
.quotes { display: grid; gap: 14px; }
.quotes h4 { margin: 0; font-size: .82rem; color: var(--muted); font-weight: 700; }
.quotes ul { list-style: none; padding: 0; display: grid; gap: 6px; margin-top: 6px; }
.quotes li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; font-size: .93rem; display: grid; gap: 6px; }
.quotes li textarea { min-height: 80px; }
.exbtns { display: flex; gap: 4px; }
.exbtns .btn.ghost { padding: 2px 6px; font-size: .78rem; }
.disclaimer { font-size: .82rem; color: var(--muted); }

@media (max-width: 560px) {
  .scale { grid-template-columns: 1fr; }
  .scale .opt { flex-direction: row; text-align: left; padding: 12px 14px; }
  .review li { grid-template-columns: 1fr; }
  .review button { grid-row: auto; grid-column: 1; justify-self: start; }
  .frow { grid-template-columns: 40px minmax(0, 1fr) 44px; }
  .frow .track { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  .top, .rhead .controls, .no-print, .tablewrap:not(.inner) { display: none !important; }
  details { display: none; }
  main { padding: 0; }
  .card, .banner { break-inside: avoid; }
  body { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
