/* TPE Market Entry — institutional practice. Black ground, gold for action and passed gates, purple for verified. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --ink: #080808;          /* brand black: the page */
  --panel: #101012;        /* sections */
  --raised: #17171a;       /* inputs, table heads, hover */
  --line: #232327;         /* hairlines */
  --line-2: #2f2f35;       /* control borders */
  --text: #efece4;         /* warm off-white */
  --muted: #9b978d;
  --faint: #6b6860;
  --gold: #c6b453;
  --gold-ink: #d9cb7d;     /* gold text on dark */
  --gold-wash: rgba(198, 180, 83, .10);
  --purple: #9c8cb8;
  --purple-wash: rgba(156, 140, 184, .14);
  --ok: #7fc59a;   --ok-wash: rgba(127, 197, 154, .12);
  --warn: #e0b45c; --warn-wash: rgba(224, 180, 92, .12);
  --bad: #ec8a83;  --bad-wash: rgba(236, 138, 131, .12);
  --r-panel: 10px; --r-ctl: 6px;
  /* kept for templates that reference the old names */
  --gold-soft: var(--gold-wash); --card: var(--panel); --bg: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 14px/1.55 "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01"; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
::selection { background: rgba(198, 180, 83, .35); }

/* type: light headlines, institutional register */
h1 { font-size: 28px; line-height: 1.2; font-weight: 400; letter-spacing: -0.015em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 500; margin: 0 0 12px; letter-spacing: -0.005em; }
h3 { font-size: 13.5px; font-weight: 500; margin: 18px 0 8px; }
p { max-width: 78ch; }
small, .muted { color: var(--muted); }
b, strong { font-weight: 600; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--raised); color: var(--muted); padding: 1px 5px; border-radius: 4px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 12px 32px; background: rgba(8, 8, 8, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.brand b { color: var(--gold); font-size: 10.5px; font-weight: 600; letter-spacing: .2em; }
.brand span { font-size: 15px; font-weight: 400; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 16px; margin-left: 6px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 4px 0; border-bottom: 1px solid transparent; }
.topbar nav a:hover { color: var(--text); border-bottom-color: var(--gold); }
.topbar .spacer { flex: 1; }
.topbar form { display: flex; gap: 6px; align-items: center; }
.topbar input { width: 130px; padding: 5px 9px; }
.topbar label { font-size: 12px; color: var(--muted); }
.topbar .who { font-size: 13px; }
.topbar .who small { color: var(--faint); }
.topbar .toplink { color: var(--muted); font-size: 13px; text-decoration: none; }
.topbar .toplink:hover { color: var(--text); }
.policy { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; color: var(--gold-ink); border: 1px solid rgba(198, 180, 83, .35); white-space: nowrap; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 32px 80px; }
.flash { padding: 10px 14px; border-radius: var(--r-ctl); margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--ok-wash); color: var(--ok); border-color: rgba(127, 197, 154, .3); }
.flash.err { background: var(--bad-wash); color: var(--bad); border-color: rgba(236, 138, 131, .3); }

/* panels: hairline, flat, no shadows */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* key figures: one strip, divided, not four boxes */
.grid.g4:has(> .kpi) { gap: 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel); overflow: hidden; }
.kpi { padding: 18px 22px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: none; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 400; letter-spacing: -0.02em; margin: 4px 0 2px; }
.kpi small { color: var(--faint); }

/* assessment header */
.ahead { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.ahead .id { font-size: 12px; font-weight: 500; color: var(--gold-ink); letter-spacing: .04em; margin-bottom: 4px; }
.ahead h1 { font-size: 30px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13.5px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--gold); }

/* the gate rail: seven workflow gates on one line, gold once passed */
.steps { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; margin: 0 0 30px; }
.steps::before { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; height: 1px; background: var(--line-2); }
.step { position: relative; display: block; padding: 24px 12px 0 0; text-decoration: none; color: var(--text); background: none; border: none; }
.step::before { content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 3px; transform: rotate(45deg) scale(.78);
  background: var(--ink); border: 1px solid var(--line-2); }
.step.done::before { background: var(--gold); border-color: var(--gold); }
/* gold runs between two consecutive passed gates only */
.step.done:has(+ .step.done)::after { content: ""; position: absolute; left: 7px; top: 7px; height: 1px; width: 100%; background: var(--gold); }
.step .n { font-size: 11px; color: var(--faint); font-weight: 500; }
.step.done .n { color: var(--gold-ink); }
.step .t { font-size: 13.5px; font-weight: 500; margin-top: 2px; }
.step .d { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.step:hover .t { color: var(--gold-ink); }
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .steps::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
  .step { padding: 0 0 0 30px; }
  .step.done:has(+ .step.done)::after { display: none; }
}

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td a { text-decoration: none; }
td a:hover { color: var(--gold-ink); }

/* status pills: dot + word, quiet tint */
.b { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 2px 9px 2px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b.ok { background: var(--ok-wash); color: var(--ok); }
.b.bad { background: var(--bad-wash); color: var(--bad); }
.b.warn { background: var(--warn-wash); color: var(--warn); }
.b.gold { background: var(--gold-wash); color: var(--gold-ink); }
.b.grey { background: transparent; color: var(--muted); border-color: var(--line-2); }
.b.purple { background: var(--purple-wash); color: var(--purple); }

/* forms */
label.f { display: inline-block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%;
  padding: 8px 10px; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--gold); }
input[type="file"] { padding: 6px; }
input[type="file"]::file-selector-button { font: inherit; color: var(--text); background: var(--line-2); border: none; border-radius: 4px; padding: 3px 10px; margin-right: 10px; cursor: pointer; }
textarea { min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198, 180, 83, .18); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.fields .wide { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { flex: 1 1 120px; }
.inline > button { flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label, .grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }

/* buttons: gold is the one primary action; everything else is outlined */
button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
  padding: 8px 16px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--raised); color: var(--text);
  transition: border-color .15s, background-color .15s, color .15s;
}
button:hover, .btn:hover { border-color: var(--muted); }
button.sec, .btn.sec { background: transparent; }
button.gold, .btn.gold { background: var(--gold); border-color: var(--gold); color: #0b0b08; }
button.gold:hover, .btn.gold:hover { background: var(--gold-ink); border-color: var(--gold-ink); }
button.danger { background: transparent; color: var(--bad); border-color: rgba(236, 138, 131, .35); }
button.danger:hover { border-color: var(--bad); }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .4; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

details > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
details > summary:hover { color: var(--text); }
.note { font-size: 12.5px; color: var(--faint); }
.mvp { background: var(--warn-wash); border: 1px solid rgba(224, 180, 92, .3); color: var(--warn); border-radius: var(--r-ctl); padding: 10px 14px; font-size: 13px; margin-bottom: 18px; }
.section-preview p { margin: 6px 0; }
.section-preview table td, .section-preview table th { font-size: 12.5px; }
.empty { text-align: center; padding: 56px 10px; color: var(--muted); }
td code { white-space: nowrap; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
ul { padding-left: 20px; }

/* the decision: the one statement each assessment leads with */
.decision { border-left: 2px solid var(--gold); padding: 6px 0 6px 20px; margin: 0 0 24px; }
.decision .k { font-size: 12px; color: var(--gold-ink); }
.decision .s { font-size: 22px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.3; margin-top: 4px; max-width: 70ch; }

/* sign-in, two-step, account */
.login { max-width: 400px; margin: 72px auto; padding: 32px 30px; }
.login h1 { font-size: 26px; }
.qr { display: inline-block; padding: 12px; background: #fff; border-radius: var(--r-ctl); }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { word-break: break-all; font-size: 13px; color: var(--text); }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 28px; margin: 14px 0 22px; }
.codes code { font-size: 15px; padding: 5px 10px; color: var(--text); }

/* approve-all bar on Conclusions */
form.card[action$="approve-pending"] { background: var(--gold-wash) !important; border-color: rgba(198, 180, 83, .3); }

/* guided intake: section list on the left, one section at a time on the right */
.intake { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.isteps { position: sticky; top: 84px; display: flex; flex-direction: column; border-left: 1px solid var(--line-2); }
.istep { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 9px 12px 9px 14px;
  margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); }
.istep .num { grid-row: 1 / 3; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  border: 1px solid var(--line-2); color: var(--muted); margin-top: 1px; }
.istep .t { font-size: 13.5px; color: var(--text); }
.istep .st { font-size: 11.5px; }
.istep:hover .t { color: var(--gold-ink); }
.istep.on { border-left-color: var(--gold); background: var(--panel); }
.istep.is-complete .num { background: var(--gold); border-color: var(--gold); color: #0b0b08; }
.istep.is-complete .st { color: var(--gold-ink); }
.istep.is-todo .st { color: var(--warn); }
.istep.is-na .t, .istep.is-na .st, .istep.is-optional .st { color: var(--faint); }
.istep.is-review .num { border-style: dashed; }
.ipanel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 26px 28px; }
.ihead { margin-bottom: 18px; }
.ihead .k { font-size: 12px; color: var(--gold-ink); }
.ihead h2 { font-size: 24px; font-weight: 400; letter-spacing: -0.01em; margin: 4px 0 6px; }
.ihead p { margin: 0; }
.todo { background: var(--warn-wash); border: 1px solid rgba(224, 180, 92, .28); border-radius: var(--r-ctl); padding: 12px 16px; margin-bottom: 20px; color: var(--text); }
.todo b { color: var(--warn); font-weight: 500; font-size: 13px; }
.todo ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.iform h3 { margin-top: 26px; }
.qs { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0 28px; margin-top: 18px; }
.q { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.q .ql { font-size: 13.5px; }
.q.unanswered .ql::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 8px; vertical-align: middle; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); overflow: hidden; flex: none; }
.seg label { display: block; margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 12px; font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--line-2); }
.seg label:first-child span { border-left: none; }
.seg input:checked + span { background: var(--gold); color: #0b0b08; }
.seg label:last-child input:checked + span { background: var(--line-2); color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
.ifoot { display: flex; gap: 10px; align-items: center; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.ifoot .spacer { flex: 1; }
.sub { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.sub h2 { font-size: 15px; }
.sub table { min-width: 860px; }
.sub td:first-child, .sub td:last-child { white-space: nowrap; }
.findings { list-style: none; padding: 0; margin: 0; }
.findings li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.intake-new { max-width: 860px; }
@media (max-width: 960px) {
  .intake { grid-template-columns: 1fr; gap: 16px; }
  .isteps { position: static; flex-direction: row; overflow-x: auto; border-left: none; border-bottom: 1px solid var(--line-2); }
  .istep { grid-template-columns: 24px auto; border-left: none; border-bottom: 2px solid transparent; margin: 0 0 -1px; white-space: nowrap; }
  .istep.on { border-bottom-color: var(--gold); background: none; }
  .istep .st { display: none; }
  .isteps { scroll-snap-type: x proximity; }
  .istep.on { scroll-snap-align: center; }
  .ipanel { padding: 20px 18px; }
}

@media (max-width: 720px) {
  .topbar { position: static; padding: 10px 16px; gap: 12px; }
  .topbar nav { margin-left: 0; gap: 6px 14px; flex-wrap: wrap; width: 100%; }
  .topbar nav a { white-space: nowrap; }
  main { padding: 22px 16px 60px; }
  .kpi { border-right: none; border-bottom: 1px solid var(--line); }
  .g2 { grid-template-columns: 1fr; }
  h1, .ahead h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* market signal */
.market .mhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.market .mline { font-size: 17px; line-height: 1.45; color: var(--text); margin: 4px 0 6px; }
.mcharts { margin: 14px 0 8px; }
.mcharts figure { margin: 0; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 6px; }
.mcharts figcaption { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mchart { width: 100%; height: auto; display: block; }
.mchart .ax { fill: var(--muted); font-size: 10px; }
.mchart .pl { fill: var(--muted); font-size: 9.5px; letter-spacing: .02em; }
.mchart .gl { stroke: var(--line); stroke-width: 1; }
.mchart .bar { fill: #4a473f; }
.mchart .bar.rec { fill: var(--gold); }
.mchart polyline { stroke-width: 2; stroke-linejoin: round; }
.mchart .lab { font-size: 10.5px; stroke: none; }
.mchart polyline.ln-d { stroke: var(--gold); } .mchart text.ln-d { fill: var(--gold); }
.mchart polyline.ln-r { stroke: var(--purple); } .mchart text.ln-r { fill: var(--purple); }
.mchart polyline.ln-h { stroke: #8a877f; stroke-dasharray: 4 3; } .mchart text.ln-h { fill: #8a877f; }
table.signals tr.primary td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
@media (max-width: 760px) {
  table.signals thead { display: none; }
  table.signals, table.signals tbody, table.signals tr, table.signals td { display: block; width: 100%; }
  table.signals tr { padding: 12px 0 12px 12px; border-bottom: 1px solid var(--line); }
  table.signals td { border: 0; padding: 2px 0; }
  table.signals tr.primary { box-shadow: inset 2px 0 0 var(--gold); }
  table.signals tr.primary td:first-child { box-shadow: none; }
  table.signals td:nth-child(4)::before { content: "Evidence "; color: var(--muted); font-size: 12px; }
  table.signals td:nth-child(5)::before { content: "Needed next: "; color: var(--muted); font-size: 12px; }
}
@media (max-width: 760px) { .card td .b { white-space: normal; } .grid.g2 > .card { min-width: 0; } }

/* market data explorer */
.mxtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.mxtabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 12px; font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 0; }
.mxtabs button:hover { color: var(--text); }
.mxtabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.mxchart { margin: 0 0 26px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 10px; }
.mxhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mxhead figcaption { font-size: 15px; color: var(--text); font-weight: 500; }
.mxlegend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mxlegend .lg { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 12px; padding: 3px 9px; border-radius: 99px; cursor: pointer; }
.mxlegend .lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.mxlegend .lg.line i, .mxlegend .lg.dash i, .mxlegend .lg.ref i { height: 2px; width: 14px; border-radius: 0; }
.mxlegend .lg.off { opacity: .38; }
.mxsvg { width: 100%; height: auto; display: block; }
.mxsvg .ax { fill: var(--muted); font-size: 11px; }
.mxsvg .ax.hl { fill: var(--gold); font-weight: 600; }
.mxsvg .ax.ref { fill: var(--text); }
.mxsvg .gl { stroke: var(--line); }
.mxsvg .zl { stroke: var(--line-2); }
.mxsvg .br.hl { stroke: var(--text); stroke-width: 1; }
.mxsvg .hlrow { fill: rgba(198,180,83,.08); }
.mxsvg rect:hover, .mxsvg .pt:hover { opacity: .8; }
.mxtable { margin-top: 10px; max-height: 340px; overflow: auto; }
.mxtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mxtable th { text-align: right; } .mxtable th:first-child { text-align: left; }
.mxtable tr.hl td { color: var(--gold); }
.mxctl { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 10px 0 16px; }
.mxctl .inl { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.mxctl select { width: auto; }
.mxsplit { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.mxpick details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.mxpick summary { cursor: pointer; font-size: 13px; color: var(--text); padding: 4px 0; }
.mxpick .ck { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; color: var(--text); cursor: pointer; }
.mxpick .ck input { width: auto; margin: 0; }
.mxview .mxchart { margin-top: 0; }
.warnline { color: var(--warn, #d9a441); }
@media (max-width: 760px) { .mxsplit { grid-template-columns: minmax(0, 1fr); } .mxsplit > * { min-width: 0; } .mxchart { padding: 12px 10px 8px; } .mxctl .seg { flex-wrap: wrap; } }
.mxctl .seg button { background: none; border: 0; border-left: 1px solid var(--line-2); border-radius: 0; padding: 5px 12px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.mxctl .seg button:first-child { border-left: 0; }
.mxctl .seg button.on { background: var(--raised); color: var(--text); }

/* open decisions */
.odec .od { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.odec .odq { margin-bottom: 8px; }
.odec .odp { gap: 18px; }
.odec .odp .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.odec .odp p { margin: 0 0 6px; }
.odec .odp ul { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }
.istep .op { color: var(--purple); }
.opennote { border-left: 2px solid var(--purple); padding: 8px 12px; margin: 0 0 14px; background: var(--purple-wash); color: var(--text); }
.mxsvg .ax.sm { font-size: 9.5px; }

/* opportunity theses */
.opp { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--ink); }
.opp.rel { border-left: 2px solid var(--gold); }
.opph { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.opp ul.ind { list-style: none; padding: 0; margin: 8px 0; }
.opp ul.ind li { padding: 3px 0; font-size: 13.5px; }
.opp ul.ind .mk { display: inline-block; width: 18px; }
.opp ul.ind li.pro .mk { color: var(--ok); } .opp ul.ind li.con .mk { color: var(--bad, #ec8a83); }
.opp ul.ind small { color: var(--muted); }
.mopps { margin: 10px 0 14px; }
.mopps .row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* action plan */
.ownsum { display: flex; flex-wrap: wrap; gap: 6px; }
.ownsum a { text-decoration: none; }
table.plan td { vertical-align: top; }
table.plan tr.done td { opacity: .55; }
table.plan tr.crit td:first-child { box-shadow: inset 2px 0 0 var(--bad, #ec8a83); }
.ownform { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; margin: 0; }
.ownform select { width: auto; max-width: 150px; font-size: 12.5px; padding: 3px 6px; }
@media (max-width: 760px) { table.plan thead { display: none; } table.plan, table.plan tbody, table.plan tr, table.plan td { display: block; width: 100%; } table.plan tr { border-bottom: 1px solid var(--line); padding: 8px 0; } table.plan td { border: 0; padding: 2px 0; } }

/* evidence */
.evstats { display: grid; grid-template-columns: auto auto 1fr; gap: 28px; align-items: start; margin-bottom: 10px; }
.evstats .v { font-size: 26px; font-weight: 500; } .evstats .v.bad { color: var(--bad, #ec8a83); }
.evstats .l { font-size: 12px; color: var(--muted); }
details.evi { border-top: 1px solid var(--line); }
details.evi summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 12px 0; }
details.evi summary::-webkit-details-marker { display: none; }
details.evi summary::before { content: "›"; color: var(--muted); width: 10px; transition: transform .15s; }
details.evi[open] summary::before { transform: rotate(90deg); }
details.evi summary .t { font-weight: 500; }
details.evi summary .meta { width: 100%; padding-left: 20px; font-size: 12.5px; color: var(--muted); }
details.evi.done summary .t { color: var(--muted); }
.evbody { padding: 0 0 16px 20px; }
.evgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.evbody .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 6px 0 4px; }
.evbody p { margin: 0 0 8px; }
.evbody ul.why { list-style: none; padding: 0; margin: 0 0 8px; } .evbody ul.why li { padding: 4px 0; }
.evform { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (max-width: 760px) { .evstats, .evgrid { grid-template-columns: 1fr; gap: 12px; } .evbody { padding-left: 0; } }

/* tourism market opportunity signal */
.tmos { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0 14px; background: var(--ink); }
.tmos > .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.tmos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.tmos .tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tmos .tile .l { font-size: 12px; color: var(--muted); }
.tmos .tile .v { font-size: 26px; font-weight: 500; margin: 2px 0; } .tmos .tile .v.ne { font-size: 17px; color: var(--muted); padding: 6px 0; }
.tmos p { margin: 6px 0; }
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.ladder .lv { border-left: 2px solid var(--line-2); padding: 4px 10px; display: flex; flex-direction: column; gap: 3px; }
.ladder .lv.ok { border-left-color: var(--ok); }
.ladder .lv .n { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ladder .lv .b { align-self: flex-start; }
.destcap { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.destcap summary { cursor: pointer; }
@media (max-width: 760px) { .tmos-grid, .ladder { grid-template-columns: 1fr; } }

/* gate help + next actions */
.gatehelp { margin: -14px 0 24px; }
.gatehelp summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.gatehelp summary:hover { color: var(--text); }
.ghgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.gh { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); font-size: 13px; }
.gh.done { opacity: .6; }
.gh .n { font-weight: 500; display: flex; justify-content: space-between; gap: 6px; align-items: center; margin-bottom: 4px; }
.gh p { margin: 4px 0; color: var(--muted); } .gh p b { color: var(--text); font-weight: 500; }
.gh .blk ul { margin: 4px 0 0 16px; padding: 0; } .gh .blk { margin-top: 6px; }
.nexts ol { list-style: none; counter-reset: nx; padding: 0; margin: 0; }
.nexts li { counter-increment: nx; border-top: 1px solid var(--line); }
.nexts li:first-child { border-top: 0; }
.nexts a.nx { display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto auto; column-gap: 10px; padding: 10px 0; text-decoration: none; color: var(--text); }
.nexts a.nx::before { content: counter(nx); grid-row: 1 / 4; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.nexts a.nx .g { font-size: 11.5px; color: var(--gold); letter-spacing: .04em; grid-column: 2; }
.nexts a.nx b { grid-column: 2; font-weight: 500; } .nexts a.nx small { grid-column: 2; color: var(--muted); }
.nexts a.nx .b { grid-column: 3; grid-row: 1 / 4; align-self: center; }
.nexts a.nx:hover b { text-decoration: underline; }
@media (max-width: 760px) { .nexts a.nx { grid-template-columns: 30px 1fr; } .nexts a.nx .b { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 4px; } }

/* field help (? with popup) + dictionary */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  margin-left: 6px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); font-size: 10.5px;
  font-weight: 600; line-height: 1; cursor: help; vertical-align: 1px; outline: none; }
.tip:hover, .tip:focus-visible, .tip:focus { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.tipbox { display: none; position: absolute; z-index: 30; top: calc(100% + 8px); left: -10px; width: 300px; max-width: 80vw;
  padding: 11px 13px; background: var(--raised, #1a1a1d); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); color: var(--text); font-size: 12.5px; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; cursor: default; }
.tip:hover .tipbox, .tip:focus .tipbox, .tip:focus-within .tipbox { display: block; }
.tipbox .th { display: block; margin-bottom: 6px; }
.tipbox .tw { display: block; color: var(--muted); margin-bottom: 6px; }
.tipbox a { color: var(--gold); text-decoration: none; font-size: 12px; }
.tipbox::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }  /* hover bridge */
.dictsearch input { width: 100%; }
.dictnav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.dictnav a { color: var(--muted); }
.dentry { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.dentry p { margin: 0 0 4px; }
.dentry.hit { background: var(--gold-wash); box-shadow: inset 2px 0 0 var(--gold); padding-left: 10px; }
@media (max-width: 760px) { .dentry { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Panama Intelligence Feed (v0.6.0) ---- */
.intelstat p { margin: 0; line-height: 1.6; }
.bad-t { color: var(--bad); }
.viewtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.viewtabs a { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); text-decoration: none; font-size: 13px; }
.viewtabs a.on { color: var(--text); border-color: var(--gold); background: var(--gold-wash); }
.intelf .row { margin: 8px 0; }
.intelf .row label { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.intelf .row select { width: auto; max-width: 320px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 8px 0; }
.fgrid input[type="search"] { grid-column: span 2; }
.fgrid .dr { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fgrid .dr input { flex: 1; min-width: 0; }
a.small { font-size: 12.5px; }
.intelday h3 { font-size: 12px; color: var(--faint); font-weight: 500; letter-spacing: .06em; margin: 22px 0 8px; }
.intelitem { padding: 16px 20px; margin-bottom: 10px; }
.intelitem.sample { border-style: dashed; }
.intelitem h3 { font-size: 16px; font-weight: 500; margin: 8px 0 6px; }
.intelitem h3 a { color: var(--text); text-decoration: none; }
.intelitem h3 a:hover { color: var(--gold-ink); }
.intelitem p { margin: 4px 0; }
.ihead { display: flex; gap: 6px; flex-wrap: wrap; }
.why { font-size: 13px; background: var(--gold-wash); border-radius: 6px; padding: 6px 10px; }
.imeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--faint); margin-top: 8px; align-items: center; }
.imeta form.inl { display: inline; }
button.link { background: none; border: none; padding: 0; color: var(--gold-ink); font-size: 12px; cursor: pointer; }
button.link:hover { text-decoration: underline; }
table.kv th { width: 34%; text-align: left; font-weight: 500; color: var(--muted); vertical-align: top; }
table.kv td ul, .flags { margin: 0; padding-left: 18px; }
.flags li { font-size: 13px; margin: 3px 0; }
tr.off td { opacity: .5; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--faint); font-size: 13px; margin: 6px 0 10px; }
.flow span { color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 10px; }
.cand { border-top: 1px solid var(--line); padding: 12px 0; }
.cand p { margin: 6px 0; font-size: 13.5px; }
.stageline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.stageline .st { font-size: 12px; text-align: center; padding: 8px 4px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--faint); }
.stageline .st.rep { border-color: var(--warn); color: var(--warn); }
.stageline .st.ver { background: var(--gold); border-color: var(--gold); color: #0b0b08; }
@media (max-width: 640px) {
  .fgrid input[type="search"] { grid-column: auto; }
  .stageline { grid-template-columns: 1fr; }
  table.kv th { width: 40%; }
}
@media (max-width: 640px) {
  .intelf .row label { flex-wrap: wrap; width: 100%; }
  .intelf .row select { max-width: 100%; width: 100%; }
  table.kv, table.kv tbody, table.kv tr, table.kv th, table.kv td { display: block; width: 100%; }
  table.kv th { padding-bottom: 0; border-bottom: none; }
  table.kv td { overflow-wrap: anywhere; }
}

/* ---- Land to permit process map (v0.6.2) ---- */
.lpintro p { margin: 6px 0; }
.lplegend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lpphases { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lpph { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 6px;
        color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.25; position: relative; }
.lpph .n { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-ink);
           display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.lpph.st-done { border-color: var(--ok); } .lpph.st-open { border-color: var(--warn); } .lpph.st-na { opacity: .45; }
.lpgridwrap { overflow-x: auto; margin-top: 8px; max-width: 100%; }
.lpphase, .lpintro { min-width: 0; }
.lpgrid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; min-width: 980px; }
.lpgrid > div { background: var(--panel, var(--bg)); padding: 6px; }
.lpgrid .h { font-size: 12px; color: var(--faint); letter-spacing: .04em; padding: 8px 6px; }
.lpgrid .lane { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; }
.lpgrid .cell { display: flex; flex-direction: column; gap: 4px; }
.chip { display: block; font-size: 11.5px; line-height: 1.25; padding: 4px 7px; border-radius: 5px; text-decoration: none; }
.lplegend .chip { display: inline-block; }
.chip.lead { background: var(--gold); color: #0b0b08; }
.chip.involved { border: 1px solid var(--gold); color: var(--gold-ink); }
.chip.s-na { opacity: .25; }
.chip.lead.s-maybe { opacity: .55; }
.chip.involved.s-maybe { border-style: dashed; }
.chip.lead.s-done { background: var(--ok); color: #0b0b08; }
.chip.involved.s-done { border-color: var(--ok); color: var(--ok); }
.chip.s-open, .chip.s-review { box-shadow: inset 4px 0 0 var(--warn); padding-left: 10px; }
.lpsteps { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: s; }
.lpstep { border-top: 1px solid var(--line); padding: 12px 0; }
.lpstep.st-na { opacity: .5; }
.lpstep p { margin: 6px 0; }
.lpmeta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; }
.lprules, .lpsrc { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.lpstep:target { background: var(--gold-wash); }
@media (max-width: 760px) {
  .lpphases { grid-template-columns: 1fr 1fr; }
}
.lpstep .row { flex-wrap: wrap; gap: 6px; }
.lpstep .b, .lpphase .b { white-space: normal; }

.appver { text-align: center; color: var(--faint); font-size: 11.5px; padding: 18px 16px 28px; }

.govdoc { border-left: 3px solid var(--gold); padding: 8px 12px; margin: 8px 0 12px; background: var(--gold-wash); border-radius: 0 6px 6px 0; }
.lpstudies tr.st-na td { opacity: .5; }

/* ---- Project timeline (v0.6.5) ---- */
.tlbig { font-size: 26px; margin: 4px 0 8px; }
.gold-t { color: var(--gold-ink); }
.tlnow { margin: 0; padding-left: 18px; } .tlnow li { margin: 4px 0; }
.tllegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.tllegend .lg { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg.crit { background: var(--gold); } .lg.norm { background: var(--muted); } .lg.done { background: var(--ok); }
.lg.cond { border: 1px dashed var(--gold); } .lg.slow { background: var(--line-2); }
.tlwrap { overflow-x: auto; margin-top: 10px; max-width: 100%; }
.tlgrid { min-width: 900px; }
.tlhead, .tlrow { display: grid; grid-template-columns: 260px 1fr; align-items: center; }
.tlaxis { position: relative; height: 22px; border-bottom: 1px solid var(--line); }
.tlaxis span { position: absolute; top: 2px; font-size: 11px; color: var(--faint); transform: translateX(2px); white-space: nowrap; }
.tltrack { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 0 4px; }
.tlrow { min-height: 30px; border-bottom: 1px solid var(--line); }
.tlname { font-size: 12.5px; padding: 4px 10px 4px 0; line-height: 1.25; }
.tlname a { color: var(--text); text-decoration: none; } .tlname a:hover { color: var(--gold-ink); }
.tlname small { display: block; color: var(--faint); font-size: 11px; }
.tlbars { position: relative; height: 30px; }
.tlgridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.tltoday { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); z-index: 3; }
.tlslow { position: absolute; top: 9px; height: 12px; background: var(--line-2); border-radius: 3px; }
.tlfast { position: absolute; top: 9px; height: 12px; background: var(--muted); border-radius: 3px; z-index: 2; }
.tlrow.is-crit .tlfast { background: var(--gold); }
.tlrow.is-crit .tlslow { background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.tlrow.is-done .tlfast { background: var(--ok); } .tlrow.is-done .tlslow { display: none; }
.tlrow.is-cond .tlfast { background: transparent; border: 1px dashed var(--gold); }
.tlrow.is-cond .tlslow { background: transparent; border: 1px dashed var(--line-2); }
.tlrow.is-cond .tlname a { color: var(--muted); }
.tlms { position: absolute; top: 8px; width: 12px; height: 12px; background: var(--gold); transform: translateX(-6px) rotate(45deg); z-index: 2; }
.tlms.slow { background: transparent; border: 1px solid var(--gold); }
.tltable tr.is-done td { opacity: .65; }
.tlform { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 6px; margin-top: 6px; min-width: 260px; }
.tlform label { font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.tlform .row { grid-column: 1 / -1; }
@media (max-width: 640px) { .tlhead, .tlrow { grid-template-columns: 170px 1fr; } .tlbig { font-size: 22px; } }

/* land & zoning (v0.6.6) */
.zproc { border-top: 1px solid var(--line-2); padding: 10px 0; }
.zproc > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zproc > summary::-webkit-details-marker { display: none; }
.zproc > summary::before { content: "▸"; color: var(--muted); margin-right: 2px; }
.zproc[open] > summary::before { content: "▾"; }
.zbody { padding: 8px 0 4px 16px; }
.ztable td { vertical-align: top; }
.zform .f { display: block; margin-bottom: 8px; }
.zmiss { columns: 2; font-size: 13px; margin: 6px 0; }
.zhist { padding-left: 16px; }
@media (max-width: 760px) { .zmiss { columns: 1; } .zbody { padding-left: 4px; } }
.zfacts { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.zfacts > summary { cursor: pointer; }
.zfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; margin: 12px 0; }
.zfgrid .f { margin: 0; }
.ztable td:first-child { white-space: nowrap; }
