/* ============================================================
   Buug Civil Registry Informative System (CRIS)
   Civic, document-ledger aesthetic — navy, cream, gold
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650;9..144,700&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --navy: #0b3a56;
  --navy-deep: #07283c;
  --navy-mid: #125078;
  --navy-soft: #1a6490;
  --gold: #c9a227;
  --gold-deep: #9a7a12;
  --gold-light: #e8d48b;
  --cream: #f6f1e6;
  --paper: #fffdf8;
  --ink: #1a2330;
  --muted: #5b6775;
  --line: #e4dccb;
  --teal: #1f6f64;
  --teal-soft: #e8f4f1;
  --rose: #8b2e2e;
  --ok: #1b7a4a;
  --ok-soft: #e7f6ee;
  --warn: #9a5b12;
  --warn-soft: #f8eedc;
  --shadow: 0 10px 30px rgba(7, 40, 60, 0.12);
  --shadow-lg: 0 24px 60px rgba(7, 40, 60, 0.18);
  --title-light: #ffffff;
  --service-red: #b3263a;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 72px;
  --tab-h: 68px;
  --max: 1180px;
  --font-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --step: 1rem;
  --focus: 0 0 0 3px var(--paper), 0 0 0 6px var(--gold);
}

html[data-size="lg"] { --step: 1.125rem; }
html[data-size="xl"] { --step: 1.25rem; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--step);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
body.has-page-bg {
  background-color: var(--cream);
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
.img-slot-preview {
  margin-top: 10px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #0b3a56; min-height: 140px;
}
.img-slot-preview img { width: 100%; height: 180px; object-fit: cover; }
.img-slot-empty { color: #e8dcc0; display: grid; place-items: center; min-height: 140px; font-size: 0.9rem; }
img { max-width: 100%; display: block; }
a { color: var(--navy-mid); text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--gold); color: var(--navy-deep); padding: 8px 14px;
  font-weight: 700; border-radius: 8px;
}
.skip:focus { top: 10px; }

/* ---------- Gov ribbon ---------- */
.ribbon {
  background: var(--navy-deep);
  color: #f3ead4;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 7px 20px;
}
.ribbon span { opacity: 0.92; }
.ribbon-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  background: transparent; color: #f3ead4; border: 1px solid rgba(232, 212, 139, 0.35);
  border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.chip-btn[aria-pressed="true"], .chip-btn.active {
  background: var(--gold); color: var(--navy-deep); border-color: var(--gold); font-weight: 700;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 3px var(--gold-light); }
.brand-text { min-width: 0; }
.brand-kicker {
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700; margin: 0;
}
.brand h1 {
  font-family: var(--font-display); font-size: 1.05rem; margin: 0;
  color: var(--navy); line-height: 1.15; font-weight: 650;
}
.brand-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42ch;
}
.brand-sub:empty { display: none; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
}
.icon-btn {
  width: 42px; height: 42px; background: var(--cream); color: var(--navy);
  border: 1px solid var(--line);
}
.btn {
  padding: 10px 18px; font-weight: 650;
}
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-mid); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.desktop-nav { display: none; gap: 4px; }
.desktop-nav a {
  text-decoration: none; color: var(--navy); font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 999px;
}
.desktop-nav a[aria-current="page"], .desktop-nav a:hover { background: var(--cream); color: var(--navy-deep); }
.search-wrap { position: relative; }
.search-wrap input {
  width: 210px; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px 8px 36px; color: var(--ink);
}
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.55; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 22px 20px 40px; }
main { min-height: 60vh; }
html.has-service-text-color .service-intro-text,
html.has-service-text-color .service-intro-text * {
  color: var(--service-text-color) !important;
}
.page { animation: rise 0.45s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page, * { animation: none !important; transition: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  min-height: 420px; display: grid; place-items: end stretch;
  background: var(--navy-deep);
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,40,60,0.25) 0%, rgba(7,40,60,0.78) 58%, rgba(7,40,60,0.94) 100%);
}
.hero-inner {
  position: relative; z-index: 1; max-width: var(--max); margin: 0 auto;
  padding: 48px 20px 36px; width: 100%;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(201,162,39,0.18); border: 1px solid rgba(232,212,139,0.45);
  color: var(--gold-light); padding: 6px 12px; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
}
.hero h2 {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.12; margin: 14px 0 10px; max-width: 18ch; font-weight: 650;
}
.hero p.lead { max-width: 52ch; color: #efe6d2; font-size: 1.08rem; margin: 0 0 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 28px;
}
.stat {
  background: rgba(255,253,248,0.08); border: 1px solid rgba(232,212,139,0.22);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.stat b { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--gold-light); }
.stat span { font-size: 0.82rem; color: #d9cda8; }

/* ---------- Cards / grids ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 8px 0 18px; }
.section-head h2, .page-title {
  font-family: var(--font-display); color: var(--title-light); margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 650;
  background: var(--navy); padding: 6px 14px; border-radius: 12px;
}
.kicker { color: var(--gold-deep); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; font-weight: 700; margin: 0 0 6px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card.clickable { text-decoration: none; color: inherit; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card img.cover { height: 150px; width: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-family: var(--font-display); color: var(--service-red); font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--cream); color: var(--navy); border-radius: 999px; padding: 4px 9px;
  border: 1px solid var(--line);
}
.tag.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.tag.gold { background: #f4ead0; color: var(--gold-deep); border-color: transparent; }
.tag.rose { background: #f7e8e8; color: var(--rose); border-color: transparent; }

.quick {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.quick a {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 14px; text-decoration: none; color: var(--title-light);
  display: flex; flex-direction: column; gap: 8px; min-height: 118px;
  box-shadow: var(--shadow);
}
.quick a:hover { border-color: var(--gold); }
.quick .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy); color: var(--gold-light);
}
.quick strong { font-size: 0.98rem; }
.quick span { color: var(--muted); font-size: 0.85rem; }

/* ---------- Service detail ---------- */
.crumb { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--navy-mid); }
.detail-hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 22px; align-items: start; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.panel h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 12px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  position: relative; padding: 0 0 18px 52px; border-left: 2px solid var(--gold-light); margin-left: 16px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -17px; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--gold-light);
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
}
.req-list { margin: 0; padding-left: 18px; }
.req-list li { margin: 6px 0; }
.fee-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.fee-row:last-child { border-bottom: 0; }
.note {
  background: var(--warn-soft); border-left: 4px solid var(--gold);
  padding: 12px 14px; border-radius: 0 12px 12px 0; color: var(--ink); font-size: 0.92rem;
}
.note.info { background: var(--teal-soft); border-left-color: var(--teal); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--navy); color: #fff; font-weight: 650; font-size: 0.88rem; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
tr:nth-child(even) td { background: #fbf7ee; }

/* ---------- Visit / map ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.map-frame {
  border: 0; width: 100%; height: 340px; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.hours { list-style: none; padding: 0; margin: 0; }
.hours li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }

/* ---------- FAQ ---------- */
details.faq {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px;
}
details.faq + details.faq { margin-top: 8px; }
details.faq summary {
  cursor: pointer; font-weight: 650; color: var(--navy); padding: 12px 0; list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--gold-deep); font-size: 1.2rem; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); margin: 0 0 14px; }

/* ---------- Comments ---------- */
.comment-form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { font-weight: 650; color: var(--navy); font-size: 0.9rem; display: block; margin-bottom: 6px; }
.field { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; color: var(--ink); }
textarea.field { min-height: 120px; resize: vertical; }
.help { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.stars { display: flex; gap: 4px; }
.stars button {
  background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: #d0c4a4; line-height: 1;
}
.stars button[aria-checked="true"], .stars button.on { color: var(--gold); }
.comment-list { display: grid; gap: 12px; }
.comment {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
}
.comment header { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.comment .who { font-weight: 700; color: var(--navy); }
.comment .when { font-size: 0.8rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.filter {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  color: var(--navy); font-weight: 600; font-size: 0.85rem;
}
.filter[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { text-align: center; color: var(--muted); padding: 28px; }

/* ---------- Staff directory ---------- */
.staff-intro { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; margin: 18px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.staff-intro img { width: 100%; height: 145px; object-fit: cover; }
.staff-intro p { margin: 18px 20px 18px 0; max-width: 62ch; color: var(--muted); }
.staff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.staff-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.staff-avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold-light); font-weight: 800; letter-spacing: .04em; }
.staff-role { color: var(--gold-deep) !important; font-size: .75rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 2px 0 4px !important; }
.staff-card h3 { font-family: var(--font-display); color: var(--navy); margin: 0; font-size: 1.12rem; line-height: 1.2; }
.staff-card p:not(.staff-role) { color: var(--muted); margin: 7px 0 0; font-size: .92rem; }
.staff-contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.staff-contact a { font-size: .9rem; font-weight: 650; }

/* ---------- Download ---------- */
.dl-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 22px; align-items: center; }
.os-card { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.os-card + .os-card { margin-top: 10px; }
.os-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--navy-deep);
  display: grid; place-items: center; font-weight: 800; flex: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: #e8dcc0; padding: 36px 20px 28px; margin-top: 12px;
}
.footer-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer h3 { font-family: var(--font-display); color: var(--gold-light); margin: 0 0 10px; font-size: 1.05rem; }
.site-footer a { color: #f3ead4; }
.site-footer p, .site-footer li { font-size: 0.92rem; }
.legal { border-top: 1px solid rgba(232,212,139,0.2); margin-top: 22px; padding-top: 14px; font-size: 0.8rem; color: #cbbd98; max-width: var(--max); margin-left: auto; margin-right: auto; }

/* ---------- Bottom tabs (mobile app chrome) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,253,248,0.96); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  text-decoration: none; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 0.68rem; font-weight: 700; padding: 6px 2px; border-radius: 12px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--navy); background: var(--cream); }
.install-banner {
  position: sticky; bottom: calc(var(--tab-h) + 8px); z-index: 45;
  margin: 0 12px 12px; background: var(--navy); color: #fff;
  border-radius: 16px; padding: 12px 14px; display: none; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
}
.install-banner.show { display: flex; }
.install-banner strong { display: block; }
.install-banner p { margin: 0; font-size: 0.85rem; color: #e8dcc0; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--navy-deep); color: #fff; padding: 12px 16px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: 0.25s ease; z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Search overlay ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(7,40,60,0.55); z-index: 70;
  display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px;
}
.overlay.open { display: flex; }
.overlay-card { background: var(--paper); width: min(640px, 100%); border-radius: 18px; padding: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; text-align: left; cursor: pointer;
  color: var(--navy); font-weight: 650;
}
.choice:hover, .choice:focus { border-color: var(--gold); }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; margin-right: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .quick, .stats, .detail-hero, .visit-grid, .dl-grid, .footer-inner, .form-row, .wizard, .staff-grid { grid-template-columns: 1fr 1fr; }
  .desktop-nav, .search-wrap { display: none; }
  .brand h1 { font-size: 0.92rem; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .quick, .stats, .detail-hero, .visit-grid, .dl-grid, .footer-inner, .form-row, .wizard, .staff-grid, .staff-intro { grid-template-columns: 1fr; }
  .staff-intro img { height: 180px; }
  .staff-intro p { margin: 0 18px 18px; }
  .hero { min-height: 520px; }
  .hero h2 { max-width: none; }
  .header-inner { padding: 8px 12px; }
  .brand img { width: 44px; height: 44px; }
  .btn-label { display: none; }
  .ribbon { font-size: 0.68rem; padding: 6px 10px; }
}
@media (min-width: 961px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .desktop-nav { display: flex; }
  .install-banner { bottom: 16px; max-width: 520px; margin-left: auto; margin-right: auto; }
}

/* ---------- Admin desk ---------- */
body.admin-mode { padding-bottom: 0; background: #eef2f5; }
body.admin-mode .tabbar,
body.admin-mode .install-banner,
body.admin-mode .desktop-nav,
body.admin-mode .search-wrap { display: none !important; }
.admin-shell {
  display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 120px);
}
.admin-side {
  background: var(--navy-deep); color: #f3ead4; padding: 22px 16px;
}
.admin-side h2 { font-family: var(--font-display); color: var(--gold-light); margin: 0 0 16px; font-size: 1.3rem; }
.admin-side nav { display: flex; flex-direction: column; gap: 4px; }
.admin-side nav a, .admin-side nav button {
  color: #f3ead4; text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 600;
  background: transparent; border: 0; text-align: left; width: 100%; cursor: pointer; font: inherit;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.inbox-badge {
  display: inline-flex; min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--gold); color: var(--navy-deep);
  font-size: 0.7rem; font-weight: 800; align-items: center; justify-content: center;
}
.inbox-badge[hidden] { display: none !important; }
.comment.is-new { box-shadow: 0 0 0 2px var(--gold); }
.report-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
@media (min-width: 900px) {
  .report-grid { grid-template-columns: repeat(3, 1fr); }
}
.report-grid-home { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) {
  .report-grid-home { grid-template-columns: repeat(4, 1fr); }
}
.report-card {
  margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block;
}
.report-controls {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
}
.report-controls .help { flex: 1; }
.report-carousel {
  display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 2px 2px 14px;
  scrollbar-color: var(--navy-mid) var(--cream);
}
.report-carousel .report-card {
  flex: 0 0 min(380px, 88vw); scroll-snap-align: start;
}
.report-carousel:focus-visible { box-shadow: var(--focus); border-radius: var(--radius); }
.report-lightbox, .event-lightbox, .announcement-lightbox {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(7, 40, 60, 0.9); padding: 14px;
}
.report-lightbox[hidden], .event-lightbox[hidden], .announcement-lightbox[hidden] { display: none; }
.report-lightbox img, .event-lightbox img, .announcement-lightbox img { max-width: 100%; max-height: 94vh; object-fit: contain; border-radius: 10px; box-shadow: var(--shadow-lg); }
.report-lightbox-close, .report-lightbox-nav, .event-lightbox-close, .announcement-lightbox-close {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,0.16);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.7rem; line-height: 1;
}
.report-lightbox-close, .event-lightbox-close, .announcement-lightbox-close { top: 16px; right: 16px; }
.report-lightbox-nav { top: 50%; transform: translateY(-50%); }
.report-lightbox-nav.prev { left: 14px; }
.report-lightbox-nav.next { right: 14px; }
.report-lightbox-nav { display: none; }
.report-lightbox-close:hover, .report-lightbox-nav:hover, .event-lightbox-close:hover, .announcement-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.report-card img {
  width: 100%; height: 220px; object-fit: contain; background: #f3eee4; display: block;
}
.report-card figcaption, .report-card caption {
  padding: 10px 14px 14px; font-size: 0.9rem; color: var(--navy); font-weight: 650;
}
.report-admin-list .img-slot-preview img { object-fit: contain; background: #f3eee4; }
.svc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.svc-admin-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap;
}
.svc-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-admin-card details { margin-top: 10px; }
.svc-admin-card summary {
  cursor: pointer; font-weight: 700; color: var(--navy);
}
.svc-cover img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; }
.event-grid { display: grid; gap: 14px; }
.announcement-controls {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
}
.announcement-controls .help { flex: 1; }
.announcement-carousel {
  display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 2px 2px 14px;
  scrollbar-color: var(--navy-mid) var(--cream);
}
.announcement-card {
  flex: 0 0 min(360px, 88vw); scroll-snap-align: start; min-height: 220px;
}
.announcement-carousel:focus-visible { box-shadow: var(--focus); border-radius: var(--radius); }
@media (min-width: 800px) {
  .event-grid { grid-template-columns: repeat(2, 1fr); }
}
.event-card {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.event-date {
  background: var(--navy); color: #fff; border-radius: 12px; text-align: center;
  padding: 10px 6px 12px; line-height: 1.1;
}
.event-date b { display: block; font-size: 1.6rem; font-weight: 800; }
.event-date span { display: block; font-size: 0.8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.event-date small { display: block; font-size: 0.72rem; opacity: .8; margin-top: 4px; }
.event-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--service-red); }
.event-card.has-photo { grid-template-columns: 76px 1fr 140px; }
.event-card > img {
  width: 140px; height: 110px; object-fit: cover; border-radius: 12px; background: #f3eee4;
  cursor: pointer;
}
@media (max-width: 640px) {
  .report-lightbox, .event-lightbox, .announcement-lightbox { padding: 8px; }
  .report-lightbox-close, .event-lightbox-close, .announcement-lightbox-close { width: 40px; height: 40px; }
  .report-controls .help { font-size: 0.74rem; }
  .announcement-controls .help { font-size: 0.74rem; }
  .event-card.has-photo { grid-template-columns: 76px 1fr; }
  .event-card > img { width: 100%; height: 140px; grid-column: 1 / -1; }
}
.ev-cover img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; }
.admin-side nav a.on, .admin-side nav a:hover,
.admin-side nav button.on, .admin-side nav button:hover { background: rgba(201,162,39,0.18); color: #fff; }
.admin-main { padding: 28px 24px 48px; }
.admin-card textarea.field { min-height: 80px; }
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
}

@media (display-mode: standalone) {
  [data-install], .install-banner { display: none !important; }
  .ribbon { padding-top: calc(6px + env(safe-area-inset-top)); }
}

@media print {
  .ribbon, .site-header, .tabbar, .install-banner, .site-footer, .hero-cta, .filters { display: none !important; }
  body { background: #fff; padding: 0; color: #000; }
  .card, .panel { box-shadow: none; }
}
