/* Affiliate cockpit — airport-wayfinding palette, signage type (Barlow Condensed) + legible body
   (Atkinson Hyperlegible). The departures board is the one loud element; everything else is quiet. */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(fonts/barlow-condensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/atkinson-hyperlegible-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-700.woff2) format("woff2"); }

:root {
  --ink: #14213D;          /* signage navy */
  --ink-2: #3D4A60;
  --muted: #5B6B7F;        /* slate */
  --surface: #EEF1F4;      /* signage white */
  --panel: #FFFFFF;
  --rule: #D5DBE2;
  --rule-soft: #E4E8ED;
  --yellow: #F7C948;       /* wayfinding yellow: the board + status only */
  --up: #2E7D5B;
  --down: #B23A3A;
  --series: #2a78d6;       /* validated data hue (light) */
  --band: #C9D7EA;         /* normal-range band */
  --board: #14213D;
  --board-ink: #F4F6F9;
  --board-dim: #9AA8BC;
  --focus: #2a78d6;
  --st-live-bg: #E1F1E9; --st-live-fg: #1B5A40; --st-draft-bg: #FBEBC0; --st-draft-fg: #5A4300; --warn-bg: #F7C948; --warn-fg: #14213D;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --fail-bg: #B23A3A; --fail-fg: #FFFFFF;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8EDF4; --ink-2: #C3CDDA; --muted: #93A1B5;
    --surface: #0D1828; --panel: #13233A; --rule: #26384F; --rule-soft: #1C2D44;
    --up: #5CB88E; --down: #E07A7A; --series: #4d93e8; --band: #2A3F5C;
    --board: #0A1422; --board-ink: #F4F6F9; --board-dim: #8796AB; --focus: #4d93e8;
    --st-live-bg: #1B3B30; --st-live-fg: #9BE3C1; --st-draft-bg: #4A3A10; --st-draft-fg: #F7DD8A; --warn-bg: #F7C948; --warn-fg: #14213D;
    --fail-bg: #E07A7A; --fail-fg: #1A0A0A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 15px/1.5 var(--body); }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: .005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-bottom: .6rem; }
h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---- top bar */
.topbar { background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.brand span { background: var(--yellow); color: #14213D; padding: 0 .3em; margin-right: .25em; border-radius: 2px; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a { font-family: var(--display); font-weight: 600; font-size: 1.05rem; padding: 6px 10px; text-decoration: none; color: var(--muted); border-radius: 4px; }
nav.main a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 0; }
nav.main a:hover { color: var(--ink); }
.filters { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select { font: inherit; padding: 5px 8px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); border-radius: 4px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 10px; cursor: pointer; font-size: .9rem; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.logout { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px; }
a.logout { text-decoration: none; }
a.logout:hover, a.logout[aria-current="page"] { color: var(--ink); }
a.logout[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--yellow); }
a.logout.gear { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }

main { padding: 26px 0 60px; }
.view-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head p { margin: 0; }
.crumb { font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
section { margin-bottom: 34px; }

/* ---- KPI strip: four figures divided by rules, no cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; }
.kpi { padding: 14px 18px 12px; }
.kpi + .kpi { border-left: 1px solid var(--rule-soft); }
.kpi .label { color: var(--muted); font-size: .9rem; }
.kpi .value { font-family: var(--display); font-weight: 600; font-size: 2.35rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: .85rem; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }

/* ---- departures board (the loud element) */
.board { background: var(--board); color: var(--board-ink); border-radius: 8px; padding: 6px 0 4px; overflow: hidden; }
.board-head, .board-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 170px 110px; gap: 14px; align-items: center; padding: 0 18px; }
.board-head { color: var(--board-dim); font-size: .82rem; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.board-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); padding-top: 11px; padding-bottom: 11px; cursor: pointer; color: inherit; }
.board-row:hover { background: rgba(255,255,255,.04); }
.board-row .what { font-family: var(--display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.board-row .where { color: var(--board-dim); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .worth { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--yellow); text-align: right; font-variant-numeric: tabular-nums; }
.board-row .worth.none { color: var(--board-dim); font-weight: 500; font-size: .95rem; }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: .98rem; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.status svg { width: 13px; height: 13px; flex: none; }
.status.fix { background: #E05A5A; color: #fff; }
.status.opp { background: var(--yellow); color: #14213D; }
.status.watch { background: transparent; color: var(--board-ink); box-shadow: inset 0 0 0 1.5px var(--board-dim); }
.status.info { background: transparent; color: var(--board-dim); }
.board-detail { padding: 2px 18px 14px 148px; color: var(--board-ink); font-size: .93rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.board-detail p { margin: 0 0 8px; max-width: 70ch; }
.board-detail dl { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 8px; color: var(--board-dim); }
.board-detail dt { display: inline; } .board-detail dd { display: inline; margin: 0 0 0 4px; color: var(--board-ink); }
.board-detail a { color: var(--yellow); }
.board-detail dl .ev-list { flex-basis: 100%; }
.board-detail dl .ev-list dd { display: block; margin: 2px 0 0; }
.board-detail dl .ev-list ul { margin: 0; padding-left: 18px; }
.board-foot { color: var(--board-dim); font-size: .85rem; padding: 10px 18px 8px; }
.board-foot button { background: none; border: 0; color: var(--yellow); cursor: pointer; padding: 0; text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .board.enter .board-row { animation: flip .42s cubic-bezier(.2,.7,.3,1) both; transform-origin: 50% 0; }
  @keyframes flip { from { opacity: 0; transform: perspective(600px) rotateX(-70deg); } to { opacity: 1; transform: none; } }
}

/* ---- two-column band */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.chart-panel { padding: 14px 16px 10px; }
.chart-panel h3 { margin: 0 0 6px; font-size: 1rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 26px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 18px; }

/* ---- tables */
.table-wrap { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule-soft); white-space: nowrap; }
table.data td.wrap-cell { white-space: normal; min-width: 220px; }
table.data th { font-weight: 700; color: var(--muted); font-size: .84rem; background: var(--panel); position: sticky; top: 0; }
table.data th button { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; color: inherit; font-size: inherit; }
table.data th[aria-sort] button { color: var(--ink); }
table.data th.r, table.data td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr.link { cursor: pointer; }
table.data tbody tr.link:hover { background: var(--rule-soft); }
table.data tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; font-size: .78rem; padding: 0 6px; border-radius: 3px; background: var(--rule-soft); color: var(--muted); }
.na { color: var(--muted); font-style: italic; }

/* ---- today vs normal (range bars) */
.ranges { display: grid; gap: 10px; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px 160px; gap: 10px; align-items: center; font-size: .9rem; }
.range-row .site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range-row .today { font-family: var(--display); font-weight: 600; font-size: 1.15rem; text-align: right; }
.rangebar { position: relative; height: 18px; }
.rangebar .track { position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--rule); }
.rangebar .band { position: absolute; top: 4px; height: 10px; background: var(--band); border-radius: 4px; }
.rangebar .typ { position: absolute; top: 2px; width: 2px; height: 14px; background: var(--muted); }
.rangebar .dot { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--panel); }

/* ---- charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 12px var(--body); }
.chart .bar { fill: var(--series); }
.chart .bar.dim { opacity: .35; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart-head button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 0; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--panel); font-size: .82rem; padding: 4px 8px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -120%); z-index: 5; }
.charts-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---- detail blocks */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.notice { border-left: 3px solid var(--yellow); background: var(--panel); padding: 10px 14px; border-radius: 0 6px 6px 0; margin-bottom: 18px; max-width: 80ch; }
.notice.fix { border-left-color: var(--down); }
.empty { padding: 22px 18px; color: var(--muted); }
.empty strong { color: var(--ink); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); font-size: .92rem; }
.list-plain li:last-child { border-bottom: 0; }
.path-steps { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.path-steps .step { background: var(--rule-soft); padding: 1px 7px; border-radius: 3px; font-size: .86rem; }
.path-steps .src { background: transparent; color: var(--muted); padding-left: 0; }
.path-steps .end-click { background: var(--series); color: #fff; }
.path-steps .end-left { background: transparent; color: var(--muted); font-style: italic; }
.path-steps .sep { color: var(--muted); font-size: .8rem; }

/* ---- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { max-width: 380px; width: 100%; }
.login h1 { font-size: 2.4rem; margin-bottom: 8px; }
.login button.primary { margin-top: 18px; font-family: var(--display); font-weight: 600; font-size: 1.15rem; background: var(--ink); color: var(--panel); border: 0; border-radius: 4px; padding: 10px 18px; cursor: pointer; }
.login .err { color: var(--down); margin-top: 10px; }
.loading { color: var(--muted); padding: 30px 0; }

/* ---- content (campaigns overview + detail) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 16px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; background: var(--ink); color: var(--panel); border: 1px solid var(--ink); border-radius: 4px; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.cbadge { display: inline-block; font-family: var(--display); font-weight: 700; font-size: .95rem; line-height: 1.3; padding: 1px 8px; border-radius: 3px; white-space: nowrap; border: 1px solid transparent; }
.ph-start { background: var(--band); color: var(--ink); }
.ph-peak { background: var(--ink); color: var(--panel); }
.ph-deadline { background: var(--warn-bg); color: var(--warn-fg); }
.ph-prep { background: var(--rule-soft); color: var(--ink-2); }
.st-live { background: var(--st-live-bg); color: var(--st-live-fg); }
.st-live-draft { background: var(--band); color: var(--ink); }
.st-scheduled { background: var(--panel); color: var(--ink); border-color: var(--ink-2); }
.st-draft { background: var(--st-draft-bg); color: var(--st-draft-fg); }
.st-failing { background: var(--fail-bg); color: var(--fail-fg); }
.needs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.needs li { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--yellow); border-radius: 0 6px 6px 0; padding: 12px 16px; }
.needs-kind { font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.needs-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
a.needs-title { display: block; padding: 2px 0; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.camp-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 18px; min-width: 0; }
.camp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.camp-card h3 { font-size: 1.3rem; margin: 0 0 2px; overflow-wrap: anywhere; }
.camp-card h3 a { display: block; padding: 4px 0; min-height: 44px; }
.camp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.camp-stats dt { color: var(--muted); font-size: .85rem; }
.camp-stats dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.item-list, .add-results { list-style: none; margin: 0; padding: 0; }
.item-list li, .add-results li { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.item-list li:last-child, .add-results li:last-child { border-bottom: 0; }
.item-list .cbadge { flex: none; min-width: 6.5em; text-align: center; }
.item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.item-title { overflow-wrap: anywhere; }
.empty-inline { color: var(--muted); margin: 0; }
.camp-head { justify-content: space-between; align-items: flex-end; }
.camp-head h1 { overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.timeline li { display: flex; flex-direction: column; padding: 8px 14px; background: var(--rule-soft); border-radius: 4px; border-top: 3px solid var(--rule); }
.timeline li[aria-current="step"] { border-top-color: var(--yellow); background: var(--band); }
.tl-phase { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.ktiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ktile { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 16px; }
.ktile .label { color: var(--muted); font-size: .9rem; }
.ktile .value { font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.table-scroll { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; max-width: 100%; }
.table-scroll table.data td.wrap-cell { min-width: 260px; }
.table-scroll table.data td { vertical-align: top; }
dialog#add-dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 18px; }
dialog#add-dlg::backdrop { background: rgba(10, 20, 34, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; }
dialog#add-dlg label { display: block; margin-bottom: 4px; }
dialog#add-dlg input { width: 100%; min-height: 44px; font: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink); }
.err-text { color: var(--down); margin: 0 0 6px; }

/* ---- content editor */
.head-btn { margin-left: auto; align-self: center; text-decoration: none; }
.head-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.head-btns .btn, .head-btn { text-decoration: none; }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn.wide { width: 100%; }
.small-btn { min-height: 44px; min-width: 44px; padding: 2px 12px; font-size: .95rem; flex: none; }

.ed-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 14px; }
.ed-where { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; min-width: 0; }
.ed-back { display: inline-flex; align-items: center; min-height: 44px; }
.ed-path { overflow-wrap: anywhere; }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-saved.bad { color: var(--down); font-weight: 700; }
#ed-msg .notice { margin-bottom: 12px; max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; overflow-wrap: anywhere; }
#ed-msg .notice:not(.fix) { border-left-color: var(--up); }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.ed-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; }
.ed-main > [role="tabpanel"] { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ed-main > [hidden] { display: none; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--rule-soft); padding: 4px; border-radius: 8px; align-self: flex-start; }
.ed-tabs button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.ed-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 33, 61, .15); }
.ed-banner { margin: 0; padding: 10px 14px; border-radius: 6px; background: var(--panel); border: 1px solid var(--rule); font-size: .95rem; }
.ed-banner.info { background: var(--band); border-color: transparent; }
.ed-banner.fail { background: var(--fail-bg); color: var(--fail-fg); border-color: transparent; }
.ed-banner.warn { background: var(--st-draft-bg); color: var(--st-draft-fg); border-color: transparent; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ed-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; min-width: 0; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--rule-soft); background: var(--surface); }
.tb { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.tb:hover { background: var(--rule-soft); }
.tb[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.tb-b { font-weight: 700; } .tb-i { font-style: italic; }
.tb-sep { width: 1px; background: var(--rule); margin: 8px 6px; }
.ed-article { padding: 22px 28px 30px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ed-title { field-sizing: content; resize: none; overflow: hidden; display: block; width: 100%; font: 600 2rem/1.15 var(--display); color: var(--ink); background: transparent; border: 0; border-bottom: 1px dashed var(--rule); padding: 4px 0 8px; border-radius: 0; }
.ed-title::placeholder { color: var(--muted); }
.ed-title:focus-visible { outline-offset: 4px; }
.ed-quill.ql-container.ql-snow { border: 0; font: 400 17px/1.65 var(--body); color: var(--ink); }
.ed-quill .ql-editor { padding: 0; min-height: 340px; overflow-wrap: anywhere; }
.ed-quill .ql-editor.ql-blank::before { left: 0; right: 0; color: var(--muted); font-style: normal; }
.ed-quill .ql-editor h2 { font: 600 1.7rem/1.15 var(--display); margin: 1em 0 .4em; }
.ed-quill .ql-editor h3 { font: 600 1.3rem/1.2 var(--display); margin: 1em 0 .3em; }
.ed-quill .ql-editor img { max-width: 100%; height: auto; border-radius: 4px; }
.ed-quill .ql-editor a { color: var(--series); }
.ed-quill .ql-editor blockquote { border-left: 3px solid var(--rule); margin: .6em 0; padding-left: 14px; color: var(--ink-2); }
.ed-sched { background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--yellow); border-radius: 0 8px 8px 0; padding: 16px 20px; min-width: 0; }
.ed-sched h2 { margin-bottom: 4px; }
.ed-note { margin: 0 0 12px; }
.ed-frame { width: 100%; height: 480px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; display: block; }
.ed-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ed-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; margin: 0; min-width: 0; }
.ed-panel h2 { font-size: 1.15rem; margin: 0; }
.ed-panel p { margin: 0; }
.ed-field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.ed-field input, .ed-field select, .ed-field textarea, .ed-when input, .ed-ask input[type="text"], .ed-ask input[type="url"] { font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 4px; width: 100%; min-width: 0; }
.ed-field textarea { resize: vertical; }
.ed-field[hidden] { display: none; }
.ed-checks { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.ed-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px; font-size: 1rem; color: var(--ink); cursor: pointer; }
.ed-check input { width: 22px; height: 22px; flex: none; margin: 0; }
.lint-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.lint-err { color: var(--down); }
.lint-warn { color: var(--ink-2); }
.ed-field input[readonly], .ed-field textarea[readonly], .ed-field input:disabled, .ed-field select:disabled { background: var(--rule-soft); color: var(--ink-2); }
.ed-lab { display: flex; justify-content: space-between; gap: 8px; }
.counter { font-variant-numeric: tabular-nums; }
.counter.over { color: var(--down); font-weight: 700; }
.ed-fs { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ed-fs legend { font-size: .88rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.ed-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ed-radio input { width: 20px; height: 20px; margin: 0; }
.ed-when { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 30px; }
.ed-when label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); flex: 1 1 130px; min-width: 0; }
.ed-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: .92rem; }
.ed-hist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.ed-hist li:last-child { border-bottom: 0; }
.ed-feat-img { display: block; width: 100%; max-height: 160px; object-fit: cover; border-radius: 4px; background: var(--rule-soft); }
.ed-feat-url { overflow-wrap: anywhere; }
.ed-feat-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-new { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.ed-new .btn { align-self: flex-start; }

dialog.ed-dlg { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 0; }
dialog.ed-dlg::backdrop { background: rgba(10, 20, 34, .55); }
dialog.ed-dlg .dlg-head { padding: 16px 18px 0; }
.dlg-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.dlg-body form { display: flex; flex-direction: column; gap: 8px; }
.dlg-body p { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
dialog.ed-preview { width: min(860px, calc(100vw - 24px)); }
dialog.ed-media { width: min(760px, calc(100vw - 24px)); }
.media-up { display: flex; flex-direction: column; gap: 6px; }
.media-up input[type="file"] { font: inherit; max-width: 100%; }
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.media-item { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 6px; cursor: pointer; min-height: 44px; }
.media-item:hover { border-color: var(--ink); }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--rule-soft); }
.media-item span { font-size: .82rem; overflow-wrap: anywhere; }
.partner-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.partner-list .btn { width: 100%; justify-content: space-between; gap: 10px; }

/* ---- content library + campaign tracker */
.subnav { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--yellow); }
.lib-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 14px; }
.lib-filters label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); min-width: 0; }
.lib-filters select, .lib-filters input { font: inherit; font-size: 1rem; min-height: 44px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); color: var(--ink); max-width: 100%; }
.lib-filters .lib-search { flex: 1 1 200px; }
.lib-filters .lib-search input { width: 100%; }
table.lib-table td { white-space: normal; vertical-align: top; }
table.lib-table td.lib-title { min-width: 220px; }
table.lib-table td.lib-title a { display: inline-block; padding: 2px 0; }
table.lib-table td.lib-title .small, table.lib-table td.lib-camp .small { display: block; overflow-wrap: anywhere; }
table.lib-table td.lib-camp { min-width: 200px; }
table.lib-table td.lib-camp a { display: inline-flex; align-items: center; min-height: 44px; }
.pager { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.pager .btn { text-decoration: none; }
.seg-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: .95rem; color: var(--ink); text-decoration: none; }
.seg-link + .seg-link { border-left: 1px solid var(--rule); }
.seg-link[aria-current="true"] { background: var(--ink); color: var(--panel); }
.tr-done { background: var(--st-live-bg); color: var(--st-live-fg); }
.tr-on { background: var(--band); color: var(--ink); }
.tr-risk { background: var(--warn-bg); color: var(--warn-fg); }
.tr-late { background: var(--fail-bg); color: var(--fail-fg); }
.tr-draft { background: var(--st-draft-bg); color: var(--st-draft-fg); }
.tr-filter { display: inline-flex; align-items: center; gap: 6px; }
.tr-filter select { font: inherit; min-height: 44px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); color: var(--ink); }
.tr-empty { background: var(--rule-soft); color: var(--ink-2); }
.tr-group { margin-bottom: 20px; }
.tr-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; }
.tr-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) minmax(0, 18em) 8em; gap: 6px 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); }
.tr-row:last-child { border-bottom: 0; }
.tr-main, .tr-when { display: flex; flex-direction: column; min-width: 0; }
.tr-title { display: flex; align-items: center; min-height: 44px; font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.tr-row .btn { text-decoration: none; }
@media (max-width: 900px) {
  .tr-row { grid-template-columns: minmax(0, 1fr); }
  .tr-row .btn { width: 100%; }
}
@media (max-width: 640px) {
  .lib-filters label { flex: 1 1 calc(50% - 6px); }
  .lib-filters .lib-search { flex: 1 1 100%; }
  .lib-filters .btn { flex: 1 1 100%; }
  .lib-wrap { background: none; border: 0; overflow: visible; }
  table.lib-table, table.lib-table tbody, table.lib-table tr, table.lib-table td { display: block; width: 100%; }
  table.lib-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.lib-table tr { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
  table.lib-table td { border: 0; padding: 4px 0; min-width: 0 !important; }
  table.lib-table td[data-label]:not(.lib-title)::before { content: attr(data-label); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  table.lib-table td.lib-title a { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
  table.lib-table td.lib-camp .btn { margin-top: 4px; }
  .pager { justify-content: space-between; }
}

/* ---- responsive */
@media (max-width: 900px) {
  .cols, .grid-2, .charts-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
  .board-head { display: none; }
  .board-row { grid-template-columns: 1fr auto; grid-template-areas: "status worth" "what what" "where where"; gap: 4px 10px; }
  .board-row .st { grid-area: status; } .board-row .what { grid-area: what; } .board-row .where { grid-area: where; } .board-row .worth { grid-area: worth; }
  .board-detail { padding-left: 18px; }
  .filters { margin-left: 0; width: 100%; }
  .topbar { position: static; }
  .topbar .wrap { gap: 8px 16px; padding-top: 8px; padding-bottom: 10px; }
  nav.main { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav.main a { flex: none; }
  .filters select { flex: 1 1 calc(100% - 50px); min-width: 0; }
  h1 { font-size: 1.7rem; }
  .camp-head .btn { width: 100%; }
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-pub-panel { display: none; }
  .ed-article { padding: 14px 14px 22px; }
  .ed-title { font-size: 1.55rem; }
  .ed-quill.ql-container.ql-snow { font-size: 16px; }
  .ed-quill .ql-editor { min-height: 240px; }
  .ed-actions { width: 100%; }
  .ed-actions .ed-saved { flex: 1 1 100%; }
  .ed-actions .btn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }
  .ed-frame { height: 360px; }
  .head-btn { margin-left: 0; width: 100%; }
  .head-btns { width: 100%; } .head-btns .btn { flex: 1 1 0; }
  dialog.ed-sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; border-bottom: 0; }
  .ed-new .btn { align-self: stretch; }
}

/* ---- step 4: adopting airport pages, static page editor panels */
.adopt-btn { margin-left: 8px; }
.adopt-sites { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.adopt-sites .btn { text-decoration: none; }
.adopt-news { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; max-width: 720px; }
.adopt-news h2, .adopt-news p { margin: 0; }
.adopt-news .btn { align-self: flex-start; }
.adopt-filter { max-width: 420px; margin-bottom: 6px; }
.adopt-filter input { font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); color: var(--ink); width: 100%; min-width: 0; }
.adopt-group { margin-bottom: 18px; }
.adopt-group[hidden], .adopt-row[hidden] { display: none; }
.adopt-group h2 { font-size: 1.15rem; margin: 10px 0 6px; overflow-wrap: anywhere; }
.adopt-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; }
.adopt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; min-height: 56px; border-bottom: 1px solid var(--rule-soft); }
.adopt-row:last-child { border-bottom: 0; }
.adopt-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adopt-title, .adopt-what span { overflow-wrap: anywhere; }
.adopt-row .btn { flex: none; text-decoration: none; }
.adopt-ok { color: var(--up); font-weight: 600; }
.adopt-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.adopt-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.adopt-side p, .adopt-side h2 { margin: 0; }
.adopt-side .btn { text-decoration: none; }
.adopt-side .notice { margin: 0; }
.adopt-blocks, .ed-blocks { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.adopt-blocks li, .ed-blocks li { overflow-wrap: anywhere; }
.adopt-blocks code, .ed-blocks code { background: var(--rule-soft); padding: 1px 6px; border-radius: 3px; font-size: .88rem; white-space: nowrap; }
.adopt-page { min-width: 0; }
.page-frame { height: 640px; }
.news-label { font-weight: 600; overflow-wrap: anywhere; }
#ed-block-notes:empty { display: none; }
dialog.ed-preview .page-frame { height: min(640px, 70vh); }
@media (max-width: 900px) {
  .adopt-grid { grid-template-columns: minmax(0, 1fr); }
  .page-frame { height: 420px; }
  .adopt-btn { margin-left: 0; }
  .adopt-row { align-items: stretch; flex-direction: column; }
  .adopt-row .btn { width: 100%; }
}

/* Connections */
.conn-list { display: grid; gap: 16px; max-width: 80ch; }
.conn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.conn-head h2 { margin: 0; }
.conn-state { font-size: .9rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--rule); }
.conn-state.ok { border-color: var(--up); color: var(--up); }
.conn-state.fix { border-color: var(--down); color: var(--down); }
.conn dl { margin: 10px 0; }
.conn dd { margin: 0 0 4px; overflow-wrap: anywhere; }
.conn-actions { margin: 10px 0; }
.conn-form, .conn-dc-code { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 8px; }
.conn-form label, .conn-dc-code label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; flex: 1 1 240px; min-width: 0; }
.conn-form input, .conn-dc-code input { min-height: 44px; padding: 6px 10px; font: inherit; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); color: var(--ink); }
.conn-msg:empty { display: none; }
.ok-text { color: var(--up); }
