/* Solutions Footprint | Durable Solutions Hub | Sudan */
:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel-2: #f6f5f1;
  --track: #eeede8;
  --ink: #1c2230;
  --ink-2: #3d4554;
  --muted: #646c7a;
  --faint: #9aa0a9;
  --line: #e2e0d9;
  --line-2: #d3d1c9;
  --brand: #1d5fae;
  --brand-dark: #164b8b;
  --brand-tint: #e8f0fa;
  --brand-tint-2: #f1f6fc;
  --brand-line: #d5e3f4;
  --on-brand: #ffffff;
  --warn-bg: #fdeee6;
  --warn-ink: #a3401a;
  --pipe-bg: #f1ecfb;
  --pipe-ink: #5541b5;
  --err: #b3261e;
  --err-bg: #fdf1f0;
  --err-line: #f0c1bd;
  --gap: #d6d5cf;
  --hatch-a: #e3e2dc;
  --hatch-b: #f3f2ee;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.04);
  --shadow-lg: 0 20px 60px rgba(10, 20, 40, 0.28);
  /* map */
  --map-water: #e3edf5;
  --map-land: #f9f8f5;
  --map-land-stroke: #dddad2;
  --map-country-label: #9a9fa8;
  --map-none: #d8d4ca;
  --map-stroke: #ffffff;
  --map-outline: #5b6474;
  --map-label: #1c2230;
  --map-halo: rgba(255, 255, 255, 0.88);
  --map-select: #000000;
  --ring-bg: #ffffff;
  --chip-bg: #ffffff;
  --radius: 10px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161d;
  --panel: #1b2029;
  --panel-2: #232934;
  --track: #2c3340;
  --ink: #e8ebf0;
  --ink-2: #c3c9d3;
  --muted: #98a0ad;
  --faint: #6c7480;
  --line: #2d3440;
  --line-2: #3a4250;
  --brand: #6ea6ec;
  --brand-dark: #8db9f1;
  --brand-tint: #1f3150;
  --brand-tint-2: #1a2638;
  --brand-line: #2a4166;
  --on-brand: #0d1522;
  --warn-bg: #3a2418;
  --warn-ink: #f2a77f;
  --pipe-bg: #2a2546;
  --pipe-ink: #b7a9f5;
  --err: #ff8a80;
  --err-bg: #3a1f1f;
  --err-line: #6b2f2b;
  --gap: #4a505b;
  --hatch-a: #39404c;
  --hatch-b: #262c36;
  --input-bg: #161b23;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --map-water: #121c28;
  --map-land: #161a21;
  --map-land-stroke: #262c35;
  --map-country-label: #6c7480;
  --map-none: #3d434e;
  --map-stroke: #12161d;
  --map-outline: #9aa0a9;
  --map-label: #e8ebf0;
  --map-halo: rgba(18, 22, 29, 0.9);
  --map-select: #ffffff;
  --ring-bg: #1b2029;
  --chip-bg: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex: none; }

/* ---------- Header ---------- */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1480px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.brand-logo { height: 42px; width: auto; display: block; border-radius: 4px; }
:root[data-theme="dark"] .brand-logo { background: #fff; padding: 3px 6px; }
.brand-divider { width: 1px; height: 36px; background: var(--line-2); }
.brand-kicker { font-size: 12px; letter-spacing: 0.08em; font-weight: 600; color: var(--brand); text-transform: uppercase; }
.brand-title { font-size: 21px; font-weight: 600; line-height: 1.15; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.main-nav a:hover { background: var(--bg); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
.header-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.icon-toggle { width: 40px; height: 40px; padding: 0; justify-content: center; }
.icon-toggle svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font-size: 14px; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 30, 50, 0.18);
  padding: 6px; width: 300px;
}
.menu-item {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left;
  padding: 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--ink);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); color: var(--ink); }
.menu-item .mi-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; }
.menu-item .mi-ico svg { width: 18px; height: 18px; }
.menu-item b { display: block; font-weight: 600; font-size: 14.5px; }
.menu-item small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }

/* ---------- Layout ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 20px 24px 32px; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.content { display: grid; gap: 16px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Filters ---------- */
.filters { padding: 18px 18px 8px; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.filters-head h2 { font-size: 17px; margin: 0; }
.field-label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); }
.input::placeholder { color: var(--faint); }
.filter-block { border-bottom: 1px solid var(--line); padding: 4px 0 14px; margin-bottom: 12px; }
.filter-group { border-top: 1px solid var(--line); padding: 12px 0; }
.filter-group:first-of-type { border-top: 0; }
.filter-group > summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::before {
  content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid var(--ink); transform: rotate(-90deg); transition: transform 0.15s;
}
.filter-group[open] > summary::before { transform: rotate(0deg); }
.filter-group .options { margin-top: 8px; display: grid; gap: 2px; }
.opt { display: grid; grid-template-columns: 18px auto 1fr auto; align-items: center; gap: 8px; padding: 4px 2px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.opt:hover { background: var(--bg); }
.opt input { margin: 0; width: 16px; height: 16px; accent-color: var(--brand); }
.opt .sw { width: 18px; height: 18px; display: grid; place-items: center; }
.opt .sw svg { width: 16px; height: 16px; }
.opt .cn { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-right: 5px; }
.opt .num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt.no-sw { grid-template-columns: 18px 1fr auto; }
.opt.is-empty { color: var(--faint); }
.group-note { font-size: 12px; color: var(--muted); margin: 6px 2px 0; }
.share-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; font-size: 14.5px; }
.share-row label { white-space: nowrap; }
.share-row output { color: var(--brand); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--brand); margin: 10px 0 4px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; margin-top: 4px; }
.check-line input { margin: 2px 0 0; accent-color: var(--brand); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; min-width: 0; overflow: hidden; }
.kpi-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.kpi-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-ico.warn { background: var(--warn-bg); color: var(--warn-ink); }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.note-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: -4px 2px 0; }
.note-line svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.showing-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.showing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-size: 13.5px; }
.tag button { border: 0; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); font-size: 16px; line-height: 1; }
.tag button:hover { background: var(--bg); color: var(--ink); }

/* ---------- Map + state panel ---------- */
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.map-card { padding: 16px 20px 14px; min-width: 0; }
.map-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.map-toolbar h2 { font-size: 18px; margin: 0 auto 0 0; white-space: nowrap; }
.tool { display: inline-flex; align-items: center; gap: 8px; }
.toolbar-label { font-size: 13.5px; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; gap: 2px; background: var(--input-bg); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.seg button:disabled { color: var(--faint); cursor: not-allowed; }

.nationwide-band { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--brand-tint-2); border: 1px solid var(--brand-line); font-size: 14px; margin-bottom: 8px; }
.nationwide-band > svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.nationwide-band .grow { flex: 1; }

.map-wrap { position: relative; border-radius: 8px; overflow: hidden; }
.map-svg { width: 100%; height: auto; display: block; }
.map-svg .water { fill: var(--map-water); }
.map-svg .land { fill: var(--map-land); stroke: var(--map-land-stroke); stroke-width: 0.8; }
.map-svg .country-lbl { font-size: 11px; letter-spacing: 0.14em; fill: var(--map-country-label); font-weight: 500; pointer-events: none; }
.map-svg .border-undetermined { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 4; pointer-events: none; }
.map-svg .state { stroke: var(--map-stroke); stroke-width: 1.2; cursor: pointer; transition: fill 0.2s, opacity 0.3s; vector-effect: non-scaling-stroke; }
.map-svg .state:focus-visible { outline: none; }
.map-svg .state.is-dim { opacity: 0.35; }
.map-svg .sudan-outline { fill: none; stroke: var(--map-outline); stroke-width: 1.3; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg .sel-outline { fill: none; stroke: var(--map-select); stroke-width: 2.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg .hover-outline { fill: none; stroke: var(--map-select); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg .flash-outline { fill: none; stroke: #f59e0b; stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg .abyei { fill: url(#hatch); stroke: var(--faint); stroke-dasharray: 3 2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-svg .lbl { fill: var(--map-label); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; pointer-events: none; font-weight: 500; }
.map-svg .lbl.is-dim { opacity: 0.45; }
.map-svg .lbl-abyei { font-style: italic; fill: var(--muted); font-weight: 400; }
.map-svg .ring { cursor: pointer; }
.map-svg .ring-num, .ring-svg .ring-num { font-size: 12.5px; font-weight: 700; fill: var(--map-label); pointer-events: none; }
.map-svg .agency-chip { cursor: pointer; }
.map-svg .agency-chip:hover .chip-bg, .map-svg .agency-chip:focus-visible .chip-bg { stroke: var(--brand); stroke-width: 2; }
.map-svg .agency-chip:focus-visible { outline: none; }
.map-svg .chip-bg { fill: var(--chip-bg); stroke: var(--line-2); stroke-width: 1; }
.map-svg .chip-badge { fill: var(--brand); }
.map-svg .chip-badge-t { fill: var(--on-brand); font-size: 10px; font-weight: 700; pointer-events: none; }
.map-svg .chip-text { font-size: 10px; font-weight: 700; fill: #1c2230; pointer-events: none; }
.map-svg .zoom-title { font-weight: 700; fill: var(--map-label); paint-order: stroke; stroke: var(--map-halo); stroke-width: 4px; text-anchor: middle; pointer-events: none; }
.map-svg .zoom-hint { fill: var(--muted); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; text-anchor: middle; pointer-events: none; }
.map-back { position: absolute; top: 10px; left: 10px; z-index: 4; box-shadow: var(--shadow); }
.map-tip { position: absolute; pointer-events: none; background: #1c2230; color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 13px; line-height: 1.4; z-index: 5; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); }
.map-tip strong { display: block; font-size: 14px; }
.map-disclaimer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  background: color-mix(in srgb, var(--panel) 85%, transparent); border-top: 1px solid var(--line);
  padding: 5px 12px; font-size: 10px; line-height: 1.4; color: var(--muted);
}
.map-disclaimer p { margin: 0 0 4px; }
.map-source { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.map-disclaimer p:last-child { margin: 0; }

.map-legend {
  position: absolute; left: 10px; right: 10px; bottom: 42px; z-index: 3;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px 9px; font-size: 12px; box-shadow: var(--shadow);
}
.legend-top { display: flex; justify-content: space-between; align-items: center; }
.legend-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.legend-top .link-btn { font-size: 12px; }
#legend-body { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(250px, 1.35fr); gap: 6px 16px; margin-top: 4px; align-items: start; }
#legend-body .legend-row { display: grid; gap: 4px; align-content: start; min-width: 0; }
#legend-body .legend-ring svg { flex: none; width: 34px; height: 34px; }
#legend-body .legend-ring { align-items: flex-start; font-size: 11.5px; line-height: 1.35; }
#legend-body .legend-title { min-width: 0; }
#legend-body .crit-keys { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(4, auto); grid-auto-flow: column; gap: 2px 8px; font-size: 11.5px; }
#legend-body .crit-keys span { white-space: nowrap; }

.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.legend-title { font-weight: 600; font-size: 12px; min-width: 118px; }
.legend-bins { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend-bins span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.legend-bins i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-ring { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); flex: 1; min-width: 0; }
.crit-keys { display: flex; flex-wrap: wrap; gap: 3px 10px; color: var(--ink-2); flex: 1; min-width: 0; }
.crit-keys span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.crit-keys svg { width: 14px; height: 14px; }
.crit-keys b { font-weight: 700; font-size: 12px; }

/* state panel */
.state-panel { padding: 16px 18px; }
.sp-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; }
.sp-kicker { font-size: 12px; letter-spacing: 0.08em; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.sp-name { font-size: 22px; font-weight: 600; margin: 2px 0 0; line-height: 1.2; }
.sp-select label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 4px; }
.sp-select select { padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); max-width: 150px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.mini { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.mini .l { font-size: 12px; color: var(--muted); }
.mini .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini .v.small { font-size: 13px; font-weight: 500; color: var(--muted); padding-top: 6px; }
.alert-soon { display: flex; gap: 8px; align-items: center; background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.alert-soon svg { width: 16px; height: 16px; flex: none; }
.sp-section { margin: 14px 0 6px; font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; gap: 10px; }
.sp-section small { font-weight: 400; color: var(--muted); font-size: 12px; text-align: right; }
.agency-row { display: flex; flex-wrap: wrap; gap: 8px; }
.agency-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); cursor: pointer; font-size: 13px; color: var(--ink);
}
.agency-btn:hover { border-color: var(--brand); }
.agency-btn .lg { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid #e5e3dc; }
.agency-btn .lg img { max-width: 22px; max-height: 22px; }
.agency-btn .lg span { font-size: 9px; font-weight: 700; color: #1c2230; }
.agency-btn b { font-weight: 600; }
.agency-btn em { font-style: normal; color: var(--muted); font-size: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr 90px 28px; align-items: center; gap: 8px; font-size: 13.5px; padding: 2px 0; }
.bar-row.crit { grid-template-columns: 18px 1fr 70px 30px; }
.bar-row.crit svg { width: 15px; height: 15px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; }
.bar.is-gap { background: repeating-linear-gradient(45deg, var(--hatch-a) 0 3px, var(--hatch-b) 3px 6px); }
.gap-word { color: var(--muted); font-size: 12px; }

.proj-card { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 8px; cursor: pointer; color: var(--ink); }
.proj-card:hover { border-color: var(--brand); }
.proj-card .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.proj-card .o { font-size: 13px; color: var(--ink-2); margin: 3px 0; }
.proj-card .d { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proj-card .f { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--track); color: var(--ink-2); }
.chip.ongoing { background: var(--brand-tint); color: var(--brand); }
.chip.soon { background: var(--warn-bg); color: var(--warn-ink); }
.chip.pipeline { background: var(--pipe-bg); color: var(--pipe-ink); }
.chip.ended { background: var(--track); color: var(--muted); }
.progress { height: 4px; background: var(--track); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: #6f9ad6; }
.crit-dots { display: inline-flex; gap: 2px; vertical-align: middle; }
.crit-dots i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.panel-more { margin-top: 10px; }
.empty-note { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ---------- Time window ---------- */
.time-card { padding: 16px 20px; }
.time-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.time-head h2 { font-size: 18px; margin: 0; }
.time-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.time-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.pill { border: 1px solid var(--line-2); background: var(--input-bg); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.time-controls select { padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); }
.time-chart { width: 100%; height: auto; display: block; margin-top: 12px; }
.time-chart .axis { font-size: 11px; fill: var(--muted); }
.time-chart .bar-in { fill: #2a6fc9; }
.time-chart .bar-out { fill: #c8d8ee; }
:root[data-theme="dark"] .time-chart .bar-in { fill: #5a95e0; }
:root[data-theme="dark"] .time-chart .bar-out { fill: #2b3a52; }
.time-chart .today { stroke: var(--ink); }
.time-chart .today-t { fill: var(--ink); font-weight: 600; }
.time-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ---------- Contributing agencies ---------- */
.agencies-card { padding: 18px 20px; }
.agencies-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.agencies-head h2 { font-size: 18px; margin: 0; }
.agencies-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.logo-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; align-items: stretch; }
.logo-tile {
  display: grid; place-items: center; height: 84px; min-width: 150px; padding: 12px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.logo-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 30, 50, 0.1); border-color: var(--brand); }
.logo-tile img { max-height: 56px; max-width: 190px; display: block; }
.logo-tile span { font-weight: 700; color: #1c2230; }
.logo-tile.is-add { background: var(--brand-tint-2); border: 1px dashed var(--brand-line); color: var(--brand); text-decoration: none; font-weight: 600; gap: 4px; text-align: center; font-size: 13.5px; }
.logo-tile.is-add svg { width: 22px; height: 22px; }

/* ---------- Dialogs ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--panel); overflow: hidden; }
dialog.modal::backdrop { background: rgba(14, 20, 32, 0.55); }
.modal-scroll { max-height: calc(100vh - 32px); overflow: auto; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); color: #1c2230; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.modal-close:hover { background: #fff; }
.hero { position: relative; height: 230px; background: var(--brand-tint-2); overflow: hidden; }
.hero img.photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .logo-hero { position: absolute; inset: 0; display: grid; place-items: center; background:
  radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 55%),
  radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 50%), var(--brand-tint-2); }
.hero .logo-card { background: #fff; border-radius: 14px; padding: 18px 28px; box-shadow: 0 8px 24px rgba(20, 30, 50, 0.12); }
.hero .logo-card img { max-height: 90px; max-width: 280px; display: block; }
.hero .logo-card span { font-size: 34px; font-weight: 700; color: #1c2230; }
.hero .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.9); color: #1c2230; cursor: pointer; font-size: 20px; }
.hero .nav.prev { left: 10px; }
.hero .nav.next { right: 10px; }
.hero .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.hero .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); }
.hero .dots i.on { background: #fff; }
.pop-body { padding: 18px 24px 8px; }
.pop-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.pop-title { font-size: 21px; line-height: 1.3; margin: 0 0 6px; }
.pop-org { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.pop-org .lg { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid #e5e3dc; display: grid; place-items: center; overflow: hidden; flex: none; }
.pop-org .lg img { max-width: 26px; max-height: 26px; }
.pop-org .lg span { font-size: 10px; font-weight: 700; color: #1c2230; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.fig { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.fig .l { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fig .l svg { width: 14px; height: 14px; color: var(--brand); }
.fig .v { font-size: 19px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fig .s { font-size: 12px; color: var(--muted); }
.pop-section { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.crit-list { display: flex; flex-wrap: wrap; gap: 8px; }
.crit-pill { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 6px; font-size: 13.5px; }
.crit-pill .ci { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.crit-pill .ci svg { width: 15px; height: 15px; }
.where { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.mini-map { width: 170px; height: auto; display: block; }
.mini-map path { stroke: var(--map-stroke); stroke-width: 1.5; fill: var(--map-none); }
.mini-map path.on { fill: var(--brand); }
.mini-map .bg { fill: var(--map-water); }
.where dl, .pop-dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.where dt, .pop-dl dt { color: var(--muted); }
.where dd, .pop-dl dd { margin: 0; }
.people-bars { display: grid; gap: 6px; }
.people-bars .pb { display: grid; grid-template-columns: 120px 1fr 80px; gap: 10px; align-items: center; font-size: 13.5px; }
.people-bars .pb .n { text-align: right; font-variant-numeric: tabular-nums; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); margin-top: 16px; }
.pop-actions .spacer { flex: 1; }
.pop-nudge { padding: 12px 24px 18px; font-size: 13.5px; color: var(--muted); background: var(--brand-tint-2); border-top: 1px solid var(--brand-line); }
.agency-modal-head { display: flex; gap: 16px; align-items: center; padding: 20px 60px 14px 24px; border-bottom: 1px solid var(--line); }
.agency-modal-head .logo-box { background: #fff; border: 1px solid #e5e3dc; border-radius: 10px; padding: 8px 12px; display: grid; place-items: center; min-width: 90px; height: 64px; }
.agency-modal-head .logo-box img { max-height: 46px; max-width: 160px; }
.agency-modal-head .logo-box span { font-weight: 700; color: #1c2230; }
.agency-modal-head h2 { margin: 0; font-size: 19px; }
.agency-modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.agency-modal-body { padding: 8px 24px 20px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1c2230; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 100; box-shadow: var(--shadow-lg); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 16px 24px; display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer-inner .grow { flex: 1; min-width: 260px; }
.footer-credits { width: 100%; font-size: 12px; color: var(--faint); }
.footer-credits a { color: inherit; }
.social { display: inline-flex; gap: 10px; }
.social a { color: var(--faint); display: inline-flex; }
.social a:hover { color: var(--ink); }
.social svg { width: 18px; height: 18px; }

/* ---------- Form page ---------- */
.form-page { max-width: 1240px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.form-page h1 { font-size: 28px; margin: 0 0 6px; }
.lede { color: var(--ink-2); margin: 0 0 18px; }
.multi-box { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-bottom: 16px; background: var(--brand-tint-2); border: 1px solid var(--brand-line); border-radius: 10px; }
.multi-box > span:first-child { display: grid; place-items: center; flex: none; }
.multi-box > span:first-child svg { width: 30px; height: 30px; color: var(--brand); }
.multi-box .grow { flex: 1; font-size: 14px; color: var(--ink-2); }
.multi-box b { color: var(--ink); display: block; font-size: 15px; }
.correcting { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.form-section { padding: 20px 22px; margin-bottom: 16px; }
.form-section h2 { font-size: 18px; margin: 0 0 14px; }
.form-section h2 .n { color: var(--brand); }
.fgrid { display: grid; gap: 14px 16px; }
.fgrid.c2 { grid-template-columns: 1fr 1fr; }
.fgrid.c3 { grid-template-columns: repeat(3, 1fr); }
.fgrid.c6 { grid-template-columns: repeat(6, 1fr); }
.fld > label, .fld > .lbl { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 14.5px; margin-bottom: 6px; white-space: nowrap; }
.fld .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.req { color: var(--warn-ink); }
textarea.input { min-height: 84px; resize: vertical; }
.readonly { background: var(--panel-2); border-color: var(--line); color: var(--ink-2); }
.affix { position: relative; }
.affix .input { padding-left: 28px; }
.affix.suffix .input { padding-left: 12px; padding-right: 30px; }
.affix > span { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.affix > span.pre { left: 12px; }
.affix > span.suf { right: 12px; }
.tip { position: relative; display: inline-flex; }
.tip-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--brand); font-size: 11px; font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: help; display: grid; place-items: center; padding: 0; }
.tip-pop {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 320px; z-index: 20;
  background: #1c2230; color: #fff; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.5;
  font-weight: 400; white-space: normal; box-shadow: var(--shadow-lg); display: none;
}
.tip-pop b { display: block; margin-bottom: 4px; }
.tip:hover .tip-pop, .tip:focus-within .tip-pop { display: block; }
.choice-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pills label { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; font-weight: 400; margin: 0; }
.choice-pills input { accent-color: var(--brand); margin: 0; }
.choice-pills label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
.state-grid label, .radio-row label, .loc-grid label, .check-col label { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14.5px; margin: 0; cursor: pointer; }
.state-grid input, .radio-row input, .loc-grid input, .check-col input { accent-color: var(--brand); margin: 0; }
.radio-row { display: flex; gap: 24px; flex-wrap: wrap; }
.check-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.loc-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.loc-group legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.loc-group .loc-tools { font-size: 12.5px; margin: 0 0 6px; }
.loc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.loc-grid label { font-size: 13.5px; }
.is-disabled { opacity: 0.5; }
.crit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crit-grid .crit-opt { display: grid; grid-template-columns: 18px 30px 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 400; margin: 0; }
.crit-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint-2); }
.crit-opt input { margin: 6px 0 0; accent-color: var(--brand); }
.crit-opt .ci { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.crit-opt .ci svg { width: 17px; height: 17px; }
.crit-opt b { font-weight: 500; display: block; }
.crit-opt small { color: var(--muted); font-size: 13px; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; background: var(--input-bg); }
.chips-input input { border: 0; outline: 0; flex: 1; min-width: 200px; padding: 4px; background: transparent; }
.chips-input .ch { display: inline-flex; gap: 6px; align-items: center; background: var(--brand-tint); color: var(--brand); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 500; }
.chips-input .ch button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.photo-drop { border: 1px dashed var(--line-2); border-radius: 10px; padding: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-drop > svg { width: 30px; height: 30px; color: var(--brand); }
.photo-list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.photo-item { width: 150px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 12px; background: var(--panel); }
.photo-item img { width: 150px; height: 100px; object-fit: cover; display: block; }
.photo-item div { padding: 6px 8px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.photo-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14.5px; cursor: pointer; font-weight: 400; }
.consent input { margin-top: 3px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 16px; align-items: center; margin: 8px 0 24px; flex-wrap: wrap; }
.form-actions .btn { padding: 11px 22px; font-size: 15.5px; }
.err { color: var(--err); font-size: 13px; margin-top: 5px; }
.has-err .input, .has-err .choice-pills label, .has-err .crit-opt, .has-err .chips-input { border-color: #d0443a; }
.error-summary { border: 1px solid var(--err-line); background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.side-card { padding: 18px 20px; margin-bottom: 14px; }
.side-card h2 { font-size: 17px; margin: 0 0 12px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 14px; color: var(--ink-2); }
.steps b { color: var(--ink); display: block; }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.sticky-side { position: sticky; top: 16px; }
.done-panel { padding: 22px; }
.done-panel h2 { margin: 0 0 8px; }
.done-panel textarea { width: 100%; min-height: 220px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.attach-note { display: flex; gap: 10px; align-items: flex-start; background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); border-radius: 8px; padding: 10px 14px; font-size: 14.5px; margin: 10px 0; }
.attach-note svg { width: 22px; height: 22px; flex: none; }
.photo-note { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-tint-2); border: 1px solid var(--brand-line); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.photo-note svg { width: 26px; height: 26px; color: var(--brand); flex: none; }

/* ---------- About page ---------- */
.about { max-width: 920px; margin: 0 auto; padding: 24px; }
.about h1 { font-size: 28px; margin: 0 0 10px; }
.about .card { padding: 20px 24px; margin-bottom: 16px; }
.about h2 { font-size: 19px; margin: 0 0 10px; }
.about table { border-collapse: collapse; width: 100%; font-size: 14px; }
.about th, .about td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.about th { font-weight: 600; color: var(--ink-2); }
.about .ci { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; vertical-align: middle; margin-right: 6px; }
.about .ci svg { width: 15px; height: 15px; }
.about ul { padding-left: 20px; margin: 6px 0; }
.about li { margin-bottom: 4px; }

/* ---------- Responsive (desktop first; phones must not break) ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-row { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; }
  .form-page { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 760px) {
  .map-disclaimer { position: static; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
  .map-legend { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  .where { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner, .page, .footer-inner, .form-page, .about { padding-left: 16px; padding-right: 16px; }
  .header-actions { margin-left: 0; width: 100%; }
  .brand-logo { height: 34px; }
  .brand-divider { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid.c2, .fgrid.c3, .crit-grid, .check-col { grid-template-columns: 1fr; }
  .fgrid.c6 { grid-template-columns: repeat(2, 1fr); }
  .state-grid, .loc-grid { grid-template-columns: 1fr 1fr; }
  .where dl, .pop-dl { grid-template-columns: 1fr; gap: 2px; }
  .where dd, .pop-dl dd { margin-bottom: 8px; }
  .hero { height: 170px; }
  .dropdown-menu { right: auto; left: 0; }
  .tip-pop { width: 260px; left: 0; transform: none; }
  .fld > label, .fld > .lbl { white-space: normal; flex-wrap: wrap; }
  .multi-box { flex-wrap: wrap; }
  .chips-input input { min-width: 0; }
}

/* ---------- Round 3: project list under the map, criteria icons, back button ---------- */
.map-col { display: grid; gap: 16px; min-width: 0; }
.list-card { padding: 16px 20px; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.list-head h2 { font-size: 18px; margin: 0; }
.list-head small { color: var(--muted); font-size: 13px; }
.proj-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 6px 18px; align-items: center;
  width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-top: 8px; cursor: pointer; color: var(--ink);
}
.proj-row:hover, .proj-row:focus-visible { border-color: var(--brand); }
.proj-row .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.proj-row .o { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.proj-row .o .lg { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid #e5e3dc; display: grid; place-items: center; overflow: hidden; flex: none; }
.proj-row .o .lg img { max-width: 17px; max-height: 17px; }
.proj-row .o .lg span { font-size: 7px; font-weight: 700; color: #1c2230; }
.proj-row .when { font-size: 13px; color: var(--muted); }
.proj-row .when .line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.proj-row .right { text-align: right; display: grid; gap: 6px; justify-items: end; }
.proj-row .money { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.proj-row .money b { font-size: 15px; color: var(--ink); }
.crit-icons { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.crit-icons .ci { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.crit-icons .ci svg { width: 15px; height: 15px; }
.list-more { margin-top: 12px; text-align: center; }
.panel-note { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--brand-tint-2); border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 12px; }
.panel-note span { display: inline-flex; gap: 8px; align-items: center; }
.panel-note svg { width: 16px; height: 16px; color: var(--brand); }
.modal-back { position: absolute; top: 10px; left: 10px; z-index: 3; height: 36px; padding: 0 14px 0 8px; border-radius: 18px; border: 0; background: rgba(255, 255, 255, 0.94); color: #1c2230; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.modal-back svg { width: 18px; height: 18px; }
.modal-back:hover { background: #fff; }
.agency-modal-head.has-back { padding-top: 54px; }
@media (max-width: 900px) {
  .proj-row { grid-template-columns: 1fr; }
  .proj-row .right { justify-items: start; text-align: left; }
}

/* full-width rows below the filters and content */
.page > .full-row { grid-column: 1 / -1; }

/* summary card mini charts */
.kbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; background: var(--track); }
.kbar i { display: block; height: 100%; }
.kleg { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.kleg b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.kdots { display: grid; grid-template-columns: repeat(9, 12px); gap: 3px; margin: 8px 0 6px; }
.kdots button { width: 12px; height: 12px; border-radius: 3px; background: var(--brand); border: 0; padding: 0; cursor: pointer; }
.kdots button.off { background: var(--map-none); }
.kdots button:hover, .kdots button:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.kdots button.on { outline: 2px solid #f2b705; outline-offset: 1px; }
.kmonths { display: flex; gap: 4px; align-items: flex-end; height: 40px; margin: 8px 0 0; }
.kmonths div { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.kmonths i { display: block; background: #e2895f; border-radius: 2px; margin: 0 auto 2px; width: 100%; }
.ktop { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ktop div { display: flex; justify-content: space-between; gap: 8px; }
.ktop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ktop b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.clear-link { font-size: 12.5px; margin-left: 6px; }
/* no browser focus frame on map shapes; keyboard focus shows the outline instead */
.map-svg .state:focus, .map-svg .ring:focus, .map-svg .agency-chip:focus, .map-svg:focus { outline: none; }

#legend-body .legend-bins { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 10px; }
#legend-body .legend-bins .none { grid-column: 1 / -1; }
#legend-body .legend-bins span { white-space: nowrap; }

/* when the map is narrow, the legend and disclaimer sit below the map instead of over it */
.map-wrap { container-type: inline-size; }
@container (max-width: 640px) {
  .map-legend { position: static; margin: 8px 0 0; box-shadow: none; }
  .map-disclaimer { position: static; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
  #legend-body { grid-template-columns: auto minmax(0, 1fr); }
  #legend-body .legend-row:last-child { grid-column: 1 / -1; }
}

/* ---------- preview, live card, my submissions ---------- */
.photo-ph { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, 0.92); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: #5b6474; white-space: nowrap; }
.logo-note { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin: -4px 0 14px; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.flow > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.flow > div.on { border-color: var(--brand); background: var(--brand-tint-2); }
.flow b { display: block; color: var(--ink); font-size: 14px; }
.flow .n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.flow > div.on .n { background: var(--brand); color: var(--on-brand); }
.pv-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; }
.pv-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pv-box > h2 { font-size: 15px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pv-box > h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.pv-box .hero { height: 190px; }
.tag-new { background: #e6f4ee; color: #17694a; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pmap { width: 100%; height: auto; display: block; }
.pmap .land { fill: var(--map-land); stroke: var(--map-land-stroke); }
.pmap .st { fill: var(--map-none); stroke: var(--map-stroke); }
.pmap .st.has { fill: #a3c4ec; }
.pmap .st.mine { fill: var(--brand); }
.pmap .sel { fill: none; stroke: var(--map-select); stroke-linejoin: round; }
.pmap text { font-weight: 700; fill: #1c2230; paint-order: stroke; stroke: #fff; }
.changes { padding: 12px 16px; display: grid; gap: 10px; }
.chg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.chg .h { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; flex-wrap: wrap; }
.chg .cnt { font-size: 13.5px; color: var(--ink-2); font-weight: 400; }
.chg .cnt b { color: var(--brand); font-size: 16px; }
.chg .fill { margin-top: 6px; font-size: 13px; color: #17694a; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chg .fill .ci { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; }
.chg .fill .ci svg { width: 13px; height: 13px; }
.private { margin-top: 16px; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--ink-2); }
.private svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.pv-actions { display: flex; gap: 12px; margin: 16px 0 24px; justify-content: flex-end; flex-wrap: wrap; }
.pv-actions .btn { padding: 11px 20px; font-size: 15px; }
.mini-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); }
.mini-card .mc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.mini-card .mc-head b { color: var(--ink); }
.mini-card .lg { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e5e3dc; display: grid; place-items: center; background: #fff; overflow: hidden; flex: none; }
.mini-card .lg img { max-width: 28px; max-height: 28px; }
.mini-card .lg span { font-size: 9px; font-weight: 700; color: #1c2230; text-align: center; padding: 2px; }
.mini-card .mc-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.mini-card .mc-line { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mini-card .mc-line b { color: var(--ink); }
.mini-card .crit-icons .ci { width: 28px; height: 28px; }
.mini-card .crit-icons .ci svg { width: 16px; height: 16px; }
.live-tag { font-size: 12px; font-weight: 600; background: #e6f4ee; color: #17694a; border-radius: 999px; padding: 2px 10px; }
.mine-page { max-width: 1000px; margin: 0 auto; padding: 24px; }
.mine-page h1 { font-size: 28px; margin: 0 0 6px; }
.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 0 0 18px; }
.notice svg { width: 22px; height: 22px; flex: none; }
.mine-item { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; margin-bottom: 14px; padding: 14px; }
.mine-item .meta { display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.mine-item .meta .btn { justify-content: center; }
.st-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.st-badge.sent { background: var(--brand-tint); color: var(--brand); }
.st-badge.live { background: #e6f4ee; color: #17694a; }
@media (max-width: 900px) { .pv-grid, .flow, .mine-item { grid-template-columns: 1fr; } }

.form-page.previewing { grid-template-columns: 1fr; max-width: 1180px; }
.form-page.previewing > aside, .form-page.previewing #form-title, .form-page.previewing #form-lede, .form-page.previewing #correcting { display: none !important; }
.hero .logo-card span { font-size: 26px; display: block; max-width: 320px; text-align: center; line-height: 1.2; }
.pv-box .where dl, .pv-box .pop-dl { grid-template-columns: 130px minmax(0, 1fr); }

.ym { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.error-summary a { color: inherit; }
.krisk { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.krisk b { font-size: 18px; color: var(--warn-ink); margin-right: 2px; }
.pv-ref { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-tint); color: var(--brand); border-radius: 8px; padding: 5px 12px; font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
.pv-ref:empty { display: none; }
.mine-ref { font-size: 13px; color: var(--muted); }
.mine-ref b { color: var(--ink); }
.pub-note { background: #e6f4ee; color: #17694a; border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* ---------- direct sending: photos, logo, confirmation ---------- */
.help-line { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 10px; line-height: 1.5; }
#photo-box { margin-bottom: 16px; }
#photo-box .photo-drop { cursor: pointer; background: var(--brand-tint-2); border-color: var(--brand-line); }
#photo-box .photo-drop:hover { border-color: var(--brand); }
#photo-ico2 svg { width: 30px; height: 30px; color: var(--brand); display: block; }
.photo-item .shrunk { color: #1a7a4c; font-weight: 500; white-space: normal; }
:root[data-theme="dark"] .photo-item .shrunk { color: #7fd6a6; }
.photo-item button { background: none; border: 0; padding: 0; color: var(--err); cursor: pointer; font: inherit; font-size: 12px; }
.photo-item div { flex-direction: column; align-items: flex-start; }
.logo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-prev { width: 64px; height: 64px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); font-weight: 700; display: grid; place-items: center; overflow: hidden; font-size: 13px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.send-err { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-line); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.send-err .link-btn { color: inherit; text-decoration: underline; font-weight: 500; }
#ts-box:not(:empty) { margin: 14px 0 0; }
.sent-ok { width: 44px; height: 44px; border-radius: 50%; background: #e6f4ec; color: #1a7a4c; display: grid; place-items: center; margin-bottom: 10px; }
.sent-ok svg { width: 22px; height: 22px; }
.sent-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.sent-facts > div { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sent-facts > div > span:first-child { color: var(--muted); }
.sent-facts b { font-size: 16px; }
.sent-facts .chip { align-self: flex-start; }

/* ---------- Add multiple projects ---------- */
.multi-page { max-width: 1180px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.multi-page h1 { font-size: 28px; margin: 0 0 6px; }
.multi-kicker { margin: 0; font-size: 13px; color: var(--muted); }
.multi-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.multi-step { padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.multi-step p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.step-n { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.xl-drop { cursor: pointer; width: 100%; box-sizing: border-box; background: var(--brand-tint-2); border-color: var(--brand-line); padding: 12px 14px; font-size: 14px; }
.xl-drop:hover { border-color: var(--brand); }
#xl-ico svg { width: 26px; height: 26px; color: var(--brand); display: block; }
.tbl-card { overflow: hidden; }
.rows-head { padding: 14px 18px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.rows-head h2 { margin: 0; font-size: 18px; }
.tbl-wrap { overflow-x: auto; }
.rows-tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
.rows-tbl th { text-align: left; background: var(--panel-2); color: var(--muted); font-size: 13px; font-weight: 500; padding: 10px 12px; }
.rows-tbl td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.rows-tbl th:first-child, .rows-tbl td:first-child { padding-left: 18px; }
.rows-tbl tr.bad td { background: var(--err-bg); }
.pill-ok, .pill-bad { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 500; }
.pill-ok { background: #e6f4ec; color: #1a7a4c; }
.pill-bad { background: var(--err-bg); color: var(--err); }
:root[data-theme="dark"] .pill-ok { background: #183b2a; color: #7fd6a6; }
.row-bad { color: var(--err); font-size: 13px; }
.row-note { color: var(--warn-ink); }
.multi-note { padding: 18px 20px; font-size: 14px; color: var(--ink-2); }
.multi-note p { margin: 6px 0 0; line-height: 1.5; }
.multi-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.sent-list { margin: 10px 0 14px; padding-left: 20px; line-height: 1.7; }
#logo-box { margin-bottom: 16px; }
/* donors with amounts */
.donor-rows { display: flex; flex-direction: column; gap: 8px; }
.donor-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px 36px; gap: 8px; align-items: center; }
.donor-row .rm { width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.donor-row .rm:hover { color: var(--err); border-color: var(--err-line); }
.donor-row .rm[hidden] { display: block; visibility: hidden; }
#add-donor { margin-top: 8px; font-size: 14px; }
.donor-sum { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.donor-sum.over { color: var(--err); }
@media (max-width: 560px) { .donor-row { grid-template-columns: minmax(0, 1fr) 36px; } .donor-row .affix { grid-column: 1; } .donor-row .rm { grid-row: 1 / span 2; grid-column: 2; } }

/* test mode bar (test.html) */
.test-bar { background: #5541b5; color: #fff; font-size: 14px; padding: 8px 24px; text-align: center; }
.test-bar a, .test-bar button { color: #fff; font: inherit; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.test-page { max-width: 820px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.test-page h1 { font-size: 28px; margin: 0; }
.test-page .card { padding: 20px; }
.test-page ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.test-state { font-weight: 500; }

/* Summary cards as filters */
.kpi { position: relative; }
.kf { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); pointer-events: none; }
.kf svg { width: 13px; height: 13px; }
.kclear { position: absolute; top: 12px; right: 12px; font: inherit; font-size: 11.5px; font-weight: 500; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.kclear:hover { background: var(--brand-dark); }
.kleg .kitem { font: inherit; color: inherit; background: none; border: 0; padding: 1px 4px; margin: 0 -4px; border-radius: 5px; display: inline-flex; align-items: center; text-align: left; }
.kleg button.kitem { cursor: pointer; }
.kleg button.kitem:hover, .kleg button.kitem:focus-visible { background: var(--brand-tint); color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.kleg .kitem.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--brand); }
.kleg.has-on .kitem:not(.on) { opacity: 0.45; }
.kbar i[data-k], .kbar i[data-donors] { cursor: pointer; }
.kbar.has-on i:not(.on) { opacity: 0.3; }
.kmore { display: inline-grid; place-items: center; min-width: 20px; height: 15px; margin-left: 4px; border: 1px solid var(--line-2); border-radius: 5px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.klink { font: inherit; font-size: 12px; color: var(--brand); background: none; border: 0; padding: 0; margin-top: 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.klink[aria-pressed="true"] { font-weight: 600; text-decoration: none; }

/* All donors window */
dialog.modal-donors { width: min(720px, calc(100vw - 24px)); }
.dl { padding: 22px 24px 4px; max-height: calc(100vh - 140px); overflow: auto; }
.dl h2 { margin: 0 0 4px; font-size: 20px; }
.dl-sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; padding-right: 30px; }
.dl-search { width: 100%; margin-bottom: 10px; }
.dl-head, .dl-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 90px 82px 40px 58px; gap: 10px; align-items: center; }
.dl-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.dl-head span:nth-child(n+4) { text-align: right; }
.dl-row { width: 100%; font: inherit; font-size: 13.5px; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px; text-align: left; cursor: pointer; }
.dl-row:hover { background: var(--brand-tint-2); }
.dl-row.on { background: var(--brand-tint); }
.dl-row.nr { cursor: default; color: var(--muted); font-style: italic; }
.dl-row.nr:hover { background: none; }
.dl-check { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; display: grid; place-items: center; font-size: 11px; color: var(--on-brand); }
.dl-row.on .dl-check { background: var(--brand); border-color: var(--brand); }
.dl-row.nr .dl-check { visibility: hidden; }
.dl-name { overflow-wrap: anywhere; }
.dl-bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.dl-bar i { display: block; height: 100%; background: var(--brand); }
.dl-amt, .dl-pct, .dl-n { text-align: right; font-variant-numeric: tabular-nums; }
.dl-pct, .dl-n { color: var(--muted); }
.dl-empty { color: var(--muted); padding: 12px 8px; }
.dl-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 12px; }
.dl-actions { display: flex; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--line); }
.dl-actions .spacer { flex: 1; }
@media (max-width: 620px) {
  .dl-head, .dl-row { grid-template-columns: 18px minmax(0, 1fr) 76px 52px; }
  .dl-head span:nth-child(3), .dl-row .dl-bar, .dl-head span:nth-child(5), .dl-row .dl-pct { display: none; }
}
.kselect-wrap { position: absolute; top: 12px; right: 12px; max-width: 58%; z-index: 4; }
.kselect { font: inherit; max-width: 100%; height: 26px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--ink-2); background: var(--panel); cursor: pointer; float: right; }
.kselect span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kselect svg { width: 11px; height: 11px; flex: none; transition: transform 0.15s; }
.kselect[aria-expanded="true"] svg { transform: rotate(180deg); }
.kselect:hover, .kselect:focus-visible, .kselect[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.kselect.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 500; }
.kmenu { position: absolute; top: 32px; right: 0; width: 210px; max-height: 340px; overflow: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 20, 40, 0.18); }
.kmenu button { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.kmenu button em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.kmenu button:hover, .kmenu button:focus-visible { background: var(--brand-tint-2); }
.kmenu button.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.kmenu button.zero { color: var(--muted); }
.kpi:has(.kselect-wrap) { overflow: visible; z-index: 3; }
.kpi:has(.kselect-wrap) .kpi-label { padding-right: 96px; }
.list-action { padding: 14px 24px 2px; }
.klink[data-soon-list] { text-decoration: none; }
.klink .u { text-decoration: underline; text-underline-offset: 2px; }
.klink .kmore { display: inline-grid; }

/* IASC criteria: short explanation in a pop-up, and the source */
.crit-tip { vertical-align: 1px; margin-left: 2px; }
.crit-tip .tip-pop { font-weight: 400; }
.crit-tip .tip-pop b { font-weight: 500; }
.iasc-source { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.gender-row { margin-top: 14px; }
.sex-toggle { margin-top: 10px; font-size: 14px; }
.sex-box { margin-top: 10px; }
.sex-tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.sex-tbl th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 6px 8px 6px 0; font-size: 13px; }
.sex-tbl thead th { color: var(--muted); }
.sex-tbl td { padding: 4px 8px 4px 0; }
.sex-tbl .input { padding: 7px 10px; }
.sex-tbl .sx-sum { font-weight: 500; min-width: 70px; }
.female-note { font-size: 12px; color: var(--muted); }

/* ---------- sign in ---------- */
.signin-btn { gap: 7px; }
.signin-btn svg { width: 18px; height: 18px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); font: 600 14px var(--font); cursor: pointer; display: grid; place-items: center; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--brand-dark); }
.acct-menu { width: 270px; }
.acct-menu .menu-item { display: block; width: 100%; text-align: left; font: 14.5px var(--font); padding: 9px 10px; }
.acct-who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.acct-who b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.acct-role { display: inline-block; margin-top: 5px; padding: 1px 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); font-size: 12px; font-weight: 600; }
:root[data-theme="dark"] .acct-role { color: var(--ink); }
dialog.signin-modal { width: min(420px, calc(100vw - 24px)); overflow: visible; }
.signin-box { padding: 26px 28px 24px; display: flex; flex-direction: column; }
.signin-box h2 { margin: 0 0 6px; font-size: 20px; padding-right: 36px; }
.signin-box p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.signin-box .field-label { margin-bottom: 6px; }
.signin-code { letter-spacing: 8px; font-size: 22px; text-align: center; }
.signin-err { color: var(--err); font-size: 14px; min-height: 20px; margin-top: 6px; }
.signin-go { margin-top: 6px; width: 100%; justify-content: center; padding: 11px; }
.signin-box .signin-small { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.signin-box .signin-small .link-btn { font-size: 12.5px; }
.signin-stop { background: var(--err-bg); border: 1px solid var(--err-line); border-radius: 8px; padding: 12px 14px; color: var(--err); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
dialog.signin-modal .modal-close { background: transparent; box-shadow: none; color: var(--muted); }
@media (max-width: 640px) { .signin-btn span { display: none; } .signin-btn { width: 40px; height: 40px; padding: 0; justify-content: center; } }
