/* Optimum Thinking Toolkit — shared styles */
:root {
  --navy: #1F3864;
  --bar: #B4C6E7;
  --head: #D9E1F2;
  --input-bg: #F2F2F2;
  --input-text: #0000FF;
  --purple: #A02B93;
  --border: #BFBFBF;
  --outline: #7F7F7F;
  --text: #1d1d1f;
  --muted: #5f6368;
  --ok: #1E7B34;
  --warn: #B45309;
  --focus: #F59E0B;
  --red1: #CC4E53; --red2: #DA7D81; --red3: #E5A5A8; --red4: #F0CBCD; --red-border: #CC4E53;
  /* Self-Governance: pastel Optimum Thinking red (#AF202F) = perceived negative, pastel Optimum Thinking blue (#0077C0) = perceived positive */
  --neg-bg: #EFD2D5; --neg-border: #DB8F97; --neg-text: #7A1621;
  --pos-bg: #CCE4F2; --pos-border: #8CC0E1; --pos-text: #004F80;
  --font: "Aptos Narrow", Aptos, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: #fafafa; font-size: 17px; line-height: 1.5; }
body.modal-open { overflow: hidden; }
a { color: var(--navy); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); }
p { margin: 0.5em 0 0.8em; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Banner + footer ---------- */
.top-banner { background: var(--navy); color: #fff; }
.top-banner .brand-logo { height: 32px; width: auto; }
.top-banner .inner { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.top-banner .crumb { font-weight: 700; letter-spacing: 0.04em; white-space: pre-wrap; }
.top-banner a { color: #fff; text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.5); }
.top-banner a:hover { border-bottom-color: #fff; }
.site-footer { text-align: center; color: var(--muted); font-size: 14px; padding: 28px 16px 36px; border-top: 1px solid #e5e5e5; margin-top: 40px; }

main { max-width: 1040px; margin: 0 auto; padding: 20px; }
.tool-title { margin: 6px 0 4px; font-size: 30px; letter-spacing: 0.01em; }
.saved-note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

/* ---------- Buttons ---------- */
.btn { font: inherit; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--outline); background: #fff; color: var(--navy); cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 40px; }
.btn:hover { background: #f0f3fa; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: #2a4a83; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eef1f7; }
.btn-small { font-size: 14px; padding: 6px 12px; min-height: 34px; }
.btn-link { background: none; border: none; padding: 0; color: var(--navy); text-decoration: underline; font: inherit; cursor: pointer; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; padding: 10px; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; }
.toolbar .spacer { flex: 1; }

/* ---------- Sections ---------- */
.section { background: #fff; border: 1px solid var(--outline); border-radius: 6px; margin: 0 0 22px; overflow: hidden; }
.section-bar { background: var(--bar); color: #000; font-weight: 700; padding: 10px 16px; margin: 0; font-size: 18px; }
.section-body { padding: 16px; }
.instructions { color: var(--purple); }
.instructions ol, .instructions ul { padding-left: 1.4em; margin: 0.4em 0; }
.instructions li { margin: 0.25em 0; }
.status { color: var(--purple); font-weight: 700; min-height: 1.5em; margin: 10px 0; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.purple-italic { color: var(--purple); font-style: italic; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 14px; }
table.grid { border-collapse: collapse; width: 100%; background: #fff; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; }
table.grid thead th { background: var(--head); font-weight: 700; color: #000; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid thead th.num { white-space: normal; }
table.grid.compact { font-size: 15px; }
table.grid.compact th, table.grid.compact td { padding: 6px 8px; }
table.grid.compact thead th { vertical-align: bottom; }
table.grid.compact tbody th { white-space: nowrap; font-weight: 600; }
table.grid td.center, table.grid th.center { text-align: center; }
table.grid tfoot td { font-weight: 700; background: #f6f7fb; }
.area-chip { display: inline-block; padding: 3px 9px; border-radius: 5px; font-weight: 700; border: 1px solid rgba(0,0,0,0.12); color: #1d1d1f; }
.area-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.25); vertical-align: -2px; margin-right: 6px; }
.defs { margin: 0; padding-left: 1.1em; font-size: 15px; }
.defs li { margin: 2px 0; }
.optional-tag { display: block; font-size: 13px; font-weight: 700; color: var(--purple); margin-bottom: 4px; }

textarea, input[type="number"] { font: inherit; color: var(--input-text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 48px; line-height: 1.45; }
textarea:focus, input:focus { border-color: var(--navy); }

/* ---------- Stepper ---------- */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.stepper button { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 999px; padding: 7px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.stepper button .num { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: var(--head); font-size: 13px; }
.stepper button[aria-current="step"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.stepper button[aria-current="step"] .num { background: #fff; color: var(--navy); }
.stepper button .tick { color: var(--ok); font-weight: 800; }
.stepper button[aria-current="step"] .tick { color: #9fe3ad; }
.progress { height: 8px; background: #e7e9f0; border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.progress > span { display: block; height: 100%; background: var(--navy); transition: width .3s; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* ---------- Resource steps ---------- */
.resource-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.res-row td:first-child { width: 48%; }
.num-ctrl { display: flex; align-items: center; gap: 4px; }
.num-ctrl input { width: 84px; text-align: right; font-weight: 700; -moz-appearance: textfield; }
.num-ctrl input::-webkit-outer-spin-button, .num-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-ctrl button { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--border); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--navy); }
.num-ctrl button:hover { background: #eef1f7; }
.total-row td { font-weight: 700; background: #f6f7fb; }
.chart-box { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.chart-box.wide { max-width: none; }
.chart-empty { text-align: center; color: var(--muted); padding: 40px 10px; border: 1px dashed var(--border); border-radius: 8px; }

.warning-box { border-left: 5px solid var(--warn); background: #FFF7ED; padding: 10px 14px; margin: 0 0 16px; border-radius: 4px; color: #7c2d12; }
.warning-box a { color: #7c2d12; font-weight: 700; }
.info-box { border-left: 5px solid var(--purple); background: #fbf2fa; padding: 10px 14px; margin: 10px 0 16px; border-radius: 4px; }

.reflect-q { background: var(--head); padding: 10px 12px; font-weight: 700; border: 1px solid var(--border); border-bottom: none; border-radius: 5px 5px 0 0; margin-top: 14px; }
.reflect-q + textarea { border-radius: 0 0 5px 5px; }

/* ---------- Primary drivers ---------- */
.intro-text h2 { margin-top: 1.2em; font-size: 22px; }
.intro-text h2:first-child { margin-top: 0; }
details.expander { border: 1px solid var(--border); border-radius: 6px; padding: 0 14px; margin: 16px 0; background: #fff; }
details.expander summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--navy); }
details.expander[open] summary { border-bottom: 1px solid #eee; margin-bottom: 8px; }
.pair-card { text-align: center; padding: 10px 0; }
.pair-indicator { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.dots { display: flex; gap: 10px; justify-content: center; margin: 6px 0 22px; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--navy); background: #fff; padding: 0; cursor: default; }
.dot.answered { background: var(--navy); cursor: pointer; }
.dot.current { box-shadow: 0 0 0 3px #f8d58a; }
.pair-question { font-size: 19px; margin: 0 0 16px; }
.choice-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; max-width: 760px; margin: 0 auto; }
.choice-row .vs { font-weight: 700; color: var(--muted); }
.choice { font: inherit; font-size: 20px; font-weight: 700; color: var(--navy); background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 26px 16px; min-height: 110px; cursor: pointer; position: relative; transition: background .15s, border-color .15s, transform .1s; }
.choice:hover { border-color: var(--navy); background: #f6f8fd; }
.choice:active { transform: scale(0.99); }
.choice[aria-pressed="true"] { background: var(--head); border-color: var(--navy); border-width: 3px; }
.choice[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 12px; font-size: 22px; color: var(--navy); }
.choice-row.three { grid-template-columns: repeat(3, 1fr); }
.choice-row.three .choice { font-size: 17px; padding: 18px 10px; min-height: 80px; }
.pair-nav { display: flex; justify-content: space-between; gap: 10px; max-width: 760px; margin: 26px auto 0; }
.place-pill { display: inline-block; min-width: 38px; text-align: center; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #f3f3f3; }

/* ---------- Home page ---------- */
.home-title { text-align: center; font-size: 34px; margin: 18px 0 2px; }
.home-sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
.compass-layout { display: grid; grid-template-columns: 1fr minmax(260px, 380px) 1fr; grid-template-areas: "tl wheel tr" "bl wheel br"; gap: 22px 26px; align-items: stretch; }
.compass-wheel { grid-area: wheel; align-self: center; text-align: center; }
.compass-wheel img { width: 100%; max-width: 380px; display: block; margin: 0 auto; }
.q-menu { background: #fff; border-radius: 12px; border: 1px solid #e3e3e3; border-top: 6px solid var(--qc, var(--navy)); padding: 14px 16px 12px; display: flex; flex-direction: column; }
.q-menu[data-pos="top-left"] { grid-area: tl; }
.q-menu[data-pos="top-right"] { grid-area: tr; }
.q-menu[data-pos="bottom-left"] { grid-area: bl; }
.q-menu[data-pos="bottom-right"] { grid-area: br; }
.q-menu h2 { margin: 0; font-size: 21px; color: var(--qc, var(--navy)); }
.q-menu .q-focus { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.q-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tool-link { display: block; text-decoration: none; color: var(--text); border: 1px solid #e6e6e6; border-radius: 8px; padding: 10px 12px; background: #fcfcfd; }
a.tool-link:hover { border-color: var(--qc, var(--navy)); background: #f8f6fc; }
.tool-link .t-name { font-weight: 700; color: var(--navy); display: block; }
.tool-link .t-desc { font-size: 14px; color: var(--muted); display: block; margin-top: 2px; }
.tool-link .t-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tool-link.disabled { opacity: 0.75; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; border: 1px solid transparent; }
.badge.not-started { background: #f1f1f1; color: #555; border-color: #ddd; }
.badge.in-progress { background: #FFF4D6; color: #8a5a00; border-color: #f2d48a; }
.badge.complete { background: #E3F4E6; color: #1E7B34; border-color: #a9d8b2; }
.badge.external { background: #EEF1FA; color: var(--navy); border-color: #cfd7ee; }
.q-empty { color: var(--muted); font-size: 14px; font-style: italic; padding: 6px 2px; }


/* ---------- My Current Goals ---------- */
.tool-status-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.tool-status-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.goal-area { background: #fff; border: 1px solid var(--acb, var(--outline)); border-radius: 8px; margin: 0 0 16px; overflow: hidden; }
.goal-area-head { margin: 0; font-size: 18px; }
.area-toggle, .goal-area-head.static { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--ac); border: none; border-bottom: 1px solid var(--acb); padding: 12px 16px; font: inherit; font-weight: 700; color: #000; text-align: left; cursor: pointer; }
.goal-area-head.static { cursor: default; }
.goal-area.closed .area-toggle { border-bottom: none; }
.area-name { flex: 1; }
.area-count { font-size: 14px; font-weight: 600; color: #333; }
.chev { transition: transform .2s; }
.goal-area.closed .chev { transform: rotate(-90deg); }
.goal-area-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.goal-area-body > .optional-tag { margin: 0; }
.goal-area-body .add-goal { align-self: flex-start; }
.goal-card { border: 1px solid var(--border); border-left: 5px solid var(--acb, var(--outline)); border-radius: 8px; padding: 12px 14px 14px; background: #fcfcfd; }
.goal-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.goal-card-head h4 { margin: 0; font-size: 16px; color: var(--navy); }
.goal-card-head .back-to-goal { margin-left: auto; }
.achieved-tag { background: #C6EFCE; color: #006100; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 99px; border: 1px solid #8fd19e; }
.field-label { display: block; font-weight: 700; font-size: 14px; margin: 10px 0 4px; color: #333; }
.type-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.choice.choice-sm { font-size: 15px; padding: 8px 18px; min-height: 40px; border-radius: 8px; border-width: 2px; }
.choice.choice-sm[aria-pressed="true"] { border-width: 2px; padding-right: 34px; }
.choice.choice-sm[aria-pressed="true"]::after { top: 7px; right: 10px; font-size: 16px; }
.type-help { margin: 4px 0 0; }
.date-input { font: inherit; color: var(--input-text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 5px; padding: 6px 8px; min-height: 38px; }
.date-field { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.date-text { width: 130px; }
.date-text.invalid { border-color: #b42318; background: #fdecec; }
.date-btn { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 16px; }
.date-btn:hover { background: #eef1f7; }
.date-picker-hidden { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.pct-row { display: flex; align-items: center; gap: 10px; }
.pct-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--navy); height: 28px; }
.pct-row input[type="range"].unset { opacity: 0.45; }
.pct-num { width: 78px !important; text-align: right; font-weight: 700; }
.pct-bar { height: 6px; background: #ececf2; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.pct-bar > span { display: block; height: 100%; border-radius: 99px; }
.goal-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.remove-goal, .del-checkin { color: #b42318; font-size: 14px; }
.goal-text { font-weight: 700; margin: 4px 0 2px; white-space: pre-line; }
.history-head { margin: 12px 0 4px; font-size: 15px; color: var(--navy); }
.checkin-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.checkin-list > li { background: #f4f5f9; border-radius: 6px; padding: 8px 10px; }
.checkin-title { font-weight: 700; }
.checkin-ev { white-space: pre-line; margin: 2px 0 4px; }
.checkin-form { border: 1px dashed var(--navy); border-radius: 8px; padding: 10px 12px; background: #fff; }
.ci-grid { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.purple-note { color: var(--purple); font-size: 15px; }
.purple-head { color: var(--purple); margin-top: 26px; }
.worth-lists h4 { margin: 14px 0 4px; font-size: 16px; }
.worth-lists ul { margin: 0; padding-left: 1.3em; }
.worth-lists li { margin: 3px 0; }

/* ---------- Mind-Body Connection Quiz ---------- */
.theme-bar { background: var(--bar); color: #000; font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 6px; display: inline-block; margin-bottom: 10px; }
.q-progress-label { font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.q-text { font-size: 20px; font-weight: 700; margin: 6px 0 16px; line-height: 1.35; color: #1d1d1f; }
.options { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.opt { font: inherit; font-size: 17px; text-align: left; display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 14px 44px 14px 16px; cursor: pointer; color: #1d1d1f; position: relative; min-height: 56px; }
.opt:hover:not(:disabled) { border-color: var(--navy); background: #f6f8fd; }
.opt .letter { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--head); color: var(--navy); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.opt .opt-text { flex: 1; padding-top: 3px; }
.opt .opt-tag { display: block; font-size: 13px; font-weight: 700; margin-top: 4px; }
.opt:disabled { cursor: default; }
.opt.is-correct { background: #C6EFCE; border-color: #006100; color: #006100; }
.opt.is-correct .letter { background: #006100; color: #fff; }
.opt.is-wrong { border-color: #7F7F7F; border-style: dashed; background: #f6f6f6; }
.opt.dim { opacity: 0.6; }
.opt[aria-pressed="true"]:not(.is-correct):not(.is-wrong) { background: var(--head); border-color: var(--navy); }
.opt .tick { position: absolute; right: 14px; top: 12px; font-size: 22px; font-weight: 800; color: #006100; }
.opt .tick.pop { animation: tickPop 300ms ease-out, glowPulse 700ms ease-out 1; }
@keyframes tickPop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes glowPulse { 0% { text-shadow: 0 0 0 rgba(0,97,0,0); } 40% { text-shadow: 0 0 14px rgba(0,160,0,0.75); } 100% { text-shadow: 0 0 0 rgba(0,97,0,0); } }
@media (prefers-reduced-motion: reduce) { .opt .tick.pop { animation: none; } .chev, .progress > span, .flash { transition: none; } }
.feedback { margin: 16px 0 0; max-width: 820px; }
.fb-correct { color: #006100; font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.fb-wrong { color: #9C5700; font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.science-label { color: #1F3864; font-weight: 800; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-width: 900px; }
.k-grid .opt { min-height: 64px; }
.k-grid .opt[aria-pressed="true"] { background: var(--head); border-color: var(--navy); border-width: 3px; }
.k-grid .opt[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 12px; color: var(--navy); font-weight: 800; }
.k-single .opt[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 12px; right: 14px; color: var(--navy); font-weight: 800; font-size: 20px; }
.other-box { margin-top: 12px; max-width: 520px; }
.about-intro { background: #fbf2fa; border-left: 5px solid var(--purple); padding: 10px 14px; border-radius: 4px; margin: 0 0 16px; }
.score-panel { border-radius: 12px; padding: 18px 20px; border: 2px solid; margin: 0 0 10px; }
.score-panel .score-big { font-size: 28px; font-weight: 800; margin: 0; }
.status-pill { display: inline-block; font-weight: 700; padding: 3px 12px; border-radius: 99px; border: 1px solid; }
.st-green { background: #C6EFCE; color: #006100; border-color: #006100; }
.st-amber { background: #FFEB9C; color: #9C5700; border-color: #9C5700; }
.st-red { background: #FFC7CE; color: #9C0006; border-color: #9C0006; }
.type-tag { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }
.worth-item, .step-item, .tool-item { border-top: 1px solid #eee; padding: 10px 0; }
.worth-item:first-child, .step-item:first-of-type, .tool-item:first-child { border-top: none; }
.worth-item p, .tool-item p { margin: 3px 0; }
.disclaimer { color: var(--muted); font-size: 13px; margin-top: 18px; }
.last-time { color: var(--muted); margin: 4px 0 0; }


/* ---------- Memory Bank ---------- */
.badge.count { background: #FFEB9C; color: #9C5700; border-color: #e6cf70; }
.mb-tabs { display: flex; gap: 4px; margin: 4px 0 0; flex-wrap: wrap; }
.mb-tabs [role="tab"] { font: inherit; font-weight: 700; font-size: 16px; padding: 10px 18px; border: 1px solid var(--outline); border-bottom: none; border-radius: 8px 8px 0 0; background: #eef1f7; color: var(--navy); cursor: pointer; }
.mb-tabs [role="tab"][aria-selected="true"] { background: var(--bar); color: #000; }
.mb-panel { border-top-left-radius: 0; }
.mb-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.mb-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.mb-filter-label { font-weight: 700; margin-right: 2px; }
.mb-msg { min-height: 1.4em; }
.mb-empty { color: var(--muted); padding: 10px 0; }
.mb-divider { display: flex; align-items: center; gap: 10px; color: #006100; font-weight: 700; font-size: 14px; margin: 16px 0 10px; }
.mb-divider::before, .mb-divider::after { content: ""; flex: 1; border-top: 1px solid #8fd19e; }
.mb-divider.small { font-size: 13px; margin: 10px 0 8px; }
.mb-clip { border: 1px solid var(--border); border-left: 5px solid #9C5700; border-radius: 8px; background: #fff; margin-bottom: 12px; transition: box-shadow .3s; }
.mb-clip.is-bal { border-left-color: #006100; background: #fbfdfb; }
.mb-clip.mb-highlight { box-shadow: 0 0 0 4px #f8d58a; }
.mb-clip.dragging, .mb-frame.dragging { opacity: 0.85; box-shadow: 0 6px 20px rgba(0,0,0,0.18); position: relative; z-index: 5; }
.mb-clip-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; flex-wrap: wrap; }
.mb-clip-title { flex: 1 1 260px; min-width: 0; }
.mb-clip-desc { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.mb-meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.mb-clip-actions, .mb-frame-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mb-icon { min-width: 34px; justify-content: center; padding: 6px 8px; }
.mb-del { color: #b42318; }
.mb-mark { color: #006100; border-color: #8fd19e; }
.drag-handle { cursor: grab; touch-action: none; border: 1px solid var(--border); background: #f6f6f8; border-radius: 6px; width: 34px; min-height: 34px; font-size: 18px; line-height: 1; color: #555; flex: 0 0 auto; user-select: none; -webkit-user-select: none; }
.drag-handle:active { cursor: grabbing; }
.drag-handle:disabled { cursor: not-allowed; opacity: 0.35; }
.mb-frames { border-top: 1px solid #eee; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.mb-frame { border: 1px solid #e6e6ea; border-radius: 6px; padding: 8px 10px; background: #fafafc; }
.mb-frame.is-bal { background: #f3faf4; }
.mb-frame-main { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.mb-charge { flex: 0 0 auto; font-weight: 800; color: var(--navy); background: var(--head); border-radius: 6px; padding: 4px 8px; font-size: 14px; }
.mb-frame-text { flex: 1 1 260px; min-width: 0; }
.mb-when { font-size: 13px; color: var(--muted); }
.mb-summary { overflow-wrap: anywhere; }
.mb-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.mb-chip.open { background: #FFEB9C; color: #9C5700; border-color: #e6cf70; }
.mb-chip.bal { background: #C6EFCE; color: #006100; border-color: #8fd19e; }
.mb-frame-actions { margin-top: 8px; padding-left: 44px; }
.mb-frame-detail { margin-top: 10px; background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 8px 12px; }
.mb-dl { display: grid; grid-template-columns: minmax(130px, 30%) 1fr; gap: 4px 12px; margin: 0; }
.mb-dl dt { font-weight: 700; color: #333; font-size: 14px; }
.mb-dl dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.mb-examples summary, .mb-intro summary { font-size: 16px; }
.mb-ex-clip h4 { margin: 12px 0 6px; color: var(--navy); }
.mb-ex-card { border: 1px solid #e6e6ea; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; background: #fafafc; }
.mb-ex-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--purple); }
.mb-field { margin: 0 0 14px; padding: 2px 0; border-radius: 6px; }
.mb-field.mb-invalid { outline: 2px solid var(--purple); outline-offset: 6px; }
.mb-input { font: inherit; color: var(--input-text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; width: 100%; }
.mb-when-row input.mb-num { width: 150px; flex: 0 0 auto; }
.mb-when-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mb-when-row .mb-input:not(.mb-num) { flex: 1 1 240px; width: auto; }
.mb-quick-row { display: flex; gap: 8px; }
.mb-help { margin: 4px 0; }
.mb-readonly { background: #f4f5f9; border: 1px solid #e3e3e8; border-radius: 6px; padding: 8px 10px; font-weight: 700; }
.mb-ff-heading { margin: 18px 0 8px; color: var(--purple); }
.mb-charge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-charge-btn.choice.choice-sm { min-width: 44px; padding: 8px 0; justify-content: center; text-align: center; }
.mb-charge-btn.choice.choice-sm[aria-pressed="true"] { padding-right: 0; }
.mb-charge-btn.choice.choice-sm[aria-pressed="true"]::after { content: none; }
.mb-firsthand label { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; cursor: pointer; }
.mb-firsthand input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--navy); flex: 0 0 auto; }
.req { font-weight: 400; font-size: 12px; color: var(--muted); }
.mb-form-status { margin-top: 6px; }
.mb-form-actions { border-top: 1px solid #eee; padding-top: 14px; }
.mb-fieldset { border: none; padding: 0; margin: 0 0 12px; }
.mb-radio { display: flex; gap: 8px; align-items: center; margin: 6px 0; cursor: pointer; }
.mb-danger { background: #b42318 !important; border-color: #b42318 !important; }
.instructions-plain h3 { margin-top: 14px; }


/* ---------- Actions & Inactions tools ---------- */
.ai-list, .ai-behaviours { display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: grid; grid-template-columns: 30px 1fr 34px; gap: 8px; align-items: start; border: 1px solid #e6e6ea; border-radius: 8px; padding: 8px 10px; background: #fcfcfd; }
.ai-num { font-weight: 800; color: var(--navy); padding-top: 8px; text-align: center; }
.ai-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.ai-type .choice.choice-sm { padding: 6px 14px; min-height: 36px; font-size: 14px; }
.ai-type .choice.choice-sm[aria-pressed="true"] { padding-right: 30px; }
.ai-area { font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; background: #fff; max-width: 100%; }
.ai-chip { font-size: 13px; }
.ai-remove { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: #b42318; }
.ai-remove:hover { background: #fdecec; }
.ai-add, .ai-add-person { align-self: flex-start; margin-top: 4px; }
.ai-ex th[scope="col"] { background: #D9E1F2; }
.ai-ex th[scope="row"] { font-weight: 700; white-space: nowrap; }
.ai-ex ul { margin: 0; padding-left: 1.1em; }
.ai-person { border: 1px solid var(--border); border-left: 5px solid var(--navy); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: #fff; }
.ai-person-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ai-person-head h3, .ai-person-head h4 { margin: 0; font-size: 17px; }
.ai-person-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 6px 0 12px; }
.ai-os-head { color: var(--purple); margin-top: 18px; }
.ai-readonly { margin: 4px 0 10px; padding-left: 1.2em; }
.ai-type-tag { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--head); border-radius: 4px; padding: 1px 6px; }
.ai-balance { margin: 10px 0 0; }
.ai-perceptions h4 { margin: 4px 0 6px; color: var(--purple); }
.ai-choose { margin: 8px 0; }
.ai-choose-sel { font: inherit; border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; max-width: 100%; width: 100%; background: #fff; }
.ai-chosen { margin: 8px 0; background: #f4f5f9; border-left: 4px solid var(--navy); padding: 6px 10px; border-radius: 4px; }
.ai-q { margin-bottom: 4px; }
.ai-next { margin: 8px 0 0; font-weight: 700; }


/* ---------- Self-Governance tones (perceived negative = pastel red, perceived positive = pastel blue) ---------- */
.tone-negative, .tone-dislike, .tone-disliked { --tone-bg: var(--neg-bg); --tone-border: var(--neg-border); --tone-text: var(--neg-text); }
.tone-positive, .tone-admire, .tone-admired { --tone-bg: var(--pos-bg); --tone-border: var(--pos-border); --tone-text: var(--pos-text); }
.section[class*="tone-"] { border-color: var(--tone-border); }
.section[class*="tone-"] > .section-bar { background: var(--tone-bg); color: #000; border-bottom: 1px solid var(--tone-border); }
th[class*="tone-"], td[class*="tone-"] { background: var(--tone-bg) !important; }
.tone-chip { display: inline-block; background: var(--tone-bg); border: 1px solid var(--tone-border); color: var(--tone-text); font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 99px; }
.mb-tabs [role="tab"][class*="tone-"] { background: #fff; border-color: var(--tone-border); border-top: 4px solid var(--tone-border); color: var(--tone-text); }
.mb-tabs [role="tab"][class*="tone-"][aria-selected="true"] { background: var(--tone-bg); color: #000; }
.mb-panel[class*="tone-"] { border: 1px solid var(--tone-border); border-top: 4px solid var(--tone-border); }
.mb-clip[class*="tone-"] { border-color: var(--tone-border); border-left: 6px solid var(--tone-border); background: #fff; }
.mb-clip[class*="tone-"] > .mb-clip-head { background: var(--tone-bg); border-radius: 6px 6px 0 0; }
.mb-clip[class*="tone-"].is-bal > .mb-clip-head { background: linear-gradient(90deg, var(--tone-bg), #f6fbf7); }
.mb-memory-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tone-text, var(--navy)); }
.mb-allbal { color: #006100; }
.mb-moment-title { font-weight: 700; overflow-wrap: anywhere; }
.mb-chip.missing { background: #F3E8F7; color: #6B2C80; border-color: #d9b8e6; }
.mb-ex-clip { border-left: 5px solid var(--tone-border, var(--border)); padding-left: 10px; margin-bottom: 12px; }
.mb-ex-clip h4 { margin-top: 2px; }
.mb-examples[class*="tone-"] > summary { color: var(--tone-text); }
.mb-memory-box { background: var(--tone-bg, #f4f5f9); border: 1px solid var(--tone-border, var(--border)); border-radius: 8px; padding: 10px 14px 4px; margin: 12px 0 16px; }
.mb-moment-box { border: 1px solid var(--tone-border, var(--border)); border-left: 6px solid var(--tone-border, var(--border)); border-radius: 8px; padding: 6px 14px 4px; background: #fff; }
.mb-box-heading { margin: 4px 0 10px; font-size: 18px; color: var(--tone-text, var(--navy)); }
.mb-moments-note { color: var(--tone-text, var(--muted)); font-style: italic; margin: 0 0 8px; }
.mb-memory-box .mb-readonly { background: #fff; }
.mb-missing-list { margin: 6px 0 10px; padding-left: 1.3em; }
.mb-missing-list li { margin: 2px 0; }
.ai-person[class*="tone-"] { border-left-color: var(--tone-border); }
.ai-person[class*="tone-"] > .ai-person-head { background: var(--tone-bg); margin: -12px -14px 10px; padding: 8px 14px; border-radius: 6px 6px 0 0; }
.ai-behaviours[class*="tone-"], .ai-list[class*="tone-"] { border-left: 4px solid var(--tone-border); padding-left: 10px; }
.ai-behaviours[class*="tone-"] > .field-label { color: var(--tone-text); }
.ai-os-head[class*="tone-"] { background: var(--tone-bg); color: #000; padding: 6px 12px; border-radius: 6px; border-left: 6px solid var(--tone-border); }

/* ---------- Modal / PDF viewer ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 20, 40, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-wide { max-width: 980px; height: calc(100vh - 32px); }
.modal-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e5e5e5; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1 1 220px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-body { padding: 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; }
.pdf-frame { width: 100%; flex: 1; min-height: 60vh; border: 1px solid var(--border); border-radius: 6px; }
.modal-wide .modal-body > div { display: flex; flex-direction: column; flex: 1; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eee; }
.report-date { font-weight: 700; }
.report-btns { display: flex; gap: 6px; }
.flash { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; transition: transform .25s; z-index: 1100; max-width: 92vw; }
.flash.show { transform: translateX(-50%) translateY(0); }
.delta-up { color: var(--ok); font-weight: 700; }
.delta-down { color: #b42318; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .compass-layout { grid-template-columns: 1fr 1fr; grid-template-areas: "wheel wheel" "tl tr" "bl br"; }
  .compass-wheel img { max-width: 320px; }
  .resource-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  main { padding: 14px; }
  .compass-layout { grid-template-columns: 1fr; grid-template-areas: "wheel" "tl" "tr" "br" "bl"; }
  .tool-title { font-size: 24px; }
  .choice-row { grid-template-columns: 1fr; gap: 10px; }
  .choice-row .vs { text-align: center; }
  .choice-row.three { grid-template-columns: 1fr; }
  .q-text { font-size: 18px; }
  .mb-frame-actions { padding-left: 0; }
  .ai-row { grid-template-columns: 22px 1fr 34px; padding: 8px; }
  .ai-person-fields { grid-template-columns: 1fr; }
  .mb-dl { grid-template-columns: 1fr; }
  .mb-dl dd { margin-bottom: 6px; }
  .mb-clip-actions .btn, .mb-frame-actions .btn { font-size: 13px; padding: 5px 9px; }
  .mb-when-row input.mb-num { width: 120px; }
  .opt { font-size: 16px; padding: 12px; }
  .goal-area-body { padding: 10px; }
  .goal-card { padding: 10px 10px 12px; }
  .choice { min-height: 80px; padding: 18px 12px; font-size: 18px; }
  .stepper button .label { display: none; }
  .stepper button[aria-current="step"] .label { display: inline; }
  .num-ctrl input { width: 70px; }
  .toolbar { gap: 6px; padding: 8px; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { font-size: 14px; padding: 7px 10px; min-height: 36px; }
  table.grid th, table.grid td { padding: 6px 7px; }
  .section-body { padding: 12px; }
}

/* ---------- Print (fallback; main output is the PDF report) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .toolbar, .step-nav, .stepper, .progress, .num-ctrl button, .pair-nav, .dots, .skip-link, .flash, .modal-overlay, .top-banner a { display: none !important; }
  .top-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-all [data-step-panel] { display: block !important; }
  .print-all [data-step-panel][hidden] { display: block !important; }
  .section { break-inside: auto; border-color: #999; }
  .section-bar, table.grid thead th, .area-chip, .area-swatch, .reflect-q { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr, .reflect-q, textarea { break-inside: avoid; }
  textarea { border: 1px solid #bbb; background: #fff !important; overflow: visible; resize: none; }
  .chart-box { max-width: 520px; break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
  main { max-width: none; padding: 0; }
}
