/* Ward Seva: one stylesheet for resident pages and the team dashboard.
   Mobile first, system fonts (Android ships Noto Devanagari), no web fonts,
   high contrast for cracked screens in sunlight, 48px tap targets. */

/* Hindi text uses Noto Sans Devanagari (self-hosted, OFL licence). The unicode-range
   means it is only downloaded and used for Devanagari letters; English and numbers keep
   the phone's own font. */
@font-face {
  font-family: "WS Devanagari";
  src: url("/static/fonts/noto-sans-devanagari-var.woff2") format("woff2");
  font-weight: 100 900;
  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 {
  --navy: #1f2d5c;
  --navy-2: #2b3d7a;
  --navy-soft: #e9edf8;
  --saffron: #f08c00;
  --saffron-dark: #c96f00;
  --saffron-soft: #fff3e0;
  --ink: #17203a;
  --ink-2: #4a5470;
  --ink-3: #5b6480;  /* >= 5:1 on white, page grey and navy-soft (WCAG AA 4.5:1) */
  --line: #dfe3ec;
  --bg: #f4f6fa;
  --card: #ffffff;
  --st-new: #5b6478;       --st-new-bg: #eceef3;
  --st-progress: #a15c00;  --st-progress-bg: #fff1d6;
  --st-done: #18794e;      --st-done-bg: #dcf3e6;
  --st-overdue: #c0271d;   --st-overdue-bg: #fde4e1;
  --st-other: #2f4a9a;     --st-other-bg: #e4e9f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 32, 58, .06), 0 2px 8px rgba(23, 32, 58, .05);
  --series-1: #2a78d6;
  --series-2: #1baf7a;
  --font: "WS Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--navy-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon-lg { width: 32px; height: 32px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8fa4e8; outline-offset: 1px; }
.btn-primary { background: var(--saffron); border-color: var(--saffron); color: #1b1300; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-danger { color: var(--st-overdue); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .85rem; color: var(--ink-3); font-weight: 400; margin-top: .25rem; }
.err { font-size: .9rem; color: var(--st-overdue); font-weight: 600; margin-top: .35rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .75rem; border: 1px solid #c9cfdc; border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
textarea { min-height: 88px; resize: vertical; }
select { appearance: auto; }
.input-sm { min-height: 38px !important; padding: .35rem .6rem !important; font-size: .9rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; }

/* ---------- cards, badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: .5rem; justify-content: space-between; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; line-height: 1.5;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-new, .b-acknowledged { color: var(--st-new); background: var(--st-new-bg); }
.b-forwarded, .b-in_progress { color: var(--st-progress); background: var(--st-progress-bg); }
.b-resolved, .b-closed { color: var(--st-done); background: var(--st-done-bg); }
.b-overdue { color: var(--st-overdue); background: var(--st-overdue-bg); }
.b-redirected, .b-rejected { color: var(--st-other); background: var(--st-other-bg); }
.b-urgent { color: #fff; background: var(--st-overdue); }
.b-urgent::before { display: none; }
.b-plain { color: var(--ink-2); background: var(--navy-soft); }
.b-plain::before { display: none; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; border: 1px solid; }
.flash-ok { background: var(--st-done-bg); color: var(--st-done); border-color: #b5e2c8; }
.flash-error { background: var(--st-overdue-bg); color: var(--st-overdue); border-color: #f5bdb7; }
.flash-warn { background: var(--st-progress-bg); color: var(--st-progress); border-color: #f3d39b; }

/* ========== RESIDENT PAGES ========== */
/* No coloured bar: a light row with a round back button and a small language pill */
.pub-top { background: transparent; color: var(--ink); }
.pub-top-inner { max-width: 560px; margin: 0 auto; padding: calc(.7rem + env(safe-area-inset-top)) 1rem .1rem; display: flex; align-items: center; gap: .6rem; min-height: 3.4rem; }
.pub-top a { color: var(--ink); text-decoration: none; }
.pub-brand { font-weight: 600; font-size: .9rem; color: var(--ink-2); display: flex; align-items: center; gap: .4rem; }
.pub-main { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.pub-foot { max-width: 560px; margin: 0 auto; padding: 1.5rem 1rem 2rem; color: var(--ink-3); font-size: .85rem; text-align: center; }

.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border-radius: 16px; padding: 1.25rem; display: flex; gap: 1rem; align-items: center; }
.hero-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--saffron); background: #fff; flex: none; }
.hero-photo-ph { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--saffron); display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); flex: none; }
.hero h1 { font-size: 1.3rem; margin: 0; }
.hero .meta { opacity: .9; font-size: .9rem; }

.big-action { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 84px; }
.big-action .ico { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.big-action strong { display: block; font-size: 1.15rem; }
.big-action strong + span { display: block; color: var(--ink-3); font-size: .9rem; }
.big-action.primary { background: var(--saffron); border-color: var(--saffron); }
.big-action.primary .ico { background: rgba(255,255,255,.35); color: #1b1300; }
.big-action.primary strong + span { color: #3d2a00; }


.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 420px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-tile { position: relative; }
.cat-tile input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.cat-tile label, .cat-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center;
  min-height: 96px; padding: .6rem .4rem; border: 2px solid var(--line); border-radius: 12px; background: var(--card);
  font-weight: 600; font-size: .95rem; cursor: pointer; margin: 0; line-height: 1.25;
}
.cat-link { color: var(--ink); text-decoration: none; }
.cat-tile label .icon, .cat-link .icon { width: 32px; height: 32px; color: var(--navy); }
.cat-tile input:checked + label { border-color: var(--saffron); background: var(--saffron-soft); box-shadow: 0 0 0 2px var(--saffron) inset; }
.cat-tile input:focus-visible + label { outline: 3px solid #8fa4e8; }
.cat-tile .ext { font-size: .7rem; font-weight: 600; color: var(--st-other); }

.section-head { display: flex; align-items: baseline; gap: .5rem; margin: 1.5rem 0 .6rem; }
.section-head h2 { margin: 0; font-size: 1.15rem; }

.photo-pick { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 96px; border: 2px dashed #b9c1d3; border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 600; color: var(--navy); text-align: center; padding: .75rem; margin: 0; }
.photo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-preview { margin-top: .5rem; border-radius: 10px; max-height: 220px; object-fit: cover; width: 100%; }

.ref-box { text-align: center; padding: 1.25rem; border-radius: 14px; background: var(--navy-soft); }
.ref-box .ref { font-size: 2rem; font-weight: 800; letter-spacing: .04em; color: var(--navy); font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 2rem; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--st-new); }
.timeline .dot.done { border-color: var(--st-done); background: var(--st-done); }
.timeline .dot.prog { border-color: var(--saffron); }
.timeline .dot.other { border-color: var(--st-other); }
.timeline .when { font-size: .8rem; color: var(--ink-3); }
.timeline .what { font-weight: 600; }
.timeline .note { color: var(--ink-2); font-size: .95rem; margin-top: .15rem; white-space: pre-line; }

.photo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.photo-row a { display: block; position: relative; }
.photo-row img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-row .cap { font-size: .75rem; color: var(--ink-3); margin-top: .2rem; }

.agency-card { border-left: 4px solid var(--st-other); }

/* ========== DASHBOARD ========== */
.dash { display: flex; min-height: 100vh; }
.side { width: 248px; background: var(--card); color: var(--ink-2); flex: none; display: none; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; color: var(--ink); font-weight: 800; font-size: 1rem; text-decoration: none; letter-spacing: -.01em; }
.side-brand small { display: block; font-weight: 500; color: var(--ink-3); font-size: .78rem; letter-spacing: 0; }
.side-brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; flex: none; box-shadow: inset 0 -3px 0 var(--saffron); }
.side nav { padding: .25rem .6rem; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; margin: 1px 0; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .93rem; }
.side nav a .icon { color: var(--ink-3); }
.side nav a.sub { padding-left: 2.2rem; font-weight: 500; font-size: .88rem; }
.side nav a.sub .icon { width: 1em; height: 1em; }
.side nav a.on { background: var(--navy-soft); color: var(--navy); }
.side nav a.on .icon { color: var(--navy); }
.side .group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 1.1rem .7rem .35rem; font-weight: 700; }
.side .count { margin-left: auto; background: var(--bg); color: var(--ink-2); font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; font-variant-numeric: tabular-nums; }
.side-foot { padding: .6rem; border-top: 1px solid var(--line); }
.side-foot a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 10px; color: var(--ink-3); text-decoration: none; font-size: .88rem; font-weight: 600; }
.side-foot a:hover { background: var(--bg); color: var(--ink); }

.dmain { flex: 1; min-width: 0; padding-bottom: 72px; }
.dtop { position: sticky; top: 0; z-index: 5; background: rgba(244, 246, 250, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.dtop-inner { padding: .6rem 1rem; display: flex; gap: .75rem; align-items: center; min-height: 60px; }
.dtop h1 { font-size: 1.2rem; margin: 0; letter-spacing: -.01em; white-space: nowrap; }

.gsearch { position: relative; flex: 0 1 340px; margin-left: 1rem; display: none; }
.gsearch .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 1rem; height: 1rem; }
.gsearch input { min-height: 38px !important; padding: .4rem .75rem .4rem 2.2rem !important; border-radius: 10px !important; background: var(--card) !important; font-size: .9rem; border: 1px solid var(--line) !important; }
@media (min-width: 1000px) { .gsearch { display: block; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar.empty { background: var(--bg); color: var(--ink-3); border: 1px dashed var(--line); }
.owner { display: inline-flex; align-items: center; gap: .45rem; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu, .bell .menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(23, 32, 58, .16); min-width: 220px; padding: .4rem; z-index: 20; }
.usermenu .menu-head, .bell .menu-head { padding: .55rem .7rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.usermenu .menu-head strong, .bell .menu-head strong { display: block; }
.usermenu .menu-head span { font-size: .8rem; color: var(--ink-3); }
.usermenu .menu a, .usermenu .menu button, .bell .menu a { display: flex; gap: .5rem; align-items: center; width: 100%; padding: .55rem .7rem; border-radius: 9px; color: var(--ink); text-decoration: none; font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; text-align: left; }
.dbody { padding: 1rem; max-width: 1280px; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; color: #c9d1ea; text-decoration: none; font-size: .78rem; font-weight: 600; }
.bottom-nav a.on { color: #fff; }
.bottom-nav .icon { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .side { display: flex; }
  .bottom-nav { display: none; }
  .dmain { padding-bottom: 0; }
  .dtop-inner, .dbody { padding-left: 1.5rem; padding-right: 1.5rem; }
}

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); display: block; }
.kpi .v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpis-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1100px) { .kpis-4 { grid-template-columns: repeat(4, 1fr); } }
.kpis-4 .kpi { padding: 1rem 1.1rem; }
.kpis-4 .kpi .v { font-size: 2.2rem; margin: .35rem 0 .2rem; }
.kpi-top { display: flex; align-items: center; gap: .55rem; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--navy-soft); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; }
.kpi-ico .icon { width: 17px; height: 17px; }
.kpi.alert .kpi-ico { background: var(--st-overdue-bg); color: var(--st-overdue); }
.kpi-foot { font-size: .82rem; color: var(--ink-3); min-height: 1.2em; }
.delta { font-weight: 700; font-size: .78rem; padding: .05rem .4rem; border-radius: 6px; margin-right: .2rem; }
.delta.good { color: var(--st-done); background: var(--st-done-bg); }
.delta.bad { color: var(--st-overdue); background: var(--st-overdue-bg); }
.kpi .l { color: var(--ink-3); font-size: .85rem; font-weight: 600; }
.kpi.alert { border-color: #f3b4ad; background: #fff7f6; }
.kpi.alert .v { color: var(--st-overdue); }

.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-detail { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); } }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 2.5rem; gap: .25rem .75rem; align-items: center; padding: .35rem 0; }
.bars .name { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; min-width: 0; }
.bars .name a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bars .track { grid-column: 1 / -1; height: 6px; gap: 2px; background: var(--navy-soft); border-radius: 99px; overflow: hidden; display: flex; }
.bars .fill { height: 100%; background: var(--navy-2); }
.bars .fill.late { background: var(--st-overdue); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }

/* filters */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; min-height: 36px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .n { font-size: .75rem; opacity: .8; }
.filters { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; margin-top: .75rem; }
.filters .q { grid-column: 1 / -1; position: relative; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(4, 1fr); } .filters .q { grid-column: auto; } }

/* complaint table (cards on mobile) */
.ctable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ctable th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: .6rem .75rem; background: #f9fafc; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.ctable td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .95rem; }
.ctable tr:last-child td { border-bottom: 0; }
.ctable .ref a { font-weight: 800; color: var(--navy); text-decoration: none; font-variant-numeric: tabular-nums; }
.ctable .cat { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.ctable .cat .icon { color: var(--navy-2); }
.ctable .sub { font-size: .82rem; color: var(--ink-3); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctable .sel { width: 36px; }
.ctable .sel input { width: 20px; height: 20px; }
.age-late { color: var(--st-overdue); font-weight: 800; }

@media (max-width: 760px) {
  .ctable, .ctable tbody, .ctable tr, .ctable td { display: block; width: 100%; }
  .ctable thead { display: none; }
  .ctable { background: none; border: 0; box-shadow: none; }
  .ctable tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .6rem; padding: .7rem .8rem .7rem 2.8rem; position: relative; box-shadow: var(--shadow); }
  .ctable td { border: 0; padding: .1rem 0; }
  .ctable td.sel { position: absolute; left: .7rem; top: .8rem; width: auto; }
  .ctable td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: .8rem; font-weight: 600; }
  .ctable .hide-m { display: none; }
}

.bulkbar { position: sticky; bottom: 72px; z-index: 6; background: var(--navy); color: #fff; border-radius: 12px; padding: .6rem .75rem; margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; box-shadow: 0 6px 20px rgba(23,32,58,.3); }
.bulkbar select, .bulkbar input { min-height: 38px; padding: .3rem .5rem; font-size: .9rem; width: auto; flex: 1 1 140px; }
@media (min-width: 900px) { .bulkbar { bottom: 1rem; } }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: .5rem; }

/* detail */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .875rem; font-weight: 600; }
.dl dd { margin: 0; font-weight: 500; }
.status-form { border: 2px solid var(--navy-soft); }
.status-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-opts label { margin: 0; }
.status-opts input { position: absolute; opacity: 0; }
.status-opts span { display: inline-flex; padding: .45rem .8rem; border-radius: 999px; border: 2px solid var(--line); font-weight: 600; font-size: .9rem; cursor: pointer; background: #fff; min-height: 40px; align-items: center; }
.status-opts input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.status-opts input:focus-visible + span { outline: 3px solid #8fa4e8; }
.history .ev { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.history .ev:last-child { border-bottom: 0; }

/* settings tables */
.stable { width: 100%; border-collapse: collapse; }
.stable th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: .5rem; border-bottom: 1px solid var(--line); }
.stable td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stable tr.off td { color: var(--ink-3); background: var(--bg); }  /* hidden rows: greyed but still readable */
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .4rem; }
.icon-pick label { margin: 0; position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: flex; align-items: center; justify-content: center; height: 56px; border: 2px solid var(--line); border-radius: 10px; color: var(--navy); background: #fff; cursor: pointer; }
.icon-pick input:checked + span { border-color: var(--saffron); background: var(--saffron-soft); }
.icon-pick input:focus-visible + span { outline: 3px solid #8fa4e8; }
.radio-card { display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--line); border-radius: 10px; padding: .75rem; cursor: pointer; font-weight: 600; margin-bottom: .5rem; background: #fff; }
.radio-card input { margin-top: .25rem; width: 18px; height: 18px; }
.radio-card:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); }
.login-card { width: 100%; max-width: 380px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; background: #fff; padding: .25rem .6rem; border-radius: 8px; border: 1px dashed var(--saffron); }

/* overview */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; }
.hello h2 { font-size: 1.45rem; margin: 0 0 .15rem; letter-spacing: -.02em; }
.hello p { margin: 0; color: var(--ink-3); }
@media (min-width: 1000px) { .grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.latetag { color: var(--st-overdue); font-weight: 700; font-size: .82rem; white-space: nowrap; }
.grid-2 > *, .grid-main > * { min-width: 0; }
@media (max-width: 600px) { .trend .axis { font-size: 20px; } .trend .tip { display: none; } }

.trend .hit:hover .cross, .trend .hit:hover circle, .trend .hit:hover .tip,
.legend b { color: var(--ink); font-weight: 700; margin-left: .15rem; }
.legend .sw-late { background: var(--st-overdue); }
.legend .sw-open { background: var(--navy-2); }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people .who { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rows { list-style: none; margin: 0 -.5rem; padding: 0; }
.row-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .5rem; border-radius: 12px; text-decoration: none; color: var(--ink); }
.cat-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--navy-soft); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.cat-ico .icon { width: 18px; height: 18px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: .82rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }

/* reports & print */
.rep-head { display: flex; gap: 1rem; align-items: center; }
.rep-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
@media print {
  .side, .bottom-nav, .dtop, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .dbody { padding: 0; max-width: none; }
}

/* ========== HINDI TYPOGRAPHY ==========
   Devanagari has tall matras above and below the line: it needs more line height,
   lighter weights (800 looks blotchy), and no uppercase / letter-spacing tricks. */
html:lang(hi) body { line-height: 1.6; }
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3 { font-weight: 600; line-height: 1.4; letter-spacing: 0; }
html:lang(hi) .side-brand, html:lang(hi) .big-action strong, html:lang(hi) .hello h2 { font-weight: 600; letter-spacing: 0; }
html:lang(hi) .btn, html:lang(hi) .chip, html:lang(hi) label { font-weight: 500; }
html:lang(hi) .badge { font-weight: 500; letter-spacing: 0; padding: .1rem .55rem; }
html:lang(hi) .side nav a { font-weight: 500; }
html:lang(hi) .side .group, html:lang(hi) .ctable th, html:lang(hi) .stable th { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; }
html:lang(hi) .kpi .l, html:lang(hi) .kpi-top .l { font-weight: 500; font-size: .9rem; }
html:lang(hi) .kpi-foot, html:lang(hi) .row-sub, html:lang(hi) .sub, html:lang(hi) .people .nums { font-size: .85rem; }
html:lang(hi) .row-title, html:lang(hi) .people .who, html:lang(hi) .bars .name, html:lang(hi) .ctable .cat { font-weight: 500; }
html:lang(hi) .latetag { font-weight: 600; }
html:lang(hi) .delta { font-weight: 600; }
html:lang(hi) .hello p { font-size: 1.02rem; }
html:lang(hi) .legend { font-size: .85rem; }

/* ========== 3D PICTURES (Fluent emoji) ========== */
.ic3d { display: inline-block; flex: none; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(23, 32, 58, .14)); }
.ic3d-sm { width: 22px; height: 22px; filter: none; }
.ic3d-md { width: 32px; height: 32px; }
.ic3d-lg { width: 46px; height: 46px; }
.ic3d-xl { width: 76px; height: 76px; }

/* Category tiles: bigger picture, lift on hover/selection. */
.cat-tile label, .cat-link { gap: .5rem; transition: transform .12s ease, box-shadow .12s ease; }
.cat-tile label .ic3d, .cat-link .ic3d { transition: transform .15s ease; }
.cat-tile label:hover, .cat-link:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(23, 32, 58, .10); }
.cat-tile label:hover .ic3d, .cat-link:hover .ic3d, .cat-tile input:checked + label .ic3d { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .cat-tile label, .cat-link, .ic3d { transition: none; } }

/* Big home actions: picture sits on a soft white disc. */
.big-action .ico { background: rgba(255, 255, 255, .6); }
.big-action .ico .ic3d { width: 38px; height: 38px; }

.success-pic { display: flex; justify-content: center; margin: .25rem 0 .75rem; }
.photo-pick .ic3d { width: 30px; height: 30px; }
.rows .row-link > .ic3d { width: 30px; height: 30px; }
.icon-pick span .ic3d { width: 34px; height: 34px; }
.ctable .cat .ic3d { width: 22px; height: 22px; }

/* ========== RESIDENT PAGES: STEPS + DESKTOP LAYOUT ========== */
.pub-back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pub-back .icon { width: 22px; height: 22px; }
.pub-back:hover { background: var(--navy-soft); }

.stepper { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; gap: .5rem; align-items: center; font-size: .9rem; font-weight: 600; color: var(--ink-3); }
.stepper li { display: flex; align-items: center; gap: .45rem; }
.stepper li + li::before { content: ""; width: 28px; height: 2px; background: var(--line); border-radius: 2px; margin-right: .1rem; }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--ink-2); font-size: .82rem; }
.stepper li.on { color: var(--ink); }
.stepper li.on span { background: var(--navy); color: #fff; }
.stepper li.done span { background: var(--st-done); color: #fff; }
.stepper li.done span .icon { width: 14px; height: 14px; }
.stepper li.done a { display: flex; align-items: center; gap: .45rem; color: var(--st-done); text-decoration: none; }

.chosen { display: flex; align-items: center; gap: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.chosen-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.chosen-text strong { font-size: 1.1rem; }
.chosen .ext, .cat-link .ext { font-size: .72rem; font-weight: 600; color: var(--st-other); }

.report-form .card h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.report-cols { display: grid; gap: 1rem; }
.submit-bar { position: sticky; bottom: 0; z-index: 5; margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(244, 246, 250, 0)); }

.cat-link { position: relative; }
.home-top, .home-info { display: grid; gap: 1rem; }
.home-actions { display: grid; gap: 1rem; }

/* Desktop: a real full-width site instead of a phone column. */
@media (min-width: 760px) {
  .pub-top-inner, .pub-main, .pub-foot { max-width: 1120px; }
  .pub-main { padding: 1.75rem 1.5rem 3rem; }
  .pub-main.narrow { max-width: 640px; }
  .pub-top-inner { padding: .75rem 1.5rem; }
  .cat-grid-wide { grid-template-columns: repeat(4, 1fr); gap: .85rem; }
  .cat-grid-wide .cat-link { min-height: 128px; font-size: 1rem; }
  .home-info { grid-template-columns: 1fr 1fr; align-items: start; }
  .submit-bar { position: static; background: none; margin: 1.25rem 0 0; padding: 0; }
  .submit-bar .btn { max-width: 420px; margin-left: auto; display: flex; }
}
@media (min-width: 900px) {
  .home-top { grid-template-columns: 1.15fr 1fr; align-items: stretch; }
  .home-top .hero { padding: 2rem; }
  .home-top .hero h1 { font-size: 1.8rem; }
  .home-top .hero-photo, .home-top .hero-photo-ph { width: 104px; height: 104px; }
  .home-actions .big-action { height: 100%; }
  .report-cols { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
@media (min-width: 1100px) {
  .cat-grid-wide { grid-template-columns: repeat(5, 1fr); }
}

/* Resident: list of my complaints (track by mobile number) */
.my-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.my-item { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.my-item:hover { border-color: #c4cad8; }
.my-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.my-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-status { flex: none; }
.my-item .chev { transform: rotate(180deg); color: var(--ink-3); width: 18px; height: 18px; flex: none; }
@media (max-width: 420px) { .my-item { flex-wrap: wrap; } .my-status { order: 3; margin-left: 2.8rem; } .my-item .chev { display: none; } }

/* 3D icons in the dashboard */
.ic3d-nav { width: 22px; height: 22px; filter: none; }
.ic3d-tab { width: 24px; height: 24px; filter: none; }
.ic3d-kpi { width: 22px; height: 22px; filter: none; }
.ic3d-greet { width: 30px; height: 30px; vertical-align: -5px; margin-left: .15rem; }
.side nav a.sub .ic3d-nav { width: 18px; height: 18px; }
.kpi-ico { background: var(--bg); }
.kpi.alert .kpi-ico { background: var(--st-overdue-bg); }
.bottom-nav a .ic3d { opacity: .55; filter: saturate(.6); transition: opacity .15s; }
.bottom-nav a.on .ic3d { opacity: 1; filter: none; }

/* ========== COMPLAINT DETAIL ========== */
.cd-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cd-head-main { flex: 1; min-width: 0; }
.cd-head h2 { font-size: 1.45rem; margin: .1rem 0 .2rem; letter-spacing: -.01em; }
.cd-ref { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.cd-where { color: var(--ink-2); }
.cd-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; text-align: right; }
.cd-owner { display: flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--ink-2); }
@media (max-width: 640px) { .cd-head { flex-wrap: wrap; } .cd-head-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; } }

.cd-grid { display: grid; gap: 1rem; }
@media (min-width: 1000px) {
  .cd-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .cd-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; padding-bottom: .5rem; }
}
.cd-side { display: grid; gap: 1rem; align-content: start; }
.cd-side > * { margin: 0; }
.cd-desc { white-space: pre-line; font-size: 1.02rem; background: var(--bg); border-radius: 12px; padding: .75rem .9rem; }
.cd-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.25rem; margin: 0 0 1rem; }
@media (min-width: 700px) { .cd-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cd-facts dt { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.cd-facts dd { margin: 0; font-weight: 500; }
.cd-facts .wide { grid-column: 1 / -1; }
.cd-resident { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .9rem; }

/* Photo strip */
.strip { display: flex; gap: .65rem; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x mandatory; }
.strip-item { flex: 0 0 auto; width: 220px; scroll-snap-align: start; text-decoration: none; color: var(--ink-2); }
.strip-item img { width: 220px; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.strip-cap { display: inline-block; font-size: .76rem; margin-top: .3rem; padding: .05rem .5rem; border-radius: 999px; background: var(--bg); }
.strip-cap.tag-resolution { background: var(--st-done-bg); color: var(--st-done); font-weight: 600; }
.strip-cap.tag-report { background: var(--navy-soft); color: var(--navy); }
.empty-note { display: flex; align-items: center; gap: .75rem; color: var(--ink-3); padding: .5rem 0; }

/* Before / after slider */
.ba { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg); user-select: none; max-height: 460px; width: 100%; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; }
.ba-line::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-tag { position: absolute; top: .6rem; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); pointer-events: none; }
.ba-tag-l { left: .6rem; }
.ba-tag-r { right: .6rem; background: rgba(24, 121, 78, .85); }

/* Dashboard timeline */
.note-box { margin-bottom: 1.1rem; }
.note-box textarea { min-height: 64px; margin-bottom: .5rem; }
.tl-dash .what { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.tl-dash .when { margin-top: .15rem; }

/* ========== SHAREABLE REPORT CARD (fixed brand colours) ========== */
.rc-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.rc-stage { display: flex; justify-content: center; padding: 1rem 0 2rem; overflow-x: auto; }
.rc { width: 540px; height: 675px; flex: none; background: #fffaf2; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
      box-shadow: 0 18px 50px rgba(23, 32, 58, .22); color: #17203a; font-family: var(--font); position: relative; }
.rc-top { display: flex; align-items: center; gap: 16px; padding: 16px 22px; color: #fff;
          background: radial-gradient(rgba(255,255,255,.07) 1.4px, transparent 1.5px) 0 0 / 14px 14px, linear-gradient(140deg, #1f2d5c 0%, #2b3d7a 100%); }
.rc-photo { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 3px solid #f08c00; flex: none; background: #2b3d7a; }
.rc-initials { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; color: #fff; }
.rc-kicker { font-size: 13px; opacity: .85; }
.rc-name { font-size: 24px; font-weight: 700; line-height: 1.4; }
.rc-title { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; background: #f08c00; color: #1b1300; padding: 2px 10px; border-radius: 999px; }
.rc-stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 8px; padding: 12px 20px 4px; }
.rc-stat { background: #fff; border-radius: 14px; padding: 10px 10px 9px; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(23,32,58,.08); }
.rc-stat b { font-size: 27px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; color: #1f2d5c; font-variant-numeric: tabular-nums; }
.rc-stat span { font-size: 11.5px; color: #4a5470; line-height: 1.45; }
.rc-stat em { font-style: normal; font-size: 11px; color: #5b6480; margin-top: 3px; }
.rc-stat.big { background: #1f2d5c; }
.rc-stat.big b { color: #fff; font-size: 34px; }
.rc-stat.big span { color: #dfe5f7; font-weight: 600; }
.rc-stat.big em { color: #aab4d4; }
.rc-ba { display: grid; gap: 8px; padding: 6px 20px; align-content: start; }
.rc-pair { background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 1px 3px rgba(23,32,58,.08); }
.rc-pair-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rc-pair figure { margin: 0; position: relative; }
.rc-pair-imgs img { width: 100%; height: 84px; object-fit: cover; border-radius: 9px; display: block; }
.rc-pair-label .ic3d { width: 20px; height: 20px; }
.rc-pair figcaption { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 1px 8px; border-radius: 999px; }
.rc-pair figcaption.after { background: #18794e; }
.rc-pair-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.rc-cats { flex: 1; padding: 10px 20px; }
.rc-cat { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-weight: 600; }
.rc-cat span { flex: 1; }
.rc-cat b { font-size: 20px; color: #1f2d5c; }
.rc-h { font-size: 13px; font-weight: 700; color: #4a5470; margin: 4px 0 6px; }
.rc-streets { padding: 0 20px 6px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chips span { background: #fff1d6; color: #7a4400; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.rc-foot { margin-top: auto; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #fff; border-top: 3px solid #f08c00; }
.rc-qr { width: 72px; height: 72px; flex: none; image-rendering: pixelated; }
.rc-cta { font-weight: 700; font-size: 15px; color: #1f2d5c; line-height: 1.35; }
.rc-url { font-size: 13px; color: #4a5470; font-weight: 600; }
@media (max-width: 600px) { .rc-stage { justify-content: flex-start; } .rc { transform: scale(.66); transform-origin: top left; margin-bottom: -230px; } }

/* ========== TOASTS ========== */
.toasts { position: fixed; z-index: 50; right: 1rem; top: 72px; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; max-width: min(380px, calc(100vw - 2rem)); }
@media (max-width: 899px) { .toasts { top: auto; bottom: 84px; left: 1rem; right: 1rem; max-width: none; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; border-radius: 14px; background: #1d1d1f; color: #fff;
         box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; animation: toast-in .25s ease-out, toast-out .4s ease-in 4s forwards; }
.toast-error, .toast-warn { animation: toast-in .25s ease-out, toast-out .4s ease-in 9s forwards; }
.toast-ico { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; font-size: .85rem; }
.toast-ok .toast-ico { background: #34c759; color: #0b2e14; }
.toast-error .toast-ico { background: #ff453a; color: #fff; }
.toast-warn .toast-ico { background: #ffb340; color: #3d2500; }
.toast-msg { flex: 1; min-width: 0; }
.toast-x { background: none; border: 0; color: #fff; opacity: .6; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.toast-x:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: toast-out 0s linear 5s forwards; } }

/* ========== SPARKLINES ========== */
.sp-open .spark-line { stroke: var(--series-1); } .sp-open .spark-area, .sp-open circle { fill: var(--series-1); }
.sp-late .spark-line { stroke: var(--st-overdue); } .sp-late .spark-area, .sp-late circle { fill: var(--st-overdue); }
.sp-done .spark-line { stroke: var(--st-done); } .sp-done .spark-area, .sp-done circle { fill: var(--st-done); }

/* ========== SIDEBAR PHOTO ========== */
.side-brand .logo-photo { object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px var(--saffron); padding: 0; }

/* ========== EMPTY STATES ========== */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.6rem 1rem; color: var(--ink-3); }
.empty-state strong { color: var(--ink); font-size: 1.02rem; margin-top: .35rem; }
.empty-state span { font-size: .9rem; }
.bars li:has(.empty-state), .stable td:has(.empty-state) { display: block; border: 0; }

/* ========== LIST / BOARD SWITCH ========== */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23,32,58,.12); }

/* ========== BOARD ========== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.board-col { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: .75rem; min-height: 200px; }
.board-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.board-count { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.board-cards { display: grid; gap: .6rem; }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .75rem; box-shadow: var(--shadow); }
.bcard-link { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.bcard-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bcard-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard-meta { display: flex; align-items: center; gap: .45rem; margin-top: .55rem; }
.bcard-actions { margin-top: .55rem; padding-top: .55rem; border-top: 1px dashed var(--line); }
.board-more { text-align: center; font-size: .88rem; padding: .4rem; }
.board .empty-state { padding: 1rem .5rem; }
.board .empty-state .ic3d-xl { width: 48px; height: 48px; }

/* ========== ONE-CLICK ACTIONS ========== */
.qa { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.qa-btn { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px;
          padding: .25rem .65rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.qa-btn:hover { border-color: var(--navy-2); color: var(--navy); }
.qa-btn.qa-go { background: var(--navy-soft); border-color: transparent; color: var(--navy); }
.qa-btn.htmx-request { opacity: .5; pointer-events: none; }
@media (min-width: 761px) {
}

/* ========== NOTIFICATION BELL ========== */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover { background: var(--bg); }
.bell-dot { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--st-overdue); color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--card); }
.bell[open] .bell-dot { display: none; }
.bell-menu { width: 340px; max-height: 70vh; overflow-y: auto; }
.bell-item { display: flex !important; align-items: flex-start !important; gap: .65rem !important; }
.bell-item.unread { background: var(--navy-soft); }
.bell-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bell-text span { font-size: .85rem; color: var(--ink-2); }
.bell-text em { font-style: normal; font-size: .76rem; color: var(--ink-3); }
@media (max-width: 600px) { .bell-menu { position: fixed !important; left: .75rem; right: .75rem; top: 64px !important; width: auto; } }

/* ========== MAP ========== */
.map { height: calc(100vh - 230px); min-height: 380px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1; }
.map-legend i { border-radius: 50%; }
.map-legend .pin-late { background: #c0271d; }
.map-legend .pin-open { background: #e08a00; }
.map-legend .pin-done { background: #18794e; }
.map-pop { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #17203a; min-width: 200px; }
.map-pop img { width: 34px; height: 34px; }
.map-pop span { display: flex; flex-direction: column; line-height: 1.35; }
.map-pop em { font-style: normal; font-size: .8rem; color: #5b6480; }
.map-pop b { font-size: .78rem; color: #1f2d5c; }
.leaflet-container { font-family: var(--font); }

/* Report form: location button */
.geo .btn { border-style: dashed; }
.geo .btn.geo-done { border-style: solid; border-color: var(--st-done); color: var(--st-done); background: var(--st-done-bg); }

/* Google Maps buttons on the complaint page and map pop-ups */
.gmaps { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.map-gmaps { display: block; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #e5e5ea; font-weight: 600; font-size: .85rem; }
.views { margin-bottom: .85rem; }
.row > .views { margin-bottom: 0; }

/* ========== PHONE FIXES (checked at 320–430 px: iPhone SE/15/Pro Max, Galaxy, Pixel, Redmi, Vivo, Oppo) ========== */
/* Notch / rounded corners: keep content out of the unsafe areas when viewport-fit=cover. */
.pub-top-inner, .dtop-inner, .pub-main, .dbody {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.bottom-nav { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* Grid/flex children may shrink below their content (stops wide photo strips etc. pushing the page). */
.cd-grid > *, .cd-side > *, .cd-main > *, .grid-2 > *, .grid-main > *, .home-top > *, .report-cols > * { min-width: 0; }

/* Bigger tap targets. */
.pub-brand { min-height: 40px; }
.qa-btn { min-height: 34px; padding: .3rem .75rem; }
.people .who, .bars .name a, .card-title > a.small { padding: .45rem 0; display: inline-block; }
details > summary { padding: .35rem 0; }

@media (max-width: 759px) {
  .hide-m { display: none !important; }
  /* Top bar: "New complaint" lives in the bottom bar on phones. */
  .dtop .top-new { display: none; }
  .dtop-inner { gap: .5rem; min-height: 56px; }
  .dtop h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.1rem; }
  .dtop .btn-sm { padding: .3rem .6rem; }
  .bell summary { width: 36px; height: 36px; }
  .avatar { width: 32px; height: 32px; }

  /* Bottom bar: five equal slots; long labels trimmed rather than overflowing. */
  .bottom-nav a { flex: 1 1 0; min-width: 0; padding: .45rem .15rem .5rem; }
  .bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Complaint cards: the whole card opens the complaint; checkbox and buttons stay tappable. */
  .ctable tr { position: relative; }
  .ctable .ref a::after { content: ""; position: absolute; inset: 0; }
  .ctable td.sel { z-index: 1; }
  .ctable .row-qa, .ctable .qa-btn { position: relative; z-index: 1; }

  /* Tables with many columns scroll inside their card instead of widening the page. */
  .card:has(> .stable), section.card:has(.stable) { overflow-x: auto; }
  .stable { min-width: 0; }

  .cd-head h2 { font-size: 1.25rem; }
  .cd-resident .btn-sm { flex: 1 1 auto; justify-content: center; }
  .strip-item, .strip-item img { width: 180px; }
  .strip-item img { height: 135px; }
  .ba { max-height: 300px; }
  .kpis-4 .kpi .v { font-size: 1.9rem; }
}
@media (max-width: 400px) {
  .hide-xs { display: none !important; }
  .bottom-nav a { font-size: .66rem; }
  .cat-grid { gap: .5rem; }
  .cat-tile label, .cat-link { min-height: 92px; padding: .5rem .3rem; font-size: .9rem; }
  .kpi-top .l { font-size: .8rem; }
  .hello h2 { font-size: 1.25rem; }
  .hello { flex-wrap: wrap; }
  .seg a { padding: .4rem .65rem; }
  .rc-toolbar .btn { flex: 1 1 auto; justify-content: center; }
}
.bell:not([open]) > .menu, .usermenu:not([open]) > .menu { display: none !important; }
.chip { position: relative; } .stepper li.done a { min-height: 40px; }
.gmaps .btn { white-space: normal; text-align: left; max-width: 100%; } .cd-head-main { min-width: 0; }

/* Home: new vs returning visitor */
.track-link { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; padding: .6rem 1rem;
              border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; background: var(--card); border: 1px dashed var(--line); }
.track-link:hover { color: var(--navy); border-color: var(--navy-2); }
.mine { padding: .9rem 1rem; }
.mine .card-title { margin-bottom: .6rem; }
.mine .card-title h2 { font-size: 1.05rem; }
.mine .my-item { box-shadow: none; padding: .65rem .75rem; }
.mine-more { display: block; text-align: center; margin-top: .6rem; font-weight: 600; font-size: .92rem; }
@media (min-width: 900px) { .home-actions { align-content: start; } .home-actions .big-action { height: auto; min-height: 110px; } }
@media (min-width: 900px) { .home-top { align-items: start; } }

/* ========== HOME LAYOUT (balanced on desktop) ========== */
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; counter-reset: none; }
.how li { position: relative; display: flex; align-items: center; gap: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem; box-shadow: var(--shadow); }
.how-n { position: absolute; top: .55rem; left: .6rem; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.how li .ic3d { margin-left: 1.3rem; }
.how-t { font-weight: 600; line-height: 1.4; }
.track-link { border-style: solid; font-size: 1rem; }

@media (min-width: 900px) {
  /* Top row: both columns the same height; the orange button grows, the status link stays one row. */
  .home-top:not(:has(.mine)) { align-items: stretch; }
  .home-top:not(:has(.mine)) .home-actions { grid-template-rows: 1fr auto; }
  .home-top:not(:has(.mine)) .big-action.primary { height: 100%; }
  .home-actions .big-action strong { font-size: 1.35rem; }
  .track-link { min-height: 64px; }

  /* "How it works": four steps across the full width. */
  .home-info { grid-template-columns: 1fr; }
  .how { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .how li { flex-direction: column; text-align: center; padding: 1.4rem 1rem 1.2rem; gap: .6rem; }
  .how li .ic3d { margin-left: 0; width: 56px; height: 56px; }
  .how-n { top: .75rem; left: .75rem; }
}
@media (min-width: 600px) and (max-width: 899px) { .how { grid-template-columns: 1fr 1fr; } }

/* Home: "Reported before? Check the status" as a highlighted secondary button. */
.track-link { background: var(--navy-soft); border: 2px solid var(--navy-2); color: var(--navy); font-weight: 700; box-shadow: var(--shadow);
              transition: background .15s, transform .12s; }
.track-link .ic3d { width: 30px; height: 30px; padding: 4px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(23, 32, 58, .15); }
.track-link:hover, .track-link:active { background: var(--card); color: var(--navy); border-color: var(--navy); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .track-link { transition: none; } .track-link:hover { transform: none; } }

/* Home: main "Report a problem" button, highlighted (dark text kept for contrast on orange). */
.home-actions .big-action.primary {
  background: linear-gradient(135deg, #ffa31a 0%, #f08c00 55%, #e07800 100%);
  border: 0; box-shadow: 0 5px 0 #b86200, 0 10px 26px rgba(240, 140, 0, .38);
  transition: transform .12s, box-shadow .12s; margin-bottom: 5px;
}
.home-actions .big-action.primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #b86200, 0 14px 30px rgba(240, 140, 0, .45); }
.home-actions .big-action.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #b86200, 0 6px 16px rgba(240, 140, 0, .35); }
.home-actions .big-action.primary .ico { background: #fff; box-shadow: 0 2px 6px rgba(120, 60, 0, .2); }
.home-actions .big-action.primary strong { font-size: 1.3rem; font-weight: 800; color: #1b1300; }
.home-actions .big-action.primary strong + span { color: #3d2600; font-weight: 500; }
.big-action .go { margin-left: auto; flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #b86200;
                  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800; }
@media (min-width: 900px) { .home-actions .big-action.primary strong { font-size: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { .home-actions .big-action.primary { transition: none; } .home-actions .big-action.primary:hover { transform: none; } }

/* Report form: optional extras + consent */
.check.consent { align-items: flex-start; font-size: .92rem; color: var(--ink-2); line-height: 1.45; margin: 0; }
.check.consent input { margin-top: .15rem; flex: none; }

/* ========== CITIZENS (admin) ========== */
.kpis-cit { grid-template-columns: repeat(2, minmax(0, 220px)); }
.cit-filters { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .cit-filters { grid-template-columns: 2fr 1fr 1fr 1fr; } .cit-filters .q { grid-column: auto; } }
.cit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cit-item { display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.cit-item:hover { border-color: var(--navy-2); }
.cit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.cit-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cit-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.4; }
.cit-consent { width: 64px; display: flex; justify-content: flex-end; }
@media (max-width: 600px) { .cit-meta .muted { display: none; } .cit-consent { width: auto; } }
.cit-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cit-avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.cit-head-main { flex: 1; min-width: 200px; }
.cit-head-main h2 { margin: 0 0 .15rem; font-size: 1.4rem; }
.cit-actions { display: flex; gap: .5rem; }
.consent-card.is-yes { border-color: #b5e2c8; }

/* Multi-photo picker */
.multi-photo .mp-count { font-size: .85rem; color: var(--ink-3); }
.mp-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.mp-thumbs:empty { display: none; }
.mp-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.mp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mp-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.mp-more { aspect-ratio: 1; border-radius: 12px; border: 2px dashed #b9c1d3; background: var(--card); color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
.multi-photo .hint { margin-top: .45rem; }

.act-table tr.act-warn td:first-child { box-shadow: inset 3px 0 0 var(--st-progress); }

/* Phones: "How it works" is secondary information; keep it quiet under the two main buttons. */
@media (max-width: 899px) {
  .home-info .section-head h2 { font-size: 1rem; color: var(--ink-2); font-weight: 600; }
  .how { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .25rem .85rem; }
  .how li { background: none; border: 0; box-shadow: none; border-radius: 0; padding: .55rem 0; gap: .7rem; }
  .how li + li { border-top: 1px solid var(--line); }
  .how-n { position: static; flex: none; width: 20px; height: 20px; font-size: .7rem; background: var(--line); color: var(--ink-2); }
  .how li .ic3d { margin-left: 0; width: 26px; height: 26px; filter: none; opacity: .9; }
  .how-t { font-weight: 400; font-size: .92rem; color: var(--ink-2); }
}

/* Resident profile */
.profile-cta { display: flex; align-items: center; gap: .85rem; margin-top: 1.25rem; padding: 1rem; border-radius: 16px; text-decoration: none;
               color: var(--navy); background: var(--navy-soft); border: 2px solid var(--navy-2); }
.profile-cta strong { display: block; font-size: 1.05rem; }
.profile-cta span span { display: block; font-size: .85rem; color: var(--ink-2); }
.profile-cta .go { background: var(--card); color: var(--navy); }
.have { font-size: .75rem; font-weight: 600; color: var(--st-done); background: var(--st-done-bg); padding: .05rem .45rem; border-radius: 999px; margin-left: .3rem; }
.field.sensitive { background: var(--bg); border-radius: 12px; padding: .75rem; border: 1px dashed var(--line); }
.sensitive-val { color: var(--ink-2); }
.profile-cta .go { flex: none; margin-left: auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
                   font-size: 1.2rem; background: var(--navy); color: #fff; }
.profile-cta > span:nth-child(2) { flex: 1; min-width: 0; }
.req { color: var(--danger, #c0392b); font-weight: 700; margin-left: .15rem; }
label.check { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; font-weight: 500; }
.field > .label { font-weight: 600; margin-bottom: .4rem; }
label.check.wa-same { margin: 0 0 .5rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); align-items: flex-start; }
label.check.wa-same input { flex: none; margin-top: .1rem; }

/* Privacy notice + consent */
.notice-box { margin: 1rem 0; padding: .9rem 1rem; border-radius: 14px; background: var(--navy-soft); border: 1px solid var(--line); }
.notice-box p { margin: 0 0 .6rem; color: var(--ink-2); }
.notice-box label.check { align-items: flex-start; font-weight: 600; }
.notice-box label.check input { flex: none; margin-top: .15rem; }
.notice-box.has-err { border-color: var(--danger, #c0392b); }
.privacy h2 { font-size: 1.05rem; margin: 1.3rem 0 .4rem; }
.privacy ul { padding-left: 1.2rem; margin: 0; }
.privacy li { margin: .3rem 0; }
.privacy .pp-short { border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: .2rem 1rem .8rem; margin: 1rem 0; }
.privacy .pp-short h2 { margin-top: .8rem; }
.notice-box label.check.optional { font-weight: 500; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--line); }

/* Streets: hide / delete */
.street-actions { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.btn-danger-ghost { color: var(--danger, #c0392b); border-color: color-mix(in srgb, var(--danger, #c0392b) 35%, transparent); background: transparent; }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger, #c0392b) 10%, transparent); }
tr.off td input { color: var(--ink-3); background: var(--bg); }
@media (min-width: 900px) { .streets-grid { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); align-items: start; } }
.street-edit input { flex: 1 1 0; min-width: 9rem; }

/* Clickable complaint rows */
.ctable tr[data-href] { cursor: pointer; }
.ctable tr[data-href]:hover td { background: var(--navy-soft); }
/* Delete + recycle bin */
.danger-zone { margin-top: 1rem; }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--danger, #c0392b); display: flex; align-items: center; gap: .5rem; }
.danger-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.danger-form p { flex-basis: 100%; margin: 0; }
.danger-form input { flex: 1 1 16rem; }
.btn-danger { background: var(--danger, #c0392b); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.08); }
.bin-actions { display: flex; gap: .4rem; justify-content: flex-end; white-space: nowrap; }
.name-edit input { min-width: 10rem; }

/* Bell: ring animation, sound toggle, live toast */
@keyframes bell-ring { 0%,100% { transform: rotate(0); } 10%,30%,50%,70% { transform: rotate(-16deg); } 20%,40%,60%,80% { transform: rotate(16deg); } 90% { transform: rotate(-6deg); } }
.bell.ringing summary img { animation: bell-ring 1.2s ease-in-out 3; transform-origin: 50% 8%; }
.bell.ringing .bell-dot { animation: bell-ring .6s ease-in-out 3; }
.sound-toggle { margin-left: auto; font: inherit; font-size: .8rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: .15rem .6rem; cursor: pointer; }
.sound-toggle.off { color: var(--ink-2); }
.bell-menu .menu-head { display: flex; align-items: center; gap: .5rem; }
a.toast-ring { text-decoration: none; color: inherit; border-left: 4px solid var(--saffron, #f08c00); }
a.toast-ring .toast-msg strong { display: block; }
a.toast-ring .toast-msg span { font-size: .85rem; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .bell.ringing summary img, .bell.ringing .bell-dot { animation: none; } }
.sound-pill { font: inherit; font-size: .8rem; font-weight: 600; border: 1px dashed var(--saffron, #f08c00); color: var(--ink); background: var(--card); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; white-space: nowrap; }
@media (max-width: 640px) { .sound-pill { font-size: .72rem; padding: .25rem .5rem; } }
a.toast-ring, a.toast-ring:visited { color: #fff; animation: toast-in .25s ease-out, toast-out .4s ease-in 14s forwards; }
a.toast-ring .toast-msg strong { color: #fff; }
a.toast-ring .toast-msg span { color: rgba(255, 255, 255, .78); }
a.toast-ring .toast-ico { background: #ffb020; color: #3a2400; }
.streets-side { display: flex; flex-direction: column; gap: 1rem; }
.fill-card { border: 1px dashed var(--saffron, #f08c00); }

/* Timing note for residents */
.eta-box { margin: 1rem 0 0; text-align: center; }
.eta-main { margin: 0; font-weight: 600; display: inline-flex; align-items: center; gap: .45rem; }
.eta-sub { margin: .35rem 0 0; font-size: .9rem; color: var(--ink-2); }

/* audit fixes */
.eta-box { margin: 1rem 0 1.25rem; }
.eta-main { display: block; }
/* "Your complaints": names wrap instead of being cut ("Garbage not pic...") */
.my-main strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.my-main .muted { overflow-wrap: anywhere; }
.error-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1.25rem; }
.error-card h1 { margin: .25rem 0 0; }
.error-card p { margin: 0 0 .5rem; }

/* Done page: what happens next */
.next-steps { text-align: left; margin: .9rem auto 0; max-width: 30rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.next-steps strong { display: block; margin-bottom: .35rem; }
.next-steps ol { margin: 0; padding-left: 1.3rem; }
.next-steps li { margin: .25rem 0; color: var(--ink-2); }
/* Resident confirmation */
.confirm-card { margin-top: 1rem; border: 2px solid var(--st-done); }
.confirm-opt { margin-top: .6rem; }
.confirm-opt > summary { list-style: none; cursor: pointer; }
.confirm-opt > summary::-webkit-details-marker { display: none; }
.confirm-opt[open] > summary { opacity: .85; }
.confirm-form { margin-top: .8rem; display: flex; flex-direction: column; gap: .4rem; }
.confirm-form .field { margin-bottom: .4rem; }
.resident-note p { margin: .3rem 0 0; font-style: italic; }
.resident-quote { font-style: italic; }

/* Notifications / install card */
.push-card { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1rem; padding: .9rem 1rem; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.push-card.compact { margin: .4rem .6rem .6rem; padding: .6rem .7rem; box-shadow: none; background: var(--navy-soft); }
.push-ico { font-size: 1.6rem; line-height: 1; }
.push-main { display: flex; flex-direction: column; gap: .35rem; min-width: 0; flex: 1; }
.push-sub { font-size: .88rem; color: var(--ink-2); }
.push-on, .push-install { align-self: flex-start; }
.push-state { font-size: .86rem; color: var(--ink-2); }
.push-state.ok { color: var(--st-done); font-weight: 600; }
.push-state.warn { color: var(--danger, #c0392b); }
.confirm-deadline { margin: -.2rem 0 .3rem; color: var(--ink-2); }
.awaiting-card { border: 2px dashed var(--saffron, #f08c00); }

/* Install/notifications card at the top of the success page */
.push-card.top { margin: 1rem 0 .25rem; border: 2px solid var(--navy-2, #2b3d7a); background: var(--navy-soft); }
.ios-steps { margin: .2rem 0 0; padding-left: 1.2rem; color: var(--ink); font-size: .92rem; }
.ios-steps li { margin: .2rem 0; }
.ios-share { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 .3rem; font-size: .8rem; background: var(--card); color: #0a84ff; }
/* Installed app: notifications ask */
.push-ask { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 14, 30, .55); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
.push-ask.hidden { display: none; }
.push-ask-box { width: 100%; max-width: 26rem; background: var(--card); color: var(--ink); border-radius: 22px; padding: 1.4rem 1.2rem 1rem; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.push-ask-ico { font-size: 2.6rem; line-height: 1; }
.push-ask-box h2 { margin: .5rem 0 .3rem; }
.push-ask-box p { margin: 0 0 1rem; color: var(--ink-2); }
.push-ask-later { margin-top: .5rem; border: 0; background: transparent; color: var(--ink-2); }

/* Language toggle: हिंदी | EN, current one highlighted */
.lang-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .82rem; font-weight: 700; line-height: 1; }
.lang-seg a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.7rem; min-height: 30px; padding: 0 .65rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.lang-seg a.on { background: var(--navy); color: #fff; }
.lang-seg.on-dark { position: absolute; top: .7rem; right: .7rem; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); box-shadow: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lang-seg.on-dark a { color: rgba(255, 255, 255, .85); min-height: 28px; min-width: 2.4rem; padding: 0 .55rem; }
.lang-seg.on-dark a.on { background: #fff; color: var(--navy); }
.hero { position: relative; }
.home-top { padding-top: calc(.9rem + env(safe-area-inset-top)); }
@media (max-width: 400px) { .hero { padding-top: 2.6rem; } }
@media (max-width: 360px) { .hero { padding-top: 3.4rem; } }

/* ===== Dashboard v2: tabs, Today, Ward ===== */
.dash-tabs { display: inline-flex; padding: 4px; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); margin: 0 0 1rem; }
.dash-tabs a { padding: .5rem 1.4rem; border-radius: 999px; font-weight: 700; color: var(--ink-2); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.dash-tabs a.on { background: var(--navy); color: #fff; }
.act-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 1000px) { .act-grid { grid-template-columns: 1fr 1fr; } }
.act-card { padding: 1rem 1.1rem; }
.act-card.is-empty { background: var(--card); }
.act-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.act-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.act-ico { font-size: 1.15rem; }
.act-count { min-width: 2rem; text-align: center; padding: .1rem .6rem; border-radius: 999px; background: var(--navy-soft); color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.act-unseen:not(.is-empty) .act-count { background: var(--saffron, #f08c00); color: #1b1200; }
.act-hint { margin: .2rem 0 .6rem; font-size: .85rem; color: var(--ink-3); }
.act-rows { list-style: none; margin: 0; padding: 0; }
.act-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.act-main { display: flex; align-items: center; gap: .6rem; flex: 1 1 11rem; min-width: 0; text-decoration: none; color: var(--ink); }
.act-txt { display: flex; flex-direction: column; min-width: 0; }
.act-txt strong { font-size: .95rem; overflow-wrap: anywhere; }
.act-txt em { font-style: normal; font-size: .8rem; color: var(--ink-3); overflow-wrap: anywhere; }
.act-age { font-size: .82rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.act-age.old { color: var(--st-overdue); }
.act-do { margin-left: auto; }
.act-more { display: inline-block; margin-top: .5rem; font-size: .88rem; font-weight: 600; }
.act-empty { padding: .6rem 0 .2rem; color: var(--st-done); font-weight: 600; }
.thanks-card { margin-top: 1rem; }
.thanks-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .thanks-grid { grid-template-columns: repeat(3, 1fr); } }
.thanks-item { display: block; padding: .8rem .9rem; border-radius: 12px; background: var(--navy-soft); text-decoration: none; color: var(--ink); }
.thanks-item p { margin: 0 0 .45rem; font-style: italic; overflow-wrap: anywhere; }
.thanks-meta { font-size: .8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
/* pending by age */
.age-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 800px) { .age-grid { grid-template-columns: repeat(4, 1fr); } }
.age-block { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); }
.age-n { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.age-l { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.age-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: .35rem; }
.age-bar i { display: block; height: 100%; border-radius: 3px; background: var(--navy); }
.age-2 .age-bar i { background: #d4a017; }
.age-3 .age-bar i { background: #e07b00; }
.age-4 .age-bar i { background: var(--st-overdue); }
.age-4:not(.zero) .age-n { color: var(--st-overdue); }
.age-block.zero .age-bar { opacity: .4; }
/* problem areas */
.area-list { list-style: none; margin: 0; padding: 0; }
.area-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.area-rank { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-weight: 800; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.area-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.area-main em { font-style: normal; font-size: .82rem; color: var(--ink-3); }
.area-main em img { vertical-align: -.25em; }
.area-nums { text-align: right; display: flex; flex-direction: column; }
.area-nums b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.area-nums small { font-size: .75rem; color: var(--ink-3); }
.rep-n { color: var(--st-overdue); white-space: nowrap; }
.card-title > div { display: flex; flex-direction: column; }
.heat-btn { cursor: pointer; font: inherit; }
.heat-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.act-grid { align-items: start; }

.member-email { display: flex; flex-wrap: wrap; gap: .35rem .8rem; align-items: center; margin-top: .4rem; max-width: 24rem; }
.member-email input[type=email] { flex: 1 1 100%; }
.member-email .check { font-weight: 500; gap: .3rem; }
.email-status { padding: .75rem 1rem; }
.member-email .check { display: inline-flex; margin: 0; }

/* Dashboard v3 */
.ward-actions { display: flex; justify-content: flex-end; margin: -3.4rem 0 1rem; }
@media (max-width: 700px) { .ward-actions { margin: 0 0 1rem; justify-content: stretch; } .ward-actions .btn { width: 100%; justify-content: center; } }
.repeat-alert { margin-top: 1rem; border: 2px solid #f3b4ad; }
.team-table th.num, .team-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.team-table td.late-n { color: var(--st-overdue); font-weight: 700; }
.rc-thanks { padding: 6px 20px 8px; }
.rc-thanks blockquote { margin: 0; background: #fff; border-radius: 14px; padding: 12px 14px; font-size: 17px; font-style: italic; color: #1f2d5c; box-shadow: 0 1px 3px rgba(23,32,58,.08); border-left: 4px solid #f08c00; }
.rc-thanks-meta { font-size: 12px; color: #4a5470; margin-top: 6px; }

/* My profile */
.profile-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; max-width: 980px; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.profile-side { display: flex; flex-direction: column; gap: 1rem; }
.profile-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.readonly-val { padding: .55rem .75rem; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem 0; }
.me-link { display: inline-flex; border-radius: 50%; text-decoration: none; }
.me-link.on .avatar, .me-link:hover .avatar { box-shadow: 0 0 0 3px var(--navy-soft); }
.more-me { gap: .7rem; }
.me-link { align-items: center; gap: .45rem; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: .9rem; }
@media (max-width: 700px) { .me-link { padding: 0; border: 0; background: transparent; } }
.usermenu > summary.me-link { list-style: none; cursor: pointer; }
.usermenu > summary.me-link::-webkit-details-marker { display: none; }
.me-caret { font-size: .7rem; color: var(--ink-3); }
.usermenu .menu a.on { font-weight: 700; }
.member-phone { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; max-width: 24rem; }
.member-phone input { flex: 1; }

/* White panels on the grey page: board columns and the List/Board/Map switch */
.board-col { background: var(--card); box-shadow: var(--shadow); }
.seg { background: var(--card); box-shadow: var(--shadow); }
.seg a.on { background: var(--navy-soft); color: var(--navy); box-shadow: none; }

/* bot trap on the report form: off-screen for people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.my-item.summary { cursor: default; }
.track-note { margin-top: .9rem; }

/* Complaint page on phones and tablets: act first. Order: summary, details + resident, actions, photos, history. */
@media (max-width: 999px) {
  .cd-grid { display: flex; flex-direction: column; gap: 1rem; }
  .cd-main, .cd-side { display: contents; }
  .cd-details { order: 1; }
  .cd-side > * { order: 2; }
  .cd-ba { order: 3; }
  .cd-photos { order: 4; }
  .cd-history { order: 5; }
}
.photo-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .85rem; }
.photo-add select { width: auto; flex: 0 0 auto; }
.photo-add input[type=file] { flex: 1 1 12rem; min-width: 0; font-size: .85rem; }
.cd-resident-who { flex: 1 1 11rem; min-width: 0; }
.cd-resident-who a { white-space: nowrap; }

/* Accessibility pass */
.pub-foot a { display: inline-block; padding: .35rem .25rem; }          /* footer links: bigger tap area */
.login-title { font-weight: 800; font-size: 1.3rem; color: var(--navy); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dbody:focus { outline: none; }
.card-title h2.h3 { font-size: 1.05rem; margin: 0; }
.stable th, .ctable th { position: relative; }  /* keeps .sr-only labels inside the scrolling table */

/* Pointer devices only: on a phone a tapped element would keep its hover look. */
@media (hover: hover) {
  .btn:hover { border-color: #c4cad8; }
  .btn-primary:hover { background: var(--saffron-dark); border-color: var(--saffron-dark); color: #fff; }
  .btn-navy:hover { background: var(--navy-2); }
  .side nav a:hover { background: var(--bg); color: var(--ink); }
  .usermenu .menu a:hover, .usermenu .menu button:hover, .bell .menu a:hover { background: var(--bg); }
  .kpi:hover { border-color: #c4cad8; }
  .ctable tbody tr:hover { background: #fafbfd; }
  .row-link:hover { background: var(--bg); }
  .age-block:hover { border-color: #c4cad8; }
}

/* Press feedback: the screen answers the moment a finger lands, not when it lifts.
   Pressing is instant (no transition); only the settle back is animated. */
.btn, .kpi, .age-block, .chip, .seg a, .row-link, .act-card, .side nav a, .bottom-nav a,
.usermenu .menu a, .usermenu .menu button, .bell .menu a, .ctable tbody tr[data-href] {
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .2s cubic-bezier(.2, .8, .3, 1);
}
.btn:active, .kpi:active, .age-block:active, .chip:active, .seg a:active, .row-link:active, .act-card:active,
.side nav a:active, .bottom-nav a:active, .usermenu .menu a:active, .usermenu .menu button:active,
.bell .menu a:active, .ctable tbody tr[data-href]:active td { transition-duration: 0s; }
.btn:active, .chip:active, .seg a:active { transform: scale(.97); }
.kpi:active, .age-block:active, .act-card:active { transform: scale(.985); }
.row-link:active, .side nav a:active, .usermenu .menu a:active, .usermenu .menu button:active, .bell .menu a:active { background: var(--bg); }
.ctable tbody tr[data-href]:active td { background: var(--navy-soft); }
.bottom-nav a:active { color: #fff; }
.btn[disabled]:active, .btn[aria-disabled="true"]:active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .btn, .kpi, .age-block, .chip, .seg a, .row-link, .act-card, .side nav a, .bottom-nav a,
  .usermenu .menu a, .usermenu .menu button, .bell .menu a, .ctable tbody tr[data-href] { transition: none; }
  .btn:active, .chip:active, .seg a:active, .kpi:active, .age-block:active, .act-card:active { transform: none; }
}

/* Complaint list: who reported it (name, and a tap-to-call number) */
.ctable .who-name { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctable .who-phone { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums; padding: .15rem 0; }
.ctable .who-phone .icon { width: 13px; height: 13px; }

/* ========== PHONE REFINEMENTS (the installed app) ========== */
/* No 300 ms tap delay and no double-tap zoom on anything you press. */
a, button, summary, label, select, input, [role="button"] { touch-action: manipulation; }

/* The photo control on the complaint page: a real button, not the browser's grey "Choose File". */
.photo-add input[type=file]::file-selector-button {
  margin-right: .6rem; padding: .55rem 1rem; min-height: 44px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--navy); font: inherit; font-weight: 700; cursor: pointer;
}
.photo-add input[type=file] { color: var(--ink-2); font-size: .85rem; }

@media (max-width: 699px) {
  /* Today: title and age on top, then the actions as two big buttons, the same in every row. */
  .act-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem .6rem; padding: .85rem 0; }
  .act-main { grid-column: 1; }
  .act-age { grid-column: 2; }
  .act-do { grid-column: 1 / -1; margin: 0; display: flex; gap: .5rem; }
  .act-do > form, .act-do > .qa { flex: 1 1 0; min-width: 0; display: flex; gap: .5rem; }
  .act-do .qa-btn { flex: 1 1 0; justify-content: center; min-height: 44px; font-size: .9rem; white-space: normal; text-align: center; }
  .act-txt strong { font-size: 1rem; }

  /* Comfortable thumbs: 44 px targets for the small buttons. */
  .btn-sm, .chip, .qa-btn { min-height: 44px; }
  .bell summary, .usermenu summary { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .photo-add select, .photo-add input[type=file], .photo-add .btn { flex: 1 1 100%; width: 100%; }
  .photo-add .btn { justify-content: center; }

  /* Board: one column fills the screen and the next one peeks in; columns snap into place. */
  .board { grid-auto-columns: 86%; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scroll-padding-left: .85rem; }
  .board > * { scroll-snap-align: start; }
  .board-col { max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); overflow-y: auto; overscroll-behavior-y: contain; }

  /* The main action on a form is a full-width button. */
  form > .btn-lg:last-child { width: 100%; }
}

/* "Other ward" flag on a complaint (resident gave a different ward number on the first screen) */
.badge.b-other { background: var(--st-other-bg); color: var(--st-other); }

/* ========== BRAND (public screens) ========== */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--navy); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -4px 0 var(--saffron); }
.brand-mark.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .68rem; box-shadow: inset 0 -3px 0 var(--saffron); }
.brand-mark.lg { width: 84px; height: 84px; border-radius: 24px; font-size: 1.9rem; box-shadow: inset 0 -7px 0 var(--saffron), 0 10px 26px rgba(31, 45, 92, .28); }
.brand-lockup { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand-text strong { display: block; font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.brand-text small { display: block; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.pub-brand .brand-mark { margin-right: .1rem; }
.home-top { padding-top: .5rem; }
.welcome-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: .25rem 0 1.1rem; }
.wb-name { margin-top: .5rem; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--navy); }
.wb-ward { font-weight: 600; color: var(--ink-2); }
.wb-parshad { display: inline-flex; align-items: center; gap: .5rem; margin-top: .55rem; padding: .3rem .9rem .3rem .3rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.wb-parshad:not(:has(img)) { padding-left: .9rem; }
.wb-parshad img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--saffron); }

/* ========== LOADING: skeleton + thin progress bar while the next screen loads ========== */
.nav-bar, .nav-skel { display: none; }
.is-navigating .nav-bar { display: block; position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; background: transparent; }
.is-navigating .nav-bar::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--saffron); border-radius: 0 3px 3px 0; animation: nav-bar 1.1s ease-in-out infinite; }
@keyframes nav-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.is-navigating .nav-skel { display: block; position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; top: calc(3.4rem + env(safe-area-inset-top));
  padding: 1rem; background: var(--bg, #f4f6fa); overflow: hidden; pointer-events: none; }
.nav-skel > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.is-dash .nav-skel { top: 60px; } .is-dash .nav-skel > * { max-width: 1200px; margin-left: 0; margin-right: 0; }
@media (min-width: 1000px) { .is-dash .nav-skel { left: 248px; } }
.sk { border-radius: 16px; margin-bottom: .9rem; background: var(--line); background-size: 200% 100%;
  background-image: linear-gradient(90deg, var(--line) 0%, rgba(255, 255, 255, .55) 50%, var(--line) 100%); animation: sk-shimmer 1.3s linear infinite; }
.sk-hero { height: 112px; } .sk-action { height: 92px; } .sk-row { height: 64px; border-radius: 14px; }
@keyframes sk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .is-navigating .nav-bar::before { animation: none; } }

/* Smooth cross-fade between screens in browsers that support it (installed Android app included). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* The offline page */
.offline { max-width: 460px; margin: 0 auto; padding: calc(2rem + env(safe-area-inset-top)) 1.25rem 2rem; display: grid; gap: .9rem; justify-items: center; text-align: center; }
.offline-brand { display: flex; flex-direction: column; align-items: center; gap: .25rem; margin-bottom: .5rem; }
.offline-ico { color: var(--ink-3); }
.offline h1 { margin: 0; font-size: 1.5rem; }
.offline p { margin: 0; color: var(--ink-2); } .offline .en { font-size: .9rem; color: var(--ink-3); }
.offline .btn { width: 100%; }

/* The parshad's photo as the brand mark (replaces the ward-number mark) */
.brand-photo { object-fit: cover; background: #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--saffron); }
.brand-photo.sm { box-shadow: 0 0 0 2px var(--saffron); }
.brand-photo.lg { box-shadow: 0 0 0 4px var(--saffron), 0 10px 26px rgba(31, 45, 92, .28); }
.side-brand .logo { font-size: 1.1rem; }
.brand-mark.brand-photo { border-radius: 50%; }

/* Photo tips on the report form */
.photo-tips{margin-top:.9rem;padding-top:.8rem;border-top:1px solid var(--line);font-size:.9rem}
.photo-tips ul{margin:.4rem 0 0;padding-left:1.1rem;display:grid;gap:.3rem;color:var(--ink-2)}

/* Team notice board */
.notice-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.notice-card { padding: 0; overflow: hidden; }
.notice-card.off { opacity: .6; }
.notice-img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.notice-body { padding: .9rem 1rem 1rem; }

/* Works gallery */
.work-page { padding: 1rem; }
.work-img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 16px; display: block; margin-top: .5rem; }
.work-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.work-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
[data-kind-show][hidden] { display: none; }

/* ---- forms on server pages ---- */
.brand-mark.brand-logo, .brand-mark.brand-logo.sm, .brand-mark.brand-logo.lg { border-radius: 50%; box-shadow: none; background: #fff; object-fit: cover; }
form.card h1 { font-size: 1.6rem; margin: 0 0 .4rem; }

/* ---- the blood request page a WhatsApp link opens (/b/<id>) ---- */
.blood-page { text-align: center; }
.blood-group { margin: 0; font-size: 3.4rem; font-weight: 800; line-height: 1; color: #c21f2f; }
.blood-page h1 { margin: .4rem 0 .3rem; font-size: 1.5rem; }
.blood-meta { margin: 0 0 .4rem; color: var(--ink-2); font-weight: 600; }
.blood-contact { margin: 1rem 0; padding: 1rem; border-radius: 14px; background: var(--navy-soft); }
.blood-contact-name { margin: .1rem 0; font-size: 1.25rem; font-weight: 800; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-pick span { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 700; cursor: pointer; }
.chip-pick input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-pick input:focus-visible + span { outline: 3px solid #f08c00; outline-offset: 2px; }
.field-error { margin: .35rem 0 0; color: #c21f2f; font-weight: 600; font-size: .9rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.field legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }

/* ---- the public site: home, works, updates, contact (server-rendered pages) ---- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: .65rem 1rem; background: var(--navy); color: #fff; border-radius: 0 0 .6rem 0; }
.skip-link:focus { left: 0; }
.pub-nav { max-width: 1120px; margin: 0 auto; padding: .1rem 1rem .5rem; display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.pub-nav::-webkit-scrollbar { display: none; }
.pub-nav a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; padding: .35rem .85rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; }
.pub-nav a[aria-current=page] { background: var(--navy-soft); color: var(--navy); }
.pub-nav .pub-nav-app { margin-left: auto; background: #f08c00; color: #2b1700; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .35rem; margin: 0 0 .9rem; padding: 0; font-size: .85rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; }
.crumbs a { color: var(--ink-2); }
.pub-main.site h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; }
.pub-main.site h2 { font-size: 1.3rem; margin: 0 0 .6rem; }
.pub-main.site h3 { font-size: 1.05rem; margin: .5rem 0 .2rem; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 44rem; margin: 0 0 1rem; }
.site-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.cards, .notice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.notice-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.work-card a { color: inherit; text-decoration: none; display: block; }
.work-card img, .work-card-ph { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--navy-soft); }
.office { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: .6rem 0 1rem; }
.office dt { font-weight: 700; color: var(--ink-2); }
.office dd { margin: 0; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem .9rem; margin-bottom: .6rem; }
.err-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: center; }
@media (max-width: 759px) { .pub-nav .pub-nav-app { display: none; } }   /* on a phone the big button in the page does this job */
@media (min-width: 760px) {
  .pub-main.site h1 { font-size: 2.4rem; }
}

/* Flat line icons (pic() macro). 2026-11-14: the sizes lived only in the dashboard's stylesheet, so on public pages
   (complaint status /t/, 404, track, report) the icon was drawn at the browser's default 300 px and squeezed the text. */
.fi { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 30%; background: var(--navy-soft, #E3EFFC); color: var(--navy, #1565C0); }
.fi svg { width: 58%; height: 58%; fill: none; stroke: currentColor; }
.fi-sm { width: 24px; height: 24px; border-radius: 8px; }
.fi-sm svg { width: 70%; height: 70%; }
.fi-md { width: 34px; height: 34px; border-radius: 11px; }
.fi-lg { width: 52px; height: 52px; border-radius: 16px; }
.fi-xl { width: 72px; height: 72px; border-radius: 22px; }
/* Phones: the top menu wraps instead of hiding "Contact" off the edge (2026-11-14, owner's phone, English). */
@media (max-width: 560px) {
  .pub-nav { flex-wrap: wrap; overflow: visible; gap: .1rem .15rem; padding-bottom: .4rem; }
  .pub-nav a { padding: .3rem .7rem; min-height: 40px; font-size: .9rem; }
}
/* /blood and /volunteers (2026-11-15) */
.bg-grid { list-style: none; padding: 0; margin: .75rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.bg-grid li { border: 1px solid var(--line, #E2E8F0); border-radius: 12px; padding: .6rem; display: grid; text-align: center; }
.bg-grid b { color: #B91C1C; font-size: 1.15rem; } .bg-grid span { font-size: .85rem; color: var(--ink-2); }
.site-ctas { display: flex; gap: .6rem; flex-wrap: wrap; }
.faq-item summary { cursor: pointer; list-style: none; } .faq-item summary h3 { display: inline; font-size: 1rem; }
.faq-item p { margin: .5rem 0 0; }

/* Send to Parshad ji: the private link page /k/<token> (2026-11-19) */
.fw-page { display: flex; flex-direction: column; gap: 14px; }
.fw-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.fw-photos img { width: 100%; height: 200px; object-fit: cover; border-radius: 16px; display: block; }
.fw-card h1 { margin: .2rem 0 .4rem; font-size: 1.5rem; }
.fw-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fw-ref { font-weight: 700; font-size: .85rem; color: var(--ink-3); letter-spacing: .03em; }
.fw-st { font-size: .8rem; font-weight: 700; color: var(--navy); background: var(--navy-soft); padding: 3px 10px; border-radius: 999px; }
.fw-words { margin: 0 0 .6rem; line-height: 1.55; }
.fw-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 .8rem; }
.fw-facts dt { color: var(--ink-3); }
.fw-facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.fw-map { width: 100%; justify-content: center; }
.fw-done > summary { list-style: none; }
.fw-done > summary::-webkit-details-marker { display: none; }
.fw-done-btn, .fw-send { width: 100%; justify-content: center; background: #18794e; border-color: #18794e; color: #fff; font-weight: 800; cursor: pointer; }
.fw-done[open] > summary { display: none; }
.fw-form { display: flex; flex-direction: column; gap: 4px; }
.fw-form h2 { margin: 0 0 .5rem; }
.fw-nudge { margin: .35rem 0 0; color: #18794e; font-weight: 600; font-size: .9rem; }
.fw-thanks { text-align: center; }
.fw-thanks h2 { margin: .2rem 0 .4rem; }
.fw-tick { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; background: #dcf3e6; color: #18794e; font-size: 2.2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fw-foot { text-align: center; margin: 0; }
.linkish { background: none; border: 0; padding: 0 2px; font: inherit; font-weight: 700; color: var(--navy); text-decoration: underline; cursor: pointer; min-height: 44px; }
.fw-label { display: block; font-weight: 600; margin-bottom: .35rem; }
.fw-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.fw-drop { min-height: 120px; border: 2px dashed #c9d0de; border-radius: 16px; background: #f7f8fb; color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; cursor: pointer; padding: 10px; text-align: center; }
.fw-file:focus-visible + .fw-drop { outline: 3px solid var(--navy); outline-offset: 2px; }
.fw-drop img { max-width: 100%; max-height: 180px; border-radius: 12px; object-fit: cover; }
