/* ==========================================================================
   Amader Durgapur Purbo — Admin (mobile-first, app-style)
   Phones/tablets (< 1024px): blue app bar + ribbon, bottom tab bar, inset
   grouped lists, orange floating action button, bottom sheets.
   Desktop (>= 1024px): sidebar + dense tables.
   Fonts: self-hosted Noto (OFL), one family across Latin/Bengali/Devanagari.
   ========================================================================== */
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2122, U+2212, U+2713; }
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2122, U+2212, U+2713; }
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSansBengali-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF9, U+200C-200D, U+25CC; }
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSansBengali-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF9, U+200C-200D, U+25CC; }
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSansDevanagari-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "ADP Sans"; src: url("../fonts/NotoSansDevanagari-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

:root {
  --blue: #0b4f9c; --blue-deep: #083a73; --blue-wash: #e8f0fa;
  --green: #1e8e4e; --green-wash: #e5f4eb;
  --orange: #f28c1b; --orange-ink: #9a4f00; --orange-wash: #fff1e0;
  --red: #c0352b; --red-wash: #fbe9e7;
  --ink: #13233a; --ink-soft: #4f6077; --line: #dde5ef; --mist: #f2f5f9; --white: #fff;
  --font: "ADP Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-xs: .78rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.125rem; --t-xl: 1.375rem; --t-2xl: 1.75rem; --t-3xl: 2.25rem;
  --r-sheet: 16px; --r-ctl: 10px;
  --appbar: 56px; --tabbar: 64px; --sidebar: 264px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.55; color: var(--ink); background: var(--mist); overscroll-behavior-y: none; }
a { color: var(--blue); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: var(--t-2xl); font-weight: 700; }
h2 { font-size: var(--t-lg); font-weight: 700; }
h3 { font-size: var(--t-md); font-weight: 700; }
p { margin: 0 0 .75rem; max-width: 70ch; }
.muted { color: var(--ink-soft); } .small { font-size: var(--t-sm); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--t-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--white); padding: .5rem 1rem; }
.skip:focus { left: 1rem; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ribbon (signature) ---------- */
.ribbon { display: flex; height: 4px; }
.ribbon span { flex: 1; }
.ribbon span:nth-child(1) { background: var(--blue-deep); }
.ribbon span:nth-child(2) { background: var(--white); }
.ribbon span:nth-child(3) { background: var(--green); }
.ribbon span:nth-child(4) { background: var(--orange); }

/* ==========================================================================
   APP SHELL — phone/tablet first
   ========================================================================== */
.shell { min-height: 100vh; min-height: 100dvh; }
.appbar { position: sticky; top: 0; z-index: 30; background: var(--blue); color: var(--white); padding-top: var(--safe-t); }
.appbar__row { display: flex; align-items: center; gap: .25rem; height: var(--appbar); padding: 0 .5rem; }
.appbar__title { flex: 1; min-width: 0; font-size: var(--t-lg); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .5rem; margin: 0; }
.appbar__brand { flex: 1; min-width: 0; padding: 0 .5rem; color: var(--white); text-decoration: none; line-height: 1.2; }
.appbar__brand strong { display: block; font-size: var(--t-lg); }
.appbar__brand span { font-size: var(--t-xs); color: #c9dbf2; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: none; flex: none; font: inherit; }
.icon-btn:hover, .icon-btn:active { background: rgba(255,255,255,.14); }
.appbar .avatar { width: 32px; height: 32px; font-size: var(--t-sm); background: var(--orange); color: var(--white); }
.appbar__desk { display: none; }

.main { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 1rem); }
.shell--pushed .main { padding-bottom: calc(1.5rem + var(--safe-b)); }
.content { padding: 1rem .875rem 1.5rem; max-width: 1240px; margin: 0 auto; width: 100%; }

/* Bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--white); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar); color: var(--ink-soft); text-decoration: none; font: inherit; font-size: .72rem; font-weight: 600; background: none; border: 0; cursor: pointer; position: relative; }
.tabbar .is-active { color: var(--blue); }
.tabbar .is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.shell--pushed .tabbar { display: none; }

/* Floating action button */
.fab { position: fixed; right: 1rem; bottom: calc(var(--tabbar) + var(--safe-b) + 1rem); z-index: 25; display: inline-flex; align-items: center; gap: .5rem; height: 56px; padding: 0 1.25rem 0 1rem; border-radius: 28px; background: var(--orange); color: var(--white); font-weight: 700; text-decoration: none; box-shadow: 0 6px 16px rgba(154,79,0,.35); }
.fab:hover { color: var(--white); background: #e07d0e; }
.shell--pushed .fab { bottom: calc(var(--safe-b) + 1rem); }

/* Side drawer (the full menu, opened from "More" on phones) */
.sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--sidebar)); z-index: 50; background: var(--blue); color: #dce8f7; display: flex; flex-direction: column; overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
.shell.nav-open .sidebar { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(8,25,48,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
.brand { padding: 1.1rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand__bn { font-size: var(--t-lg); font-weight: 700; color: var(--white); line-height: 1.3; display: block; text-decoration: none; }
.brand__en { font-size: var(--t-xs); color: #b9cde8; }
.nav { padding: .5rem .5rem 1.25rem; flex: 1; }
.nav__group { margin-top: 1rem; padding: 0 .75rem .35rem; font-size: var(--t-xs); color: #9fb8da; }
.nav a { display: flex; align-items: center; gap: .75rem; min-height: 46px; padding: 0 .75rem; border-radius: var(--r-ctl); color: #e6eef9; text-decoration: none; font-size: var(--t-sm); }
.nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav a.is-active { background: var(--white); color: var(--blue-deep); font-weight: 700; }
.nav svg.i { width: 20px; height: 20px; }
.sidebar__me { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: .6rem; }
.sidebar__me select { background: rgba(255,255,255,.1); color: var(--white); border-color: rgba(255,255,255,.25); min-height: 40px; }
.sidebar__me select option { color: var(--ink); }
.sidebar__me .btn { width: 100%; }
.sidebar__foot { padding: .75rem 1.25rem 1rem; font-size: var(--t-xs); color: #b9cde8; }

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1, .crumbs { display: none; } /* the app bar carries the title on phones */
.page-head p { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
.page-head__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.has-fab .page-head__actions .btn--primary { display: none; }

/* ---------- Sheets (inset grouped surfaces) ---------- */
.panel { background: var(--white); border-radius: var(--r-sheet); margin-bottom: 1rem; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.panel__head h2 { margin: 0; font-size: var(--t-md); }
.panel__body { padding: 1rem; }
.panel--danger .panel__head { background: var(--red-wash); }
.section-title { font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); margin: 1.25rem .25rem .5rem; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 > .panel, .grid-3 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Dashboard ---------- */
.greet { margin: .25rem .25rem 1rem; }
.greet strong { display: block; font-size: var(--t-xl); line-height: 1.25; }
.greet span { color: var(--ink-soft); font-size: var(--t-sm); }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-sheet); overflow: hidden; margin-bottom: 1rem; }
.figure { background: var(--white); padding: .9rem 1rem; }
.figure__n { font-size: var(--t-3xl); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--blue-deep); }
.figure__l { font-size: var(--t-xs); color: var(--ink-soft); }
.figure--alert .figure__n { color: var(--red); }
.figure--warm .figure__n { color: var(--orange-ink); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .8rem .25rem; background: var(--white); border-radius: var(--r-sheet); text-decoration: none; color: var(--ink); font-size: .74rem; font-weight: 600; text-align: center; line-height: 1.25; }
.quick a span.q { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--blue-wash); color: var(--blue); }
.quick a:nth-child(2) span.q { background: var(--green-wash); color: var(--green); }
.quick a:nth-child(3) span.q { background: var(--orange-wash); color: var(--orange-ink); }
.quick a:nth-child(4) span.q { background: var(--red-wash); color: var(--red); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--blue); } .chart .bar--now { fill: var(--orange); }
.chart text { font-size: 17px; fill: var(--ink-soft); font-family: var(--font); }
.chart .val { fill: var(--ink); font-weight: 700; }
.hbar { display: grid; grid-template-columns: 5.5rem 1fr 2.5rem; gap: .75rem; align-items: center; margin-bottom: .6rem; font-size: var(--t-sm); }
.hbar__track { display: block; background: var(--mist); border-radius: 99px; height: 10px; overflow: hidden; }
.hbar__fill { display: block; background: var(--green); height: 100%; border-radius: 99px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed a { display: block; padding: .75rem 1rem; text-decoration: none; color: var(--ink); }
.feed .feed__t { display: block; font-weight: 600; font-size: var(--t-sm); }
.feed .feed__m { display: block; font-size: var(--t-xs); color: var(--ink-soft); }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* ---------- Lists: tables become tappable rows on phones ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #f8fafd; white-space: nowrap; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.lead-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue-wash); color: var(--blue-deep); font-weight: 700; flex: none; }
.who { display: flex; align-items: center; gap: .75rem; }
.who > span:last-child { min-width: 0; }

@media (max-width: 1023.98px) {
  .table-wrap { overflow: visible; }
  .table-wrap > table:not(.matrix), .table-wrap > table:not(.matrix) tbody, .table-wrap > table:not(.matrix) tr { display: block; }
  .table-wrap > table:not(.matrix) thead { display: none; }
  .table-wrap > table:not(.matrix) tr { position: relative; padding: .8rem 1rem; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; column-gap: .9rem; row-gap: .3rem; }
  .table-wrap > table:not(.matrix) tbody tr:last-child { border-bottom: 0; }
  .table-wrap > table:not(.matrix) tr[data-href] { padding-right: 2.25rem; cursor: pointer; }
  .table-wrap > table:not(.matrix) tr[data-href]:active { background: var(--mist); }
  .table-wrap > table:not(.matrix) tr[data-href]::after { content: ""; position: absolute; right: 1rem; top: 50%; width: 9px; height: 9px; border-right: 2px solid #9aa9bc; border-top: 2px solid #9aa9bc; transform: translateY(-50%) rotate(45deg); }
  .table-wrap > table:not(.matrix) td { display: block; padding: 0; border: 0; text-align: left; font-size: var(--t-xs); color: var(--ink-soft); }
  .table-wrap > table:not(.matrix) td:first-child { flex: 1 0 100%; font-size: var(--t-md); color: var(--ink); }
  .table-wrap > table:not(.matrix) td[data-label]:not(:first-child):not(.no-label)::before { content: attr(data-label) " "; color: #8292a7; }
  .table-wrap > table:not(.matrix) td:empty { display: none; }
  .table-wrap > table:not(.matrix) td.cell-wide { flex-basis: 100%; }
}

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: var(--t-xs); font-weight: 700; white-space: nowrap; }
.pill--ok { background: var(--green-wash); color: #13663a; }
.pill--warn { background: var(--orange-wash); color: var(--orange-ink); }
.pill--bad { background: var(--red-wash); color: #9b2a22; }
.pill--neutral { background: var(--blue-wash); color: var(--blue-deep); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.field label, .label { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: .35rem; }
.field .hint, .hint { font-size: var(--t-xs); color: var(--ink-soft); margin: .35rem 0 0; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
  border: 1px solid #c3cfdd; border-radius: var(--r-ctl); padding: .65rem .8rem; min-height: 48px; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, #6b7d93 50%), linear-gradient(135deg, #6b7d93 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.25rem; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,79,156,.18); }
input:disabled { background: var(--mist); color: var(--ink-soft); }
[aria-invalid=true] { border-color: var(--red); }
.field-error { color: var(--red); font-size: var(--t-xs); margin: .3rem 0 0; }
.check { display: flex; align-items: flex-start; gap: .65rem; font-size: var(--t-sm); cursor: pointer; min-height: 28px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; }
.shell--pushed .form-actions--sticky { position: sticky; bottom: 0; z-index: 20; margin: 1rem -.875rem 0; padding: .75rem .875rem calc(.75rem + var(--safe-b)); background: rgba(242,245,249,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.form-actions--sticky .btn--primary { flex: 1; }

/* Search + filter sheet */
.searchbar { display: flex; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--line); align-items: center; }
.searchbar input[type=search] { border-radius: 99px; background: var(--mist); border-color: transparent; padding-left: 1rem; }
.filters { border-bottom: 1px solid var(--line); }
.filters > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; font-size: var(--t-sm); font-weight: 600; color: var(--blue); }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: auto; transition: transform .15s; }
.filters[open] > summary::after { transform: rotate(-135deg); }
.filters__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: 0 1rem 1rem; align-items: end; }
.filters__body .field--wide, .filters__body .btn { grid-column: 1 / -1; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .4rem .9rem; border-radius: 99px; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); font-size: var(--t-sm); text-decoration: none; font-weight: 600; }
.chip[aria-current=true] { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-size: var(--t-sm); font-weight: 700; padding: .6rem 1.1rem; min-height: 48px; border-radius: var(--r-ctl); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-deep); color: var(--white); }
.btn--ghost { background: var(--white); color: var(--blue); border-color: #c3cfdd; }
.btn--danger { background: var(--red); color: var(--white); }
.btn--sm { min-height: 38px; padding: .35rem .8rem; font-size: var(--t-xs); }
.btn--block { width: 100%; }
.btn--link { background: none; border: 0; color: var(--blue); padding: 0; min-height: 0; text-decoration: underline; font-weight: 600; }
.inline-form { display: inline; }

/* ---------- Messages ---------- */
.flash { border-radius: var(--r-ctl); padding: .8rem 1rem; margin-bottom: 1rem; font-size: var(--t-sm); background: var(--white); border-left: 4px solid; }
.flash--error { background: var(--red-wash); border-color: var(--red); }
.flash--warning { background: var(--orange-wash); border-color: var(--orange); }
.flash--info { background: var(--blue-wash); border-color: var(--blue); }
.flash--success { background: var(--green-wash); border-color: var(--green); }
.flash ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 5.25rem); transform: translate(-50%, 0); z-index: 60; width: min(92vw, 420px); margin: 0; background: var(--ink); color: var(--white); border: 0; border-radius: 12px; box-shadow: 0 10px 30px rgba(8,25,48,.3); transition: opacity .3s, transform .3s; }
.shell--pushed .toast { bottom: calc(var(--safe-b) + 5.5rem); }
.toast.is-hiding { opacity: 0; transform: translate(-50%, 10px); }
.dev-note { background: #fff8d6; border: 1px dashed #c9a400; border-radius: var(--r-ctl); padding: .75rem 1rem; font-size: var(--t-sm); margin-bottom: 1rem; }
.empty { padding: 2.25rem 1.25rem; text-align: center; color: var(--ink-soft); font-size: var(--t-sm); }
.empty strong { display: block; color: var(--ink); margin-bottom: .25rem; font-size: var(--t-md); }

/* Confirm bottom sheet */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; background: var(--white); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(8,25,48,.5); }
dialog.sheet[open] { animation: sheet-up .2s ease-out; }
.sheet__body { padding: 1.5rem 1.25rem calc(1.25rem + var(--safe-b)); }
.sheet__grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: .6rem auto 0; }
.sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1.25rem; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Segmented tabs (user detail) */
.tabs { display: flex; gap: 4px; padding: 4px; background: #e3e9f1; border-radius: 12px; margin-bottom: 1rem; position: sticky; top: calc(var(--appbar) + var(--safe-t) + 4px); z-index: 10; }
.tabs a { flex: 1; text-align: center; padding: .55rem .25rem; border-radius: 9px; font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); text-decoration: none; }
.tabs a[aria-selected=true] { background: var(--white); color: var(--blue-deep); box-shadow: 0 1px 3px rgba(8,25,48,.12); }
.tabbed [data-tab-panel][hidden] { display: none; }

/* ---------- Detail list ---------- */
.dl { display: grid; grid-template-columns: 1fr; margin: 0; font-size: var(--t-sm); }
.dl dt { color: var(--ink-soft); font-size: var(--t-xs); padding-top: .6rem; }
.dl dd { margin: 0; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.dl dd:last-of-type { border-bottom: 0; }
.profile-head { display: flex; align-items: center; gap: .9rem; margin: .25rem .25rem 1rem; }
.profile-head .lead-avatar { width: 56px; height: 56px; font-size: var(--t-xl); background: var(--white); }
.profile-head strong { display: block; font-size: var(--t-xl); line-height: 1.2; }

/* ---------- Permissions ---------- */
.perm-module { border-top: 1px solid var(--line); padding: .9rem 0; }
.perm-module:first-child { border-top: 0; padding-top: 0; }
.perm-module__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.perm-module__head h3 { margin: 0; text-transform: capitalize; }
.perm-list { display: grid; grid-template-columns: 1fr; gap: .25rem; }
.perm-list .check { padding: .4rem 0; }
.perm-list .check.is-locked { opacity: .5; cursor: not-allowed; }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: .75rem .4rem; font-size: var(--t-xs); }
.matrix td.c { text-align: center; padding: .4rem; }
.matrix .yes { color: var(--green); font-weight: 700; }
.matrix .mod td { background: var(--blue-wash); font-weight: 700; color: var(--blue-deep); }
.matrix td:first-child { position: sticky; left: 0; background: var(--white); }

/* ---------- Pager ---------- */
.pager-wrap { display: flex; flex-direction: column; gap: .6rem; align-items: center; padding: .9rem 1rem; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .5rem; border-radius: var(--r-ctl); text-decoration: none; border: 1px solid var(--line); background: var(--white); }
.pagination .active a { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ==========================================================================
   SIGN-IN (phone: app splash header + sheet; desktop: split)
   ========================================================================== */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--blue); }
.auth__brand { color: var(--white); padding: calc(var(--safe-t) + 2rem) 1.5rem 2.75rem; }
.auth__brand .ribbon { display: none; }
.auth__name { font-weight: 800; font-size: 2.5rem; line-height: 1.12; margin: 0; }
.auth__name span { display: block; }
.auth__name span:last-child { color: #ffd29a; }
.auth__en { margin: .5rem 0 0; color: #cfe0f5; }
.auth__tagline { margin: 1.25rem 0 0; font-size: var(--t-md); border-left: 4px solid var(--orange); padding-left: .75rem; color: var(--white); }
.auth__formside { flex: 1; background: var(--white); border-radius: 24px 24px 0 0; padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-b)); }
.auth__card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth__card h1 { font-size: var(--t-xl); }
.auth__card .field { margin-bottom: 1rem; }
.auth__card .btn--primary { width: 100%; }
.auth__langs { display: flex; gap: .5rem; margin-bottom: 1.25rem; font-size: var(--t-sm); }
.auth__langs a { padding: .35rem .8rem; border-radius: 99px; text-decoration: none; border: 1px solid var(--line); color: var(--ink-soft); }
.auth__langs a[aria-current=true] { border-color: var(--blue); background: var(--blue-wash); color: var(--blue); font-weight: 700; }
.otp-input { font-size: 1.75rem !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.auth__meta { margin-top: 1.5rem; font-size: var(--t-xs); color: var(--ink-soft); }

/* ==========================================================================
   TABLET (>= 640px)
   ========================================================================== */
@media (min-width: 640px) {
  .content { padding: 1.25rem 1.5rem 2rem; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .perm-list { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .filters__body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters__body .btn { grid-column: auto; }
  .dl { grid-template-columns: 11rem 1fr; }
  .dl dt, .dl dd { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .dl dt:last-of-type { border-bottom: 0; }
}

/* ==========================================================================
   DESKTOP (>= 1024px): sidebar, top bar, tables
   ========================================================================== */
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar { position: sticky; top: 0; height: 100vh; width: auto; transform: none; transition: none; }
  .scrim, .tabbar, .fab, .appbar__mobile { display: none !important; }
  .appbar { background: var(--white); color: var(--ink); border-bottom: 1px solid var(--line); }
  .appbar .ribbon { display: none; }
  .appbar__desk { display: flex; align-items: center; gap: 1rem; height: 60px; padding: 0 2rem; }
  .appbar__desk .appbar__title { padding: 0; font-size: var(--t-md); color: var(--ink-soft); font-weight: 600; }
  .appbar__desk .avatar { background: var(--orange-wash); color: var(--orange-ink); }
  .main { padding-bottom: 2rem; min-width: 0; }
  .shell--pushed .main { padding-bottom: 2rem; }
  .content { padding: 1.75rem 2rem 3rem; margin: 0; }
  .page-head { margin-bottom: 1.5rem; }
  .page-head h1 { display: block; margin: 0; }
  .crumbs { display: block; font-size: var(--t-sm); margin-bottom: .25rem; }
  .crumbs a { color: var(--ink-soft); }
  .has-fab .page-head__actions .btn--primary { display: inline-flex; }
  .panel { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1.5rem; }
  .panel__head { padding: 1rem 1.25rem; }
  .panel__body { padding: 1.25rem; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
  .grid-3 { grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
  .figures { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1.5rem; }
  .quick { display: none; }
  .greet strong { font-size: var(--t-2xl); }
  .tabs { display: none; }
  .tabbed [data-tab-panel][hidden] { display: block; }
  .profile-head { display: none; }
  .form-actions--sticky { position: static; margin: 1.5rem 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; }
  .form-actions--sticky .btn--primary { flex: none; }
  .searchbar { padding: 1rem 1.25rem .5rem; border-bottom: 0; }
  .searchbar input[type=search] { max-width: 420px; }
  .filters { border-bottom: 1px solid var(--line); }
  .filters > summary { display: none; }
  .filters__body { display: flex; flex-wrap: wrap; padding: .25rem 1.25rem 1rem; }
  .filters__body .field { min-width: 160px; }
  .chips { padding: .5rem 1.25rem .9rem; }
  tbody tr:hover td { background: #fafcff; }
  tbody tr[data-href] { cursor: pointer; }
  .pager-wrap { flex-direction: row; justify-content: space-between; padding: .9rem 1.25rem; }
  .toast { bottom: 2rem; }
  .shell--pushed .toast { bottom: 2rem; }
  dialog.sheet { margin: auto; border-radius: 16px; }
  .auth { flex-direction: row; background: var(--white); }
  .auth__brand { flex: 1.1; display: flex; flex-direction: column; justify-content: space-between; background: var(--blue); padding: 0 0 3rem; }
  .auth__brand .ribbon { display: flex; height: 6px; }
  .auth__brand-inner { padding: 3rem 3.5rem 0; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
  .auth__name { font-size: clamp(3rem, 5vw, 4.6rem); }
  .auth__tagline { font-size: var(--t-xl); }
  .auth__formside { flex: 1; display: flex; align-items: center; border-radius: 0; padding: 2rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .sidebar, .appbar, .tabbar, .fab, .filters, .searchbar, .btn { display: none !important; } .shell { display: block; } }

/* Late additions: avatar + desktop identity chip, auth toasts */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 700; }
.topbar__me { display: flex; align-items: center; gap: .6rem; margin-left: auto; text-decoration: none; color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
.auth .toast { bottom: calc(1rem + var(--safe-b)); }
@media (max-width: 1023.98px) { .table-wrap > table td.desk-only { display: none; } }
@media (min-width: 1024px) { .who .small { display: none; } .who br { display: none; } }
.subnav { margin-bottom: 1rem; border-bottom: 0; padding: .5rem; }
.profile-actions { margin-bottom: 1rem; }
@media (min-width: 1024px) { .subnav { background: none; border: 0; padding: 0 0 1rem; } .profile-actions { display: none; } }
@media (max-width: 1023.98px) {
  .page-head--desk { display: none; }
  .page-head > div > p { display: none; }
  .shell--pushed .page-head > div > p { display: block; }
  .page-head:not(:has(.greet)):not(:has(.page-head__actions > *)):not(:has(p)) { display: none; }
}
@media (min-width: 1024px) { td { vertical-align: middle; } }

/* ---------- Stage 2: members ---------- */
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.skill:last-child { border-bottom: 0; }
.skill__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.skill__top strong { display: block; }
.skill p { margin: .35rem 0 0; }
.skill__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.inline-reason { display: inline-flex; gap: .4rem; align-items: center; }
.inline-reason input { min-height: 38px; padding: .3rem .6rem; font-size: 14px; width: 11rem; }
.cert { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-top: .6rem; padding: .6rem .75rem; background: var(--mist); border-radius: var(--r-ctl); }
details.mini { width: 100%; }
details.mini > summary { cursor: pointer; color: var(--blue); font-weight: 700; font-size: var(--t-sm); padding: .35rem 0; }
details.mini[open] > summary { margin-bottom: .6rem; }
.week { display: grid; gap: .5rem; }
.week__row { display: grid; grid-template-columns: 1fr 6.25rem auto 6.25rem; align-items: center; gap: .4rem; }
.week__row input[type=time] { min-height: 42px; padding: .4rem .5rem; font-size: 15px; }
.week__day { font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: .5rem 1rem 1rem; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: .6rem; padding: .55rem 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 1.5rem; bottom: -.55rem; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); margin-top: .3rem; box-shadow: 0 0 0 3px var(--blue-wash); }
.timeline li > span:last-child { display: grid; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; }
.contact-row .feed__t, .contact-row .feed__m { padding: 0; }
.coverage-gap td:first-child .row-title { color: var(--red); }
.resolve-steps { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.resolve-steps li { font-size: var(--t-xs); padding: .2rem .6rem; border-radius: 99px; background: var(--mist); color: var(--ink-soft); }
.resolve-steps li.hit { background: var(--green-wash); color: #13663a; font-weight: 700; }
.spoc-card { display: grid; gap: .25rem; }
.spoc-card strong { font-size: var(--t-lg); }
.figure--link { text-decoration: none; color: inherit; display: block; }
.figure--link:active { background: var(--mist); }
.coverage-note { margin: 0; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.other-actions { border-top: 1px solid var(--line); padding-top: .75rem; }
.other-actions > summary { color: var(--ink-soft); }
.warn-text { color: var(--orange-ink); }

/* ---------- Stage 3: complaints & media ---------- */
.complaint-head { display: grid; gap: .25rem; margin: .25rem .25rem 1rem; }
.complaint-head strong { font-size: var(--t-xl); line-height: 1.25; }
.complaint-head__pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.complaint-desc { white-space: normal; margin-bottom: 1rem; }
.tab-count { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--mist); font-size: var(--t-xs); }
.tabs a[aria-selected=true] .tab-count { background: var(--blue-wash); }
.share-link { border: 2px solid var(--green); }
.share-link h2 { font-size: var(--t-md); }
.copy-row { display: flex; gap: .5rem; align-items: center; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.geo { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.geo .hint { flex-basis: 100%; }
.segmented { display: grid; gap: .4rem; }
.panel__note { padding: .75rem 1rem; margin: 0; border-top: 1px solid var(--line); }
.timeline__dot--public { background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }

.uploader { display: grid; gap: .6rem; }
.uploader__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.uploader__pick { cursor: pointer; }
.uploader__queue { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.upload { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .6rem .75rem; background: var(--mist); border-radius: var(--r-ctl); font-size: var(--t-sm); }
.upload__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload__bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #dbe3ee; overflow: hidden; }
.upload__bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.upload--ok .upload__bar span { background: var(--green); }
.upload--ok .upload__state { color: #13663a; }
.upload--bad .upload__state { color: var(--red); grid-column: 1 / -1; }
.upload--bad .upload__bar { display: none; }

.gallery { list-style: none; margin: 0; padding: .75rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.gallery__item { display: grid; gap: .35rem; align-content: start; min-width: 0; }
.gallery__item img, .gallery__item video { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #dfe6ef; display: block; }
.gallery__item--video, .gallery__item--audio, .gallery__item--document { grid-column: 1 / -1; }
.gallery__item--video video { aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.gallery__audio audio { width: 100%; }
.gallery__doc { display: flex; gap: .6rem; align-items: center; padding: .75rem; background: var(--mist); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; word-break: break-all; }
.gallery__doc span { flex: none; padding: .3rem .45rem; border-radius: 6px; background: var(--red); color: var(--white); font-size: var(--t-xs); font-weight: 700; }
.gallery__meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: space-between; }
.gallery__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Public tracking */
.public .content { max-width: 640px; padding-bottom: calc(2rem + var(--safe-b)); }
.public .appbar__row { padding-right: .75rem; }
.public-langs { display: flex; gap: .25rem; }
.public-langs a { color: #dce8f7; text-decoration: none; font-size: var(--t-sm); padding: .3rem .5rem; border-radius: 8px; }
.public-langs a[aria-current=true] { background: rgba(255,255,255,.18); color: var(--white); font-weight: 700; }
.track-title { font-size: var(--t-2xl); margin: .25rem 0 .5rem; }
.progress-steps { list-style: none; margin: 1.25rem 0 .5rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; counter-reset: step; }
.progress-steps li { position: relative; padding-top: 14px; font-size: .72rem; color: var(--ink-soft); text-align: center; line-height: 1.25; }
.progress-steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 99px; background: var(--line); }
.progress-steps li.done::before { background: var(--green); }
.progress-steps li.now::before { background: var(--orange); }
.progress-steps li.now { color: var(--ink); font-weight: 700; }
.answer-group { display: grid; gap: .5rem; }
.answer { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; font-weight: 600; }
.answer:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.answer input { width: 20px; height: 20px; accent-color: var(--blue); }
.rating { border: 0; margin: 0; padding: 0; }
.rating legend { padding: 0; margin-bottom: .35rem; }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.1rem; line-height: 1; color: #c9d3df; cursor: pointer; padding: 0 .1rem; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--orange); }
.stars input:focus-visible + label { outline: 3px solid var(--orange); border-radius: 6px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1rem 1.25rem; } .complaint-head { display: none; } .uploader__buttons { grid-template-columns: auto auto; justify-content: start; } }

/* ---------- Stage 4: projects & tasks ---------- */
.cards { list-style: none; margin: 0; padding: 0; }
.card-row { border-bottom: 1px solid var(--line); }
.card-row:last-child { border-bottom: 0; }
.card-row > a { display: grid; gap: .35rem; padding: .85rem 1rem; color: inherit; text-decoration: none; }
.card-row > a:active { background: var(--mist); }
.card-row__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.card-row__top strong { line-height: 1.3; }
.card-row__meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--ink-soft); }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: .25rem 0; }
.progress__bar { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress__bar--0 { width: 0%; }
.progress__bar--5 { width: 5%; }
.progress__bar--10 { width: 10%; }
.progress__bar--15 { width: 15%; }
.progress__bar--20 { width: 20%; }
.progress__bar--25 { width: 25%; }
.progress__bar--30 { width: 30%; }
.progress__bar--35 { width: 35%; }
.progress__bar--40 { width: 40%; }
.progress__bar--45 { width: 45%; }
.progress__bar--50 { width: 50%; }
.progress__bar--55 { width: 55%; }
.progress__bar--60 { width: 60%; }
.progress__bar--65 { width: 65%; }
.progress__bar--70 { width: 70%; }
.progress__bar--75 { width: 75%; }
.progress__bar--80 { width: 80%; }
.progress__bar--85 { width: 85%; }
.progress__bar--90 { width: 90%; }
.progress__bar--95 { width: 95%; }
.progress__bar--100 { width: 100%; }
.blockers { margin: .4rem 0 0; padding-left: 1.2rem; }
.blockers a { color: inherit; font-weight: 600; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item { display: grid; grid-template-columns: 44px 1fr; gap: .5rem; align-items: start; padding: .55rem 1rem; border-bottom: 1px solid var(--line); }
.checklist__item:last-child { border-bottom: 0; }
.checklist__item.is-done .checklist__text > :first-child, .checklist__item.is-done .checklist__text { color: var(--ink-soft); }
.checklist__text { display: grid; gap: .15rem; padding-top: .55rem; }
.checklist__form { margin: 0; }
.tick { width: 40px; height: 40px; border-radius: 12px; border: 2px solid #b9c6d6; background: var(--white); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.tick--on { background: var(--green); border-color: var(--green); }
.tick--on::after { content: ""; width: 12px; height: 20px; border: solid var(--white); border-width: 0 4px 4px 0; transform: rotate(45deg) translate(-1px, -2px); }
.tick:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.suggest { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.suggest__item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.suggest__who { display: grid; gap: .2rem; min-width: 0; }
.suggest__why { display: flex; flex-wrap: wrap; gap: .25rem; }
.why { font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; background: var(--mist); color: var(--ink-soft); }
.why--ok { background: var(--green-wash); color: #13663a; }
.why--warn { background: #fff1df; color: var(--orange-ink); }
.stage-pick { border: 0; margin: 0; padding: 0; }
.stage-pick legend { padding: 0; margin-bottom: .35rem; }
.stage-pick { display: block; }
.stage-pick__opt { display: inline-flex; margin: 0 .35rem .35rem 0; }
.stage-pick__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stage-pick__opt span { padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; cursor: pointer; font-size: var(--t-sm); }
.stage-pick__opt input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--white); }
.stage-pick__opt input:focus-visible + span { outline: 3px solid var(--orange); }
.gallery-title { font-size: var(--t-sm); margin: 1rem 1rem 0; color: var(--ink-soft); text-transform: none; }

/* ---------- Sign-in banner ---------- */
.auth__banner { display: block; margin: calc(-1 * (var(--safe-t) + 2rem)) -1.5rem 1.25rem; }
.auth__banner img { display: block; width: 100%; height: auto; aspect-ratio: 2048 / 758; background: #f5d9b8; }
/* With a banner the big brand title is shortened on phones, so the form stays near the top. */
.auth__banner ~ .auth__brand-inner .auth__name { font-size: 1.75rem; }
.auth__banner ~ .auth__brand-inner .auth__tagline { margin-top: .75rem; }
.auth:has(.auth__banner) .auth__brand { padding-top: calc(var(--safe-t) + 2rem); padding-bottom: 2rem; }
@media (min-width: 1024px) {
  .auth__banner { margin: 0; }
  .auth__banner ~ .auth__brand-inner .auth__name { font-size: clamp(2.2rem, 3.4vw, 3.4rem); }
  .auth:has(.auth__banner) .auth__brand { padding: 0 0 3rem; }
  .auth__banner ~ .auth__brand-inner { padding-top: 2rem; }
}

/* ---------- Stage 5: notices & notifications ---------- */
.bell { position: relative; }
.bell__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: var(--white);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--blue); }
.bell--desk { color: var(--ink); margin-left: auto; }
.bell--desk .bell__count { box-shadow: 0 0 0 2px var(--white); }
.chips-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-right: 1rem; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox__item { border-bottom: 1px solid var(--line); }
.inbox__item a { display: grid; grid-template-columns: 12px 1fr; gap: .6rem; padding: .85rem 1rem; color: inherit; text-decoration: none; }
.inbox__item a:active { background: var(--mist); }
.inbox__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; background: transparent; }
.inbox__item.is-unread .inbox__dot { background: var(--orange); }
.inbox__item.is-unread strong { font-weight: 800; }
.inbox__item:not(.is-unread) strong { font-weight: 600; color: var(--ink-soft); }
.inbox__text { display: grid; gap: .15rem; }
.toggles { list-style: none; margin: 0; padding: 0; }
.toggles li { border-bottom: 1px solid var(--line); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; cursor: pointer; }
.toggle > span { display: grid; gap: .15rem; }
.toggle input { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: #c6d1de; position: relative; flex: none; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked { background: var(--green); }
.toggle input:checked::after { transform: translateX(20px); }
.toggle input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.target-pick { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.target-pick legend { width: 100%; padding: 0; margin-bottom: .35rem; }
.notice-body h2 { margin-top: 0; }
.notice-body { line-height: 1.65; }
.msg-row { padding: .75rem 1rem; display: grid; gap: .3rem; }
.msg-row__top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.msg-row__text { margin: 0; padding: .5rem .6rem; background: var(--mist); border-radius: 8px; word-break: break-word; }
.public-links { display: flex; gap: .75rem; margin-left: auto; margin-right: .5rem; }
.public-links a { color: #dce8f7; text-decoration: none; font-size: var(--t-sm); font-weight: 600; }
.ward-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ward-filter select { width: auto; flex: 1; min-width: 10rem; }
.notice-card > a { display: grid; gap: .35rem; padding: 1rem 1.1rem; color: inherit; text-decoration: none; }
.notice-card h2 { margin: .1rem 0; font-size: var(--t-lg); }
.notice-card p { margin: 0; color: var(--ink-soft); }
.notice-card--urgent { border-left: 5px solid var(--red); }
.notice-card--important { border-left: 5px solid var(--orange); }
.notice-card__prio { color: var(--red); }
.notice-card--important .notice-card__prio { color: var(--orange-ink); }
.files { padding-left: 1.2rem; }
@media (max-width: 420px) { .public-links { display: none; } }

/* Tabs nested inside a panel (e.g. one tab per language): not sticky (panels clip
   their content, which would push a sticky bar down), and still tabs on desktop. */
.tabbed--inline > .tabs { position: static; margin: .75rem .75rem 0; }
@media (min-width: 1024px) {
  .tabbed--inline > .tabs { display: flex; }
  .tabbed--inline > [data-tab-panel][hidden] { display: none; }
}

/* ---------- Stage 6: emergency control room ---------- */
:root { --sev-critical: #b3261e; --sev-high: #e0601b; --sev-medium: #c99300; --sev-low: #4f6b8a; }
.btn--danger { background: var(--red); color: var(--white); border-color: var(--red); }
.btn--danger:hover { background: #a42b22; }
.btn--big { min-height: 56px; font-size: var(--t-md); }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.emg-official { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--red-wash); border: 1px solid #f1c6c1; border-radius: var(--r-card); padding: .75rem 1rem; margin-bottom: 1rem; }
.emg-official strong { width: 100%; color: #8e221b; font-size: var(--t-sm); }
.emg-call { display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem .7rem; border-radius: 99px; background: var(--white); color: var(--ink); text-decoration: none; font-size: var(--t-sm); border: 1px solid #f1c6c1; }
.emg-call span { font-weight: 800; color: var(--red); }
.emg-board { display: grid; gap: 1rem; }
@media (min-width: 900px) { .emg-board { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; } }
.emg-col { background: #edf1f6; border-radius: var(--r-card); padding: .6rem; }
.emg-col__head { font-size: var(--t-sm); margin: .2rem .3rem .6rem; display: flex; justify-content: space-between; }
.emg-col__empty { margin: .3rem; }
.emg-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.emg-card { background: var(--white); border-radius: 12px; border-left: 6px solid var(--sev-low); box-shadow: 0 1px 2px rgba(8,25,48,.08); }
.emg-card--critical { border-left-color: var(--sev-critical); } .emg-card--high { border-left-color: var(--sev-high); } .emg-card--medium { border-left-color: var(--sev-medium); }
.emg-card > a { display: grid; gap: .25rem; padding: .7rem .8rem; color: inherit; text-decoration: none; }
.emg-card.is-overdue { box-shadow: 0 0 0 2px var(--sev-critical); animation: emg-pulse 1.6s ease-in-out infinite; }
@keyframes emg-pulse { 50% { box-shadow: 0 0 0 4px rgba(179,38,30,.35); } }
@media (prefers-reduced-motion: reduce) { .emg-card.is-overdue { animation: none; } }
.emg-card__top { display: flex; justify-content: space-between; align-items: center; }
.emg-card__alert { display: block; font-size: var(--t-xs); font-weight: 800; color: var(--white); background: var(--sev-critical); border-radius: 6px; padding: .2rem .45rem; }
.emg-sev { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 6px; color: var(--white); background: var(--sev-low); }
.emg-sev--critical { background: var(--sev-critical); } .emg-sev--high { background: var(--sev-high); } .emg-sev--medium { background: var(--sev-medium); }
.emg-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--t-sm); }
.emg-clock--big { font-size: 1.15rem; }
.emg-head { display: grid; gap: .3rem; padding: 1rem; border-radius: var(--r-card); background: var(--white); border-left: 8px solid var(--sev-low); margin-bottom: 1rem; }
.emg-head--critical { border-left-color: var(--sev-critical); background: #fff5f4; } .emg-head--high { border-left-color: var(--sev-high); } .emg-head--medium { border-left-color: var(--sev-medium); }
.emg-head strong, .emg-head h1 { font-size: 1.35rem; margin: 0; }
.emg-head__row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.svc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 700px) { .svc-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.svc { border: 1px solid var(--line); border-radius: 12px; padding: .6rem; display: grid; gap: .4rem; }
.svc--needed { border-color: var(--sev-high); background: #fff7f0; }
.svc--done { border-color: var(--green); background: var(--green-wash); }
.svc__call { display: flex; justify-content: space-between; color: inherit; text-decoration: none; }
.svc__name { font-weight: 700; }
.pick-grid { border: 0; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
@media (min-width: 700px) { .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pick-grid legend { grid-column: 1 / -1; padding: 0; margin-bottom: .2rem; }
.pick { display: block; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: .4rem; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: var(--t-sm); cursor: pointer; background: var(--white); }
.pick input:checked + span { background: var(--blue); color: var(--white); border-color: var(--blue); }
.pick input:focus-visible + span { outline: 3px solid var(--orange); }
.pick--critical input:checked + span { background: var(--sev-critical); border-color: var(--sev-critical); }
.pick--high input:checked + span { background: var(--sev-high); border-color: var(--sev-high); }
.pick--medium input:checked + span { background: var(--sev-medium); border-color: var(--sev-medium); }
.pick--low input:checked + span { background: var(--sev-low); border-color: var(--sev-low); }
.timeline__dot--escalation, .timeline__dot--dispatch { background: var(--red); }
.timeline__dot--responder { background: var(--green); }
.timeline__dot--service { background: var(--orange); }
.emg-banner { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; padding: .9rem 1rem; border-radius: var(--r-card); background: #fff1e6; border: 1px solid #f7c99c; color: var(--ink); text-decoration: none; margin-bottom: 1rem; }
.emg-banner--critical { background: var(--sev-critical); border-color: var(--sev-critical); color: var(--white); }
.emg-banner__go { margin-left: auto; font-weight: 700; }
.public-links__sos { background: var(--red); color: var(--white) !important; padding: .2rem .6rem; border-radius: 99px; }
.emg-public__lead { font-size: var(--t-md); }
.emg-big { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 16px; background: var(--red); color: var(--white); text-decoration: none; font-weight: 700; font-size: var(--t-md); }
.emg-big span { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.emg-list { list-style: none; margin: 0; padding: 0; }
.emg-list li { border-bottom: 1px solid var(--line); }
.emg-list a { display: flex; gap: 1rem; align-items: center; padding: .8rem 1rem; color: inherit; text-decoration: none; min-height: 56px; }
.emg-list span:last-child { display: grid; }
.emg-list__num { min-width: 4.2rem; font-size: 1.3rem; font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; }
.ok-text { color: #13663a; }
.center { text-align: center; }
@media (max-width: 420px) { .public-links { display: flex; } .public-links a:not(.public-links__sos) { display: none; } }

/* Narrow phones: service boxes stack name over number; the button fills the box. */
.svc { min-width: 0; }
.svc__call { flex-direction: column; gap: .1rem; }
.svc__call .mono { font-size: 1.05rem; font-weight: 800; color: var(--red); }
.svc .btn { width: 100%; white-space: normal; line-height: 1.2; padding: .45rem .4rem; }
/* Public numbers: the number keeps its width; long local numbers never cover the name. */
.emg-list a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; }
.emg-list__num { min-width: 3.4rem; white-space: nowrap; }
.emg-list__num:not(:empty) { font-size: clamp(1rem, 4.6vw, 1.3rem); }

/* ---------- Stage 7: public site, events, content ---------- */
.public-nav { display: flex; gap: .25rem; overflow-x: auto; padding: .4rem .75rem .5rem; background: var(--blue-deep, #08396f); scrollbar-width: none; }
.public-nav::-webkit-scrollbar { display: none; }
.public-nav a { flex: none; color: #dce8f7; text-decoration: none; font-weight: 600; font-size: var(--t-sm); padding: .35rem .75rem; border-radius: 99px; }
.public-nav a[aria-current=page] { background: var(--white); color: var(--blue); }
.public-footer { padding: 1.5rem 1rem calc(1.5rem + var(--safe-b)); text-align: center; color: var(--ink-soft); font-size: var(--t-sm); border-top: 1px solid var(--line); margin-top: 1rem; }
.public-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; margin-bottom: .5rem; }
.public-footer a { color: var(--ink-soft); }
.pub-hero { text-align: center; padding: 1rem .5rem .25rem; }
.pub-hero h1 { margin: 0; color: var(--blue); }
.pub-hero p { margin: .25rem auto 0; color: var(--ink-soft); }
.pub-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
@media (min-width: 760px) { .pub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pub-tile { display: grid; gap: .2rem; padding: 1rem; border-radius: var(--r-card); background: var(--white); text-decoration: none; color: var(--ink); border-top: 5px solid var(--blue); box-shadow: 0 1px 2px rgba(8,25,48,.06); min-height: 96px; }
.pub-tile strong { font-size: var(--t-md); }
.pub-tile span { font-size: var(--t-sm); color: var(--ink-soft); }
.pub-tile--track { border-top-color: var(--orange); } .pub-tile--events { border-top-color: var(--green); }
.pub-tile--emergency { border-top-color: var(--red); background: #fff6f5; } .pub-tile--emergency strong { color: var(--red); }
.ev-row { display: grid !important; grid-template-columns: 56px 1fr; gap: .8rem; align-items: center; }
.ev-row__text { display: grid; gap: .2rem; }
.ev-date { display: grid; place-items: center; width: 56px; height: 60px; border-radius: 12px; background: var(--blue-wash); color: var(--blue); line-height: 1.05; }
.ev-date b { font-size: 1.45rem; } .ev-date span { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.ev-date--big { width: 68px; height: 72px; } .ev-date--big b { font-size: 1.8rem; }
.ev-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .75rem; }
.ev-head h1 { margin: .15rem 0 0; }
.ev-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: .75rem; }
.ev-done { text-align: center; padding: .5rem; }
.ev-done__label { margin: .75rem 0 .1rem; font-weight: 700; }
.ev-done__code { font-size: 2.1rem; font-weight: 900; letter-spacing: .12em; color: var(--blue); margin: 0; }
.ev-cancel { margin-top: 1rem; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.checkin { display: flex; gap: .5rem; }
.checkin input { flex: 1; font-size: 1.3rem; letter-spacing: .1em; text-transform: uppercase; }
.input-sm { width: 6rem; }
.flash--link { display: block; text-decoration: none; color: inherit; }
.content-body { line-height: 1.65; }
.content-body h2 { font-size: var(--t-md); margin-top: 1.25rem; }
.content-body .lead { font-size: var(--t-md); color: var(--ink-soft); }
.checklist-plain { padding-left: 1.2rem; }
.checklist-plain li { margin: .2rem 0; }
.pub-checked { margin-top: 1.25rem; padding: .6rem .75rem; background: var(--mist); border-radius: 10px; }

/* ---------- Stage 8: reports ---------- */
.rep-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; padding: 1rem; align-items: end; }
@media (min-width: 900px) { .rep-filters { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; } }
.rep-filters .field { margin: 0; }
.rep-filters__go { grid-column: 1 / -1; }
@media (min-width: 900px) { .rep-filters__go { grid-column: auto; } }
.rep-quick { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); }
.rep-quick a { margin-right: .6rem; }
.rep-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .rep-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rep-kpi { align-content: start; }
.rep-def { margin: .35rem 0 0; font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.35; }
.rep-table td.num, .rep-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-proj { display: grid; gap: .25rem; padding: .8rem 1rem; }
.chart { width: 100%; height: auto; display: block; max-height: 520px; }
.chart text { font-family: inherit; }
.chart__label, .chart__axis { fill: var(--ink-soft); font-size: 12px; }
.chart__value { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart__bar, .chart__col--0 { fill: var(--blue); }
.chart__col--1 { fill: var(--green); }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .4rem 0 0; color: var(--ink-soft); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: .4rem; }
.key--0 { background: var(--blue); } .key--1 { background: var(--green); }
@media print {
  .no-print, .subnav, .page-head__actions, .toast, .bell { display: none !important; }
  body, .main, .content { background: #fff !important; }
  .panel, .figure { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  .rep-figures { grid-template-columns: repeat(4, 1fr) !important; }
  .chart__bar, .chart__col--0 { fill: #0b4f9c; } .chart__col--1 { fill: #1e8e4e; }
  a { color: inherit; text-decoration: none; }
}

.rep-more { grid-column: 1 / -1; }
.rep-more summary { cursor: pointer; color: var(--blue); font-weight: 600; padding: .2rem 0; }
.rep-more__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; margin-top: .5rem; }
@media (min-width: 900px) { .rep-filters { grid-template-columns: repeat(2, minmax(0, 12rem)) auto 1fr; } .rep-more__body { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chart--cols { max-width: 820px; }
.chart--bars { max-width: 760px; }

/* Report charts: readable label size after scaling to a phone. */
.chart__label, .chart__axis, .chart__value { font-size: 14px; }
.chart--bars { max-width: 560px; } .chart--cols { max-width: 680px; }

/* ---------- Complaint lifecycle v2 & citizen self-service ---------- */
.banner { display: grid; gap: .2rem; padding: .7rem .9rem; margin: .75rem 0; border-radius: 10px; background: var(--blue-wash); border-left: 4px solid var(--blue); }
.banner--warn { background: #fff4e5; border-left-color: var(--orange); }
.banner--end { background: var(--mist); border-left-color: #8a96a6; }
.handled { margin: .5rem 0 0; }
.progress-steps--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sla-bar { position: relative; height: 26px; border-radius: 8px; background: var(--mist); overflow: hidden; margin: 0 0 1rem; }
.sla-bar__fill { display: block; height: 100%; background: var(--green); }
.sla-bar--amber .sla-bar__fill { background: var(--orange); } .sla-bar--red .sla-bar__fill { background: var(--red); }
.sla-bar--paused .sla-bar__fill { background: #9aa7b7; }
.sla-bar__text { position: absolute; inset: 0 .6rem; display: flex; align-items: center; font-weight: 700; color: var(--ink); }
.sla-bar__fill--0 { width: 0%; }
.sla-bar__fill--5 { width: 5%; }
.sla-bar__fill--10 { width: 10%; }
.sla-bar__fill--15 { width: 15%; }
.sla-bar__fill--20 { width: 20%; }
.sla-bar__fill--25 { width: 25%; }
.sla-bar__fill--30 { width: 30%; }
.sla-bar__fill--35 { width: 35%; }
.sla-bar__fill--40 { width: 40%; }
.sla-bar__fill--45 { width: 45%; }
.sla-bar__fill--50 { width: 50%; }
.sla-bar__fill--55 { width: 55%; }
.sla-bar__fill--60 { width: 60%; }
.sla-bar__fill--65 { width: 65%; }
.sla-bar__fill--70 { width: 70%; }
.sla-bar__fill--75 { width: 75%; }
.sla-bar__fill--80 { width: 80%; }
.sla-bar__fill--85 { width: 85%; }
.sla-bar__fill--90 { width: 90%; }
.sla-bar__fill--95 { width: 95%; }
.sla-bar__fill--100 { width: 100%; }
.public-nav__report { background: var(--orange); color: var(--white) !important; }
.pub-tile--report { border-top-color: var(--orange); background: #fff7ef; grid-column: 1 / -1; }
.pub-tile--report strong { color: var(--orange-ink); font-size: 1.15rem; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.input-big { font-size: 1.35rem; letter-spacing: .06em; min-height: 52px; }
.me-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .75rem; }
.card-row--attention { border-left: 4px solid var(--orange); }
.similar { padding: .75rem 1rem 1rem; border-top: 1px solid var(--line); background: #fffaf3; }
.similar h3 { margin: 0 0 .2rem; font-size: var(--t-md); }
.similar__item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.similar__text { display: grid; gap: .1rem; min-width: 0; }
.created-note { display: grid; gap: .25rem; text-align: center; }
.created-note__num { font-size: 1.6rem; font-weight: 900; letter-spacing: .04em; }
.routing-warn { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
/* The orange "Report" menu item stays readable when it is the current page. */
.public-nav a.public-nav__report[aria-current=page] { background: var(--white); color: var(--orange-ink, #a95a06) !important; box-shadow: inset 0 0 0 2px var(--orange); }

/* ---------- Stage 9: authenticator app ---------- */
.qr { width: 220px; max-width: 70vw; aspect-ratio: 1; margin: .25rem auto; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret-key { font-size: 1.1rem; letter-spacing: .08em; word-break: break-all; }
.recovery { border: 2px solid var(--orange); }
.recovery__list { columns: 2; padding-left: 1.4rem; font-size: 1.1rem; line-height: 1.9; }

/* ---------- Stage 10: maintenance page ---------- */
.maintenance { display: grid; place-items: center; min-height: 100vh; margin: 0; background: var(--mist, #f3f6fa); font-family: system-ui, sans-serif; }
.maintenance__box { max-width: 30rem; padding: 2rem 1.5rem; text-align: center; background: #fff; border-radius: 16px; border-top: 6px solid #0b4f9c; }
.maintenance__box h1 { color: #0b4f9c; } .maintenance__box h2 { color: #0b4f9c; font-size: 1.1rem; margin-top: 1.5rem; }

/* ---------- Public site on desktop ----------
   The staff panel's desktop rules (white top bar, content pinned left next to the sidebar)
   must not apply to the public site, which has no sidebar. */
@media (min-width: 1024px) {
  .public .appbar { background: var(--blue); color: var(--white); border-bottom: 0; }
  .public .appbar .ribbon { display: flex; }
  .public .appbar__row,
  .public .public-nav { max-width: 1040px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
  .public .public-nav { background: none; }
  .public .appbar > .public-nav { box-shadow: 0 0 0 100vmax var(--blue-deep, #08396f); clip-path: inset(0 -100vmax); background: var(--blue-deep, #08396f); }
  .public .content { max-width: 1040px; margin: 0 auto; }
}

/* ---------- Home-page banner slider ----------
   Every banner shows at the same shape (8:3, e.g. 1600 × 600) so the page does not jump. */
.hero-slider { position: relative; margin: -1rem -.875rem 1rem; background: var(--blue-deep, #08396f); overflow: hidden; }
.hero-slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hero-slider__track::-webkit-scrollbar { display: none; }
.hero-slider__track:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.hero-slider__slide { flex: 0 0 100%; scroll-snap-align: start; }
.hero-slider__slide a { display: block; }
.hero-slider img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; object-fit: cover; }
.hero-slider__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(8,25,48,.55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; display: none; }
.hero-slider__arrow--prev { left: .6rem; } .hero-slider__arrow--next { right: .6rem; }
.hero-slider__arrow:hover, .hero-slider__arrow:focus-visible { background: rgba(8,25,48,.8); }
.hero-slider__bar { position: absolute; left: 0; right: 0; bottom: .45rem; display: flex; justify-content: center; align-items: center; gap: .35rem; pointer-events: none; }
.hero-slider__bar button { pointer-events: auto; cursor: pointer; }
.hero-slider__dot { width: 10px; height: 10px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: rgba(8,25,48,.35); }
.hero-slider__dot[aria-current=true] { background: #fff; }
.hero-slider__pause { margin-left: .4rem; height: 22px; min-width: 26px; padding: 0 .35rem; border: 0; border-radius: 99px; background: rgba(8,25,48,.55); color: #fff; font-size: .65rem; }
@media (min-width: 640px) { .hero-slider { margin: 0 0 1.25rem; border-radius: var(--r-card); } .hero-slider__arrow { display: block; } }
/* Admin: banner list and preview */
.banner-list { list-style: none; margin: 0; padding: 0; }
.banner-row { display: grid; grid-template-columns: 120px 1fr; gap: .4rem .9rem; align-items: center; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.banner-row:first-child { border-top: 0; }
.banner-row__pic { display: grid; place-items: center; aspect-ratio: 8 / 3; border-radius: 8px; overflow: hidden; background: var(--mist, #f3f6fa); color: var(--ink-soft); font-size: var(--t-xs); text-align: center; text-decoration: none; }
.banner-row__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-row__text { display: grid; gap: .2rem; min-width: 0; }
.banner-row__text a { color: var(--ink); text-decoration: none; }
.banner-row__actions { grid-column: 1 / -1; display: flex; gap: .35rem; justify-content: flex-end; }
@media (min-width: 760px) { .banner-row { grid-template-columns: 200px 1fr auto; } .banner-row__actions { grid-column: auto; } }
.banner-preview { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; object-fit: cover; border-radius: 10px; background: var(--mist, #f3f6fa); }
.field[hidden] { display: none; }
