/* ==========================================================================
   EnviroWitness — design system
   Premium civic-tech / environmental aesthetic.
   Sections: 1 Tokens · 2 Base · 3 Layout · 4 Components · 5 Pages
             6 Admin · 7 Utilities · 8 Responsive · 9 Motion/Print
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand greens (deep, civic, grown-up) */
  --green-950: #052A1D;
  --green-900: #0A4A36;
  --green-800: #0E5C43;   /* primary */
  --green-700: #127353;
  --green-600: #17805F;
  --green-100: #DDEFE7;
  --green-50:  #EFF7F3;

  /* Charcoal & neutrals */
  --ink:       #1B2320;   /* headings / primary text */
  --ink-700:   #39433F;   /* body */
  --ink-500:   #64716C;   /* secondary */
  --ink-400:   #8B9793;   /* tertiary */
  --line:      #E3E9E6;
  --line-soft: #EEF2F0;
  --bg:        #F6F8F7;
  --bg-2:      #EEF2F0;
  --card:      #FFFFFF;

  /* Warm accent */
  --amber:      #E8A33D;
  --amber-deep: #C9831B;
  --amber-ink:  #7A5207;
  --amber-soft: #FCF1DC;
  --terracotta: #D2673E;

  /* Semantic */
  --danger:      #C0392B;
  --danger-soft: #FBEAE7;
  --info:        #2A63A8;
  --info-soft:   #E8F0FA;
  --violet:      #6B4FBB;
  --violet-soft: #EEEAFB;
  --slate:       #55636B;
  --slate-soft:  #ECF0F2;
  --success:     #0E7C5A;
  --success-soft:#E2F4ED;

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(15, 40, 30, .06);
  --sh-2: 0 2px 6px rgba(15, 40, 30, .06), 0 12px 28px -18px rgba(15, 40, 30, .35);
  --sh-3: 0 8px 20px -8px rgba(15, 40, 30, .18), 0 24px 48px -24px rgba(15, 40, 30, .30);
  --ring: 0 0 0 3px rgba(23, 128, 95, .35);

  /* Type */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout metrics */
  --topbar-h: 64px;
  --bottomnav-h: 66px;
  --sidebar-w: 248px;
  --maxw: 1180px;
  --maxw-narrow: 760px;
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.18; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--green-100); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
details > summary { cursor: pointer; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--green-800); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.mono { font-family: var(--font-mono); font-size: .86em; letter-spacing: .02em; }
.muted { color: var(--ink-500); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.strong { font-weight: 700; color: var(--ink); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.view { flex: 1 0 auto; outline: none; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.container-narrow { width: 100%; max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 18px; }
.page-pad { padding-top: 26px; padding-bottom: 48px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 18px;
  height: var(--topbar-h); display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: var(--sh-1); flex: 0 0 auto;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; color: var(--ink); font-size: 1.06rem; letter-spacing: -.02em; }
.brand-sub { font-size: .68rem; color: var(--ink-500); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 8px 12px; border-radius: var(--r-pill); font-size: .92rem; font-weight: 600;
  color: var(--ink-700); text-decoration: none;
}
.nav-link:hover { background: var(--green-50); color: var(--green-800); text-decoration: none; }
.nav-link.is-active { background: var(--green-100); color: var(--green-900); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; position: relative;
  color: var(--ink-700);
}
.icon-btn:hover { border-color: var(--green-600); color: var(--green-800); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  background: var(--terracotta); border-radius: 50%; border: 2px solid #fff;
}
.nav-toggle { display: none; }
.mobile-menu { display: none; }

/* Bottom nav (citizen mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch; justify-content: space-around;
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 2px 7px; font-size: .66rem; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-500); text-decoration: none; border: 0; background: none; cursor: pointer;
}
.bn-item svg { width: 22px; height: 22px; }
.bn-item:hover { text-decoration: none; }
.bn-item.is-active { color: var(--green-800); }
.bn-fab-wrap { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 76px; }
.bn-fab {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(145deg, var(--green-700), var(--green-900));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 22px -8px rgba(10, 74, 54, .7); transform: translateY(-14px);
}
.bn-fab:hover { transform: translateY(-16px); }
.bn-fab svg { width: 26px; height: 26px; }
.has-bottomnav { padding-bottom: calc(var(--bottomnav-h) + 14px); }

/* Sidebar (admin) */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 80;
  background: var(--green-950); color: #CFE3DA; padding: 18px 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar .brand { padding: 4px 8px 14px; }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-sub { color: #7FA795; }
.side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6F9384; padding: 14px 10px 6px; font-weight: 700; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  color: #CFE3DA; font-size: .92rem; font-weight: 600; text-decoration: none;
}
.side-link svg { width: 19px; height: 19px; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.side-link.is-active { background: var(--green-700); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.1); font-size: .76rem; color: #7FA795; }
.admin-mode { background: var(--bg); }
.admin-mode-view { padding-left: var(--sidebar-w); min-height: 100vh; }
.admin-shell { padding-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.admin-top {
  position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
}
.admin-top h1 { font-size: 1.12rem; margin: 0; }
.admin-main { padding: 22px; flex: 1; }
.sidebar-toggle { display: none; }

/* Footer */
.site-footer { background: var(--green-950); color: #A9C6B9; margin-top: 40px; }
.site-footer a { color: #D9EBE2; }
.footer-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 18px 26px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 28px;
}
.footer-title { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.footer-note {
  border-top: 1px solid rgba(255,255,255,.12); padding: 16px 18px 26px;
  max-width: var(--maxw); margin: 0 auto; font-size: .8rem; color: #8FB0A2;
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
}

/* --------------------------------------------------------------------------
   4. COMPONENTS
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s;
  white-space: nowrap; background: #fff; color: var(--ink);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green-800); color: #fff; box-shadow: 0 8px 18px -10px rgba(10,74,54,.8); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-secondary { border-color: var(--green-800); color: var(--green-800); background: #fff; }
.btn-secondary:hover { background: var(--green-50); }
.btn-warm { background: var(--amber); color: #402A02; }
.btn-warm:hover { background: var(--amber-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-700); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A5301F; color: #fff; }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: .86rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; width: 40px; height: 40px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .spinner { width: 16px; height: 16px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
.btn-ghost .spinner, .btn-secondary .spinner { border-color: rgba(10,74,54,.25); border-top-color: var(--green-800); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 20px; }
.card-pad-lg { padding: 26px; }
.card-soft { background: var(--green-50); border-color: var(--green-100); }
.card-hover { transition: box-shadow .15s ease, transform .15s ease, border-color .15s; }
.card-hover:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: #D3DED8; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin: 0; }
.card-sub { font-size: .86rem; color: var(--ink-500); margin: 3px 0 0; }

/* Stat / KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green-600); }
.stat-card.tone-amber::after { background: var(--amber); }
.stat-card.tone-info::after { background: var(--info); }
.stat-card.tone-danger::after { background: var(--danger); }
.stat-card.tone-violet::after { background: var(--violet); }
.stat-card.tone-slate::after { background: var(--slate); }
.stat-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-500); }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.stat-foot { font-size: .8rem; color: var(--ink-500); margin-top: 4px; }
.stat-foot .up { color: var(--success); font-weight: 700; }
.stat-foot .down { color: var(--danger); font-weight: 700; }

/* Badges & status pills */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--r-pill); font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  background: var(--bg-2); color: var(--ink-700); border: 1px solid transparent; white-space: nowrap;
}
.badge-demo { background: var(--amber-soft); color: var(--amber-ink); border-color: #F2DDB4; }
.badge-live { background: var(--success-soft); color: var(--success); border-color: #BFE5D6; }
.badge-anon { background: var(--violet-soft); color: var(--violet); }
.badge-urgent { background: var(--danger-soft); color: var(--danger); }
.badge-high { background: var(--amber-soft); color: var(--amber-ink); }
.badge-normal { background: var(--slate-soft); color: var(--slate); }
.badge-low { background: var(--info-soft); color: var(--info); }
.badge-ref { font-family: var(--font-mono); background: #F1F5F3; color: var(--green-900); border-color: var(--line); font-weight: 700; }

.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-submitted      { background: var(--slate-soft);  color: var(--slate); }
.status-under_review   { background: var(--amber-soft);  color: var(--amber-ink); }
.status-verified       { background: var(--info-soft);   color: var(--info); }
.status-assigned       { background: var(--violet-soft); color: var(--violet); }
.status-in_progress    { background: var(--amber-soft);  color: #A35A0B; }
.status-resolved       { background: var(--success-soft);color: var(--success); }
.status-closed         { background: var(--bg-2);        color: var(--ink-500); }
.status-rejected       { background: var(--danger-soft); color: var(--danger); }
.status-duplicate      { background: #F6EFE8;            color: #8A6A4A; }

.priority { font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.priority-urgent { color: var(--danger); }
.priority-high { color: var(--amber-deep); }
.priority-normal { color: var(--slate); }
.priority-low { color: var(--info); }

/* Forms */
.field { margin-bottom: 16px; }
.label { display: block; font-size: .88rem; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.label .opt { font-weight: 600; color: var(--ink-400); font-size: .78rem; }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font-size: .96rem; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green-600); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364716C' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.help { font-size: .82rem; color: var(--ink-500); margin-top: 6px; }
.error-text { font-size: .84rem; color: var(--danger); font-weight: 600; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--danger); }

.search-wrap { position: relative; }
.search-wrap .input { padding-left: 42px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-400); }

.check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green-700); flex: 0 0 auto; }
.check-text { font-size: .92rem; }
.check-sub { font-size: .8rem; color: var(--ink-500); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: #CFD8D4; transition: background .15s; position: relative; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--sh-1); }
.switch input:checked + .track { background: var(--green-700); }
.switch input:checked + .track::after { transform: translateX(18px); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border-radius: var(--r-pill); border: 1.5px solid var(--line);
  background: #fff; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink-700);
  display: inline-flex; align-items: center; gap: 7px; transition: all .12s;
}
.chip:hover { border-color: var(--green-600); color: var(--green-800); }
.chip.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.chip svg { width: 16px; height: 16px; }

.segmented { display: inline-flex; background: var(--bg-2); border-radius: var(--r-pill); padding: 4px; gap: 4px; }
.segmented button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: var(--r-pill);
  font-size: .88rem; font-weight: 700; color: var(--ink-500); cursor: pointer;
}
.segmented button.is-active { background: #fff; color: var(--green-900); box-shadow: var(--sh-1); }

/* Dropzone & media */
.dropzone {
  border: 2px dashed #C7D5CE; border-radius: var(--r-md); background: var(--green-50);
  padding: 26px 18px; text-align: center; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--green-600); background: var(--green-100); }
.dropzone svg { width: 34px; height: 34px; color: var(--green-700); margin: 0 auto 8px; }
.dropzone-title { font-weight: 700; color: var(--ink); }
.dropzone-sub { font-size: .82rem; color: var(--ink-500); margin-top: 4px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }
.media-item { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item .media-type {
  position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.6); color: #fff;
  font-size: .64rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; letter-spacing: .06em;
}
.media-item .media-del {
  position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(0,0,0,.62); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center;
}
.media-item .media-del:hover { background: var(--danger); }
.media-item .media-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.4); }
.media-item .media-progress i { display: block; height: 100%; background: var(--green-600); }

/* Callouts */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); font-size: .9rem; border: 1px solid; }
.callout svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.callout strong { color: var(--ink); }
.callout-safety { background: var(--amber-soft); border-color: #F0D9AC; color: #6B4A0B; }
.callout-info { background: var(--info-soft); border-color: #C9DDF4; color: #244F84; }
.callout-success { background: var(--success-soft); border-color: #BFE5D6; color: #0B5F45; }
.callout-danger { background: var(--danger-soft); border-color: #F1CFC9; color: #8E2A1D; }
.callout-neutral { background: var(--bg-2); border-color: var(--line); color: var(--ink-700); }
.callout .callout-body { flex: 1; }
.callout .callout-body p:last-child { margin-bottom: 0; }

.demo-strip {
  background: repeating-linear-gradient(-45deg, var(--amber-soft), var(--amber-soft) 12px, #FAE9C9 12px, #FAE9C9 24px);
  border-bottom: 1px solid #F0D9AC; color: var(--amber-ink);
  font-size: .8rem; font-weight: 700; text-align: center; padding: 7px 14px;
}

/* Modal */
.modal-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 22, 17, .55); backdrop-filter: blur(3px); }
.modal {
  position: relative; background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 560px;
  max-height: 88vh; overflow: auto; box-shadow: var(--sh-3); animation: pop .18s ease;
}
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-title { font-size: 1.1rem; font-weight: 800; margin: 0; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 6px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Toasts */
.toast-root { position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + 18px); transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: var(--r-md);
  font-size: .92rem; font-weight: 600; box-shadow: var(--sh-3); display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .22s ease;
}
.toast svg { width: 19px; height: 19px; flex: 0 0 auto; }
.toast-success { background: var(--green-800); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--amber-deep); }
.toast .toast-close { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; padding: 0; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-500); background: var(--bg); padding: 11px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--green-50); }

/* Timeline / audit trail */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .tl-item { position: relative; padding: 0 0 20px 30px; }
.timeline .tl-item::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: -2px; width: 2px; background: var(--line); }
.timeline .tl-item:last-child::before { display: none; }
.timeline .tl-dot {
  position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 4px solid var(--green-600);
}
.timeline .tl-dot.tone-amber { border-color: var(--amber); }
.timeline .tl-dot.tone-danger { border-color: var(--danger); }
.timeline .tl-dot.tone-info { border-color: var(--info); }
.timeline .tl-title { font-weight: 700; color: var(--ink); font-size: .92rem; }
.timeline .tl-meta { font-size: .78rem; color: var(--ink-500); }

/* Empty & skeleton */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-500); }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon svg { width: 30px; height: 30px; }
.empty-title { font-weight: 800; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, #E7ECEA 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab {
  padding: 10px 16px; font-size: .92rem; font-weight: 700; color: var(--ink-500);
  border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap;
}
.tab.is-active { color: var(--green-800); border-bottom-color: var(--green-800); }
.tab:hover { color: var(--green-700); }
.tab .count { background: var(--bg-2); border-radius: 999px; padding: 1px 8px; font-size: .74rem; margin-left: 6px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

/* --------------------------------------------------------------------------
   5. PAGES — Landing
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(102deg, rgba(5, 42, 31, .94) 0%, rgba(5, 42, 31, .88) 42%, rgba(5, 42, 31, .70) 72%, rgba(5, 42, 31, .50) 100%),
    url("../assets/hero-banner.webp") center 42% / cover no-repeat;
  border-bottom: none;
}
/* Witness hero photograph: a resident documenting a collapsed drain. */
html.product-witness .hero {
  background:
    linear-gradient(102deg, rgba(5, 42, 31, .94) 0%, rgba(5, 42, 31, .88) 42%, rgba(5, 42, 31, .70) 72%, rgba(5, 42, 31, .50) 100%),
    url("../assets/hero-banner-witness.webp?v=20261029") center 42% / cover no-repeat;
}
html.product-witness .phone-card .ph-img {
  background: linear-gradient(135deg, rgba(31, 122, 92, .52), rgba(10, 74, 54, .62)),
    url("../assets/hero-banner-witness.webp?v=20261029") 58% 55% / cover;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 18px 60px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--green-100); color: var(--green-900);
  font-size: .78rem; font-weight: 800; padding: 6px 14px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase;
}
.hero-title { font-size: clamp(2rem, 5.2vw, 3.3rem); margin: 18px 0 14px; letter-spacing: -.03em; }
.hero-title .accent { color: var(--green-700); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.14rem); color: var(--ink-500); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 20px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta-item { font-size: .84rem; color: var(--ink-500); display: flex; align-items: center; gap: 8px; }
.hero-meta-item svg { width: 17px; height: 17px; color: var(--green-700); }
.hero-art { position: relative; }

/* Photo hero: light treatment so copy stays legible over the banner */
.hero .hero-badge { background: rgba(255, 255, 255, .12); color: #FFF3E0; border: 1px solid rgba(255, 255, 255, .28); }
.hero .hero-title { color: #fff; }
.hero .hero-title .accent { color: var(--amber); }
.hero .hero-sub { color: #D7E9E2; }
.hero .hero-meta-item { color: #CBE3DA; }
.hero .hero-meta-item svg { color: var(--amber); }
.hero .btn-primary { background: var(--green-600); }
.hero .btn-primary:hover { background: var(--green-700); }
.hero .btn-secondary { border-color: rgba(255, 255, 255, .75); color: #fff; background: rgba(255, 255, 255, .10); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, .20); color: #fff; }
.hero .phone { box-shadow: 0 22px 55px rgba(0, 0, 0, .45), var(--sh-3); }

/* Phone mock in hero */
.phone {
  width: min(300px, 78vw); margin: 0 auto; border-radius: 34px; background: var(--ink);
  padding: 12px; box-shadow: var(--sh-3);
}
.phone-screen { background: var(--bg); border-radius: 24px; overflow: hidden; }
.phone-notch { height: 22px; display: grid; place-items: center; }
.phone-notch::after { content: ""; width: 84px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.25); }
.phone-card { background: #fff; margin: 10px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.phone-card .ph-img {
  height: 118px;
  background: linear-gradient(135deg, rgba(31, 122, 92, .52), rgba(10, 74, 54, .62)), url("../assets/hero-banner.webp") 58% 55% / cover;
  position: relative; display: grid; place-items: center; color: rgba(255, 255, 255, .9);
}
.phone-card .ph-img svg { width: 40px; height: 40px; }
.phone-card .ph-body { padding: 11px 13px 13px; }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ph-title { font-size: .82rem; font-weight: 800; color: var(--ink); }
.ph-sub { font-size: .7rem; color: var(--ink-500); margin-top: 3px; }
.ph-bar { height: 6px; border-radius: 99px; background: var(--bg-2); margin-top: 10px; overflow: hidden; }
.ph-bar i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--green-600), var(--green-800)); }
.float-chip {
  position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 13px; font-size: .78rem; font-weight: 700; box-shadow: var(--sh-2); display: flex; gap: 8px; align-items: center;
}
.float-chip svg { width: 16px; height: 16px; }
.float-chip.fc-1 { top: 8%; left: -4%; color: var(--green-800); animation: floaty 5s ease-in-out infinite; }
.float-chip.fc-2 { bottom: 14%; right: -6%; color: var(--amber-ink); animation: floaty 6.4s ease-in-out infinite .6s; }
@keyframes floaty { 50% { transform: translateY(-9px); } }

.section { padding: 64px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--green-950); color: #C6DED3; }
.section-dark h2, .section-dark h3 { color: #fff; }
.eyebrow { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--green-700); margin-bottom: 10px; }
.section-dark .eyebrow { color: var(--amber); }
.section-title { max-width: 700px; }
.section-sub { color: var(--ink-500); max-width: 640px; margin-top: -4px; }
.section-dark .section-sub { color: #9FBFB1; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); }
.section-alt .feature-card { background: var(--bg); }
.icon-tile { width: 46px; height: 46px; border-radius: 14px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; margin-bottom: 14px; }
.icon-tile.tone-amber { background: var(--amber-soft); color: var(--amber-deep); }
.icon-tile.tone-info { background: var(--info-soft); color: var(--info); }
.icon-tile.tone-violet { background: var(--violet-soft); color: var(--violet); }
.icon-tile svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { font-size: .92rem; color: var(--ink-500); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 34px; counter-reset: step; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; position: relative; }
.step-num {
  width: 34px; height: 34px; border-radius: 12px; background: var(--green-800); color: #fff;
  font-weight: 800; display: grid; place-items: center; font-size: .95rem; margin-bottom: 12px;
}
.step h3 { font-size: 1rem; }
.step p { font-size: .88rem; color: var(--ink-500); margin: 0; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-strip-item { text-align: center; padding: 18px 10px; }
.stat-strip-value { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; color: var(--green-700); letter-spacing: -.02em; }
.stat-strip-label { font-size: .84rem; color: var(--ink-500); font-weight: 600; }

.cat-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  padding: 9px 16px; border-radius: 999px; font-size: .9rem; font-weight: 700; color: var(--ink-700);
}
.cat-chip svg { width: 17px; height: 17px; color: var(--green-700); }

.cta-band {
  background: linear-gradient(135deg, var(--green-800), var(--green-950));
  border-radius: var(--r-xl); padding: clamp(30px, 5vw, 52px); color: #D7ECE2; text-align: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band .btn-warm { margin-top: 10px; }

.faq { display: grid; gap: 12px; margin-top: 26px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.faq summary { font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--green-700); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; font-size: .92rem; color: var(--ink-500); }

/* --------------------------------------------------------------------------
   5b. PAGES — Report wizard
   -------------------------------------------------------------------------- */
.wizard { display: grid; grid-template-columns: 232px 1fr; gap: 26px; align-items: start; }
.wiz-steps { position: sticky; top: calc(var(--topbar-h) + 18px); display: grid; gap: 4px; }
.wiz-step {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-md);
  color: var(--ink-500); font-size: .9rem; font-weight: 700; border: 1px solid transparent;
}
.wiz-step .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); color: var(--ink-500);
  display: grid; place-items: center; font-size: .8rem; flex: 0 0 auto;
}
.wiz-step.is-active { background: var(--green-50); color: var(--green-900); border-color: var(--green-100); }
.wiz-step.is-active .n { background: var(--green-800); color: #fff; }
.wiz-step.is-done .n { background: var(--green-100); color: var(--green-800); }
.wiz-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.wiz-panel-head { padding: 22px 24px 0; }
.wiz-panel-body { padding: 18px 24px 24px; }
.wiz-nav {
  display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px;
  border-top: 1px solid var(--line); background: var(--bg); position: sticky; bottom: 0;
}
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.cat-tile {
  border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 16px 14px; cursor: pointer;
  background: #fff; text-align: left; transition: all .12s; display: grid; gap: 8px; justify-items: start;
}
.cat-tile:hover { border-color: var(--green-600); box-shadow: var(--sh-1); }
.cat-tile.is-active { border-color: var(--green-800); background: var(--green-50); box-shadow: var(--ring); }
.cat-tile .icon-tile { margin: 0; width: 40px; height: 40px; border-radius: 12px; }
.cat-tile .cat-name { font-weight: 700; color: var(--ink); font-size: .93rem; }
.cat-tile .cat-desc { font-size: .78rem; color: var(--ink-500); }

/* Grouped issue picker (Witness) */
.cat-group { margin-bottom: 20px; }
.cat-group:last-child { margin-bottom: 0; }
.cat-group-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); font-weight: 800; margin-bottom: 10px; }

/* Agency routing (Witness) */
.agency-chip {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--ink-700);
}
.agency-chip svg { width: 15px; height: 15px; color: var(--green-700); }
.agency-chip.is-suggest { cursor: pointer; transition: all .12s; }
.agency-chip.is-suggest:hover { border-color: var(--green-600); box-shadow: var(--sh-1); }
.agency-chip.is-on { background: var(--green-50); border-color: var(--green-700); color: var(--green-900); }
.ag-suggest-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.ag-details { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; background: #fff; }
.ag-details > summary { cursor: pointer; font-weight: 600; color: var(--green-900); font-size: .9rem; }
.ag-details[open] > summary { margin-bottom: 4px; }
.ag-wrap { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ag-group { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; background: #fff; }
.ag-group-title { font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); font-weight: 800; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.ag-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.ag-row:last-child { border-bottom: 0; }
.ag-row:hover { background: var(--green-50); }
.ag-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green-700); flex: 0 0 auto; }
.ag-row .ag-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; flex: 0 0 auto; }
.ag-row .ag-ic svg { width: 18px; height: 18px; }
.ag-txt { display: grid; gap: 2px; }
.ag-name { font-weight: 700; color: var(--ink); font-size: .9rem; }
.ag-desc { font-size: .78rem; color: var(--ink-500); }

/* Reports-by-agency board (admin) */
.ag-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ag-card { display: block; text-decoration: none; border: 1px solid var(--line); transition: all .12s; }
.ag-card:hover { border-color: var(--green-600); box-shadow: var(--sh-1); transform: translateY(-1px); }
.ag-card .ag-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; flex: 0 0 auto; }
.ag-card .ag-ic svg { width: 20px; height: 20px; }
.ag-stat { font-size: .84rem; color: var(--ink-500); }
.ag-num { font-weight: 800; color: var(--green-700); font-size: 1.3rem; }

.review-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.review-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: .92rem; border-bottom: 1px solid var(--line-soft); background: #fff; }
.review-row:last-child { border-bottom: 0; }
.review-row .k { color: var(--ink-500); font-weight: 600; }
.review-row .v { font-weight: 700; color: var(--ink); text-align: right; }

/* Location picker */
.loc-picker { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.loc-preview { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); min-height: 240px; position: relative; }
.gps-status { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 700; }
.gps-status.ok { color: var(--success); }
.gps-status.off { color: var(--ink-500); }

/* Confirmation */
.confirm-hero { text-align: center; padding: 40px 20px 8px; }
.confirm-check {
  width: 84px; height: 84px; border-radius: 50%; background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; margin: 0 auto 18px; animation: pop .3s ease;
}
.confirm-check svg { width: 42px; height: 42px; }
.ref-box {
  display: inline-flex; align-items: center; gap: 12px; background: var(--green-50);
  border: 1.5px dashed var(--green-600); border-radius: var(--r-md); padding: 14px 22px; margin-top: 6px;
}
.ref-box .ref-id { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 800; color: var(--green-900); letter-spacing: .06em; }

/* --------------------------------------------------------------------------
   5c. PAGES — Feed / Map
   -------------------------------------------------------------------------- */
.feed-layout { display: grid; grid-template-columns: 1.25fr .95fr; gap: 20px; align-items: start; }
.map-shell { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); height: 560px; }
.map-canvas { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.map-canvas:active { cursor: grabbing; }
.map-tile { position: absolute; user-select: none; pointer-events: none; image-rendering: auto; }
.map-fallback { position: absolute; inset: 0; background:
   linear-gradient(rgba(14,92,67,.05) 1px, transparent 1px),
   linear-gradient(90deg, rgba(14,92,67,.05) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px; background-color: #EDF3F0; }
.map-water { position: absolute; background: #CDE3EF; opacity: .8; border-radius: 40% 55% 50% 45%; }
.map-marker { position: absolute; transform: translate(-50%, -100%); cursor: pointer; z-index: 5; }
.map-pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg);
  background: var(--green-700); border: 2.5px solid #fff; box-shadow: var(--sh-2); display: grid; place-items: center;
}
.map-pin svg { width: 14px; height: 14px; color: #fff; transform: rotate(45deg); }
.map-pin.t-urgent { background: var(--danger); }
.map-pin.t-high { background: var(--amber-deep); }
.map-pin.t-resolved { background: var(--success); }
.map-pin.t-muted { background: var(--slate); }
.map-pin.selected { outline: 3px solid rgba(23,128,95,.4); outline-offset: 2px; }
.map-pin-pulse { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(23,128,95,.25); animation: pulse 2s ease-out infinite; z-index: -1; }
@keyframes pulse { 0% { transform: translate(-50%,-50%) scale(.5); opacity: .9; } 100% { transform: translate(-50%,-50%) scale(1.6); opacity: 0; } }
.map-controls { position: absolute; right: 12px; top: 12px; display: grid; gap: 8px; z-index: 10; }
.map-ctrl { width: 38px; height: 38px; border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); cursor: pointer; display: grid; place-items: center; font-weight: 800; color: var(--ink-700); }
.map-ctrl:hover { border-color: var(--green-600); color: var(--green-800); }
.map-legend {
  position: absolute; left: 12px; bottom: 12px; background: rgba(255,255,255,.95); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 13px; font-size: .74rem; font-weight: 700; display: flex; gap: 12px; flex-wrap: wrap;
  box-shadow: var(--sh-1); max-width: calc(100% - 24px);
}
.legend-dot { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-note { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 10px; padding: 6px 11px; font-size: .72rem; font-weight: 700; color: var(--ink-500); z-index: 10; }
.map-popup {
  position: absolute; transform: translate(-50%, calc(-100% - 40px)); background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--sh-3); width: 240px; z-index: 20; overflow: hidden; animation: pop .15s ease;
}
.map-popup .mp-img { height: 96px; background: linear-gradient(135deg, #2E8B69, #0A4A36); display: grid; place-items: center; color: rgba(255,255,255,.9); }
.map-popup .mp-img svg { width: 30px; height: 30px; }
.map-popup .mp-body { padding: 11px 13px 13px; }
.map-popup .mp-title { font-size: .86rem; font-weight: 800; color: var(--ink); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar .search-wrap { flex: 1; min-width: 220px; }
.filter-bar .select { width: auto; min-width: 140px; padding: 10px 36px 10px 12px; font-size: .88rem; }

.feed-list { display: grid; gap: 14px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.feed-item { display: grid; grid-template-columns: 92px 1fr; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; cursor: pointer; transition: all .12s; text-decoration: none; color: inherit; }
.feed-item:hover { border-color: var(--green-600); box-shadow: var(--sh-2); text-decoration: none; }
.feed-item.is-selected { border-color: var(--green-800); box-shadow: var(--ring); }
.feed-thumb { width: 92px; height: 76px; border-radius: 10px; background: linear-gradient(135deg, #2E8B69, #0A4A36); display: grid; place-items: center; color: rgba(255,255,255,.85); overflow: hidden; }
.feed-thumb svg { width: 26px; height: 26px; }
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-body { min-width: 0; }
.feed-title { font-weight: 800; color: var(--ink); font-size: .95rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feed-meta { font-size: .78rem; color: var(--ink-500); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.feed-desc { font-size: .85rem; color: var(--ink-700); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --------------------------------------------------------------------------
   5d. PAGES — Citizen dashboard / wallet / profile
   -------------------------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.report-card-top { display: grid; grid-template-columns: 130px 1fr; gap: 0; }
.report-card-media { background: linear-gradient(135deg, #2E8B69, #0A4A36); min-height: 128px; display: grid; place-items: center; color: rgba(255,255,255,.85); }
.report-card-media img { width: 100%; height: 100%; object-fit: cover; }
.report-card-media svg { width: 34px; height: 34px; }
.report-card-body { padding: 15px 17px; }
.report-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 17px; background: var(--bg); border-top: 1px solid var(--line); flex-wrap: wrap; }

.status-track { display: flex; gap: 0; margin: 14px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.st-node { flex: 1; min-width: 84px; text-align: center; position: relative; font-size: .68rem; font-weight: 700; color: var(--ink-400); }
.st-node::before { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--bg-2); border: 2.5px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 2; }
.st-node::after { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 1; }
.st-node:first-child::after { display: none; }
.st-node.is-done { color: var(--green-800); }
.st-node.is-done::before { background: var(--green-700); border-color: var(--green-700); }
.st-node.is-done::after { background: var(--green-700); }
.st-node.is-current { color: var(--amber-deep); }
.st-node.is-current::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }

.wallet-card {
  background: linear-gradient(140deg, var(--green-700) 0%, var(--green-950) 100%);
  border-radius: var(--r-lg); padding: 24px; color: #D8EFE4; position: relative; overflow: hidden;
}
.wallet-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.06); }
.wallet-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: #8FBFA9; }
.wallet-balance { font-size: 2.6rem; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.wallet-balance span { font-size: .95rem; font-weight: 700; color: #A9D3C0; letter-spacing: .04em; }
.wallet-row { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.wallet-mini .wm-val { font-size: 1.15rem; font-weight: 800; color: #fff; }
.wallet-mini .wm-key { font-size: .74rem; color: #8FBFA9; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.wallet-progress { margin-top: 18px; }
.wallet-progress .wp-track { height: 8px; background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; }
.wallet-progress .wp-fill { height: 100%; background: linear-gradient(90deg, var(--amber), #FFD79A); border-radius: 99px; transition: width .5s ease; }
.wallet-progress .wp-label { display: flex; justify-content: space-between; font-size: .76rem; color: #A9D3C0; margin-top: 7px; font-weight: 700; }

.tx-list { display: grid; gap: 0; }
.tx-item { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line-soft); }
.tx-item:last-child { border-bottom: 0; }
.tx-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.tx-icon.t-plus { background: var(--success-soft); color: var(--success); }
.tx-icon.t-minus { background: var(--amber-soft); color: var(--amber-deep); }
.tx-icon.t-pending { background: var(--slate-soft); color: var(--slate); }
.tx-icon svg { width: 18px; height: 18px; }
.tx-body { flex: 1; min-width: 0; }
.tx-title { font-weight: 700; color: var(--ink); font-size: .9rem; }
.tx-sub { font-size: .78rem; color: var(--ink-500); }
.tx-amount { font-weight: 800; font-size: .98rem; white-space: nowrap; }
.tx-amount.plus { color: var(--success); }
.tx-amount.minus { color: var(--amber-deep); }
.tx-amount.pending { color: var(--ink-400); }

.notif-item { display: flex; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; align-items: flex-start; }
.notif-item.is-unread { background: var(--green-50); border-color: var(--green-100); }
.notif-icon { width: 40px; height: 40px; border-radius: 13px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; flex: 0 0 auto; }
.notif-icon svg { width: 19px; height: 19px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: .92rem; color: var(--ink); }
.notif-text { font-size: .85rem; color: var(--ink-700); margin-top: 2px; }
.notif-time { font-size: .74rem; color: var(--ink-400); margin-top: 4px; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); flex: 0 0 auto; margin-top: 6px; }

/* Profile */
.profile-head { display: flex; gap: 18px; align-items: center; }
.avatar {
  width: 62px; height: 62px; border-radius: 20px; background: var(--green-800); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: 0 0 auto;
}
.avatar-sm { width: 36px; height: 36px; border-radius: 12px; font-size: .85rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-info { flex: 1; }
.setting-name { font-weight: 700; color: var(--ink); font-size: .94rem; }
.setting-desc { font-size: .82rem; color: var(--ink-500); margin-top: 2px; }

/* Auth */
.auth-card { max-width: 440px; margin: 34px auto; }
.auth-tabs { display: flex; background: var(--bg-2); border-radius: var(--r-pill); padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: var(--r-pill); font-weight: 700; font-size: .9rem; color: var(--ink-500); cursor: pointer; }
.auth-tabs button.is-active { background: #fff; color: var(--green-900); box-shadow: var(--sh-1); }

/* Evidence gallery */
.evidence-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.evidence-cell { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--bg-2); cursor: zoom-in; }
.evidence-cell img, .evidence-cell video { width: 100%; height: 100%; object-fit: cover; }
.evidence-cell .ev-tag { position: absolute; left: 7px; bottom: 7px; background: rgba(0,0,0,.62); color: #fff; font-size: .66rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.evidence-cell .ev-dl { position: absolute; right: 7px; top: 7px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; cursor: pointer; z-index: 2; }
.evidence-cell .ev-dl:hover, .evidence-cell .ev-dl:focus-visible { background: var(--green-800, #0E5C43); }
.evidence-cell .ev-dl svg { width: 17px; height: 17px; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.meta-list { display: grid; gap: 0; }
.meta-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.meta-row:last-child { border-bottom: 0; }
.meta-row .mk { color: var(--ink-500); font-weight: 600; }
.meta-row .mv { font-weight: 700; color: var(--ink); text-align: right; }

.note-item { background: var(--amber-soft); border: 1px solid #F0D9AC; border-radius: var(--r-sm); padding: 11px 14px; font-size: .87rem; color: #6B4A0B; margin-bottom: 8px; }
.note-item .note-meta { font-size: .74rem; font-weight: 700; color: var(--amber-ink); margin-top: 4px; }

/* --------------------------------------------------------------------------
   6. ADMIN
   -------------------------------------------------------------------------- */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; box-shadow: var(--sh-1); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-title { font-weight: 800; color: var(--ink); font-size: .96rem; }
.chart-sub { font-size: .78rem; color: var(--ink-500); }
.chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: .78rem; color: var(--ink-500); font-weight: 600; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 46px; gap: 10px; align-items: center; font-size: .84rem; margin-bottom: 9px; }
.hbar-label { color: var(--ink-700); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--bg-2); height: 12px; border-radius: 99px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-800)); border-radius: 99px; }
.hbar-val { text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.queue-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.queue-toolbar .search-wrap { flex: 1; min-width: 200px; }
.chipbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }

.action-bar { display: flex; gap: 9px; flex-wrap: wrap; }
.detail-actions { display: grid; gap: 10px; }
.btn-approve { background: var(--success); color: #fff; }
.btn-approve:hover { background: #0B6549; color: #fff; }

.ai-card {
  background: linear-gradient(135deg, #F3F0FC, #FBF7EE); border: 1.5px dashed #C9BFF0;
  border-radius: var(--r-lg); padding: 22px;
}
.ai-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--violet); color: #fff; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; padding: 4px 11px; border-radius: 999px; }
.roadmap-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.roadmap-item:last-child { border-bottom: 0; }
.roadmap-status { font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; height: fit-content; text-transform: uppercase; letter-spacing: .06em; }
.roadmap-status.planned { background: var(--info-soft); color: var(--info); }
.roadmap-status.concept { background: var(--slate-soft); color: var(--slate); }
.roadmap-status.next { background: var(--amber-soft); color: var(--amber-ink); }

/* --------------------------------------------------------------------------
   7. UTILITIES
   -------------------------------------------------------------------------- */
.row { display: flex; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 22px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.hidden-mobile { display: initial; }
.only-mobile { display: none; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb { font-size: .82rem; color: var(--ink-500); margin-bottom: 14px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-500); font-weight: 600; }
.breadcrumb a:hover { color: var(--green-700); }
.link-quiet { color: var(--ink-500); font-weight: 600; font-size: .88rem; }
.link-quiet:hover { color: var(--green-700); }

/* --------------------------------------------------------------------------
   8. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 38px; padding-bottom: 46px; }
  .hero-art { order: -1; display: none; }
  .hero {
    background-image:
      linear-gradient(rgba(5, 42, 31, .95), rgba(5, 42, 31, .88)),
      url("../assets/hero-banner.webp");
    background-position: 24% center;
  }
  html.product-witness .hero {
    background-image:
      linear-gradient(rgba(5, 42, 31, .95), rgba(5, 42, 31, .88)),
      url("../assets/hero-banner-witness.webp?v=20261029");
    background-position: 30% center;
  }
  .wizard { grid-template-columns: 1fr; }
  .wiz-steps { position: static; grid-auto-flow: column; grid-auto-columns: 1fr; overflow-x: auto; }
  .wiz-step { flex-direction: column; align-items: center; text-align: center; font-size: .72rem; gap: 6px; padding: 8px 4px; }
  .feed-layout, .detail-grid, .dash-grid, .loc-picker { grid-template-columns: 1fr; }
  .map-shell { height: 380px; }
  .feed-list { max-height: none; }
  .admin-shell { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--sh-3); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: grid; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .section { padding: 44px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .report-card-top { grid-template-columns: 1fr; }
  .report-card-media { min-height: 150px; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .table { min-width: 640px; }
  .kpi-grid { gap: 10px; }
  .stat-value { font-size: 1.5rem; }
  .only-mobile { display: initial; }
  .hidden-mobile { display: none !important; }
  .topbar-inner { gap: 10px; }
  .brand-sub { display: none; }
  .modal { max-height: 92vh; }
  .feed-item { grid-template-columns: 76px 1fr; }
  .feed-thumb { width: 76px; height: 66px; }
}
@media (min-width: 921px) {
  .bottomnav { display: none; }
  .has-bottomnav { padding-bottom: 40px; }
}

/* Mobile drawer menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 150; display: block;
}
.mobile-menu .mm-backdrop { position: absolute; inset: 0; background: rgba(8,22,17,.5); }
.mobile-menu .mm-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: #fff;
  padding: 20px; box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 6px; animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.mm-link { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
.mm-link:hover { background: var(--green-50); text-decoration: none; }
.mm-link.is-active { background: var(--green-100); color: var(--green-900); }
.mm-link svg { width: 19px; height: 19px; color: var(--green-700); }

/* --------------------------------------------------------------------------
   9. MOTION / PRINT / ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .bottomnav, .sidebar, .site-footer, .btn, .filter-bar, .map-controls { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* --------------------------------------------------------------------------
   10. LIVE CAMERA CAPTURE (report evidence: camera + microphone)
   -------------------------------------------------------------------------- */
.cap-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(4, 24, 17, .93); display: grid; place-items: center; padding: 16px; }
.cap-modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px);
  background: #072019; border: 1px solid rgba(255,255,255,.12); border-radius: 20px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.cap-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #EAF4F0; }
.cap-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .95rem; }
.cap-title svg { width: 18px; height: 18px; }
.cap-head .icon-btn { color: #EAF4F0; background: rgba(255,255,255,.08); }
.cap-stage { position: relative; flex: 1 1 auto; min-height: 260px; background: #000; }
.cap-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cap-status {
  position: absolute; inset: 0; z-index: 2; background: #05130E;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; padding: 26px; color: #DCEDE7;
}
.cap-status[hidden] { display: none; }
.cap-status .spinner { width: 26px; height: 26px; border-color: rgba(255,255,255,.25); border-top-color: #7FD1B2; }
.cap-status p { margin: 0; font-weight: 800; font-size: .98rem; }
.cap-status .cap-status-sub { font-weight: 500; font-size: .84rem; color: #9DB8AE; max-width: 340px; line-height: 1.55; }
.cap-status.is-error svg { width: 34px; height: 34px; color: var(--amber); }
.cap-denied-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.cap-denied-actions .btn-secondary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.45); color: #fff; }
.cap-denied-actions .btn-secondary:hover { background: rgba(255,255,255,.2); color: #fff; }
.cap-rec {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.6); color: #fff; padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .05em;
}
.cap-rec[hidden] { display: none; }
.cap-rec i { width: 9px; height: 9px; border-radius: 50%; background: #FF4D4D; animation: capblink 1s steps(2, start) infinite; }
@keyframes capblink { 50% { opacity: .2; } }
.cap-controls { flex: 0 0 auto; padding: 14px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cap-tabs { display: inline-flex; gap: 4px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px; }
.cap-tabs button {
  border: 0; background: transparent; color: #BFD6CC; font-family: inherit; font-weight: 700; font-size: .85rem;
  padding: 7px 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
}
.cap-tabs button svg { width: 15px; height: 15px; }
.cap-tabs button.is-active { background: #fff; color: #0A4A36; }
.cap-tabs button:disabled { opacity: .4; cursor: not-allowed; }
.cap-shutter {
  width: 72px; height: 72px; padding: 0; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.9); background: rgba(255,255,255,.14);
  position: relative; cursor: pointer; transition: transform .12s ease, border-color .18s ease;
}
.cap-shutter:active { transform: scale(.94); }
.cap-shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; transition: all .18s ease; }
.cap-shutter.is-rec { border-color: #FF7A7A; }
.cap-shutter.is-rec::after { inset: 15px; border-radius: 8px; background: #FF4D4D; }
.cap-shutter:disabled { opacity: .35; cursor: not-allowed; }
.cap-controls .btn-ghost { color: #CFE3DB; }
.cap-controls .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.cap-hint { margin: 0; font-size: .75rem; color: #8FA9A0; display: flex; align-items: center; gap: 6px; text-align: center; }
.cap-hint svg { width: 13px; height: 13px; flex: 0 0 auto; }
.cap-hint[hidden] { display: none; }
@media (max-width: 560px) {
  .cap-wrap { padding: 0; }
  .cap-modal { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; }
}

/* ================================================================== */
/* Splash (first paint) + connection screen (backend unreachable)     */
/* ================================================================== */
.splash {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px;
}
.splash-logo { width: 104px; height: 104px; object-fit: contain; margin-bottom: 14px; }
.splash-name { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.splash-tag { font-size: .92rem; color: var(--ink-500); margin-top: 4px; }
.splash-spin {
  width: 30px; height: 30px; border-radius: 50%; margin-top: 26px;
  border: 3px solid var(--green-100); border-top-color: var(--green-800);
  animation: ew-spin .8s linear infinite;
}
.splash-status { margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--green-800); }
@keyframes ew-spin { to { transform: rotate(360deg); } }

.conn-screen {
  min-height: 72vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 48px 18px;
}
.conn-logo { width: 88px; height: 88px; object-fit: contain; }
.conn-screen h1 { font-size: 1.5rem; margin: 14px 0 2px; color: var(--ink); }
.conn-sub { color: var(--ink-500); font-size: .95rem; margin: 0 0 22px; }
.conn-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--sh-1); padding: 26px 24px; max-width: 430px; width: 100%;
}
.conn-card h2 { font-size: 1.05rem; margin: 12px 0 6px; color: var(--ink); }
.conn-card p { font-size: .93rem; color: var(--ink-700); margin: 0 0 8px; }
.conn-card .btn { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .splash-spin { animation-duration: 1.8s; } }

/* ==========================================================================
   Capture-first wizard: auto status bar + evidence tags
   ========================================================================== */
.auto-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.auto-item {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: .82rem; font-weight: 600; color: var(--ink-700);
}
.auto-item svg { width: 16px; height: 16px; }
.auto-item.ok { border-color: #BFE0D0; background: var(--green-50); color: var(--green-800); }
.auto-item.warn { border-color: #EBD3A8; background: var(--amber-soft); color: var(--amber-ink); }
.mini-map { border-radius: var(--r-md, 12px); overflow: hidden; border: 1px solid var(--line); }

.media-tagbtn {
  position: absolute; left: 7px; top: 7px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; cursor: pointer;
}
.media-tagbtn:hover, .media-tagbtn:focus-visible { background: var(--green-800, #0E5C43); }
.media-tagbtn svg { width: 15px; height: 15px; }
.media-tagcount {
  position: absolute; right: 7px; bottom: 7px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.62); color: #fff; font-size: .66rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.media-tagcount svg { width: 12px; height: 12px; }

/* tagged evidence must not crop, or the pins would point at the wrong spot */
.evidence-cell.has-tags img { object-fit: contain; }
.lightbox-media { position: relative; display: inline-block; max-width: 100%; }

.tag-pin {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 22px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: #e53935; color: #fff; font-size: .72rem; font-weight: 800;
  border: 2px solid #fff; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: none; z-index: 3;
}
.tag-pin.is-editable { pointer-events: auto; cursor: help; }

/* ------------------------------------------------------------ tag editor */
.tagger-stage {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2); cursor: crosshair;
}
.tagger-stage img { display: block; width: 100%; height: auto; }
.tagger-new { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.tagger-new .input { flex: 1 1 200px; }
.tagger-list { margin-top: 14px; display: grid; gap: 8px; }
.tagger-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff;
}
.tagger-row .tag-num {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  background: #e53935; color: #fff; font-size: .74rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.tagger-row .tag-text { flex: 1 1 auto; font-size: .9rem; }

/* ==========================================================================
   Learn & play (EnviroQuest)
   ========================================================================== */
.learn-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 18px;
}
.learn-hero-num { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.learn-hero-num span { font-size: 1.1rem; opacity: .75; font-weight: 600; }
.learn-hero-title { font-weight: 700; letter-spacing: .01em; }
.learn-hero .small.muted { color: rgba(255,255,255,.8); }
.learn-hero-stars { font-size: 1.3rem; color: #F5C451; }

.learn-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.learn-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-1);
}
.learn-card h3 { margin: 4px 0 0; font-size: 1.05rem; color: var(--ink); }
.learn-card-top { display: flex; align-items: center; justify-content: space-between; }
.learn-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }

.learn-ring {
  --pct: 0; width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--green-600) calc(var(--pct) * 1%), var(--green-100) 0);
  position: relative; font-size: .68rem; font-weight: 800; color: var(--ink);
}
.learn-ring::after {
  content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%;
}
.learn-ring b { position: relative; z-index: 1; }

.learn-lessons { display: grid; gap: 10px; }
.learn-lesson {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.learn-lesson.is-locked { opacity: .62; }
.learn-lesson.is-passed { border-color: #BFE0D0; background: var(--green-50); }
.learn-lesson > div:nth-child(2) { flex: 1 1 260px; }
.learn-lesson h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.learn-level {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-100); color: var(--green-900); font-weight: 800;
}
.learn-stars { color: #E0A32E; letter-spacing: 2px; font-size: .95rem; }

.learn-article {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px;
}
.learn-article-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.learn-article h1 { margin: 0 0 4px; font-size: 1.4rem; color: var(--ink); }
.learn-article h2 { font-size: 1.05rem; color: var(--green-900); margin: 20px 0 6px; }
.learn-article p { margin: 0 0 4px; line-height: 1.62; color: var(--ink-700); }
.learn-summary {
  font-size: 1.02rem; font-weight: 600; color: var(--ink) !important;
  border-left: 3px solid var(--green-600); padding-left: 12px; margin: 14px 0 4px;
}
.learn-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.learn-quiz { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.learn-quiz-bar { height: 6px; background: var(--green-100); border-radius: 999px; overflow: hidden; }
.learn-quiz-bar span { display: block; height: 100%; background: var(--green-600); transition: width .3s ease; }
.learn-quiz-count { font-size: .78rem; font-weight: 700; color: var(--ink-500); margin: 10px 0 4px; }
.learn-quiz h2 { font-size: 1.1rem; color: var(--ink); margin: 0 0 16px; }
.learn-options { display: grid; gap: 10px; }
.learn-option {
  text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font-size: .95rem; color: var(--ink-700); cursor: pointer; font-family: inherit;
}
.learn-option:hover:not(:disabled) { border-color: var(--green-600); background: var(--green-50); }
.learn-option:disabled { cursor: default; }
.learn-option.is-right { border-color: var(--green-600); background: var(--green-50); font-weight: 700; }
.learn-option.is-wrong { border-color: #E0A9A2; background: #FBEDEB; }
.learn-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; line-height: 1.55; }
.learn-feedback.is-right { background: var(--green-50); color: var(--green-900); }
.learn-feedback.is-wrong { background: var(--amber-soft); color: var(--amber-ink); }
.learn-quiz-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.learn-result {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 24px; text-align: center;
}
.learn-result.is-pass { border-color: #BFE0D0; background: linear-gradient(180deg, var(--green-50), #fff 60%); }
.learn-result-stars { font-size: 2.2rem; color: #E0A32E; letter-spacing: 4px; }
.learn-result h1 { margin: 8px 0 4px; font-size: 1.5rem; color: var(--ink); }
.learn-award {
  display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0;
  background: var(--green-900); color: #fff; border-radius: 999px; padding: 9px 18px; font-size: .92rem;
}
.learn-award.is-plain { background: var(--bg-2); color: var(--ink-700); }
.learn-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.learn-result-actions .callout, .learn-result .tiny { max-width: 460px; margin-left: auto; margin-right: auto; }
