/*
 * Application styles. Colours, fonts and radii come only from the theme's
 * tokens.css. Logical properties throughout (margin-inline-start, inset-inline-end),
 * so right-to-left needs no second stylesheet.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 100%; }
html.ts-large { font-size: 112.5%; }
html.ts-larger { font-size: 125%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 1rem; line-height: 1.55;
  color: var(--ink); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
[dir="rtl"] body { line-height: 1.7; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
[dir="rtl"] h1 { letter-spacing: 0; }
p { margin: 0 0 1em; max-width: 72ch; }
a { color: var(--brand-accent); text-underline-offset: .18em; }
html.ul a { text-decoration: underline; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
html.rm *, html.rm *::before, html.rm *::after { animation: none !important; transition: none !important; }

.skip { position: absolute; inset-inline-start: 1rem; inset-block-start: -4rem; background: var(--panel); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius-s); z-index: 100; box-shadow: var(--shadow-1); }
.skip:focus { inset-block-start: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ demo marker */
.demo-band {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 1.6rem; padding: .15rem 1rem; font-size: .78rem; font-weight: 600;
  color: var(--demo-band-b); background: var(--demo-band-a);
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(21, 32, 43, .14) 14px 22px);
}

/* ------------------------------------------------------------ header */
.topbar { background: var(--brand-strong); color: var(--on-brand); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--on-brand); text-decoration: none; min-width: 0; }
.brand img { height: 28px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: .98rem; font-weight: 600; white-space: nowrap; }
.brand-text span { font-size: .75rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tool-link, .tool-btn {
  color: var(--on-brand); text-decoration: none; font: inherit; font-size: .875rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: var(--radius-s); border: 1px solid rgba(255, 255, 255, .35);
  background: transparent; cursor: pointer; min-height: 2.25rem; display: inline-flex; align-items: center;
}
.tool-link:hover, .tool-btn:hover { background: rgba(255, 255, 255, .12); }
.persona {
  display: flex; align-items: center; gap: .55rem; background: rgba(255, 255, 255, .08);
  border-radius: var(--radius-m); padding: .3rem .4rem .3rem .3rem;
}
[dir="rtl"] .persona { padding: .3rem .3rem .3rem .4rem; }
.persona-avatar { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-accent); font-weight: 600; font-size: .85rem; flex: none; }
.persona label { font-size: .7rem; opacity: .8; display: block; line-height: 1.1; }
.persona select {
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--on-brand); background: transparent;
  border: 0; padding: .1rem 1.4rem .1rem 0; max-width: 18rem; min-height: 2rem; cursor: pointer;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - .55rem) 55%, calc(100% - .25rem) 55%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
[dir="rtl"] .persona select { padding: .1rem 0 .1rem 1.4rem; background-position: .25rem 55%, .55rem 55%; }
.persona select option { color: var(--ink); background: var(--panel); }
.persona .apply { display: inline-flex; }
.js .persona .apply { display: none; }

/* ------------------------------------------------------------ page */
main { display: block; }
.page { max-width: 1440px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.page-narrow { max-width: 760px; }
.flash { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius-m); border-inline-start: 4px solid var(--sev-info); background: var(--sev-info-wash); }
.flash.success { border-color: var(--sev-low); background: var(--sev-low-wash); }
.flash.error { border-color: var(--sev-critical); background: var(--sev-critical-wash); }
.flash.info { border-color: var(--sev-info); background: var(--sev-info-wash); }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.25rem; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }

/* ------------------------------------------------------------ forms */
.field { margin-block-end: 1.1rem; }
.field label, .field .label { display: block; font-weight: 600; margin-block-end: .3rem; font-size: .95rem; }
.field .hint { display: block; color: var(--ink-3); font-size: .85rem; margin-block-end: .35rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select.input, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--land-edge); border-radius: var(--radius-s); padding: .6rem .75rem; min-height: 2.75rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
.code-input { font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { width: 1.25rem; height: 1.25rem; margin-block-start: .2rem; flex: none; accent-color: var(--brand-accent); }
.field-error { display: block; color: var(--sev-critical); font-weight: 600; margin-block-start: .35rem; }
.btn {
  font: inherit; font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: var(--radius-s); cursor: pointer; text-decoration: none;
  border: 1px solid var(--brand-strong); background: var(--brand-strong); color: var(--on-brand);
}
.btn:hover { background: var(--brand); }
.btn.secondary { background: var(--panel); color: var(--brand-strong); }
.btn.secondary:hover { background: var(--brand-wash); }
.btn.small { min-height: 2.25rem; padding: .35rem .75rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.danger { background: var(--sev-critical); border-color: var(--sev-critical); }

/* ------------------------------------------------------------ sign-in */
.gate { min-height: calc(100vh - 1.6rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.gate-map { background: var(--brand-strong); color: var(--on-brand); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2rem; }
.gate-map .brand img { height: 34px; }
.gate-map svg { position: absolute; inset: 7% 10% 27% 10%; width: 80%; height: 66%; }
.gate-map .land { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .55); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.gate-map .district { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: .8; vector-effect: non-scaling-stroke; }
.gate-map .affected { fill: rgba(242, 194, 48, .16); stroke: rgba(242, 194, 48, .55); }
.gate-map .road { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: .8; vector-effect: non-scaling-stroke; }
.gate-caption { position: relative; max-width: 30rem; margin-block-start: auto; }
.gate-caption h1 { font-size: 2rem; font-weight: 600; }
.gate-caption p { opacity: .85; }
.gate-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--panel); }
.gate-form-in { width: 100%; max-width: 25rem; }
.gate-lang { display: flex; justify-content: flex-end; margin-block-end: 2rem; }
.gate-lang a { font-weight: 600; text-decoration: none; padding: .4rem .7rem; border: 1px solid var(--rule); border-radius: var(--radius-s); }
.gate-error { padding: .75rem 1rem; border-radius: var(--radius-m); background: var(--sev-critical-wash); border-inline-start: 4px solid var(--sev-critical); margin-block-end: 1.25rem; font-weight: 500; }
.gate-foot { margin-block-start: 2rem; font-size: .82rem; color: var(--ink-3); }
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; min-height: 0; }
  .gate-map { min-height: 15rem; padding: 1.25rem; }
  .gate-map svg { inset: 0; width: 100%; height: 100%; opacity: .7; }
  .gate-caption h1 { font-size: 1.5rem; }
}

/* ------------------------------------------------------------ welcome */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 2rem; align-items: end; margin-block-end: 2rem; }
.hero h1 { font-size: 2.25rem; max-width: 18ch; }
.hero-facts { display: grid; gap: .5rem; }
.audience { margin-block-end: 2rem; }
.audience h2 { font-size: 1rem; color: var(--ink-2); border-block-end: 1px solid var(--rule); padding-block-end: .4rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15.5rem, 100%), 1fr)); gap: .75rem; }
.person-card { display: flex; gap: .8rem; align-items: center; width: 100%; text-align: start; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .8rem; font: inherit; color: inherit; cursor: pointer; min-height: 4.5rem; }
.person-card:hover { border-color: var(--brand-accent); }
.person-card[aria-current="true"] { border-color: var(--brand-accent); box-shadow: inset 4px 0 0 var(--brand-accent); }
[dir="rtl"] .person-card[aria-current="true"] { box-shadow: inset -4px 0 0 var(--brand-accent); }
.person-card .persona-avatar { width: 2.6rem; height: 2.6rem; color: var(--on-brand); }
.person-card .pc-text { display: block; min-width: 0; }
.person-card b { display: block; font-weight: 600; color: var(--ink); }
.person-card .pc-sub { display: block; font-size: .85rem; color: var(--ink-3); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 1.75rem; } }

/* ------------------------------------------------------------ tables (ops) */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--panel); }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data th, table.data td { padding: .6rem .75rem; text-align: start; border-block-end: 1px solid var(--rule-soft); vertical-align: top; }
table.data th { font-weight: 600; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--rule-soft); color: var(--ink-2); }
.tag.ok { background: var(--sev-low-wash); color: var(--sev-low); }
.tag.off { background: var(--sev-critical-wash); color: var(--sev-critical); }
.issued { border: 2px solid var(--sev-low); background: var(--sev-low-wash); border-radius: var(--radius-m); padding: 1rem 1.25rem; margin-block-end: 1.5rem; }
.issued code { font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-block-end: 1rem; }
.filters .field { margin: 0; }

/* ------------------------------------------------------------ footer */
.footer { border-block-start: 1px solid var(--rule); color: var(--ink-3); font-size: .82rem; }
.footer-in { max-width: 1440px; margin: 0 auto; padding: 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer p { margin: 0; }

@media (max-width: 640px) {
  .topbar-in { padding: .5rem .75rem; }
  .brand-text span { display: none; }
  .persona { order: 3; width: 100%; }
  .persona select { max-width: none; width: 100%; }
  .persona > div { flex: 1; min-width: 0; }
  .page { padding: 1rem .75rem 2.5rem; }
}

/* ------------------------------------------------------------ phone frame (mobile option A) */
.frame-page { min-height: calc(100vh - 1.6rem); display: flex; flex-direction: column; }
.frame-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .75rem 1rem; background: var(--panel); border-block-end: 1px solid var(--rule); }
.frame-brand { color: var(--ink); font-weight: 600; }
.frame-controls { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .4rem; }
.frame-controls [aria-pressed="true"] { background: var(--brand-strong); color: var(--on-brand); }
.frame-stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3rem; padding: 2rem 1rem; flex-wrap: wrap; }
.device { position: relative; background: #0d1114; padding: 14px; border-radius: 52px; box-shadow: 0 20px 50px rgba(21, 32, 43, .28); }
.device-status { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 28px; background: var(--brand-strong); color: #fff; font-size: 14px; font-weight: 600; border-radius: 40px 40px 0 0; direction: ltr; }
.device-icons { font-size: 11px; letter-spacing: .02em; }
.device iframe { display: block; width: 390px; height: 800px; border: 0; border-radius: 0 0 40px 40px; background: var(--surface); }
.device-notch { width: 110px; height: 30px; background: #0d1114; border-radius: 20px; }
.device-android { border-radius: 30px; padding: 12px 10px 18px; }
.device-android .device-status { height: 28px; border-radius: 20px 20px 0 0; padding: 0 16px; font-size: 12px; }
.device-android .device-notch { width: 12px; height: 12px; border-radius: 50%; }
.device-android iframe { width: 384px; height: 804px; border-radius: 0 0 20px 20px; }
.device.rotated .device-status { display: none; }
.device.rotated iframe { width: 844px; height: 390px; border-radius: 40px; }
.device-android.rotated iframe { width: 832px; height: 384px; border-radius: 20px; }
.frame-qr { max-width: 17rem; }
.frame-qr .qr { width: 12rem; height: 12rem; display: block; margin: .5rem 0; }
@media (max-width: 900px) { .frame-qr { display: none; } .device iframe { max-width: calc(100vw - 4rem); } }

/* ------------------------------------------------------------ icons, role navigation, phone layout */
.icon { width: 1.35rem; height: 1.35rem; flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.narrow-only { display: none; }
.appnav { background: var(--panel); border-block-end: 1px solid var(--rule); }
.appnav ul { list-style: none; margin: 0 auto; padding: 0 .5rem; max-width: 1440px; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.appnav a { display: flex; align-items: center; gap: .45rem; padding: .7rem .8rem; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap; border-block-end: 3px solid transparent; }
.appnav a:hover { color: var(--ink); }
.appnav a[aria-current="page"] { color: var(--brand-strong); border-block-end-color: var(--brand-accent); font-weight: 600; }
.tools-menu summary { list-style: none; cursor: pointer; color: var(--on-brand); padding: .4rem; border-radius: var(--radius-s); display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-sheet { position: absolute; inset-inline: .5rem; margin-block-start: .4rem; background: var(--brand-strong); border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--radius-m); padding: .5rem; display: grid; gap: .4rem; z-index: 40; box-shadow: var(--shadow-1); }
.tools-sheet .tool-link, .tools-sheet .tool-btn { width: 100%; justify-content: flex-start; }
.backbar { background: var(--panel); border-block-end: 1px solid var(--rule); padding: .35rem .5rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; text-decoration: none; min-height: 2.75rem; padding-inline-end: .5rem; }

@media (max-width: 760px) {
  .wide-only { display: none; }
  .narrow-only { display: block; }
  .demo-band { position: sticky; inset-block-start: 0; z-index: 31; padding-block-start: calc(.15rem + env(safe-area-inset-top)); }
  .topbar { position: sticky; inset-block-start: calc(1.6rem + env(safe-area-inset-top)); z-index: 30; }
  .topbar-in { flex-wrap: nowrap; gap: .5rem; }
  .brand img { display: none; }
  .brand-text b { font-size: .95rem; }
  .persona { order: 0; width: auto; flex: 1; min-width: 0; padding: .2rem .3rem; }
  .persona label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .persona select { font-size: .85rem; }
  .persona-avatar { width: 1.8rem; height: 1.8rem; font-size: .75rem; }
  .tabbar { position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 30; border-block-start: 1px solid var(--rule); border-block-end: 0; padding-block-end: env(safe-area-inset-bottom); }
  .tabbar ul { padding: 0; gap: 0; overflow: visible; }
  .tabbar li { flex: 1; min-width: 0; }
  .tabbar a { flex-direction: column; gap: .15rem; padding: .45rem .2rem .5rem; font-size: .72rem; border-block-end: 0; border-block-start: 3px solid transparent; justify-content: center; min-height: 3.6rem; }
  .tabbar a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar a[aria-current="page"] { border-block-start-color: var(--brand-accent); }
  body.has-tabbar { padding-block-end: calc(4rem + env(safe-area-inset-bottom)); }
  body.has-tabbar .footer { display: none; }
}

/* ------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.badge.sev-critical { background: var(--sev-critical); color: #fff; }
.badge.sev-high { background: var(--sev-high); color: #fff; }
.badge.sev-moderate { background: var(--sev-moderate-wash); color: var(--sev-moderate); border-color: var(--sev-moderate); }
.badge.sev-low { background: var(--sev-low-wash); color: var(--sev-low); border-color: var(--sev-low); }
.badge.st { background: var(--panel); color: var(--ink-2); border-color: var(--rule); }
.badge.st-reported, .badge.st-verified { border-color: var(--sev-info); color: var(--sev-info); }
.badge.st-dispatched, .badge.st-on_scene { background: var(--brand-wash); color: var(--brand-strong); border-color: var(--brand); }
.badge.st-contained { background: var(--sev-moderate-wash); color: var(--sev-moderate); }
.badge.st-resolved, .badge.st-closed { background: var(--sev-low-wash); color: var(--sev-low); }
.badge.st-duplicate, .badge.st-false_alarm { color: var(--ink-3); }
.badge.sos-badge { background: var(--sev-critical); color: #fff; letter-spacing: .04em; }
.badge.best { background: var(--brand-accent); color: #fff; }
.overdue-text { color: var(--sev-critical); }
.assumed { font-size: .72rem; font-weight: 600; padding: 0 .35rem; border-radius: 3px; background: var(--sev-moderate-wash); color: var(--sev-moderate); }
.eyebrow { font-size: .8rem; color: var(--ink-3); margin: 0 0 .2rem; font-weight: 500; letter-spacing: .02em; }
.page-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-block-end: 1rem; }
.page-head h1 { margin: 0; }
.crumbs { margin-block-end: .5rem; color: var(--ink-3); }

/* ------------------------------------------------------------ operations map */
.cop-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; margin-block-end: 1rem; }
.cop-head h1 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(min(6.5rem, 100%), 1fr)); gap: .5rem; margin: 0; }
.kpis > div { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .5rem .75rem; }
.kpis dt { font-size: .74rem; color: var(--ink-3); }
.kpis dd { margin: 0; font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.kpis .bad { border-color: var(--sev-critical); background: var(--sev-critical-wash); }
.kpis .bad dd { color: var(--sev-critical); }
.kpis .warn { border-color: var(--sev-high); }
.cop-body { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; align-items: start; }
.cop-side { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem; max-height: 78vh; overflow: auto; }
.cop-side h2 { font-size: 1.05rem; }
.attention { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.attention a { display: grid; gap: .2rem; padding: .6rem .7rem; border: 1px solid var(--rule-soft); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; border-inline-start: 4px solid var(--rule); }
.attention a:hover { border-color: var(--brand-accent); }
.attention .is-overdue a { border-inline-start-color: var(--sev-critical); background: var(--sev-critical-wash); }
.att-top { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.att-title { font-weight: 500; }
.att-meta { color: var(--ink-3); }

.opmap { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .5rem; position: relative; }
.opmap-tools { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .25rem .25rem .5rem; }
.layers { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.layer-toggle { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; cursor: pointer; min-height: 2rem; }
.layer-toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand-accent); }
.zoom { display: flex; gap: .3rem; }
.opmap-svg { display: block; width: 100%; height: 70vh; min-height: 22rem; background: var(--sea); border-radius: var(--radius-s); touch-action: none; cursor: grab; }
.opmap.compact .opmap-svg { height: 16rem; min-height: 0; cursor: default; }
.opmap-svg .sea { fill: var(--sea); }
.opmap-svg .neighbour { fill: #e6e3dc; stroke: #c9c4b8; stroke-width: .6; }
.opmap-svg .land { fill: var(--land); stroke: var(--land-edge); stroke-width: 1; }
.opmap-svg .district { stroke: #b8b2c6; stroke-width: .6; fill: transparent; }
.opmap-svg .district.c1 { fill: rgba(199, 90, 18, .08); }
.opmap-svg .district.c2 { fill: rgba(199, 90, 18, .16); }
.opmap-svg .district.c3 { fill: rgba(199, 90, 18, .26); }
.opmap-svg .district.c4 { fill: rgba(179, 38, 30, .32); }
.opmap-svg .zone { stroke: none; pointer-events: none; }
.opmap-svg .hatch { stroke-width: 3; }
.opmap-svg .hatch.warning { stroke: rgba(179, 38, 30, .35); }
.opmap-svg .hatch-bg.warning { fill: rgba(179, 38, 30, .08); }
.opmap-svg .hatch.watch { stroke: rgba(199, 90, 18, .3); }
.opmap-svg .hatch.advisory { stroke: rgba(47, 101, 151, .25); }
.opmap-svg .road { fill: none; stroke-linecap: round; }
.opmap-svg .road.major { stroke: #d6a06b; stroke-width: 2.2; }
.opmap-svg .road.minor { stroke: #cfcac0; stroke-width: 1.2; }
.opmap-svg text { font-family: var(--font-sans); }
.opmap-svg .layer-labels text { font-size: 11px; fill: var(--ink-2); text-anchor: middle; paint-order: stroke; stroke: var(--land); stroke-width: 3px; font-weight: 500; pointer-events: none; }
.opmap-svg .sensor path { fill: var(--sev-info); stroke: #fff; stroke-width: 1.2; }
.opmap-svg .sensor.high path { fill: var(--sev-high); }
.opmap-svg .unit rect { fill: #fff; stroke: var(--brand-strong); stroke-width: 1.6; }
.opmap-svg .unit text { font-size: 10px; font-weight: 700; text-anchor: middle; fill: var(--brand-strong); }
.opmap-svg .unit.s-available rect { stroke: var(--sev-low); }
.opmap-svg .unit.s-available text { fill: var(--sev-low); }
.opmap-svg .unit.s-unavailable rect { stroke: var(--ink-3); stroke-dasharray: 2 2; }
.opmap-svg .unit.s-unavailable text { fill: var(--ink-3); }
.opmap-svg .unit.s-en_route rect, .opmap-svg .unit.s-assigned rect { fill: var(--brand-wash); }
.opmap-svg .unit.s-on_scene rect { fill: var(--brand-strong); }
.opmap-svg .unit.s-on_scene text { fill: #fff; }
.opmap-svg .incident circle { stroke: #fff; stroke-width: 1.8; }
.opmap-svg .incident.sev-critical circle { fill: var(--sev-critical); }
.opmap-svg .incident.sev-high circle { fill: var(--sev-high); }
.opmap-svg .incident.sev-moderate circle { fill: var(--sev-moderate); }
.opmap-svg .incident.sev-low circle { fill: var(--sev-low); }
.opmap-svg .incident .halo { fill: none; stroke: var(--sev-critical); stroke-width: 2.5; animation: halo 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.opmap-svg .incident:focus-visible circle, .opmap-svg .incident:hover circle { stroke: var(--ink); stroke-width: 2.5; }
@keyframes halo { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.4); } }
.opmap-svg.hide-incidents .layer-incidents, .opmap-svg.hide-units .layer-units, .opmap-svg.hide-sensors .layer-sensors,
.opmap-svg.hide-zones .layer-zones, .opmap-svg.hide-labels .layer-labels { display: none; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .5rem .25rem 0; padding: 0; font-size: .8rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: .35rem; }
.legend .key { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; }
.legend .key.sev-critical { background: var(--sev-critical); } .legend .key.sev-high { background: var(--sev-high); }
.legend .key.sev-moderate { background: var(--sev-moderate); } .legend .key.sev-low { background: var(--sev-low); }
.legend .key.overdue { border: 2px solid var(--sev-critical); background: transparent; }
.legend .key.unit { border-radius: 2px; border: 2px solid var(--brand-strong); background: #fff; }
.legend .key.sensor { border-radius: 0; background: var(--sev-high); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.legend .key.zone { border-radius: 2px; background: repeating-linear-gradient(45deg, rgba(179, 38, 30, .4) 0 2px, transparent 2px 5px); }
.map-source { margin: .35rem .25rem 0; }

/* ------------------------------------------------------------ intake */
.reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: .75rem; }
.report { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .9rem 1rem; display: grid; gap: .45rem; align-content: start; }
.report.sos { border-inline-start: 5px solid var(--sev-critical); }
.report-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.report-head h3 { margin: 0; font-size: 1rem; }
.report-head time { margin-inline-start: auto; }
.report-text { margin: 0; }
.ai-box { border: 1px dashed var(--brand-accent); background: var(--brand-wash); border-radius: var(--radius-s); padding: .5rem .7rem; }
.ai-box p { margin: .2rem 0; }
.ai-box ul { margin: .2rem 0 0; padding-inline-start: 1.1rem; }
.ai-label { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-accent); }
[dir="rtl"] .ai-label { letter-spacing: 0; }
.report-actions { display: grid; gap: .4rem; }
.inline-fields { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-fields select.input { width: auto; min-height: 2.25rem; padding: .3rem .5rem; font-size: .88rem; flex: 1 1 8rem; }
details.reject summary { list-style: none; display: inline-flex; }
details.reject summary::-webkit-details-marker { display: none; }
details.reject form { display: grid; gap: .35rem; margin-block-start: .4rem; }
.cluster { border: 2px solid var(--brand-accent); border-radius: var(--radius-l); padding: 1rem; margin-block-end: 1.25rem; background: var(--panel); }
.cluster-head h2 { margin: .1rem 0 .2rem; }
.cluster-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: .6rem; margin: .75rem 0; }
.cluster-reports .report { background: var(--surface); }
.cluster-action label { font-weight: 600; font-size: .9rem; }

/* ------------------------------------------------------------ incident page */
.inc-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-block-end: 1rem; }
.inc-head h1 { margin: 0 0 .4rem; }
.target { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .6rem .9rem; display: grid; gap: .2rem; min-width: 14rem; }
.target b { font-size: 1.3rem; }
.target.bad { border-color: var(--sev-critical); background: var(--sev-critical-wash); }
.target.bad b { color: var(--sev-critical); }
.inc-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.inc-main, .inc-side { display: grid; gap: 1rem; }
.inc-main .panel h2, .inc-side .panel h2 { font-size: 1.05rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); gap: .5rem; margin: .5rem 0 0; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; font-weight: 500; }
.moves { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.move.with-reason { display: grid; gap: .3rem; flex: 1 1 16rem; }
.unit-list, .report-list, .suggest { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.report-list li { border-block-end: 1px solid var(--rule-soft); padding-block-end: .5rem; }
.suggest li { background: var(--panel); border-radius: var(--radius-s); padding: .4rem .5rem; }
.suggest .inline-fields { justify-content: space-between; }
.skipped { color: var(--ink-2); border-inline-start: 3px solid var(--ink-3); padding-inline-start: .5rem; }
.map-panel { padding: .25rem; }
.note-form { display: grid; gap: .35rem; margin-block-end: 1rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.timeline li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .5rem; padding-block-end: .6rem; border-block-end: 1px solid var(--rule-soft); }
.timeline .tl-note div { background: var(--sev-moderate-wash); padding: .3rem .5rem; border-radius: var(--radius-s); }
textarea { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--land-edge); border-radius: var(--radius-s); padding: .5rem .7rem; }

/* ------------------------------------------------------------ units board */
.unit-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1rem; }
.units { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.units li { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; padding: .45rem .5rem; border: 1px solid var(--rule-soft); border-radius: var(--radius-s); }
.units li.s-unavailable { background: var(--surface); }
.unit-st.s-available { background: var(--sev-low-wash); color: var(--sev-low); }
.unit-st.s-assigned, .unit-st.s-en_route { background: var(--brand-wash); color: var(--brand-strong); }
.unit-st.s-on_scene { background: var(--brand-strong); color: #fff; }
.unit-st.s-unavailable { background: var(--rule-soft); color: var(--ink-3); }
.unit-count { display: inline-flex; align-items: center; gap: .3rem; margin-inline-end: .9rem; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; background: var(--rule); }
.dot.s-available { background: var(--sev-low); } .dot.s-assigned, .dot.s-en_route { background: var(--brand); } .dot.s-on_scene { background: var(--brand-strong); } .dot.s-unavailable { background: var(--ink-3); }
tr.is-overdue td { background: var(--sev-critical-wash); }

@media (max-width: 1100px) { .cop-body, .inc-grid { grid-template-columns: minmax(0, 1fr); } .kpis { grid-template-columns: repeat(3, 1fr); } .cop-side { max-height: none; } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } .opmap-svg { height: 55vh; } }

/* ------------------------------------------------------------ alerts */
.alert-group { margin-block-end: 1.5rem; }
.alert-group h2 { font-size: 1.05rem; }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.alert-list a { display: grid; gap: .2rem; padding: .7rem .9rem; background: var(--panel); border: 1px solid var(--rule); border-inline-start: 5px solid var(--rule); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; }
.alert-list a:hover { border-color: var(--brand-accent); }
.alert-list .lvl-critical a { border-inline-start-color: var(--sev-critical); }
.alert-list .lvl-high a { border-inline-start-color: var(--sev-high); }
.alert-list .lvl-moderate a { border-inline-start-color: var(--sev-moderate); }
.alert-list .lvl-low a { border-inline-start-color: var(--sev-low); }
.al-top { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.al-title { font-weight: 600; }
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.bilingual > div { min-width: 0; }
.bilingual [dir="rtl"] { text-align: right; }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.radio-row .check input { margin-block-start: .1rem; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: .35rem .75rem; margin-block-start: .4rem; }
.zone-option { padding: .3rem .4rem; border-radius: var(--radius-s); }
.zone-option:hover { background: var(--brand-wash); }
.narrow-field { max-width: 12rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: 1rem; }
.alert-form { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.25rem; margin-block-start: 1rem; }
@media (max-width: 760px) { .bilingual { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ citizen app */
.my { max-width: 40rem; margin: 0 auto; display: grid; gap: 1rem; }
.my.wide { max-width: none; }
.my h1 { margin: 0; }
.greet { margin: 0; font-size: 1.05rem; font-weight: 600; }
.center { text-align: center; margin-inline: auto; }
.section-title { font-size: 1rem; margin: .5rem 0; }
.pub-alert { background: var(--panel); border: 1px solid var(--rule); border-inline-start: 6px solid var(--rule); border-radius: var(--radius-m); padding: 1rem; }
.pub-alert.lvl-critical { border-inline-start-color: var(--sev-critical); background: linear-gradient(var(--sev-critical-wash), var(--panel) 60%); }
.pub-alert.lvl-high { border-inline-start-color: var(--sev-high); }
.pub-alert.lvl-moderate { border-inline-start-color: var(--sev-moderate); }
.pub-alert.lvl-low { border-inline-start-color: var(--sev-low); }
.pub-alert h2 { font-size: 1.2rem; margin: .35rem 0; }
.pub-alert p { margin: .25rem 0; }
.pub-alert-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pub-alert-top time { margin-inline-start: auto; }
.reply-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-block-start: .7rem; }
.reply-row .btn { width: 100%; min-height: 3.2rem; font-size: 1rem; }
.btn.safe { background: var(--sev-low); border-color: var(--sev-low); }
.replied { font-weight: 600; color: var(--sev-low); }
.sos-button { display: grid; place-items: center; gap: .1rem; text-decoration: none; color: #fff; background: var(--sev-critical); border-radius: 999px;
  width: min(15rem, 70vw); aspect-ratio: 1; margin: .5rem auto 0; box-shadow: 0 0 0 10px var(--sev-critical-wash), 0 10px 30px rgba(179, 38, 30, .35); text-align: center; align-content: center; }
.sos-button:hover, .sos-button:focus-visible { background: #8f1d17; }
.sos-label { font-size: 2.6rem; font-weight: 700; letter-spacing: .06em; line-height: 1; }
[dir="rtl"] .sos-label { letter-spacing: 0; font-size: 2.2rem; }
.sos-sub { font-size: 1rem; opacity: .95; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.quick a { display: flex; align-items: center; gap: .6rem; padding: .9rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; font-weight: 600; min-height: 3.5rem; }
.quick a:hover { border-color: var(--brand-accent); }
.quick .icon { color: var(--brand-accent); }
.my-reports { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.my-reports li { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .8rem .9rem; }
.my-reports p { margin: .15rem 0; }
.mr-top { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.mr-state b { color: var(--brand-strong); }
.pg-resolved .mr-state b { color: var(--sev-low); }
.pg-not_emergency .mr-state b, .pg-not_found .mr-state b { color: var(--ink-3); }
.mr-text { color: var(--ink-2); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; margin: .5rem 0; padding: 0; }
.steps li { height: .4rem; border-radius: 999px; background: var(--rule-soft); }
.steps li.done { background: var(--brand-accent); }
.outbox-panel { background: var(--sev-moderate-wash); border: 1px solid var(--sev-moderate); border-radius: var(--radius-m); padding: .7rem .9rem; font-weight: 500; }
.report-form { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem; display: grid; gap: .2rem; }
.report-form.is-sos { border-color: var(--sev-critical); }
.loc-box { background: var(--brand-wash); border-radius: var(--radius-s); padding: .6rem .8rem; margin-block-end: .8rem; }
.loc-box p { margin: 0 0 .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--rule); border-radius: 999px; padding: .4rem .75rem; cursor: pointer; min-height: 2.75rem; }
.chip input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-accent); }
.chip:has(input:checked) { background: var(--brand-wash); border-color: var(--brand-accent); }
.btn.big { min-height: 3.6rem; font-size: 1.15rem; }
.sent { text-align: center; }
.sent-mark { width: 4.5rem; height: 4.5rem; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; color: #fff; background: var(--sev-low); }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.legend .key.band { border-radius: 2px; background: rgba(199, 90, 18, .3); }

/* ------------------------------------------------------------ field app */
.unit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.unit-head h1 { margin: 0; }
.assignment { background: var(--panel); border: 1px solid var(--rule); border-block-start: 6px solid var(--rule); border-radius: var(--radius-m); padding: 1rem; display: grid; gap: .5rem; }
.assignment.sev-critical { border-block-start-color: var(--sev-critical); }
.assignment.sev-high { border-block-start-color: var(--sev-high); }
.assignment.sev-moderate { border-block-start-color: var(--sev-moderate); }
.assignment h2 { margin: 0; font-size: 1.25rem; }
.assignment p { margin: 0; }
.field-steps { list-style: none; margin: .25rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; counter-reset: s; }
.field-steps li { text-align: center; font-size: .82rem; font-weight: 600; color: var(--ink-3); padding-block-start: .5rem; border-block-start: 4px solid var(--rule-soft); }
.field-steps li.done { color: var(--brand-strong); border-block-start-color: var(--brand-accent); }
.leader-form, details.backup form { display: grid; gap: .4rem; }
details.backup summary { list-style: none; }
details.backup summary::-webkit-details-marker { display: none; }
details.backup[open] summary { margin-block-end: .5rem; }
.loc-share { margin: 0; }
.event.active { border-color: var(--brand-accent); box-shadow: inset 4px 0 0 var(--brand-accent); } .event-list { display: grid; gap: 1rem; margin-block-end: 1rem; } .event h2 { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.inc-main > *, .inc-side > *, .cop-body > * { min-width: 0; }
.report-text, .pub-alert p, .assignment p, .bilingual p { overflow-wrap: anywhere; }
.report > *, .report-actions > *, .cluster > * { min-width: 0; } .inline-fields select.input { max-width: 100%; min-width: 0; }

/* ------------------------------------------------------------ shelters */
.shelter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: .75rem; }
.shelter-card { display: grid; gap: .35rem; padding: 1rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; align-content: start; }
.shelter-card:hover { border-color: var(--brand-accent); }
.shelter-card.over { border-color: var(--sev-critical); }
.shelter-card .badge { justify-self: start; }
.occ { display: grid; gap: .25rem; min-width: 12rem; }
.occ-bar { height: .6rem; border-radius: 999px; background: var(--rule-soft); overflow: hidden; }
.occ-bar span { display: block; height: 100%; background: var(--sev-low); }
.occ.near .occ-bar span { background: var(--sev-moderate); }
.occ.over .occ-bar span { background: var(--sev-critical); }
.families, .needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.families li, .needs-list li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding-block-end: .45rem; border-block-end: 1px solid var(--rule-soft); }
.needs-list .n-delivered { color: var(--ink-3); }
.need-form { display: grid; gap: .35rem; margin: .8rem 0; }
.found { margin-block-start: 1rem; border-block-start: 1px solid var(--rule); padding-block-start: .8rem; display: grid; gap: .5rem; }
.found fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .35rem; }
[data-scan-video] { width: 100%; max-width: 22rem; border-radius: var(--radius-m); margin-block-start: .5rem; }

.occ-bar .w0 { width: 0%; }
.occ-bar .w5 { width: 5%; }
.occ-bar .w10 { width: 10%; }
.occ-bar .w15 { width: 15%; }
.occ-bar .w20 { width: 20%; }
.occ-bar .w25 { width: 25%; }
.occ-bar .w30 { width: 30%; }
.occ-bar .w35 { width: 35%; }
.occ-bar .w40 { width: 40%; }
.occ-bar .w45 { width: 45%; }
.occ-bar .w50 { width: 50%; }
.occ-bar .w55 { width: 55%; }
.occ-bar .w60 { width: 60%; }
.occ-bar .w65 { width: 65%; }
.occ-bar .w70 { width: 70%; }
.occ-bar .w75 { width: 75%; }
.occ-bar .w80 { width: 80%; }
.occ-bar .w85 { width: 85%; }
.occ-bar .w90 { width: 90%; }
.occ-bar .w95 { width: 95%; }
.occ-bar .w100 { width: 100%; }
.family-qr { text-align: center; } .family-qr .qr { width: min(15rem, 70vw); height: auto; margin: .5rem auto; display: block; } .family-code { font-size: 1.6rem; font-weight: 700; letter-spacing: .12em; margin: .2rem 0; }
.table-wrap { position: relative; }

/* ------------------------------------------------------------ volunteers and partners */
.shift.s-past { background: var(--surface); }
.shift.s-now { border-color: var(--brand-accent); }
.shift.has-problem { border-color: var(--sev-critical); }
.families li.is-overdue { background: var(--sev-critical-wash); padding-inline: .4rem; border-radius: var(--radius-s); }
.ma { display: grid; gap: .25rem; padding: .7rem .9rem; background: var(--panel); border: 1px solid var(--rule); border-inline-start: 5px solid var(--rule); border-radius: var(--radius-m); }
.lvl-high .ma { border-inline-start-color: var(--sev-high); }
.low-stock { border-color: var(--sev-high); background: var(--sev-high-wash); margin-block-end: 1rem; }
.matrix td { min-width: 9rem; }
.w3 { display: block; padding: .3rem .4rem; border-radius: var(--radius-s); margin-block-end: .25rem; background: var(--brand-wash); }
.w3.st-planned { background: var(--sev-moderate-wash); }
.w3.st-done { background: var(--sev-low-wash); }

/* ------------------------------------------------------------ recovery */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-block-end: 1rem; }
.tabs a { padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); text-decoration: none; color: var(--ink-2); font-size: .88rem; }
.tabs a[aria-current="page"] { background: var(--brand-strong); color: var(--on-brand); border-color: var(--brand-strong); }
.tabs a[aria-current="page"] .muted { color: inherit; }
.checks { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .35rem; }
.checks li { padding: .35rem .6rem; border-radius: var(--radius-s); background: var(--sev-low-wash); }
.checks li.fail { background: var(--sev-critical-wash); color: var(--sev-critical); font-weight: 500; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); gap: .5rem; margin-block-start: .5rem; }
.photos img { width: 100%; height: auto; border-radius: var(--radius-s); display: block; }

/* ------------------------------------------------------------ dashboard, reports, print */
.dash-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-block-end: 1rem; }
.dash-kpis dd { font-size: 1.3rem; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 1rem; margin-block-end: 1rem; }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar.sev-critical { fill: var(--sev-critical); } .chart .bar.sev-high { fill: var(--sev-high); } .chart .bar.sev-moderate { fill: var(--sev-moderate); } .chart .bar.sev-low { fill: var(--sev-low); }
.chart .axis { stroke: var(--rule); }
.chart .target { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 2; }
.chart text { font-family: var(--font-sans); font-size: 10px; fill: var(--ink-2); }
.chart text.v { text-anchor: middle; font-weight: 600; }
.chart text.v.start { text-anchor: start; }
.chart text.lbl.end { text-anchor: end; }
[dir="rtl"] .chart svg { direction: ltr; }
.print-page { max-width: 52rem; margin: 0 auto; padding: 1.5rem; background: #fff; }
.print-head { display: flex; justify-content: space-between; align-items: center; border-block-end: 2px solid var(--brand-strong); padding-block-end: .6rem; margin-block-end: 1rem; }
.print-table { margin-block-end: 1rem; }
@media (max-width: 900px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .print-actions, .skip { display: none !important; }
  .demo-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .print-page { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  .chart, table { break-inside: avoid; }
}
.big-checks li { padding: .6rem .8rem; }
.roles-matrix td.yes { text-align: center; color: var(--sev-low); font-weight: 700; background: var(--sev-low-wash); }
.roles-matrix th[scope="col"] { white-space: normal; min-width: 6rem; vertical-align: bottom; }
.integ.st-degraded { border-color: var(--sev-moderate); } .integ.st-down { border-color: var(--sev-critical); background: var(--sev-critical-wash); }
.tpl .bilingual input, .tpl .bilingual textarea { margin-block-end: .4rem; }
.narrow-input { width: 8rem !important; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.chat li { max-width: 88%; padding: .6rem .8rem; border-radius: var(--radius-l); }
.chat li p { margin: 0; }
.chat li.me { justify-self: end; background: var(--brand-strong); color: var(--on-brand); border-end-end-radius: 4px; }
.chat li.ai { justify-self: start; background: var(--panel); border: 1px solid var(--rule); border-end-start-radius: 4px; }
.chat li.urgent { border-color: var(--sev-critical); background: var(--sev-critical-wash); }
.chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-block-start: .5rem; }
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; }
.assist-link { display: block; text-decoration: none; color: var(--ink); } .assist-link:hover { border-color: var(--brand-accent); }
.print-page { overflow-wrap: anywhere; } .print-head { gap: 1rem; flex-wrap: wrap; } @media print { .table-wrap { overflow: visible; border: 0; } }
