:root {
  --bg: #cfe4fb; --card: #ffffff; --ink: #1a2142; --muted: #5f6a8a; --line: #e4e8f5;
  --accent: #7b68ee; --accent-soft: #eeeafd; --warn: #b2182b;
  --glass: rgba(255,255,255,.55); --shadow: 0 10px 30px rgba(92,104,190,.14);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); line-height: 1.45; min-height: 100vh;
  background: radial-gradient(900px 600px at 0% 100%, #e6c8f7 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #8fa8f5 0%, transparent 60%), linear-gradient(180deg, #8fd3f7 0%, #b9d4fa 45%, #d5c9f6 100%) fixed; }
.top, .funnel, .statusbar, .layout, footer { position: relative; }
.top { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; padding: 22px 28px 10px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 2px; letter-spacing: -.01em; }
.titles p { margin: 0; color: var(--muted); font-size: .92rem; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.controls label { display: grid; gap: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
input, select, button { font: inherit; font-size: .9rem; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.85); color: var(--ink); }
button { transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover { box-shadow: 0 4px 14px rgba(123,104,238,.2); }
input { width: 220px; }
button { cursor: pointer; font-weight: 600; }
button:hover, select:hover { border-color: var(--accent); }
.funnel { display: flex; gap: 6px; padding: 8px 28px 0; max-width: 1500px; margin: 0 auto; overflow-x: auto; }
.funnel { gap: 8px; padding-bottom: 6px; }
.funnel button { flex: 1 0 auto; text-align: left; padding: 11px 18px; border-radius: 16px; border: 1px solid rgba(255,255,255,.7); background: var(--glass); backdrop-filter: blur(12px); color: var(--ink); font-weight: 700; }
.funnel button small { display: block; font-weight: 500; font-size: .74rem; opacity: .85; }
.funnel button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(123,104,238,.35); }
.statusbar { max-width: 1500px; margin: 0 auto; padding: 10px 28px; font-size: .88rem; color: var(--muted); min-height: 42px; }
.statusbar b { color: var(--ink); }
main { min-width: 0; }
.statusbar:empty { display: none; }
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1500px; margin: 0 auto; padding: 14px 28px 24px; }
.layout.no-rail { grid-template-columns: minmax(0, 1fr); }
.layout.no-rail .rail { display: none; }
.rail { position: sticky; top: 12px; background: var(--glass); backdrop-filter: blur(16px); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); border-radius: 22px; padding: 14px; max-height: calc(100vh - 24px); overflow: auto; }
.rail-h { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rail-h b { font-size: 1.05rem; } .rail-h small { color: var(--muted); } .rail-h button { justify-self: start; margin-top: 6px; padding: 4px 10px; font-size: .8rem; }
.eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.step button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 9px 10px 9px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 5px solid var(--line); background: rgba(255,255,255,.85); font-weight: 400; }
.step.cur button { background: var(--accent-soft); border-color: var(--accent); border-left-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.step.t-flag button { border-left-color: var(--warn); } .step.t-warn button { border-left-color: #e0b72f; } .step.t-ok button { border-left-color: #2e7d4f; }
.step .num { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.step .q { font-size: .78rem; color: var(--muted); }
.step .v { font-weight: 700; font-size: .9rem; } .step .det { font-size: .78rem; color: var(--muted); }
.intro-hero { background: var(--card); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); border-radius: 22px; padding: 24px 26px; margin-bottom: 16px; }
.intro-hero h2 { font-size: 1.5rem; line-height: 1.25; margin: 6px 0 10px; letter-spacing: -.01em; max-width: 52ch; }
.intro-hero p { max-width: 70ch; color: var(--muted); margin: 0 0 8px; } .intro-hero .eyebrow { color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.g-4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -.01em; } .stat span { color: var(--muted); font-size: .85rem; }
.howto ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 80ch; }
.flow { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 0; }
.fstep { display: grid; grid-template-columns: 44px 1fr; gap: 14px; position: relative; padding-bottom: 14px; }
.fstep:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line); }
.fnum { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; z-index: 1; }
.fbody { box-shadow: var(--shadow); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.fstep.t-flag .fbody { border-left-color: var(--warn); } .fstep.t-warn .fbody { border-left-color: #e0b72f; } .fstep.t-ok .fbody { border-left-color: #2e7d4f; }
.fbody h3 { margin: 0 0 6px; font-size: 1rem; }
.fbody dl { display: grid; grid-template-columns: 80px 1fr; gap: 3px 10px; margin: 0 0 8px; font-size: .88rem; }
.fbody dt { color: var(--muted); font-weight: 600; } .fbody dd { margin: 0; }
.flive { font-size: .88rem; margin-bottom: 8px; } .flive .v { font-weight: 700; } .flive .det { color: var(--muted); }
.fbody button { padding: 4px 12px; font-size: .82rem; }

.question { margin: 4px 0 14px; font-size: 1.02rem; }
.question span { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.g-1 { grid-template-columns: 1.3fr 1fr; }
.g-2 { grid-template-columns: 1.8fr 1fr; }
.g-3 { grid-template-columns: 1.4fr 1fr 1fr; }
.wide { grid-column: 1 / -1; }
.card { background: var(--card); border: 1px solid rgba(255,255,255,.8); border-radius: 20px; padding: 16px 18px 14px; min-width: 0; box-shadow: var(--shadow); }
.ctitle { font-weight: 700; font-size: .92rem; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ctitle em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .8rem; }
.seg { display: inline-flex; gap: 4px; margin-left: auto; }
.seg button { padding: 4px 10px; font-size: .8rem; border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
svg { display: block; width: 100%; height: auto; }
svg text { fill: var(--ink); font-family: inherit; }
.axis text { fill: var(--muted); font-size: 11px; }
.axis path, .axis line { stroke: var(--line); }
.lab { font-size: 11px; }
.dim { opacity: .13; }
.list { max-height: 520px; overflow: auto; font-size: .86rem; }
.list table { width: 100%; border-collapse: collapse; }
.list th { text-align: left; position: sticky; top: 0; background: var(--card); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 6px; }
.list td { padding: 5px 6px; border-top: 1px solid var(--line); }
.list tr[data-code] { cursor: pointer; }
.list tr[data-code]:hover, .list tr.sel { background: var(--accent-soft); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; color: #fff; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; margin-top: 6px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.tip { position: fixed; z-index: 9; pointer-events: none; background: #11162a; color: #fff; padding: 7px 10px; border-radius: 9px; font-size: .8rem; max-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
footer { max-width: 1500px; margin: 0 auto; padding: 4px 28px 36px; color: var(--muted); font-size: .8rem; }
.note { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
@media (max-width: 1000px) { .g-1, .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } .layout { grid-template-columns: 1fr; padding-left: 14px; padding-right: 14px; } .rail { position: static; max-height: none; } .top, .funnel, .statusbar, footer { padding-left: 14px; padding-right: 14px; } input { width: 100%; } }

.toggle { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.toggle input { width: auto; padding: 0; }
.dim { opacity: .13; }

/* ---------- soft (neumorphic) controls, after design-samples/dashbaord3.button.jpg ---------- */
:root { --soft: #eef1fb; --sh-d: rgba(143,159,203,.5); --sh-l: rgba(255,255,255,.95); --pastel: linear-gradient(135deg, #bfe6ff 0%, #d8cbff 55%, #f7cdee 100%); }
button { background: var(--soft); border: 1px solid rgba(255,255,255,.7); border-radius: 999px; color: var(--ink); font-weight: 600; padding: 9px 18px;
  box-shadow: 5px 5px 12px var(--sh-d), -5px -5px 12px var(--sh-l); transition: box-shadow .18s, transform .18s, background .18s, color .18s; }
button:hover { border-color: rgba(255,255,255,.7); transform: translateY(-1px); box-shadow: 7px 7px 16px var(--sh-d), -7px -7px 16px var(--sh-l); }
button:active { transform: none; box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.sm, .seg button { padding: 5px 13px; font-size: .8rem; box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l); }
button.go, button.primary { background: var(--pastel); color: #2b2f66; border-color: rgba(255,255,255,.8); }
.seg { gap: 8px; padding: 4px; border-radius: 999px; background: var(--soft); box-shadow: inset 2px 2px 6px var(--sh-d), inset -2px -2px 6px var(--sh-l); }
.seg button { box-shadow: none; background: transparent; border-color: transparent; color: var(--muted); }
.seg button:hover { transform: none; box-shadow: none; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--soft); color: var(--accent); border-color: rgba(255,255,255,.8); box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l), 0 0 0 2px rgba(167,139,250,.22); }
input, select { background: var(--soft); border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 9px 16px; box-shadow: inset 3px 3px 7px var(--sh-d), inset -3px -3px 7px var(--sh-l); }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select:hover, input:hover { border-color: rgba(255,255,255,.7); }
.funnel { gap: 12px; padding: 10px 28px 14px; }
.funnel button { background: var(--soft); backdrop-filter: none; border-radius: 18px; border: 1px solid rgba(255,255,255,.7); color: var(--muted); font-weight: 700; padding: 11px 18px; }
.funnel button small { color: var(--muted); }
.funnel button[aria-selected="true"] { background: var(--soft); color: var(--accent); border-color: rgba(255,255,255,.9); transform: none; box-shadow: inset 4px 4px 9px var(--sh-d), inset -4px -4px 9px var(--sh-l); position: relative; }
.funnel button[aria-selected="true"]::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--pastel); }
.step button { border-radius: 14px; box-shadow: 4px 4px 10px var(--sh-d), -4px -4px 10px var(--sh-l); background: var(--soft); font-weight: 400; }
.step.cur button { box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l); background: var(--soft); border-color: rgba(255,255,255,.9); border-left-color: var(--accent); }
.list tr[data-code]:hover, .list tr.sel { background: var(--accent-soft); }
/* switch */
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle i { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--soft); box-shadow: inset 2px 2px 5px var(--sh-d), inset -2px -2px 5px var(--sh-l); position: relative; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 1px 2px 5px var(--sh-d); transition: left .2s, background .2s; }
.toggle input:checked + i { background: var(--pastel); }
.toggle input:checked + i::after { left: 19px; }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
/* rail extras */
.grp { margin-top: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.rail-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
#bars1 { max-height: 600px; overflow: auto; }
/* flow map */
.g-2e { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.finalq h3 { margin: 4px 0 6px; font-size: 1.05rem; } .finalq p { margin: 0; color: var(--muted); font-size: .9rem; }
.flowmap { display: grid; gap: 14px; }
.lanes { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.lane { background: var(--glass); border: 1px solid rgba(255,255,255,.8); border-radius: 22px; padding: 12px 14px 14px; box-shadow: var(--shadow); }
.lane-tag { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.lane-row { display: flex; align-items: stretch; gap: 8px; }
.arrow { align-self: center; font-size: 1.4rem; color: var(--accent); }
.fcard { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.fcard.t-flag { border-left-color: var(--warn); } .fcard.t-warn { border-left-color: #e0b72f; } .fcard.t-ok { border-left-color: #2e7d4f; }
.fcard .num { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fcard h3 { margin: 0; font-size: .98rem; } .fcard p { margin: 0; font-size: .84rem; } .fcard .look { color: var(--muted); font-size: .78rem; }
.fcard .flive { font-size: .84rem; margin: 4px 0; } .fcard .flive .v { font-weight: 700; } .fcard .flive .det { color: var(--muted); }
.fcard button { justify-self: start; }
.merge { text-align: center; font-size: .85rem; color: var(--muted); position: relative; padding: 6px 0; }
.merge span { background: var(--glass); border: 1px solid rgba(255,255,255,.8); border-radius: 999px; padding: 6px 16px; display: inline-block; }
.merge::before { content: "↓"; display: block; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.scen h3 { margin: 4px 0 8px; } .scen ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; font-size: .88rem; }
@media (max-width: 1000px) { .g-2e, .lanes { grid-template-columns: 1fr; } .lane-row { flex-direction: column; } .arrow { transform: rotate(90deg); } }

/* no coloured left edge: tone is a small dot instead */
.step button, .step.cur button, .step.t-flag button, .step.t-warn button, .step.t-ok button,
.fcard, .fcard.t-flag, .fcard.t-warn, .fcard.t-ok { border-left: 1px solid rgba(255,255,255,.8); }
.fcard { border-color: var(--line); }
.step .num::before, .fcard .num::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--line); vertical-align: 0; }
.t-flag .num::before { background: var(--warn); } .t-warn .num::before { background: #e0b72f; } .t-ok .num::before { background: #2e7d4f; }
.step.cur .num::before { box-shadow: 0 0 0 3px rgba(123,104,238,.25); }

/* ---------- bookmark tabs attached to the sheet ---------- */
:root { --sheet: #edf2fd; }
.funnel { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: min(1444px, calc(100% - 56px)); max-width: none; margin: 0 auto; padding: 10px 0 0; overflow: visible; position: relative; z-index: 2; }
.funnel button { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 62px; padding: 10px 8px 12px; border-radius: 16px 16px 0 0; border: 1px solid rgba(255,255,255,.6); border-bottom: none; background: rgba(255,255,255,.42); color: var(--muted); box-shadow: none; transform: none; margin-bottom: 0; }
.funnel button:hover { background: rgba(255,255,255,.7); color: var(--ink); transform: none; box-shadow: none; }
.funnel button small { font-weight: 500; font-size: .72rem; }
.funnel button[aria-selected="true"] { background: var(--sheet); color: var(--accent); border-color: rgba(255,255,255,.9); box-shadow: 0 -4px 14px rgba(92,104,190,.12); margin-bottom: -1px; padding-bottom: 13px; position: relative; z-index: 3; }
.funnel button[aria-selected="true"]::after { left: 14px; right: 14px; top: 0; bottom: auto; height: 4px; border-radius: 0 0 4px 4px; }
.layout { width: min(1444px, calc(100% - 56px)); max-width: none; margin: 0 auto; padding: 22px; background: var(--sheet); border: 1px solid rgba(255,255,255,.9); border-radius: 0 24px 24px 24px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.statusbar { padding: 0 28px; min-height: 0; }
.statusbar:not(:empty) { padding: 8px 28px; }
.rail { background: rgba(255,255,255,.7); }
@media (max-width: 1000px) { .funnel { width: calc(100% - 28px); overflow-x: auto; grid-template-columns: repeat(7, 120px); } .layout { width: calc(100% - 28px); padding: 14px; } }

/* ---------- larger context rail ---------- */
.layout { grid-template-columns: 390px minmax(0, 1fr); gap: 24px; }
.rail { padding: 18px; }
.rail-h b { font-size: 1.35rem; } .rail-h small { font-size: .95rem; } .eyebrow { font-size: .76rem; }
.toggle { font-size: .9rem; }
.steps { gap: 12px; margin-top: 14px; }
.grp { font-size: .76rem; margin-top: 10px; }
.step button { padding: 14px 16px; gap: 4px; border-radius: 16px; }
.step .num { font-size: .78rem; } .step .q { font-size: .9rem; }
.step .v { font-size: 1.12rem; line-height: 1.25; } .step .det { font-size: .9rem; line-height: 1.4; }
.step .v .pill { font-size: .9rem; padding: 2px 12px; }
.rail-nav button.sm { font-size: .9rem; padding: 8px 16px; }
.rail .note { font-size: .88rem; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

/* sheet corners flush with the first and last tab so the edge reads as one line */
.layout { border-radius: 0 0 24px 24px; }
