/* The Untangling Map: styles.
   Colours are set once in :root below. To change a colour, change it here AND in assets/js/1-brand-colours.js (the map drawing uses that file). */
/* Layout: one calm column, a four-step journey, the knot map as the single visual moment. Light theme only, to match the website. */
:root {
  --bg: #FBFCFB; --surface: #FFFFFF; --ink: #333333; --muted: #555B58; --line: #D4E0D3; --soft: #EEF4ED;
  --deep: #5F8576; --pale: #B0CCAF; --coral: #E98173;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Mulish", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; padding: 0 16px; }
.wrap { max-width: 700px; margin: 0 auto; padding-block: 28px 64px; display: flex; flex-direction: column; gap: 28px; }
.brand { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--ink); }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 8vw, 54px); line-height: 1.05; letter-spacing: -0.02em; margin: 6px 0 14px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--deep); }
.hook { font-family: var(--display); font-weight: 500; font-size: clamp(19px, 3.6vw, 22px); line-height: 1.4; max-width: 34em; margin-bottom: 14px; padding-left: 16px; border-left: 4px solid var(--coral); }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 5vw, 30px); line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 8px; text-wrap: balance; }
h3 { font-size: 14px; font-family: var(--mono); font-weight: 500; letter-spacing: .02em; color: var(--ink); margin: 0 0 6px; }
p { margin: 0; max-width: 62ch; }
.lede { font-size: 18px; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 700; }
.lede.spaced { margin-top: 12px; }
.foot-actions { display: flex; gap: 18px; flex-wrap: wrap; }
.mlist { display: flex; flex-direction: column; gap: 12px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.side-door { font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.side-door a, .tool a, .tool-line a, .plainlink { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }

.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--deep); }
.step-label { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; margin-bottom: 4px; }

[hidden] { display: none !important; }
.panel { display: flex; flex-direction: column; gap: 18px; }
.threads { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.thread { display: grid; grid-template-columns: 16px 1fr; gap: 12px; align-items: start; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.thread:hover { border-color: var(--muted); }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.thread .swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--deep); margin-top: 4px; display: grid; place-items: center; }
.thread[aria-pressed="true"] { border: 2px solid var(--deep); }
.thread[aria-pressed="true"] .swatch { background: var(--deep); }
.thread[aria-pressed="true"] .swatch::after { content: ""; width: 5px; height: 8px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.thread b { display: block; font-weight: 700; }
.thread i { display: block; font-style: normal; color: var(--muted); font-size: 15px; }

.rate { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.rate legend, .rate-head { font-weight: 700; font-size: 17px; padding: 0; margin-bottom: 4px; }
fieldset.rate { margin: 0; min-width: 0; }
.ropts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ropt { font: 600 14px var(--body); line-height: 1.25; color: var(--ink); text-align: center; background: var(--bg); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 6px 9px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ropt:hover { border-color: var(--muted); }
.ropt svg { width: 44px; height: 14px; flex: none; }
.ropt[aria-pressed="true"] { border: 2px solid var(--deep); background: var(--soft); font-weight: 700; }
.ropt[aria-pressed="true"] .rlabel::before { content: "\2713  "; }
@media (max-width: 600px) {
  .ropts { grid-template-columns: 1fr; }
  .ropt { flex-direction: row; text-align: left; padding: 10px 12px; gap: 12px; }
}
.compact { display: flex; flex-direction: column; gap: 8px; }

.q { display: flex; flex-direction: column; gap: 10px; }
.q-title { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.35; letter-spacing: normal; }
.q-num { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px; }
.opt { font: inherit; color: var(--ink); text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; cursor: pointer; }
.opt:hover { border-color: var(--muted); }
.opt.none { font-style: italic; }
.opt[aria-pressed="true"] { border: 2px solid var(--deep); background: var(--soft); font-weight: 700; }
.opt[aria-pressed="true"]::before { content: "\2713  "; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.35; }
textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 92px; resize: vertical; width: 100%; }
.note { font-size: 15px; color: var(--muted); }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.btn { font: 700 16px var(--body); padding: 12px 22px; border-radius: 999px; border: 2px solid var(--deep); background: var(--pale); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: #A2C2A1; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--line); }
.link { font: inherit; background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }

/* Result */
.example-flag { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; border: 1px solid var(--ink); padding: 4px 10px; border-radius: 6px; align-self: flex-start; }
.verdict { display: flex; flex-direction: column; gap: 10px; }
.verdict .name { color: var(--deep); }
.gap-note { font-size: 16px; color: var(--muted); }
.map-box { background: var(--bg); border: 1px solid var(--pale); border-radius: 14px; padding: 18px 12px 12px; }
.map-desktop svg { display: block; width: 100%; height: auto; }
.map-mobile { display: none; flex-direction: column; gap: 14px; }
.mrow { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.mrow svg { width: 52px; height: 18px; }
.mname { font-size: 16px; }
.mname.focus { font-weight: 700; }
.mname .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--coral); border: 1px solid var(--ink); margin-right: 7px; vertical-align: 0; }
.mann { font: 13px var(--mono); line-height: 1.45; }
.mknot svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.mcap { text-align: center; }
.mcap .mann { display: block; }
.mcap b { font-size: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; padding: 10px 4px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 731px) {
  .map-desktop { display: none; }
  .map-mobile { display: flex; }
}
.words { background: var(--soft); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.words q { font-size: 19px; line-height: 1.45; font-style: italic; display: block; }
.words small { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.result-grid { display: grid; gap: 22px; }
.result-block { display: flex; flex-direction: column; gap: 6px; padding-left: 16px; border-left: 3px solid var(--deep); }
.result-block.plain { border-left-color: var(--line); }
.pull { font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.35; }
.also { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pale); border: 1px solid var(--ink); }
.tool { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }

.path { background: var(--soft); border: 2px solid var(--deep); border-radius: 14px; padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.path h2.help-label { font-size: 14px; font-family: var(--mono); font-weight: 500; letter-spacing: .02em; line-height: 1.4; margin: 0; }
.path .route-name { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 5vw, 30px); line-height: 1.25; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.path blockquote { margin: 0; font-size: 18px; line-height: 1.55; font-style: italic; max-width: 56ch; padding-left: 14px; border-left: 3px solid var(--coral); }
.path .who { font-size: 16px; }
.path .row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }

/* Results header (D) and contact invitation (A) */
.result-head { display: flex; flex-direction: column; gap: 4px; }
.result-head h1 { font-size: clamp(30px, 6.5vw, 40px); margin: 0; }
.contact { border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.contact h2 { font-size: 21px; margin: 0; }
.contact .row { padding-top: 4px; }
.contact a.plainlink { font-weight: 700; }
.print-only { display: none; }
/* Printed or saved-as-PDF map (B): keep the map, result and contact details; drop controls */
@media print {
  body { padding: 0; background: #fff; }
  .wrap { padding: 0; gap: 18px; }
  #intro, #progress, .keep, .foot, .nav, .panel:not(#s5), .path .row .btn { display: none !important; }
  .panel { animation: none !important; }
  .map-desktop { display: block !important; } .map-mobile { display: none !important; }
  .map-box, .path, .result-block { break-inside: avoid; }
  .print-only { display: block; border-top: 1px solid var(--ink); padding-top: 12px; font-size: 14px; }
  .print-only a { color: var(--ink); }
}
.keep { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.keep form { display: flex; flex-direction: column; gap: 12px; }
.frow { display: flex; gap: 10px; flex-wrap: wrap; }
.frow input[type="email"] { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--muted); border-radius: 999px; padding: 11px 18px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 16px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--deep); }
.check span { color: var(--muted); }
.check strong { color: var(--ink); }
.privacy { font-size: 14px; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.privacy a { color: var(--ink); text-underline-offset: 3px; }
.btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.sent { font-size: 16px; background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: rise .35s ease both; }
  @keyframes rise { from { transform: translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* Results page, 10 October 2026: explanation heading, other threads, PDF download and status messages */
.verdict .explore { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.verdict .explore .lede { color: var(--ink); }
.also-box { display: flex; flex-direction: column; gap: 10px; }
.chip b { font-weight: 700; }
.keep h2 { font-size: 24px; margin: 0; }
.keep .row { display: flex; flex-wrap: wrap; gap: 10px; }
.letters-intro { font-size: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.btn.done { background: var(--surface); border-color: var(--deep); cursor: default; }
.btn.done:hover { background: var(--surface); }
.status:empty { display: none; }
.status { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-size: 16px; color: var(--ink); background: var(--soft); border: 2px solid var(--deep); border-left-width: 6px; border-radius: 10px; padding: 12px 14px; }
.status.info { background: var(--surface); border-color: var(--muted); }
.status.error { background: #FDF0EE; border-color: var(--coral); }
.status-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; line-height: 1; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-family: var(--body); }
.status.ok .status-icon { background: var(--deep); border-color: var(--deep); color: #FFFFFF; }
.status-body { display: flex; flex-direction: column; gap: 6px; }
.status-body p { max-width: none; }
.status-title { font-weight: 700; font-size: 17px; }
.status .plainlink { align-self: flex-start; }
#pdfStage { position: absolute; left: -10000px; top: 0; width: 674px; visibility: hidden; pointer-events: none; }
.foot .copyright { display: block; font-size: 13px; margin-top: 2px; }
.example-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; background: var(--soft); border: 2px dashed var(--deep); border-radius: 12px; padding: 14px 16px; }
.example-banner p { margin: 0; }
.example-title { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.foot-actions .btn { padding: 10px 20px; }
.tie-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tie-list li { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 3.8vw, 22px); line-height: 1.3; color: var(--deep); padding-left: 22px; position: relative; }
.tie-list li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--pale); border: 1.5px solid var(--ink); }
.tie-answers { font-family: var(--display); font-weight: 500; font-size: clamp(19px, 3.8vw, 22px); line-height: 1.4; margin-top: 4px; }
.tie-answers .name { color: var(--deep); font-weight: 600; }
.words q, .chip, .verdict, .tool-line { overflow-wrap: anywhere; }
.tie-list.single li { padding-left: 0; }
.tie-list.single li::before { display: none; }
