/* Kit v3 Civic (owner ruling R72). Tokens from v3.css only. Logical properties, so the page works right to left. */
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

.cv-main { inset-block: 76px 120px; inset-inline-start: 76px; width: 404px; }
.cv-main .panel__hd { padding-block-end: 14px; }
.cv-main .stats { margin-block-start: 12px; }
.cv-main .stat small { display: block; color: var(--ink-3); font-size: 11px; margin-block-start: 2px; }
.cv-tools { margin-block-start: 12px; }
.cv-tools button { font-size: 12px; padding-inline: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.cv-tools button em { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-tools button[aria-pressed="true"] em { color: var(--ink-2); }

/* Filters */
.cv-filt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-block-start: 10px; }
.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; width: 100%; height: 32px; padding-inline: 10px 28px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); text-overflow: ellipsis; }
.sel select:hover { border-color: var(--line-2); }
.sel::after { content: ""; position: absolute; inset-inline-end: 11px; inset-block-start: 13px; width: 6px; height: 6px; border-inline-end: 1.5px solid var(--ink-3); border-block-end: 1.5px solid var(--ink-3); transform: rotate(45deg); pointer-events: none; }
.sel select option { background: var(--bg-1); color: var(--ink); }
.cv-states { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 8px; }
.cv-states::-webkit-scrollbar { display: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 9px; border-radius: var(--r); border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill em { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pill:hover { border-color: var(--line-2); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill[aria-pressed="true"] em { color: inherit; opacity: .6; }

/* Records */
.cv-sec { padding: 12px 16px 4px; }
.cv-sec + .cv-sec { border-block-start: 1px solid var(--line); }
.cv-sec__h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-block-end: 8px; }
.cv-sec__h .eyebrow b { color: var(--ink); font-weight: 600; margin-inline-start: 6px; }
.card { width: 100%; display: block; text-align: start; padding: 12px; margin-block-end: 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-1); color: inherit; }
.card:hover { border-color: var(--line-2); }
.card[aria-selected="true"] { border-color: var(--red); background: var(--red-soft); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__t { display: block; font: 600 15px/1.25 var(--f); letter-spacing: -.01em; margin-block-start: 8px; }
.card__s { display: block; color: var(--ink-2); margin-block-start: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card__m { display: flex; align-items: center; gap: 10px; margin-block-start: 10px; color: var(--ink-3); font-size: 12px; }
.card__m .meter { flex: 1; }
.chip--sm { height: 20px; padding-inline: 7px; font-size: 11px; }
.chip--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Empty, designed (KIT_V3 1.6) */
.empty { margin: 4px 0 10px; padding: 16px; border-radius: var(--r); border: 1px dashed var(--line-2); display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.empty b { grid-row: span 2; font: 600 40px/1 var(--f); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.empty span { font-weight: 600; }
.empty small { color: var(--ink-3); }
.empty .btn { grid-column: 1 / -1; justify-content: center; margin-block-start: 10px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; margin-block-end: 10px; }
.kv div { background: var(--bg-1); padding: 10px; min-width: 0; }
.kv b { display: block; font: 600 20px/1 var(--f); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kv span { display: block; margin-block-start: 5px; color: var(--ink-3); font-size: 11.5px; }
.rule { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; padding: 7px 0; border-block-start: 1px solid var(--line); font-size: 12.5px; }
.rule:first-of-type { border-block-start: 0; }
.rule svg { margin-block-start: 1px; color: var(--ink-3); }
.rule small { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.crow { width: 100%; display: grid; grid-template-columns: 76px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; margin-inline: -8px; width: calc(100% + 16px); border: 0; border-radius: var(--r); background: transparent; text-align: start; color: inherit; text-decoration: none; }
.crow:hover { background: var(--bg-2); }
.crow .mono { color: var(--ink-3); font-size: 11px; }
.crow span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Allocator (budget) */
.alloc { padding: 14px; border-radius: var(--r); background: var(--bg-1); border: 1px solid var(--line); margin-block-end: 10px; }
.alloc__bar { height: 10px; border-radius: var(--r); background: var(--bg-3); overflow: hidden; display: flex; margin-block: 10px 6px; }
.alloc__bar i { display: block; height: 100%; background: var(--ink-2); border-inline-end: 1px solid var(--bg-1); }
.alloc__row { display: grid; grid-template-columns: minmax(0,1fr) 120px 44px; gap: 10px; align-items: center; padding-block: 6px; }
.alloc__row span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.alloc__row input[type=range] { width: 100%; accent-color: var(--ink); }
.alloc__row b { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.alloc__tot { display: flex; justify-content: space-between; align-items: baseline; color: var(--ink-3); font-size: 12px; }
.alloc__tot b { font: 600 22px/1 var(--f); color: var(--ink); letter-spacing: -.02em; }
.alloc__tot b.over { color: var(--red); }

/* Inspector */
.cv-insp { inset-block-start: 76px; max-height: calc(100% - 196px); }
.cv-insp[hidden] { display: flex; }
.flow { display: grid; grid-template-columns: 1fr 14px 1fr 14px 1fr; align-items: stretch; gap: 0; margin: 14px 16px 0; }
.flow > div { padding: 10px; border-radius: var(--r); background: var(--bg-1); border: 1px solid var(--line); min-width: 0; }
.flow > i { align-self: center; justify-self: center; width: 8px; height: 8px; border-inline-end: 1.5px solid var(--ink-3); border-block-start: 1.5px solid var(--ink-3); transform: rotate(45deg); }
[dir="rtl"] .flow > i { transform: rotate(-135deg); }
.flow .eyebrow { font-size: 10px; }
.flow b { display: block; font: 600 13px/1.25 var(--f); margin-block-start: 6px; }
.flow small { display: block; color: var(--ink-3); font-size: 11px; margin-block-start: 3px; }
.flow .handle { font: 500 11px/1 var(--m); color: var(--ink-2); margin-block-start: 6px; display: block; }
.isec { padding: 14px 16px 0; }
.isec > .eyebrow { margin-block-end: 6px; display: block; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.steps li::before { content: ""; position: absolute; inset-inline-start: 8px; inset-block: 0; width: 1px; background: var(--line-2); }
.steps li:first-child::before { inset-block-start: 50%; }
.steps li:last-child::before { inset-block-end: 50%; }
.steps i { position: relative; z-index: 1; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: var(--bg-1); }
.steps li[data-st="done"] i { background: var(--ink); border-color: var(--ink); }
.steps li[data-st="in-progress"] i { border-color: var(--red); box-shadow: inset 0 0 0 3px var(--bg-1), inset 0 0 0 8px var(--red); }
.steps small { color: var(--ink-3); font-size: 11.5px; }
.asks button { width: 100%; display: grid; grid-template-columns: 22px 1fr; gap: 8px; text-align: start; padding: 8px; margin-inline: -8px; width: calc(100% + 16px); border: 0; border-radius: var(--r); background: transparent; color: inherit; font-size: 12.5px; }
.asks button:hover { background: var(--bg-2); }
.asks .n { font: 500 11px/18px var(--m); color: var(--ink-3); }

/* Strip: the states of the current tool */
.cv-strip { grid-template-columns: 220px minmax(0,1fr) 248px; }
.funnel { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch; margin-inline: 0; }
.funnel button { position: relative; border: 0; border-inline-end: 1px solid var(--line); background: transparent; color: inherit; text-align: start; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.funnel button:last-child { border-inline-end: 0; }
.funnel button:hover { background: var(--bg-2); }
.funnel button[aria-pressed="true"] { background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--red); }
.funnel b { font: 600 30px/1 var(--f); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.funnel span { color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel small { color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-start { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 14px; border-inline-start: 1px solid var(--line); }
.cv-start .btn { height: 42px; justify-content: center; font-size: 14px; }
.cv-start small { color: var(--ink-3); font-size: 11px; text-align: center; }

.cv-legend { position: absolute; z-index: 9; inset-block-end: 120px; inset-inline-end: 400px; padding: 10px 12px; border-radius: var(--r); display: flex; align-items: center; gap: 12px; font-size: 12px; }
.cv-legend b { font: 600 18px/1 var(--f); font-variant-numeric: tabular-nums; }
.cv-legend .rings { display: flex; align-items: flex-end; gap: 6px; }
.cv-legend .rings i { display: block; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.cv-legend small { color: var(--ink-3); display: block; }
.cv-layers { inset-inline-start: 492px; max-width: calc(100% - 492px - 396px); }

/* Wizard */
.wiz { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 76px 12px 12px; background: rgba(0,0,0,.5); }
:root[data-theme="light"] .wiz { background: rgba(0,0,0,.22); }
.wiz[hidden] { display: none; }
.wiz__box { width: min(1120px, 100%); height: min(680px, 100%); display: grid; grid-template-columns: 212px minmax(0,1fr) 352px; overflow: hidden; background: var(--glass-2); }
.wiz__nav { border-inline-end: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: auto; }
.wiz__nav .eyebrow { padding: 0 8px 10px; }
.wiz__nav button { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; height: 38px; padding-inline: 8px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); text-align: start; font-weight: 500; }
.wiz__nav button i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 500 10.5px/1 var(--m); font-style: normal; color: var(--ink-3); }
.wiz__nav button[aria-current="step"] { background: var(--bg-2); color: var(--ink); }
.wiz__nav button[aria-current="step"] i { border-color: var(--ink); color: var(--ink); }
.wiz__nav button[data-ok="1"] i { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.wiz__nav button[data-flag="1"] i { border-color: var(--red); color: var(--red); }
.wiz__nav .wiz__note { margin-block-start: auto; padding: 10px 8px 0; color: var(--ink-3); font-size: 11.5px; }
.wiz__form { display: flex; flex-direction: column; min-height: 0; }
.wiz__hd { padding: 18px 20px 14px; border-block-end: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wiz__hd h2 { margin: 6px 0 0; font: 600 22px/1.2 var(--f); letter-spacing: -.01em; }
.wiz__bd { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.wiz__ft { padding: 12px 20px; border-block-start: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.wiz__ft .grow { flex: 1; color: var(--ink-3); font-size: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > label, .fld > .lab { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; font-size: 12.5px; }
.fld > label small, .fld > .lab small { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.fld input:not([type=range]):not([type=checkbox]), .fld textarea { width: 100%; padding: 9px 11px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-1); color: var(--ink); font-size: 13.5px; outline: 0; }
.fld textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
.fld input:focus, .fld textarea:focus { border-color: var(--ink-3); }
.fld .help { color: var(--ink-3); font-size: 11.5px; }
.fld--row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.kinds button { text-align: start; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-1); color: inherit; display: flex; flex-direction: column; gap: 4px; }
.kinds button b { font-weight: 600; }
.kinds button small { color: var(--ink-3); font-size: 11.5px; }
.kinds button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.srcrow { display: grid; grid-template-columns: minmax(0,1fr) 130px; gap: 8px; }
.checks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.check { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 11px 12px; border-block-start: 1px solid var(--line); background: var(--bg-1); }
.check:first-child { border-block-start: 0; }
.check b { font-weight: 600; display: block; }
.check small { color: var(--ink-3); display: block; margin-block-start: 2px; font-size: 11.5px; }
.check .st { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.check[data-ok="1"] .st { color: var(--ink-2); }
.check[data-ok="0"] .st { color: var(--red); }
.check mark { background: var(--red-soft); color: var(--red); border-radius: var(--r); padding: 0 3px; }
.dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; margin-block-start: 1px; }
.check[data-ok="1"] .dot { background: var(--ink); color: var(--bg); }
.check[data-ok="0"] .dot { background: var(--red); color: var(--red-ink); }
.wiz__pv { border-inline-start: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; background: var(--bg-1); }
.pv { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); padding: 16px; }
.pv__t { font: 600 18px/1.25 var(--f); letter-spacing: -.01em; margin-block-start: 10px; word-break: break-word; }
.pv__t.ph, .pv__s.ph { color: var(--ink-3); }
.pv__s { color: var(--ink-2); margin-block-start: 6px; word-break: break-word; }
.pv__n { display: flex; align-items: baseline; gap: 8px; margin-block-start: 14px; }
.pv__n b { font: 600 32px/1 var(--f); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pv__n span { color: var(--ink-3); }
.pv .meter { margin-block-start: 8px; height: 6px; border-radius: var(--r); }
.pv__f { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 12px; }
.pv__src { margin-block-start: 12px; padding-block-start: 10px; border-block-start: 1px solid var(--line); color: var(--ink-3); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.exbadge { display: inline-flex; align-items: center; height: 22px; padding-inline: 8px; border-radius: var(--r); background: var(--ink); color: var(--bg); font: 600 10.5px/1 var(--f); letter-spacing: .06em; text-transform: uppercase; }
.toast { position: fixed; z-index: 60; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%); padding: 10px 14px; border-radius: var(--r); font-size: 13px; max-width: calc(100% - 24px); }
[dir="rtl"] .toast { transform: translateX(50%); }
.toast[hidden] { display: none; }

.phone-only { display: none !important; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
textarea { font: inherit; color: inherit; }
/* The platform rail floats on the inline end (spine.js): panels at the end clear it */
.has-rail-end .cv-layers { max-width: calc(100% - 492px - 460px); }
.cv-layers button { padding-inline: 7px; gap: 6px; }
.has-rail-end .cv-legend { inset-inline-end: 464px; }
.has-rail-end .cv-strip { inset-inline-end: 76px; }
.cities button .fl, .tipcard .fl { margin-inline-end: 6px; vertical-align: -2px; }
.pal__fl { display: grid; place-items: center; }
.cv-ctx { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; color: var(--ink-2); font-size: 12px; }
.cv-ctx .fl { flex: none; }

@media (max-width: 1180px) {
  .cv-legend { display: none; }
  .wiz__box { grid-template-columns: 180px minmax(0,1fr) 300px; }
}
/* Sources of the map (as on Home): Natural Earth, ETOPO 2022, Copernicus DEM with its notice */
.has-rail-end .attr { inset-inline-end: 80px; }
@media (max-width: 760px) {
  .cv-main { max-height: 56vh !important; }
  .cv-main .title { font-size: 18px; }
  .cv-main .stats { display: none; }
  .cv-layers, .has-rail-end .cv-layers { inset-inline: 8px; max-width: none; }
  .has-rail-end .cv-strip { inset-inline-end: 8px; }
  .cv-insp { display: none; }
  .cv-insp.open { display: flex; inset-inline: 8px; width: auto; inset-block: auto 8px; max-height: 64vh; z-index: 14; }
  .cv-insp.open[hidden] { display: none; }
  .wiz { padding: 0; }
  .wiz__box { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); height: 100%; border-radius: 0; }
  .wiz__nav { flex-direction: row; overflow-x: auto; padding: 10px; border-inline-end: 0; border-block-end: 1px solid var(--line); }
  .wiz__nav .eyebrow, .wiz__nav .wiz__note { display: none; }
  .wiz__nav button { flex: none; grid-template-columns: 22px auto; }
  .wiz__nav button span { display: none; }
  .wiz__nav button[aria-current="step"] span { display: inline; }
  .wiz__pv { display: none; }
  .wiz__box.pvon .wiz__pv { display: flex; position: absolute; inset: 58px 0 60px; z-index: 2; }
  .fld--row { grid-template-columns: 1fr; }
  .wiz__ft .grow { visibility: hidden; }
  .wiz__ft { flex-wrap: nowrap; }
  .phone-only { display: inline-flex !important; }
}

/* Phone: the tool segments keep their own width and scroll, so the labels never run together (QA, 5 Nov) */
@media (max-width: 760px) {
  .cv-tools { grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .cv-tools::-webkit-scrollbar { display: none; }
  .cv-tools button { padding-inline: 10px; gap: 6px; white-space: nowrap; }
}
