/* ACT Values Platform — mobile-first, both themes, CSP-strict (no inline styles). */
:root {
  color-scheme: light dark;
  --surface: #fcfcfb;
  --surface-2: #f2f1ee;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #8a8880;
  --line: #e3e1dc;
  --accent: #2a78d6;          /* series-1 light */
  --accent-ink: #ffffff;
  --good: #008300;
  --warn-bg: #fdf3e0;
  --warn-ink: #7a5200;
  --danger: #b3261e;
  --enrolled: #4a3aa7;        /* slot 7 — enrolled-mode identity, persistent */
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1a1a19;
    --surface-2: #232322;
    --card: #262625;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-3: #8a8880;
    --line: #3a3936;
    --accent: #3987e5;
    --good: #4caf50;
    --warn-bg: #3a2f14;
    --warn-ink: #eda100;
    --danger: #e66767;
    --enrolled: #9085e9;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 1.35rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
p { margin: .5rem 0; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
a { color: var(--accent); }

/* header */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
header .brand { font-weight: 650; font-size: 1rem; }
header .spacer { flex: 1; }

/* buttons — 44px minimum targets */
button, .btn {
  appearance: none; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font: inherit; padding: 11px 16px; min-height: 44px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-block { display: flex; width: 100%; }
button:disabled { opacity: .45; cursor: default; }

/* forms */
label { display: block; margin: 12px 0 4px; font-weight: 550; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); min-height: 44px;
}
textarea { min-height: 88px; resize: vertical; }
.field-hint { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.error { color: var(--danger); margin: 8px 0; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

/* mode identity — enrolled must be visually unmistakable (§4.1) */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 650; letter-spacing: .02em;
}
.badge-personal { background: var(--surface-2); color: var(--ink-2); }
.badge-enrolled { background: var(--enrolled); color: #fff; }
.badge-released { background: var(--good); color: #fff; }
.badge-verified { background: var(--good); color: #fff; }
.badge-failed { background: var(--danger); color: #fff; }
.enrolled-banner {
  background: var(--enrolled); color: #fff; padding: 8px 16px; font-size: .85rem;
  text-align: center; position: sticky; top: 0; z-index: 11;
}

/* sort flow */
.sort-progress { font-size: .85rem; color: var(--ink-2); text-align: center; margin: 8px 0; }
.value-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 20px; margin: 12px 0; box-shadow: var(--shadow); text-align: center;
}
.value-card .value-name { font-size: 1.4rem; font-weight: 700; letter-spacing: .01em; }
.value-card .value-brief { color: var(--ink-2); margin-top: 6px; }
.value-detail { text-align: left; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.value-detail ul { margin: 6px 0; padding-left: 20px; }
.bucket-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.bucket-row .skip { grid-column: 1 / -1; }

/* ratings */
.rating-row { margin: 14px 0; }
.rating-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 6px; }
.rating-scale button { min-height: 44px; padding: 0; border-radius: 8px; font-size: .9rem; }
.rating-scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.rating-anchors { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); margin-top: 2px; }

/* stepper */
.step-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.step-dots span.on { background: var(--accent); }

/* results */
.safety-note {
  background: var(--warn-bg); color: var(--warn-ink);
  border-radius: var(--radius); padding: 12px 14px; font-size: .88rem; margin: 12px 0;
}
.safety-note a { color: inherit; font-weight: 650; }
.own-words {
  border-left: 3px solid var(--accent); padding: 6px 12px; margin: 10px 0;
  color: var(--ink); background: var(--surface-2); border-radius: 0 8px 8px 0;
  font-style: italic;
}
.finding-q { margin: 12px 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.finding-q .q-values { font-weight: 650; font-size: .85rem; color: var(--accent); margin-bottom: 4px; }

/* bulls-eye plot */
.viz-root { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.viz-root svg { width: 100%; height: auto; display: block; }
.viz-title { font-weight: 650; font-size: .95rem; margin-bottom: 4px; }
.viz-sub { font-size: .8rem; color: var(--ink-2); margin-bottom: 8px; }

/* session list */
.session-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.session-item:last-child { border-bottom: none; }
.session-meta { flex: 1; min-width: 0; }
.session-meta .when { font-size: .85rem; color: var(--ink-2); }

/* timeline chips (practitioner) */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: .8rem; min-height: 32px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip-gap { border-style: dashed; }
a.chip-released { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: 16px 16px 0 0; padding: 20px 16px 28px;
  width: 100%; max-width: 640px; max-height: 85vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 16px; }
}

/* footer safety bar during assessment */
.pause-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 16px; display: flex; justify-content: center;
}
.pause-bar button { border: none; background: none; color: var(--ink-2); text-decoration: underline; min-height: 36px; }

/* desktop: sort becomes a wider card, keep one-at-a-time flow */
@media (min-width: 900px) {
  main { max-width: 760px; }
  .value-card { padding: 32px; }
}
