/* Guided funding plan wizard (ADR-0077). Uses the design system tokens. Status is never colour alone: every badge carries text. */
.fgw { color: var(--text-primary); }
.fgw-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fgw-promise { margin: 0 0 8px; max-width: none; font-size: 1rem; line-height: 1.5; }
.fgw-save { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fgw-saved { font-size: .85rem; color: var(--text-secondary); }
.fgw-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.fgw-aside { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--bg-card, transparent); position: sticky; top: 12px; }
.fgw-aside-h { font-size: .95rem; margin: 0 0 8px; }
.fgw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fgw-step-btn { width: 100%; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px; cursor: pointer; color: inherit; font: inherit; }
.fgw-step-btn:hover { border-color: var(--border); }
.fgw-step-btn:focus-visible, .fgw-btn:focus-visible, .fgw-link:focus-visible { outline: 3px solid var(--c-focus, #1d4ed8); outline-offset: 2px; }
.fgw-step.is-current .fgw-step-btn { border-color: var(--border); background: rgba(127,127,127,.08); }
.fgw-step-num { font-weight: 700; font-size: .85rem; border: 1px solid var(--border); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.fgw-step-label { display: block; font-weight: 600; font-size: .9rem; }
.fgw-step-sum { display: block; font-size: .8rem; color: var(--text-secondary); }
.fgw-badge { font-size: .72rem; font-weight: 700; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.fgw-badge-reviewed { border-color: #15803d; }
.fgw-badge-needs_review { border-color: #b45309; }
.fgw-badge-skipped { border-style: dashed; }
.fgw-count { font-size: .8rem; color: var(--text-secondary); margin: 0 0 2px; }
.fgw-h { font-size: 1.35rem; margin: 0 0 10px; }
.fgw-h:focus { outline: none; }
.fgw-lead { margin: 0 0 12px; }
.fgw-sub { font-size: 1rem; margin: 18px 0 6px; }
.fgw-note, .fgw-help { font-size: .85rem; color: var(--text-secondary); }
.fgw-error { color: var(--c-error, #b91c1c); min-height: 1.2em; margin: 6px 0; font-size: .9rem; }
.fgw-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.fgw-fieldset legend { font-weight: 700; padding: 0 6px; }
.fgw-radio, .fgw-check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.fgw-primary-pick { padding-left: 24px; font-size: .85rem; color: var(--text-secondary); }
.fgw-opt { border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 6px; }
.fgw-opt:last-child { border-bottom: none; }
.fgw-field { display: grid; gap: 4px; margin: 8px 0; }
.fgw-field input, .fgw-field select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input, transparent); color: inherit; min-height: 40px; }
.fgw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fgw-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.fgw-btn { font: inherit; font-weight: 600; padding: 9px 16px; min-height: 40px; border-radius: 8px; border: 1px solid var(--border); background: none; color: inherit; cursor: pointer; }
.fgw-btn.fgw-primary { background: var(--c-primary, #1d4ed8); border-color: var(--c-primary, #1d4ed8); color: #fff; }
.fgw-link { background: none; border: none; padding: 0; color: var(--c-primary, #1d4ed8); text-decoration: underline; cursor: pointer; font: inherit; }
.fgw-narrative { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.fgw-narrative h3 { font-size: .95rem; margin: 0 0 4px; }
.fgw-skipbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.fgw-skipbar p { margin: 0; flex: 1 1 280px; }
.fgw-assoc, .fgw-conflict { border: 1px solid var(--border); border-left: 4px solid #b45309; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.fgw-review { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fgw-position { display: grid; gap: 4px; margin: 6px 0; }
.fgw-pos { display: flex; gap: 12px; }
.fgw-pos dt { font-weight: 700; min-width: 100px; }
.fgw-pos dd { margin: 0; }
.fgw-refine { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 8px; }
.fgw-refine h3 { font-size: 1rem; margin: 0 0 2px; }
/* UX layer (ADR-0078) */
.fgw-sofar { margin: 0 0 12px; }
.fgw-sofar > summary { cursor: pointer; list-style: none; }
.fgw-sofar > summary::-webkit-details-marker { display: none; }
.fgw-sofar > summary .fgw-aside-h::after { content: ' (show or hide)'; font-weight: 400; font-size: .75rem; color: var(--text-secondary); }
.fgw-sofar-list, .fgw-summary-list { margin: 6px 0 0; display: grid; gap: 6px; }
.fgw-sofar-row dt { font-size: .75rem; font-weight: 700; color: var(--text-secondary); text-transform: none; }
.fgw-sofar-row dd { margin: 0; font-size: .88rem; overflow-wrap: anywhere; }
.fgw-summary { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.fgw-summary h3 { font-size: .95rem; margin: 8px 0 2px; }
.fgw-summary h3:first-child { margin-top: 0; }
.fgw-summary ul { margin: 4px 0; padding-left: 20px; }
.fgw-full, .fgw-more { margin: 10px 0; }
.fgw-full > summary, .fgw-more > summary { cursor: pointer; font-weight: 600; }
.fgw-value { border-left: 4px solid #15803d; padding: 6px 12px; margin: 0 0 12px; background: rgba(127,127,127,.06); border-radius: 0 8px 8px 0; }
.fgw-why { font-size: .85rem; color: var(--text-secondary); margin: 8px 0 2px; }
.fgw-changed { min-height: 1.2em; font-size: .9rem; margin: 8px 0 0; }
.fgw-cards { display: grid; gap: 12px; margin: 0 0 12px; }
.fgw-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.fgw-card h3 { font-size: 1rem; margin: 0 0 4px; display: inline; }
.fgw-action-more { margin: 8px 0; }
.fgw-action-more > summary { cursor: pointer; font-weight: 600; }
@media (max-width: 800px) {
  .fgw-layout { grid-template-columns: 1fr; }
  .fgw-aside { position: static; }
  .fgw-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .fgw-step-btn { transition: border-color .15s; } }

/* One navigation (ADR-0079): eight steps across the top, compact selector on narrow screens. */
.fgw-layout, .fgw-aside { display: block; }
.fgw-stepper { margin: 0 0 8px; }
.fgw-steps { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; overflow-x: auto; }
.fgw-step-btn { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 2px; padding: 8px 6px; min-height: 44px; }
.fgw-step.is-current .fgw-step-btn { border: 2px solid var(--c-primary, #1d4ed8); background: rgba(29,78,216,.08); }
.fgw-step-label { font-size: .82rem; }
.fgw-compact { display: none; }
.fgw-journey { font-size: .85rem; color: var(--text-secondary); margin: 0; }
.fgw-statusline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: .85rem; margin: 0 0 8px; }
.fgw-sofar { border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; margin: 0 0 14px; }
.fgw-sofar > summary { cursor: pointer; font-size: .9rem; }
.fgw-sofar-h { font-weight: 700; }
.fgw-sofar-brief { color: var(--text-secondary); margin-left: 8px; overflow-wrap: anywhere; }
.fgw-secondary { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.fgw-tool { border-top: 1px solid var(--border); padding-top: 8px; }
@media (max-width: 760px) {
  .fgw-steps { display: none; }
  .fgw-compact { display: grid; gap: 4px; }
  .fgw-compact-now { margin: 0; font-weight: 700; }
  .fgw-compact-label { font-size: .8rem; color: var(--text-secondary); }
  .fgw-compact select { font: inherit; padding: 8px 10px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; }
  .fgw-sofar-brief { display: none; }
}

/* Screenshot review (ADR-0080) */
.fgw-lead, .fgw-summary, .fgw-body > p { max-width: none; }
.fgw-welcome { color: var(--text-secondary); }
.fgw-pin { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; color: var(--text-secondary); cursor: pointer; }
.fgw-pinned .fgw-stepper { position: sticky; top: 0; z-index: 20; background: var(--bg-surface, #fff); padding: 6px 0; border-bottom: 1px solid var(--border); }

/* Inputs the user fills in are visually distinct from read-only evidence. */
.fgw-input-card { background: var(--bg-input-card, rgba(29,78,216,.05)); border: 1px solid var(--border); border-left: 4px solid var(--c-primary, #1d4ed8); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.fgw-reset { margin-top: 6px; justify-self: start; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: inherit; min-height: 32px; }
.fgw-reset:hover { border-color: var(--c-primary, #1d4ed8); }

/* Footer secondary actions are real, distinctly coloured buttons. */
.fgw-secondary { gap: 10px; }
.fgw-review-btn { background: #0f766e; border-color: #0f766e; color: #fff; }
.fgw-review-btn:hover { background: #115e59; border-color: #115e59; }
.fgw-save-btn { background: #fff7ed; border: 2px solid #c2410c; color: #9a3412; font-weight: 600; }
.fgw-save-btn:hover { background: #ffedd5; }

/* Step 8: plan summary left, "To resolve" right. */
.fgw-twopanel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin: 0 0 14px; }
.fgw-panel { min-width: 0; }
.fgw-panel:not(.fgw-input-card) { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.fgw-resolve { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.fgw-resolve-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.fgw-reviewed > summary { cursor: pointer; }
@media (max-width: 800px) { .fgw-twopanel { grid-template-columns: 1fr; } .fgw-pin { margin-left: 0; } }

/* Inputs in a row share one top edge, whatever sits beneath them. */
.fgw-row { align-items: start; }
.fgw-field { align-content: start; }

/* Text never wraps before the container edge. */
.fgw p, .fgw li, .fgw dd, .fgw dt, .fgw-narrative, .fgw-narrative p { max-width: none; }

/* ADR-0081 combined release */
.fgw-para{margin:.5rem 0}
.fgw-tag-reported,.fgw-tag-unknown,.fgw-tag-supplied{border-left:3px solid var(--fgw-line,#c9d3e0);padding-left:.6rem}
.fgw-tag-unknown{border-left-color:#b45309}
.fgw-tag-supplied{border-left-color:#2563eb}
.fgw-quota progress{width:100%;height:.6rem}
.fgw-update{margin:.75rem 0;padding:.6rem .8rem;border:1px solid #2563eb;border-radius:6px;background:#eff6ff}
.fgw-update .fgw-btn{margin-right:.5rem}
.fgw-followup{margin:.5rem 0}
.fgw-addrow{margin:.5rem 0 1rem}
.fgw-fin-summary,.fgw-gaps{margin:.75rem 0;padding:.6rem .8rem;border:1px solid var(--fgw-line,#c9d3e0);border-radius:6px}
.fgw-gaps{border-color:#b45309}
.fgw-plan-narrative p{margin:.4rem 0}
.fgw-fieldset{border:1px solid var(--fgw-line,#c9d3e0);border-radius:6px;margin:.75rem 0;padding:.5rem .8rem}
.fgw-inline select{margin-left:.4rem}

.fgw-insights{margin:.4rem 0 .6rem 1.2rem;padding:0}
.fgw-insights li{margin:.35rem 0}
.fgw-busy{display:flex;align-items:center;gap:.6rem;margin:.5rem 0;padding:.6rem .8rem;border:1px solid #2563eb;border-radius:6px;background:#eff6ff;color:#1e3a8a}
.fgw-busy-text{animation:fgw-blink 1s steps(1,end) infinite}
.fgw-spinner{width:1.1rem;height:1.1rem;flex:0 0 auto;border:3px solid #bfdbfe;border-top-color:#2563eb;border-radius:50%;animation:fgw-spin .9s linear infinite}
@keyframes fgw-blink{0%,100%{opacity:1}50%{opacity:.35}}
@keyframes fgw-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.fgw-busy-text,.fgw-spinner{animation:none}}

/* ADR-0083 wizard refinement: guidance, help, readiness, working budget, alternatives, review */
.fgw-guide { margin: 0 0 12px; max-width: 70ch; color: var(--text-secondary); }
.fgw-readiness { font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; }
.fgw-readiness-ready { border-color: #15803d; color: #166534; }
.fgw-readiness-draft { border-color: #b45309; color: #92400e; }
.fgw-help-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-width: 24px; margin-left: 6px; padding: 0; font: inherit; font-size: .8rem; font-weight: 700; line-height: 1; color: var(--c-primary, #1d4ed8); background: transparent; border: 1px solid currentColor; border-radius: 50%; cursor: pointer; vertical-align: middle; }
.fgw-help-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.fgw-help-pop { margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid #2563eb; border-radius: 8px; background: var(--bg-input-card, rgba(29,78,216,.05)); font-size: .9rem; }
.fgw-help-pop p { margin: 0 0 6px; }
.fgw-help-pop p:last-child { margin-bottom: 0; }
.fgw-field textarea, .fgw-inline-form textarea { width: 100%; min-height: 4.5rem; resize: vertical; font: inherit; box-sizing: border-box; overflow: hidden; }
.fgw-unknown { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; font-size: .9rem; }
.fgw-wide { grid-column: 1 / -1; }
.fgw-inline-form { display: grid; gap: 8px; margin: 8px 0; }
.fgw-lines { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.fgw-line { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.fgw-alt-lines { margin: 4px 0 8px 1.1rem; padding: 0; }
.fgw-receipts { margin: 4px 0 0 1.1rem; padding: 0; font-size: .9rem; }
.fgw-fin-h, .fgw-plan-sec, .fgw-purpose-h, .fgw-res-h, .fgw-sum-h, .fgw-steps-h { font-size: 1.05rem; margin: 18px 0 6px; }
.fgw-chip { display: inline-block; font-size: .75rem; font-weight: 700; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-right: 6px; }
.fgw-check-row { display: flex; gap: 8px; align-items: baseline; margin: 4px 0; }
.fgw-checklist { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.fgw-action-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; margin: 4px 0; }
.fgw-why-fit, .fgw-check-first { margin: 4px 0; font-size: .9rem; }
.fgw-check-first { color: #92400e; }
.fgw-quota-wrap { margin-top: 8px; font-size: .85rem; }
.fgw-ready-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.fgw-ready-why { font-size: .9rem; color: var(--text-secondary); }
.fgw-sofar-list { margin: 8px 0 0; display: grid; gap: 4px; }
.fgw-sofar-row { display: grid; grid-template-columns: 11rem 1fr; gap: 8px; }
.fgw-sofar-row dt { font-weight: 600; }
.fgw-sofar-row dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .fgw-sofar-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .fgw-spinner, .fgw-busy-text { animation: none; } }

/* Secondary footer actions stay real buttons (ADR-0080) but never compete with the one primary button. */
.fgw-btn.fgw-quiet-btn { background: transparent; border: 1px solid var(--border); color: var(--text-primary, inherit); font-weight: 600; }
.fgw-btn.fgw-quiet-btn:hover { background: var(--bg-input-card, rgba(29,78,216,.05)); }
.fgw-help-pop { display: block; }
.fgw-help-pop[hidden] { display: none; }
.fgw-help-line { display: block; margin: 4px 0 0; }

/* ── Prompt 1 (ADR-0084): goals, approaches, paired budget, actions ─────────────────────────────────────── */
.fgw-guide { margin: 4px 0 12px; }
.fgw-guide p { margin: 0 0 2px; color: var(--text-secondary); }
.fgw-guide p:first-child { color: var(--text-primary, inherit); }
.fgw-goal-card { border-left: 4px solid transparent; }
.fgw-goal-card.is-active { border-left-color: var(--accent, #1d4ed8); }
.fgw-goal-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.fgw-goal-head .fgw-sub { margin: 0; }
.fgw-goal-form { display: grid; gap: 10px; margin-top: 8px; }
.fgw-goalpick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.fgw-pick.is-on { background: var(--accent, #1d4ed8); color: #fff; border-color: var(--accent, #1d4ed8); }
.fgw-targets { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.fgw-q { margin: 0 0 14px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }
.fgw-why { margin: 0 0 6px; font-size: .9rem; color: var(--text-secondary); }
.fgw-cards { display: grid; gap: 12px; margin: 10px 0; }
.fgw-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .fgw-cards-2 { grid-template-columns: minmax(0, 1fr); } }
.fgw-ap-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 8px; align-content: start; background: var(--bg-card, transparent); }
.fgw-ap-card.is-selected { border-color: var(--accent, #1d4ed8); box-shadow: 0 0 0 1px var(--accent, #1d4ed8) inset; }
.fgw-card-h { margin: 0; font-size: 1rem; }
.fgw-facts { margin: 0; display: grid; gap: 6px; }
.fgw-fact dt { font-weight: 700; font-size: .85rem; }
.fgw-fact dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.fgw-fact.is-unknown dd { color: var(--text-secondary); font-style: italic; }
.fgw-card-more { margin-top: 2px; }
.fgw-paired { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin: 12px 0; }
@media (max-width: 860px) { .fgw-paired { grid-template-columns: minmax(0, 1fr); } }
.fgw-col { min-width: 0; }
.fgw-line-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fgw-alloc, .fgw-alloc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; font-size: .9rem; }
.fgw-act-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fgw-act-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.fgw-act-form textarea, .fgw-input-card textarea { min-height: 3.5rem; resize: vertical; overflow-wrap: anywhere; }
.fgw-suggest { margin-top: 14px; }
.fgw-nextreview, .fgw-review-label, .fgw-saved-line, .fgw-after-save { margin: 6px 0; }
.fgw-live:empty { display: none; }
.fgw-update { border: 1px solid var(--accent, #1d4ed8); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.fgw-para { margin: 6px 0; overflow-wrap: anywhere; }
.fgw-para-unknown { color: var(--text-secondary); }
.fgw-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 12px; margin: 6px 0; min-width: 0; }
.fgw-fieldset legend { font-weight: 700; padding: 0 6px; }
.fgw .fgw-tool #fg-plan-add-form { display: none; }

/* ── Saved plan workspace (ADR-0084): Your plan, Review progress, Test a scenario ── */
.fgw-wsnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card, transparent); }
.fgw-wsbtn.is-current { background: var(--c-primary, #1d4ed8); border-color: var(--c-primary, #1d4ed8); color: #fff; }
.fgw-wsbtn.fgw-quiet-btn.is-current { background: transparent; color: inherit; border-width: 2px; }
.fgw-ws .fgw-panel { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 12px 0; min-width: 0; }
.fgw-ws legend.fgw-sub { padding: 0 6px; font-weight: 700; }
.fgw-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.fgw-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
.fgw-table caption { text-align: left; font-weight: 700; padding: 4px 0; }
.fgw-table th, .fgw-table td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.fgw-table thead th { font-size: .8rem; color: var(--text-secondary); }
.fgw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 14px; }
.fgw-record { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; margin: 8px 0; min-width: 0; }
.fgw-record legend { font-weight: 700; padding: 0 6px; overflow-wrap: anywhere; }
.fgw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.fgw-warn { border: 2px solid var(--c-warn, #92400e); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: var(--bg-card, transparent); }
.fgw-ws .fgw-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fgw-ws .fgw-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; align-content: start; }
.fgw-adopt { border: 2px solid var(--c-primary, #1d4ed8) !important; }
.fgw-linked { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--border); }
.fgw-ws .fgw-error:empty { display: none; }
.fgw-ws-mode .fgw-main { margin-top: 6px; }
@media (max-width: 560px) { .fgw-table { font-size: .82rem; } .fgw-wsnav .fgw-btn { flex: 1 1 100%; } }

/* ── Orientation and visuals (ADR-0084, Prompt 3). Meaning is always in the words; patterns and borders back up colour. ── */
.fgw-how { margin: 6px 0 10px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; }
.fgw-how summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.fgw-process { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fgw-process-stage { display: grid; gap: 2px; align-content: start; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; position: relative; }
.fgw-process-stage + .fgw-process-stage::before { content: "\2192"; position: absolute; left: -10px; top: 8px; font-weight: 700; background: var(--bg-card, #fff); line-height: 1; }
.fgw-process-num { font-size: .75rem; color: var(--text-secondary); }
.fgw-process-label { font-weight: 700; }
.fgw-process-text { font-size: .85rem; color: var(--text-secondary); }
.fgw-process-branch { border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; margin: 4px 0 8px; }
.fgw-process-returns { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; }
@media (max-width: 760px) { .fgw-process { grid-template-columns: minmax(0, 1fr); } .fgw-process-stage + .fgw-process-stage::before { content: "\2193"; left: 8px; top: -12px; } }
.fgw-rec-status { margin: 0 0 6px; font-size: .9rem; }
.fgw-cover { display: flex; width: 100%; max-width: 420px; height: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.fgw-cover:empty { display: none; }
.fgw-cover-seg { display: block; height: 100%; min-width: 2px; }
.fgw-cover-conf { background: var(--c-primary, #1d4ed8); }
.fgw-cover-prop { background: repeating-linear-gradient(45deg, var(--c-primary, #1d4ed8) 0 3px, transparent 3px 6px); }
.fgw-cover-rest { background: transparent; }
.fgw-cover-key { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .78rem; color: var(--text-secondary); margin-bottom: 4px; }
.fgw-cover-k { display: inline-block; width: 12px; height: 10px; border: 1px solid var(--border); border-radius: 2px; vertical-align: middle; margin-right: 3px; }
.fgw-bars { display: grid; gap: 10px; margin: 8px 0; }
.fgw-bar-group { display: grid; gap: 3px; }
.fgw-bar-title { font-weight: 700; font-size: .85rem; }
.fgw-bar-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 6.5rem; gap: 8px; align-items: center; font-size: .82rem; }
.fgw-bar-track { height: 10px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.fgw-bar-fill { display: block; height: 100%; }
.fgw-bar-baseline { background: var(--text-secondary, #555); }
.fgw-bar-working { background: var(--c-primary, #1d4ed8); }
.fgw-bar-actual { background: repeating-linear-gradient(45deg, var(--c-primary, #1d4ed8) 0 3px, transparent 3px 6px); }
.fgw-bar-value { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 560px) { .fgw-bar-row { grid-template-columns: 6.5rem minmax(0, 1fr); } .fgw-bar-value { grid-column: 1 / -1; text-align: left; } }

/* Containment (ADR-0084): a bare 1fr track cannot shrink below its content, so a select with long options or a
   date input pushed form rows wider than the page. These tracks and their children may shrink, and controls never
   exceed the width of their column. */
.fgw-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .fgw-row { grid-template-columns: minmax(0, 1fr); } }
.fgw-row > *, .fgw-inline-form > *, .fgw-line > *, .fgw-field { min-width: 0; }
.fgw-inline { display: block; min-width: 0; }
.fgw-inline select, .fgw-inline input, .fgw-field select, .fgw-field input { max-width: 100%; box-sizing: border-box; }
.fgw-inline select { margin-left: 0; }

/* A grid item's automatic track grows to its widest content, so a select with long options stretched the whole
   field past its column. One shrinkable track keeps the control inside the field. */
.fgw-field, .fgw-inline-form, .fgw-line { grid-template-columns: minmax(0, 1fr); }
.fgw-field select, .fgw-field input:not([type="checkbox"]):not([type="radio"]), .fgw-row .fgw-inline select, .fgw-row .fgw-inline input:not([type="checkbox"]):not([type="radio"]) { width: 100%; }

/* Dates: a text box that reads normal writing, a Calendar button, and the browser's own picker kept behind them (date-field.js). */
.fgw-datefield { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; position: relative; min-width: 0; max-width: 100%; }
.fgw-datefield .fgw-date-text { flex: 1 1 9rem; min-width: 0; font: inherit; padding: 8px 10px; min-height: 40px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input, transparent); color: inherit; }
.fgw-datefield .fgw-date-text[aria-invalid="true"] { border-color: #b91c1c; border-width: 2px; }
.fgw-date-pick { font: inherit; font-size: .85rem; min-height: 40px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.fgw-date-pick:hover { border-color: var(--c-primary, #1d4ed8); }
.fgw-date-native { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; left: 0; bottom: 0; }
.fgw-date-msg { flex-basis: 100%; font-size: .82rem; color: #b91c1c; }
.fgw-date-msg:empty { display: none; }

/* 2026-10-11: optional AI starting draft, items that need review, and the final review (ADR-0085) */
.fgw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fgw-seeded-slot:empty { display: none; }
.fgw-start-choice .fgw-choice-row, .fgw-draft .fgw-draft-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fgw-draft-group { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 12px; padding: 8px 12px; }
.fgw-draft-group legend { font-weight: 700; padding: 0 6px; }
.fgw-draft-item { border-top: 1px solid var(--border); padding: 8px 0; }
.fgw-draft-item:first-of-type { border-top: 0; }
.fgw-draft-item.is-skipped { opacity: .75; }
.fgw-draft-pick { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.fgw-draft-text { font-weight: 600; }
.fgw-evidence { list-style: none; padding: 0; margin: 8px 0 0; }
.fgw-evidence li { padding: 6px 0; border-top: 1px solid var(--border); }
.fgw-badge-recorded, .fgw-badge-calculated, .fgw-badge-comparison { border-color: #1d4ed8; }
.fgw-badge-suggested { border-color: #7c3aed; }
.fgw-badge-unknown { border-style: dashed; border-color: #b45309; }
.fgw-badge-your_answer { border-color: #15803d; }
.fgw-seeded-list { list-style: none; padding: 0; margin: 8px 0; }
.fgw-seeded-list li { padding: 8px 0; border-top: 1px solid var(--border); }
.fgw-final-body h4, .fgw-draft-narrative h4 { margin: 12px 0 4px; font-size: 1rem; }
.fgw-connections { padding-left: 18px; }

/* ── Public Horizons STEM demonstration (ADR-0086, 2026-10-11) ───────────────────────────────────── */
.fg-demo-banner, .fg-demo-gateway { --demo-text: #3d3000; --demo-text-soft: #5c4a00; --demo-surface: #fff7e0; --demo-surface-2: #fffdf4; --demo-line: #c9a227; --demo-btn-line: #8a6d00; --demo-tag-bg: #3d3000; --demo-tag-text: #fff; color: var(--demo-text); }
[data-theme="dark"] .fg-demo-banner, [data-theme="dark"] .fg-demo-gateway { --demo-text: #f7edc2; --demo-text-soft: #eadfb0; --demo-surface: #2b2410; --demo-surface-2: #241e0d; --demo-line: #c9a227; --demo-btn-line: #d9b83c; --demo-tag-bg: #f7edc2; --demo-tag-text: #2b2410; }
.fg-demo-banner { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 10px 14px; background: var(--demo-surface); border: 1px solid var(--demo-line); border-radius: 8px; }
.fg-demo-banner[hidden], .fg-demo-gateway[hidden] { display: none; }
.fg-demo-banner p { margin: 0; flex: 1 1 320px; font-size: .9rem; line-height: 1.45; color: var(--demo-text); }
.fg-demo-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--demo-tag-bg); color: var(--demo-tag-text); border-radius: 999px; padding: 2px 10px; }
.fg-demo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-demo-gateway { margin: 0 0 20px; padding: 22px; border: 1px solid var(--demo-line); background: var(--demo-surface-2); border-radius: 10px; }
.fg-demo-gateway h2 { margin: 10px 0 6px; font-size: 1.3rem; color: var(--demo-text); }
/* The explanation runs the full width of the card (the page rule for paragraphs is raised above any narrower one). */
.fg-page .fg-demo-gateway > p { margin: 0 0 14px; max-width: none; line-height: 1.55; font-size: 1rem; color: var(--demo-text); }
.fg-demo-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fg-demo-choice p { margin: 8px 0 0; font-size: .9rem; line-height: 1.45; color: var(--demo-text-soft); }
.fg-demo-fresh { margin: 14px 0 0; font-size: .85rem; color: var(--demo-text-soft); }
.fg-demo-fresh a { color: var(--demo-text); text-decoration: underline; }
/* Ghost buttons inside the notice take the notice's own colours, so they read in light and dark themes. */
.fg-demo-banner .ni-btn-ghost, .fg-demo-gateway .ni-btn-ghost { color: var(--demo-text); border-color: var(--demo-btn-line); background: transparent; }
.fg-demo-banner .ni-btn-ghost:hover, .fg-demo-gateway .ni-btn-ghost:hover { background: rgba(201,162,39,.18); color: var(--demo-text); }
body.fg-demo .fg-intro p { display: none; }
@media (max-width: 640px) { .fg-demo-banner { position: static; } }

/* Start again (delete the whole plan). The confirm button reads as a destructive choice. */
.fgw-startagain { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--c-border, #d6d3d1); }
.fgw-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.fgw-danger:hover { background: #991b1b; border-color: #991b1b; }
