/* ===================== three wings: safety, deals, planner (scripts/wings.mjs, public/wings.js) =====================
   Loaded after style.css; uses its tokens (newsprint look), light and dark. */
:root {
  --band-warm: #1e6b46; --band-ok: #3b6420; --band-caution: #8a5a00; --band-hostile: #a3361f; --band-avoid: #7d1022;
  --band-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --band-warm: #7fd1a6; --band-ok: #b5d98a; --band-caution: #f0c060; --band-hostile: #f39a83; --band-avoid: #f58c9c;
    --band-ink: #121417;
  }
}
:root[data-theme="dark"] {
  --band-warm: #7fd1a6; --band-ok: #b5d98a; --band-caution: #f0c060; --band-hostile: #f39a83; --band-avoid: #f58c9c;
  --band-ink: #121417;
}
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.lede { font-size: 1.125rem; line-height: 1.6; }
.label { color: var(--muted); font-size: 0.875rem; margin: 0 0 4px; }
.crumbs { margin: 0 0 6px; font-size: 0.9375rem; }
.status.bad { color: var(--bad); }

/* score chips: the colour always comes with the number and words */
.score { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; border-radius: var(--radius); background: var(--band-ok); color: var(--band-ink); font-weight: 600; white-space: nowrap; }
.score.band-warm { background: var(--band-warm); }
.score.band-ok { background: var(--band-ok); }
.score.band-caution { background: var(--band-caution); }
.score.band-hostile { background: var(--band-hostile); }
.score.band-avoid { background: var(--band-avoid); }
.score-of { font-weight: 400; opacity: 0.9; font-size: 0.85em; }
.score-t { font-weight: 400; }
.score.big { font-size: 1.75rem; padding: 6px 14px; }
.score.big .score-t { font-size: 1rem; }
.trend { font-size: 0.875rem; color: var(--text-2); white-space: nowrap; }
.trend.up { color: var(--band-warm); }
.trend.down { color: var(--band-hostile); }
.flag { display: inline-block; border: 1px solid var(--axis); border-radius: var(--radius); padding: 0 6px; font-size: 0.8125rem; color: var(--text-2); margin-block: 2px; }
.lvl { font-weight: 600; }
.lvl-3, .lvl-4 { color: var(--band-hostile); }

.score-head { display: grid; gap: 16px; border-block-start: 2px solid var(--rule); padding-block: 16px 4px; margin-block: 12px 0; }
@media (min-width: 720px) { .score-head { grid-template-columns: 1fr 1.4fr; align-items: start; } }
.score-parts { display: grid; gap: 12px; }
.part { border-inline-start: 3px solid var(--line); padding-inline-start: 12px; }
.part-v { margin: 0; font-size: 1.125rem; font-weight: 600; }

/* tables and tools */
.table-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin-block: 8px; }
.table-tools .field { margin: 0; }
.field > span:first-child { font-weight: 600; }
.field input, .field select, .field textarea, .copy input, [data-move-out] input {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: var(--radius);
  padding: 8px 10px; min-height: 44px; max-width: 100%;
}
.field input[type="range"] { padding: 0; border: 0; accent-color: var(--accent); min-height: 44px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
table.safety td, table.safety th { vertical-align: middle; }
table.data tr[hidden] { display: none; }
.copy input, [data-move-out] input { width: 100%; }

/* home: three entries */
.wings { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; gap: 12px; }
@media (min-width: 760px) { .wings { grid-template-columns: repeat(3, 1fr); } }
.wing { display: flex; flex-direction: column; gap: 6px; min-height: 100%; padding: 18px; border: 1px solid var(--text); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.wing:hover { background: var(--surface-2); }
.wing strong { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; }
.wing span:last-child { color: var(--text-2); }
.wing-k { font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--muted); }
.deal-strip, .changes, .stories, .alerts { list-style: none; padding: 0; margin: 8px 0; }
.deal-strip li, .changes li, .stories li, .alerts li { border-block-end: 1px solid var(--line); padding-block: 10px; }
.deal-strip a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; text-decoration: none; color: var(--text); }
.deal-strip .price, .deal .price { font-weight: 600; font-size: 1.125rem; }
.tag { font-size: 0.8125rem; border: 1px solid var(--axis); padding: 0 6px; border-radius: var(--radius); }
.tag-incident, .tag-refusal { border-color: var(--band-hostile); }
.tag-welcome { border-color: var(--band-warm); }

/* chart */
.chart-box { margin-block: 8px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-combined { stroke: var(--text); }
.chart path.recon { stroke-dasharray: 5 5; opacity: 0.8; }
.chart .ln-ground { stroke: var(--accent); stroke-width: 2; }
.chart .ln-official { stroke: var(--band-caution); stroke-dasharray: 2 4; }
.legend { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9375rem; }
.legend .key { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-inline-end: 6px; }
.key.ln-combined { border-color: var(--text); }
.key.ln-ground { border-color: var(--accent); }
.key.ln-official { border-top-style: dotted; border-color: var(--band-caution); }
.range { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 0.9375rem; min-height: 44px; min-width: 44px; padding: 6px 12px; border: 1px solid var(--axis); background: transparent; color: var(--text); border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:hover { border-color: var(--text); }
.actions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn.ghost { border-color: var(--axis); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block: 10px; }
.link { color: var(--text); }

/* deals portal */
.filters { border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--radius); margin-block: 12px; }
.grid2 { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.mode { border: 0; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px; border: 1px solid var(--axis); border-radius: 999px; cursor: pointer; }
.seg:has(input:checked) { border-color: var(--text); background: var(--surface-2); font-weight: 600; }
.deals { list-style: none; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .deals { grid-template-columns: 1fr 1fr; } }
.deal { border: 1px solid var(--line); border-top: 3px solid var(--text); padding: 12px 14px; border-radius: var(--radius); }
.deal h3 { margin: 0; font-family: var(--serif); font-size: 1.375rem; }
.deal-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.deal p { margin: 4px 0; }
.deal .pct strong { color: var(--band-warm); }
.deal .incl { border-inline-start: 3px solid var(--line); padding-inline-start: 8px; }
.post textarea { width: 100%; font: inherit; font-size: 0.9375rem; background: var(--bg); color: var(--text); border: 1px solid var(--muted); }
.cta { border: 1px dashed var(--axis); padding: 12px 16px; margin-block: 16px; }

/* planner */
.planner, .q-wrap { max-width: 44rem; }
.q { border-block-start: 2px solid var(--rule); padding-block: 14px; }
.q-t { font-family: var(--serif); font-size: 1.625rem; line-height: 1.25; margin: 0 0 10px; }
.slider { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.slider input { width: 100%; accent-color: var(--accent); min-height: 44px; }
.slider .end { color: var(--text-2); font-size: 0.9375rem; }
.q-opts { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 6px; }
.envs { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.env { display: grid; grid-template-columns: 9rem 1fr; gap: 8px; align-items: center; }
.env input[type="range"] { width: 100%; accent-color: var(--accent); }
.q-nav { display: flex; justify-content: space-between; gap: 10px; margin-block: 14px; flex-wrap: wrap; }
.plan { border-top: 3px solid var(--text); padding-top: 10px; }
.plan section { margin-block: 18px; }
.plan h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 6px; }
.days { padding-inline-start: 0; list-style: none; display: grid; gap: 10px; }
.day { border: 1px solid var(--line); padding: 8px 12px; border-radius: var(--radius); }
.day h4 { margin: 0 0 4px; }
.items { list-style: none; padding: 0; margin: 0; }
.it { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding-block: 4px; border-block-end: 1px dotted var(--line); }
.it:last-child { border: 0; }
.it-free, .it-move { color: var(--text-2); }
.it-highlight { font-weight: 600; }
.it-tools { margin-inline-start: auto; display: inline-flex; gap: 4px; }
.mini { font: inherit; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: var(--radius); cursor: pointer; }
.mini:hover { border-color: var(--text); }
.verify { font-size: 0.8125rem; }
table.costs tr.excluded td, table.costs tr.excluded th { text-decoration: line-through; color: var(--muted); }
table.costs tfoot th, table.costs tfoot td { font-weight: 600; border-top: 2px solid var(--rule); }
.facts dt { font-weight: 600; margin-top: 8px; }
.facts dd { margin: 0; }
.checklist { padding-inline-start: 1.2em; }
.vars { list-style: none; padding: 0; display: grid; gap: 10px; }
.var { border: 1px solid var(--line); padding: 10px 12px; }
.var h3 { margin: 0; font-size: 1.125rem; }
.plan-actions .status { flex-basis: 100%; }
@media print {
  .filters, .q-nav, .it-tools, .plan-actions, .range, .table-tools, .refine { display: none !important; }
}

/* the screen-reader caption is absolutely positioned: keep it inside the scroll box (RTL overflow at 360 px) */
.table-wrap { position: relative; }

/* scale key: one line + the five bands, above every score */
.legend-scale { margin-block: 8px 12px; }
.legend-line { margin: 0 0 6px; }
.legend-bands { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9375rem; }
.legend-bands li { display: inline-flex; align-items: center; gap: 6px; }
