/* Market · Power · Morality: one narrow reading column; no external fonts, no external requests. */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --ink: #18202b; --muted: #566272; --line: #d3dae3;
  --mkt: #27589f; --pwr: #a3303d; --mor: #2b7550; --you: #b86e00; --err: #a3303d;
  --f-display: Georgia, 'Times New Roman', serif;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, Menlo, Consolas, 'Courier New', monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151b; --surface: #18202a; --ink: #e8ecf1; --muted: #98a4b3; --line: #2b3642;
    --mkt: #7aa7ea; --pwr: #e8838f; --mor: #72c99b; --you: #f0b548; --err: #e8838f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-body); }
.wrap {
  max-width: 660px; margin: 0 auto; padding-block: 18px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; line-height: 1.15; }
h2 { font-size: 1.55rem; line-height: 1.25; }
h3 { font-size: 1.1rem; margin-top: 28px; margin-bottom: 8px; }
p { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.eyebrow { font: 500 .75rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.05rem; margin-top: 12px; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.brand { font: 500 .78rem/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.lang button { font: 600 .8rem/1 var(--f-mono); padding: 10px 14px; min-height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang button:focus-visible { outline: 3px solid var(--mkt); outline-offset: -3px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 6px; min-height: 48px;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .choice:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--mkt); outline-offset: 2px; }

.principles { display: grid; gap: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.principles div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.principles dt { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.principles dd { margin: 0; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.k-A { --c: var(--mkt); } .k-B { --c: var(--pwr); } .k-C { --c: var(--mor); }

.prog { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.prog .bar { height: 100%; width: 0; background: var(--ink); transition: width .25s ease; }
.meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font: 400 .8rem/1.2 var(--f-mono); color: var(--muted); }
.q-text { margin-top: 36px; font-size: 1.6rem; max-width: 30ch; }
.hint { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.choices { display: grid; gap: 10px; margin-top: 28px; }
.choice {
  display: block; width: 100%; text-align: left; font: inherit; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; min-height: 56px; cursor: pointer;
}
.choice:hover { border-color: var(--ink); }
.choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.nav { margin-top: 28px; }

.type-h { margin-top: 10px; font-size: 2rem; line-height: 1.2; }
.code { font: 500 .6em/1 var(--f-mono); background: var(--ink); color: var(--bg); padding: 4px 10px; border-radius: 4px; margin-right: 10px; vertical-align: .18em; display: inline-block; }
.pill { display: inline-block; margin-top: 14px; padding: 3px 10px; border: 1px solid var(--ink); border-radius: 99px; font: 500 .78rem/1.4 var(--f-mono); }
.pill.border { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.lit { margin-top: 10px; color: var(--muted); font-size: .92rem; }
.tri-wrap { margin: 26px 0 0; }
.tri { display: block; width: 100%; height: auto; overflow: visible; }
.tri text { font: 400 11px var(--f-body); fill: var(--muted); }
.tri text.nm { font-size: 10.5px; }
.tri text.on { fill: var(--ink); font-weight: 700; }
.tri .lc { font-family: var(--f-mono); font-weight: 600; font-size: 12px; }
.tri .lv { font: 700 10px var(--f-mono); fill: var(--ink); }
.tri .pole { font: 700 11px var(--f-body); letter-spacing: .08em; }
.tri .pole-A { fill: var(--mkt); } .tri .pole-B { fill: var(--pwr); } .tri .pole-C { fill: var(--mor); }
figcaption { margin-top: 6px; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--you); flex: none; }

.card { margin-top: 28px; padding: 18px 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card h3 { margin-top: 0; }
.bars { display: grid; gap: 16px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: end; }
.brow .nm { font-weight: 600; }
.brow .gl { color: var(--muted); font-size: .85rem; }
.brow .val { font: 500 .9rem/1 var(--f-mono); }
.meter { grid-column: 1 / -1; position: relative; height: 10px; background: var(--line); }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--c); }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; }
ul.plain { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
details { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 8px; font-size: .92rem; color: var(--muted); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.start-actions { margin-top: 28px; }
#copy-box { width: 100%; margin-top: 12px; min-height: 5rem; font: .85rem/1.4 var(--f-mono); background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }

.grid { display: grid; gap: 14px; margin-top: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; min-height: 46px;
}
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: .92rem; }
.consent input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.err { color: var(--err); font-size: .9rem; margin-top: 10px; }
.actions .err { margin-top: 0; }
.ok { color: var(--mor); font-weight: 600; }
.peer { margin-top: 16px; }
.peer .pt { font-weight: 600; margin-bottom: 6px; }
.prow { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 6.5rem; gap: 8px; align-items: center; font: .8rem/1.6 var(--f-mono); }
.prow .pm { display: block; height: 8px; background: var(--line); position: relative; }
.prow .pm i { position: absolute; inset: 0 auto 0 0; background: var(--muted); }
.prow.me .pm i { background: var(--you); }
.prow.me { font-weight: 600; }

.foot { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; display: grid; gap: 8px; }
.foot a { color: var(--muted); }
.page h1 { font-size: 1.8rem; }
.page h2 { font-size: 1.2rem; margin-top: 26px; }
.page p, .page li { margin-top: 8px; max-width: 64ch; }
.page ul { padding-left: 1.2rem; }
.todo { background: #fff3c4; color: #3a2b00; padding: 0 4px; border-radius: 3px; }
@media (max-width: 520px) {
  .tri text { font-size: 12.5px; }
  .tri text.nm { font-size: 12.5px; }
  .tri .lc { font-size: 14px; }
  .tri .pole { font-size: 13px; }
}
@media (max-width: 440px) {
  h1 { font-size: 1.75rem; }
  .q-text { font-size: 1.4rem; }
  .principles div { grid-template-columns: 1fr; gap: 2px; }
  .brand { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) { .prog .bar { transition: none; } }
