:root {
    --font: var(--civic-font-body);
    --bg: var(--civic-page);
    --surface: var(--civic-card);
    --surface-alt: var(--civic-soft);
    --line: var(--civic-line);
    --ink: var(--civic-ink);
    --ink-soft: var(--civic-muted);
    --muted: var(--civic-muted);
    --navy: var(--civic-navy);
    --navy-deep: var(--civic-navy);
    --green: var(--civic-blue);
    --green-dark: var(--civic-blue-strong);
    --button: var(--civic-blue);
    --button-hover: var(--civic-blue-strong);
    --button-active: var(--civic-blue-strong);
    --focus: var(--civic-blue);
    --radius: 8px;
    --radius-sm: 6px;
    --content: 1280px;
    --shadow-sm: var(--civic-shadow);
    --shadow-md: var(--civic-shadow);
}

body.dark-mode {
    --bg: var(--civic-page);
    --surface: var(--civic-card);
    --surface-alt: var(--civic-soft);
    --line: var(--civic-line);
    --ink: var(--civic-ink);
    --ink-soft: var(--civic-muted);
    --muted: var(--civic-muted);
    --green: var(--civic-blue);
    --green-dark: var(--civic-blue-strong);
    --button: var(--civic-blue-strong);
    --button-hover: var(--civic-blue);
    --focus: var(--civic-blue);
}

body { font-size: 15px; }
h1, h2, h3, h4 { font-family: var(--civic-font-display); font-weight: 800; letter-spacing: -.035em; }
.gov-bar { background: #031737; border-bottom: 3px solid #087b40; color: #c4d1e1; }
.gov-bar-inner { min-height: 48px; padding-block: 4px; }
.gov-identity, .gov-actions { display: flex; align-items: center; gap: 13px; }
.gov-identity strong { color: #fff; font-size: 12px; letter-spacing: .08em; }
.gov-identity > span { color: #7290ad; }
.gov-actions a { color: #fff; border: 1px solid #2d476b; border-radius: 5px; padding: 6px 11px; text-decoration: none; font-weight: 700; }
.gov-actions a:hover, .gov-actions .theme-toggle:hover { background: #17365d; }
.gov-actions .theme-toggle { border: 0; font-weight: 700; }
.site-header { border: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header-inner { min-height: 90px; padding: 12px 32px; justify-content: space-between; }
.site-brand { gap: 12px; flex: 0 0 auto; }
.site-brand img { width: 56px; height: 56px; padding: 4px; border: 2px solid #068445; border-radius: 50%; background: #fff; object-fit: contain; }
.site-brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.2; }
.site-brand-text .site-brand-portal { order: -1; color: var(--civic-blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.site-brand-portal::before { display: none; }
.site-brand-text strong { font-size: 17px; color: var(--ink); }
.site-brand-text > span:not(.site-brand-portal) { font-size: 12px; }
.site-brand-text [data-portal-i18n] { color: inherit; font: inherit; letter-spacing: inherit; }
.site-nav { flex: 1; min-width: 0; border: 0; box-shadow: none; }
.site-nav-inner { padding: 0; max-width: none; justify-content: flex-end; gap: 16px; }
.site-nav ul { gap: 2px; }
.site-nav-list, .site-nav-account { flex-shrink: 0; }
.site-nav-account a, .site-nav-account button { white-space: nowrap; }
.site-nav-list a { min-height: 42px; padding: 0 6px; border-radius: 7px; font-size: 14px; white-space: nowrap; }
.site-nav-list a::after { display: none; }
.site-nav-list a[aria-current="page"] { color: var(--civic-blue); background: var(--civic-blue-soft); }
.site-nav-account a:not(.btn) { min-height: 42px; color: var(--civic-blue); font-size: 14px; }
.site-nav-account .btn { min-height: 42px; border-radius: 6px; background: var(--civic-blue); color: #fff; font-size: 14px; }
.site-nav-account .btn:hover { background: var(--civic-blue-strong); }
.menu-toggle.btn { border-color: var(--line); }
.btn { border-radius: 6px; box-shadow: none; font-size: 14px; }
.btn-green { background: var(--button); color: #fff; }
.btn-green:hover { background: var(--button-hover); }
.container { padding: 34px 32px 80px; }
.card, .panel { border-color: var(--line); box-shadow: var(--civic-shadow); }
.card-accent { border-top: 6px solid var(--civic-blue); position: relative; }
.card-accent::before { content: ""; position: absolute; top: -6px; left: 50%; right: 0; height: 6px; background: var(--civic-green); border-radius: 0 7px 0 0; }
.form-input { background: var(--civic-page); border-color: var(--line); }
.form-input:focus { border-color: var(--civic-blue); }
.page-band { background: var(--surface); border-color: var(--line); }
.page-band-inner { padding: 34px 32px 40px; }
.page-band h1 { font-size: clamp(30px, 3vw, 38px); color: var(--ink); }
.page-band-lead { font-size: 16px; }
.breadcrumb a { color: var(--civic-blue); font-weight: 700; }
.breadcrumb ol { margin-bottom: 20px; }

/* Resident landing page */
.portal-band { border: 0; background: linear-gradient(110deg, #f4faff, var(--civic-page) 65%); }
.portal-band-inner { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 52px; align-items: center; padding: 54px 32px 22px; }
.portal-hero { max-width: 540px; }
.portal-hero .eyebrow { display: inline-block; margin-bottom: 17px; padding: 9px 13px; border-left: 4px solid var(--civic-green); background: #fff; color: var(--civic-blue); font-size: 11px; letter-spacing: .09em; }
.portal-hero h1 { margin: 0 0 17px; color: var(--ink); font-size: clamp(38px, 3.8vw, 56px); line-height: 1.1; letter-spacing: -.055em; }
.portal-hero > p:not(.eyebrow):not(.portal-hero-account) { max-width: 50ch; color: var(--muted); font-size: 16px; line-height: 1.7; }
.portal-hero-actions { margin-top: 27px; gap: 10px; }
.portal-hero-actions .btn { min-height: 48px; padding: 11px 17px; }
.portal-hero-actions .btn-hero-outline { color: var(--ink); background: var(--surface); border-color: var(--line); }
.portal-hero-actions .btn-hero-outline:hover { color: var(--civic-blue); border-color: var(--civic-blue); }
.portal-hero .portal-hero-account { margin-top: 17px; color: var(--muted); font-size: 13px; }
.portal-hero-account a { color: var(--civic-blue); }
.portal-hero-account a:hover { color: var(--civic-blue-strong); }
.portal-hero-photo { position: relative; margin: 0; height: 410px; overflow: hidden; border-radius: 7px; box-shadow: var(--civic-shadow); }
.portal-hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portal-hero-photo figcaption { position: absolute; right: 12px; bottom: 12px; padding: 5px 9px; border-radius: 4px; background: rgba(3, 23, 55, .84); color: #fff; font-size: 11px; }
.portal-band + .container { padding-top: 0; }
.digital-services { margin: 0 0 52px; }
.portal-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--civic-shadow); }
.portal-service-card { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 11px; row-gap: 1px; min-height: 84px; padding: 15px 35px 15px 17px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.portal-service-card:last-child { border-right: 0; }
.portal-service-card:hover, .portal-service-card:focus-visible { transform: none; background: var(--civic-blue-soft); }
.portal-service-card .service-icon { grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 32px; height: 32px; margin: 0; border-radius: 5px; background: var(--civic-blue-soft); color: var(--civic-blue); }
.service-icon svg { width: 18px; height: 18px; }
.portal-service-card strong { grid-column: 2; grid-row: 1; color: var(--ink); font-size: 13px; }
.portal-service-card > span:not(.service-icon):not(.service-start) { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 11px; }
.portal-service-card::after { content: ""; right: 16px; top: 50%; bottom: auto; width: 18px; height: 18px; margin: 0; border: 0; background: var(--civic-blue); transform: translateY(-50%); transition: transform .18s ease; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.portal-service-card:hover::after, .portal-service-card:focus-visible::after { transform: translate(3px, -50%); }
.service-info { grid-template-columns: .94fr 1.06fr; gap: 22px; align-items: stretch; }
.howto, .doc-rates { padding: 30px; border-radius: 7px; }
.howto { background: #031737; color: #d5e2ef; border-color: #031737; }
.howto h2 { color: #fff; margin: 6px 0 10px; }
.howto > p:not(.eyebrow) { color: #b8c9dc; font-size: 13px; }
.howto .eyebrow { color: #35c58a; }
.howto-steps li { color: #e2e9f1; border-color: #213a59; }
.howto-steps li strong { color: #fff; }
.howto-steps li::before { background: #163557; color: #35c58a; }
.howto-note { padding: 14px 16px; border: 1px solid #244564; border-radius: 5px; background: #102b4c; }
.doc-rates .eyebrow { color: var(--civic-blue); }
.doc-rates h2 { margin-top: 5px; }
.doc-rates-note { font-size: 12px; }
.doc-rates-table thead { background: #eaf4f7; }
.doc-rates-table td { color: var(--civic-blue); font-weight: 700; }
.announcements-section { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: 22px; align-items: start; }
.announcements-intro h2 { margin: 5px 0; }
.announcements-intro > p:last-child { color: var(--muted); font-size: 14px; }
.notice-callout { padding: 21px; border-radius: 0; border-top: 3px solid var(--civic-blue); }
.notice-callout:last-child { border-top-color: var(--civic-green); }
.notice-callout h3 { font-size: 16px; }
.portal-announcement-item { padding: 12px 0; border-top: 1px solid var(--line); }
.portal-announcement-item h4 { margin: 2px 0 6px; color: var(--civic-ink); font-size: 15px; }
.portal-announcement-date { margin: 0; color: var(--muted); font-size: 12px !important; }
.portal-announcement-image { display: block; width: auto; max-width: 100%; max-height: 420px; margin: 10px 0 12px; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; object-position: left center; }
.portal-announcement-body { color: var(--ink-soft); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-announcement-all { display: inline-block; margin-top: 12px; font-weight: 700; }
.portal-announcement-archive { display: grid; gap: 16px; max-width: 920px; margin-inline: auto; }
.portal-announcement-back { justify-self: start; margin-bottom: 5px; }
.portal-announcement-card, .portal-announcement-empty { padding: 22px 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--civic-shadow); }
.portal-announcement-card h2 { margin: 4px 0 10px; font-size: 21px; }
.portal-announcement-card .portal-announcement-body { font-size: 15px; }
.portal-announcement-empty h2, .portal-announcement-empty p { margin: 0; }
.portal-announcement-empty p { margin-top: 8px; color: var(--muted); }
.portal-announcement-pagination { overflow-x: auto; }
.office-section { margin-top: 65px; padding-top: 42px; }
.office-details, .office-map { min-height: 400px; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--civic-shadow); }
.office-map { padding: 0; overflow: hidden; }
.hotline-panel { padding: 28px 32px; border-radius: 0; background: #031737; }
.hotline-list li { border-radius: 0; border-left: 3px solid var(--civic-green); }
.site-footer { background: #031737; }

/* Shared account screens */
.auth-layout { grid-template-columns: minmax(0, 1.05fr) minmax(310px, .95fr); gap: 32px; }
.auth-layout .card { box-shadow: var(--civic-shadow); }
.auth-aside { padding: 0; border: 0; background: transparent; }
.auth-aside section { padding: 24px 28px; border-radius: 7px; background: #031737; color: #dce8f3; }
.auth-aside section + section { margin-top: 18px; padding: 20px 24px; border-left: 4px solid var(--civic-blue); border-radius: 0; background: var(--surface); }
.auth-aside section:last-child { border-left-color: var(--civic-green); }
.auth-aside h2 { color: #fff; font-size: 23px; }
.auth-aside section + section h2 { color: var(--ink); font-size: 16px; }
.auth-aside section:first-child p, .auth-aside section:first-child li { color: #dce8f3; }
.auth-aside .btn { background: #fff; border-color: #fff; color: #031737; }
.auth-aside .btn:hover { color: var(--civic-blue); }
.resident-auth-heading { display: flex; align-items: center; gap: 16px; padding: 12px 0 27px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.resident-auth-heading h2 { color: var(--ink); font-size: 24px; }
.resident-auth-heading p { color: var(--muted); font-size: 14px; }
.resident-auth-symbol { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border: 2px solid var(--civic-green); border-radius: 50%; background: #031737; color: #fff; }
.resident-auth-symbol svg { width: 22px; height: 22px; }
.resident-password-field { position: relative; display: block; }
.resident-password-field .form-input { padding-right: 65px; }
.resident-password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 4px; background: transparent; color: var(--civic-blue); padding: 7px 8px; font: 700 12px var(--civic-font-body); cursor: pointer; }
.resident-password-toggle:hover { background: var(--civic-blue-soft); }
.resident-auth-security { margin-top: 28px; color: var(--muted); font-size: 12px; }
.resident-auth-security::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--civic-green); }
.auth-aside .plain-list { list-style: none; padding: 0; margin: 18px 0; }
.auth-aside .plain-list li { position: relative; padding-left: 28px; }
.auth-aside .plain-list li::before { content: ""; position: absolute; left: 5px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #35c58a; }
.registration-step-title { margin: 5px 0 8px; font-size: 24px; }
.step-count { color: var(--civic-blue); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 800; }
.step-guidance { padding-bottom: 24px; border-bottom: 1px solid var(--line); color: var(--muted); }
.progress-steps { margin: 0 0 29px; }
.progress-steps li { color: var(--muted); }
.progress-steps li::before { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-alt); color: var(--muted); line-height: 1; }
.progress-steps li[aria-current="step"]::before { color: #fff; }
.auth-layout .card-body > form .btn[type="submit"] { min-height: 48px; }
.auth-layout .next-note { border-top: 1px solid var(--line); padding-top: 16px; }
.progress-steps li[aria-current="step"] { color: var(--civic-blue); }
.progress-steps li[aria-current="step"]::before { background: var(--civic-blue); color: #fff; }

@media (max-width: 1180px) {
    .site-brand-text > span:not(.site-brand-portal) { display: none; }
    .site-nav-list a { padding-inline: 7px; font-size: 13px; }
    .site-header-inner { padding-inline: 20px; }
}
@media (max-width: 960px) {
    .portal-band { background: var(--civic-page); }
    .portal-band-inner { gap: 25px; padding-block: 40px 22px; }
    .portal-hero-photo { height: 340px; }
    .service-info, .office-section, .auth-layout { grid-template-columns: 1fr; }
    .announcements-section { grid-template-columns: 1fr; }
    .auth-aside { display: grid; gap: 14px; }
    .auth-aside section + section { margin-top: 0; }
}
@media (max-width: 1280px) {
    .site-header-inner { position: relative; }
    .menu-toggle.btn { display: inline-flex; order: 2; }
    .site-nav { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; border-top: 1px solid var(--line); box-shadow: var(--civic-shadow); }
    .site-nav-inner { padding: 12px 20px 18px; }
    .site-nav-list a { font-size: 14px; }
}
@media (max-width: 680px) {
    .gov-bar-inner { padding-inline: 16px; }
    .gov-identity { gap: 7px; }
    .gov-identity > span, .gov-identity { font-size: 0; }
    .gov-identity strong { font-size: 11px; }
    .gov-actions { gap: 5px; }
    .gov-actions a, .gov-actions .theme-toggle { font-size: 11px; padding: 5px 7px; }
    .site-header-inner { min-height: 74px; padding: 9px 16px; }
    .site-brand img { width: 44px; height: 44px; }
    .site-brand-text strong { font-size: 15px; }
    .site-brand-text .site-brand-portal { font-size: 9px; }
    .site-header .menu-toggle { min-width: 42px; width: 42px; min-height: 42px; padding: 0; justify-content: center; }
    .menu-toggle .menu-label-closed, .menu-toggle .menu-label-open { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .container { padding: 28px 16px 58px; }
    .page-band-inner { padding: 26px 16px 32px; }
    .portal-band-inner { grid-template-columns: 1fr; padding: 42px 16px 20px; }
    .portal-hero h1 { font-size: clamp(34px, 9vw, 42px); }
    .portal-hero > p:not(.eyebrow):not(.portal-hero-account) { font-size: 15px; }
    .portal-hero-actions { flex-direction: row; }
    .portal-hero-actions .btn { width: auto; min-height: 44px; }
    .portal-hero-photo { height: auto; aspect-ratio: 1.42; }
    .portal-service-grid { grid-template-columns: 1fr; }
    .portal-service-card { border-right: 0; border-bottom: 1px solid var(--line); }
    .portal-service-card:last-child { border-bottom: 0; }
    .service-info { gap: 16px; }
    .howto, .doc-rates { padding: 22px 19px; }
    .notice-row { grid-template-columns: 1fr; }
    .office-details, .office-map { min-height: 0; }
    .hotline-panel { padding: 24px 16px; }
    .auth-aside { display: block; }
    .auth-aside section + section { margin-top: 14px; }
    .auth-aside section { padding: 22px 20px; }
    .card-body { padding: 24px 20px; }
    .site-footer-inner { padding: 38px 16px 28px; }
}

/* Default dim appearance; the resident toggle still restores the light palette. */
body.dark-mode {
    --civic-page: #101e2b;
    --civic-card: #1a2c3d;
    --civic-soft: #24384a;
    --civic-ink: #eef5fb;
    --civic-muted: #b5c8d8;
    --civic-line: #395165;
    --civic-blue: #8cc3ff;
    --civic-blue-strong: #b3d7ff;
    --civic-blue-soft: #183c5d;
    --civic-green: #61d09a;
    --civic-shadow: 0 8px 22px rgba(0, 8, 19, .17);
    --button: #1464af;
    --button-hover: #1b76c9;
    --button-active: #0d5294;
    background: var(--civic-page);
}
body.dark-mode .site-header { background: var(--civic-card); }
body.dark-mode .site-nav { background: var(--civic-card); }
body.dark-mode .site-nav-list a { color: var(--civic-ink); }
body.dark-mode .site-nav-list a[aria-current="page"] { background: var(--civic-blue-soft); color: #c8e3ff; }
body.dark-mode .site-nav-account .btn { background: #1464af; color: #fff; }
body.dark-mode .portal-band { background: linear-gradient(110deg, #1d3446, var(--civic-page) 72%); }
body.dark-mode .portal-hero .eyebrow { background: var(--civic-card); color: var(--civic-blue); }
body.dark-mode .portal-hero h1 { color: var(--civic-ink); }
body.dark-mode .portal-hero > p:not(.eyebrow):not(.portal-hero-account),
body.dark-mode .portal-hero .portal-hero-account { color: var(--civic-muted); }
body.dark-mode .portal-hero-actions .btn-hero-outline { background: var(--civic-card); color: var(--civic-ink); border-color: var(--civic-line); }
body.dark-mode .portal-hero-photo img { filter: brightness(.82); }
body.dark-mode .portal-service-grid,
body.dark-mode .portal-service-card { background: var(--civic-card); }
body.dark-mode .portal-service-card:hover,
body.dark-mode .portal-service-card:focus-visible { background: var(--civic-soft); }
body.dark-mode .portal-service-card strong { color: var(--civic-ink); }
body.dark-mode .doc-rates,
body.dark-mode .notice-callout,
body.dark-mode .office-details,
body.dark-mode .office-map { background: var(--civic-card); }
body.dark-mode .doc-rates-table thead { background: var(--civic-soft); }
body.dark-mode .doc-rates-table thead th { background: var(--civic-soft); }
body.dark-mode .auth-aside section + section { background: var(--civic-card); }
body.dark-mode .auth-aside .btn { color: #031737; }
body.dark-mode .page-band { background: var(--civic-card); }
body.dark-mode .form-input { background: var(--civic-page); color: var(--civic-ink); }
body.dark-mode .form-input::placeholder { color: #98aec1; }
/* Match the staff workspace page background */
body:not(.dark-mode) { --bg: #d9e6ef; background: #d9e6ef; }
body.dark-mode { --bg: oklch(17% .025 240); background: oklch(17% .025 240); }
/* Full-bleed barangay hall hero with the copy overlapping the photo */
.portal-band, body.dark-mode .portal-band { position: relative; overflow: hidden; display: flex; align-items: center; min-height: max(560px, calc(100svh - 176px)); border: 0; background: #031737; }
.portal-band-inner { position: static; display: block; width: 100%; max-width: var(--content, 1200px); margin: 0 auto; padding: 72px 32px 88px; }
.portal-hero { position: relative; z-index: 1; max-width: 640px; }
.portal-hero-photo, body.dark-mode .portal-hero-photo { position: absolute; inset: 0; z-index: 0; height: auto; margin: 0; border-radius: 0; box-shadow: none; }
.portal-hero-photo img, body.dark-mode .portal-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; filter: none; }
.portal-hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 23, 55, .92) 0%, rgba(3, 23, 55, .78) 38%, rgba(3, 23, 55, .35) 68%, rgba(3, 23, 55, .1) 100%), linear-gradient(0deg, rgba(3, 23, 55, .45) 0%, transparent 35%); }
.portal-hero-photo figcaption { z-index: 1; right: 24px; bottom: 24px; }
.portal-hero .eyebrow, body.dark-mode .portal-hero .eyebrow { background: rgba(255, 255, 255, .1); color: #fff; border-left-color: #2fc27a; backdrop-filter: blur(4px); }
.portal-hero h1, body.dark-mode .portal-hero h1 { color: #fff; font-size: clamp(42px, 5vw, 76px); text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.portal-hero > p:not(.eyebrow):not(.portal-hero-account), body.dark-mode .portal-hero > p:not(.eyebrow):not(.portal-hero-account) { color: rgba(255, 255, 255, .88); font-size: 17px; }
.portal-hero .portal-hero-account, body.dark-mode .portal-hero .portal-hero-account { color: rgba(255, 255, 255, .78); }
.portal-hero-account a { color: #9fd0ff; }
.portal-hero-actions .btn-hero-outline, body.dark-mode .portal-hero-actions .btn-hero-outline { background: transparent; border-color: rgba(255, 255, 255, .75); color: #fff; }
.portal-hero-actions .btn-hero-outline:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
@media (max-width: 700px) {
    .portal-band, body.dark-mode .portal-band { min-height: max(520px, calc(100svh - 140px)); }
    .portal-band-inner { padding: 56px 16px 72px; }
    .portal-hero-photo, body.dark-mode .portal-hero-photo { aspect-ratio: auto; }
    .portal-hero-photo::after { background: linear-gradient(180deg, rgba(3, 23, 55, .45) 0%, rgba(3, 23, 55, .35) 22%, rgba(3, 23, 55, .82) 50%, rgba(3, 23, 55, .92) 100%); }
    .portal-hero-photo img, body.dark-mode .portal-hero-photo img { object-position: 68% center; }
    .portal-band-inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: inherit; }
    .portal-hero h1 { font-size: clamp(36px, 10vw, 48px); }
}
/* Header sits on the hero photo, then turns solid after scrolling */
.site-header { position: sticky; top: 0; z-index: 60; transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.site-nav-list a { transition: background-color .18s ease, color .18s ease; }
.site-nav-list a:hover, .site-nav-list a:focus-visible { background: var(--civic-blue-soft); color: var(--civic-blue); }
.site-nav-account a:not(.btn) { padding: 0 10px; border-radius: 7px; transition: background-color .18s ease, color .18s ease; }
.site-nav-account a:not(.btn):hover { background: var(--civic-blue-soft); color: var(--civic-blue-strong); }
.site-nav-account .btn { transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.site-nav-account .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(3, 23, 55, .25); }
body.dark-mode .site-nav-list a:hover, body.dark-mode .site-nav-list a:focus-visible { background: var(--civic-soft); color: #fff; }
.site-header.is-solid, body.hero-header-scrolled .site-header { box-shadow: 0 6px 18px rgba(3, 23, 55, .12); }

body.has-hero-header .portal-band { margin-top: -91px; padding-top: 91px; min-height: max(620px, calc(100svh - 48px)); }
body.has-hero-header:not(.hero-header-scrolled) .site-header,
body.has-hero-header:not(.hero-header-scrolled) .site-nav { border-color: transparent; background: transparent; box-shadow: none; }
body.has-hero-header:not(.hero-header-scrolled) .site-brand strong,
body.has-hero-header:not(.hero-header-scrolled) .site-brand-text > span:last-child,
body.has-hero-header:not(.hero-header-scrolled) .site-nav-list a,
body.has-hero-header:not(.hero-header-scrolled) .site-nav-account a:not(.btn) { color: #fff; }
body.has-hero-header:not(.hero-header-scrolled) .site-brand-portal { color: #9fd0ff; }
body.has-hero-header:not(.hero-header-scrolled) .site-nav-list a[aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; }
body.has-hero-header:not(.hero-header-scrolled) .site-nav-list a:hover,
body.has-hero-header:not(.hero-header-scrolled) .site-nav-list a:focus-visible,
body.has-hero-header:not(.hero-header-scrolled) .site-nav-account a:not(.btn):hover { background: rgba(255, 255, 255, .14); color: #fff; }
body.has-hero-header:not(.hero-header-scrolled) .menu-toggle { border-color: rgba(255, 255, 255, .7); background: transparent; color: #fff; }
@media (max-width: 1280px) {
    body.has-hero-header:not(.hero-header-scrolled) .site-nav { background: var(--surface); }
    body.has-hero-header:not(.hero-header-scrolled) .site-nav .site-nav-list a,
    body.has-hero-header:not(.hero-header-scrolled) .site-nav .site-nav-account a:not(.btn) { color: var(--ink); }
}
@media (max-width: 700px) {
    body.has-hero-header .portal-band { margin-top: -75px; padding-top: 75px; }
}
/* Barangay Hall card and map share the same height */
.office-section { align-items: stretch; }
.office-map { display: flex; flex-direction: column; }
.office-map .map-panel { display: flex; flex: 1; flex-direction: column; border: 0; border-radius: 0; }
.office-map .map-panel iframe { flex: 1; height: auto; min-height: 300px; }
/* Breathing room between the hero photo and the service cards */
.portal-band + .container > .digital-services:first-child, .portal-band + .container .digital-services { margin-top: 40px; }
@media (max-width: 700px) { .portal-band + .container .digital-services { margin-top: 24px; } }
/* Keep the round seal and green gov-bar line in dark mode */
body.dark-mode .gov-bar { border-bottom: 3px solid #087b40; }
body.dark-mode .site-brand img { padding: 4px; border: 2px solid #068445; border-radius: 50%; background: #fff; }
/* Sun and moon theme toggle; the hero photo dims slightly in dark mode */
.gov-actions .theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; color: #fff; transition: background-color .18s ease, transform .25s ease; }
.gov-actions .theme-toggle:hover { transform: rotate(15deg); }
.theme-toggle .theme-icon { grid-area: 1 / 1; width: 19px; height: 19px; transition: opacity .25s ease, transform .35s ease; }
.theme-toggle .theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
body.dark-mode .theme-toggle .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
body.dark-mode .theme-toggle .theme-icon-sun { opacity: 1; transform: none; color: #ffd166; }
body.dark-mode .portal-hero-photo img { filter: brightness(.72); }
@media (max-width: 700px) { .gov-actions .theme-toggle { width: 34px; height: 34px; min-height: 34px; padding: 0; } }
.portal-hero-photo img { transition: filter .7s ease; }
@media (prefers-reduced-motion: reduce) { .portal-hero-photo img { transition: none; } }
.gov-actions .theme-toggle { margin-right: -8px; }
/* Request flow spans the full content width, aligned with the page header */
.request-layout { max-width: none; }
/* Stack the unconfirmed-fees notice under the requirements panel at the same width */
.requirements-intro { grid-template-columns: 1fr; gap: 14px; }
.requirements-intro .unconfirmed { margin: 0; }

.resident-password-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; }
.resident-password-toggle svg { width: 21px; height: 21px; }
.resident-password-toggle[aria-pressed="false"] .password-eye-slash { display: none; }
.resident-password-toggle:focus-visible { outline: 2px solid var(--civic-blue); outline-offset: 2px; }
.auth-layout .form-group { min-width: 0; }
.auth-layout input[type="date"] { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; box-sizing: border-box; }
.auth-layout input[type="date"]::-webkit-date-and-time-value { text-align: left; }

.new-resident-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, .4fr); align-items: start; gap: 24px; }
.new-resident-card { min-width: 0; }
.new-resident-intro { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.new-resident-intro h2 { margin: 0 0 10px; font-size: 24px; }
.new-resident-intro p { margin: 0 0 10px; color: var(--muted); }
.new-resident-intro small, .new-resident-optional { color: var(--muted); font-size: 12px; font-weight: 400; }
.new-resident-section { min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.new-resident-section legend { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 18px; padding: 0; font-weight: 700; font-size: 17px; color: var(--ink); }
.new-resident-section-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--civic-blue-soft); color: var(--civic-blue); font-size: 13px; }
.new-resident-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.new-resident-fields .form-group { min-width: 0; margin: 0; }
.new-resident-fields .form-input { width: 100%; min-width: 0; max-width: 100%; min-height: 46px; box-sizing: border-box; }
.new-resident-fields textarea { resize: vertical; }
.new-resident-field-wide { grid-column: 1 / -1; }
.new-resident-upload { padding: 18px; border: 1px dashed var(--line); border-radius: 7px; background: var(--surface-alt); }
.new-resident-upload input { width: 100%; min-width: 0; }
.new-resident-upload .form-note { margin: 10px 0 0; }
.new-resident-form-actions { display: flex; justify-content: flex-end; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.new-resident-form-actions .btn { min-height: 48px; }
.new-resident-secondary-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
.new-resident-status { display: grid; gap: 14px; }
.new-resident-status h2 { margin: 0; font-size: 17px; color: var(--muted); }
.new-resident-status p { margin: 0; }
.new-resident-reference { font-family: var(--civic-font-display); font-size: 25px; overflow-wrap: anywhere; }
.new-resident-status-badge { justify-self: start; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--civic-blue-soft); color: var(--civic-blue); font-size: 13px; font-weight: 700; }
.new-resident-status[data-application-state=approved] .new-resident-status-badge { background: rgba(8, 123, 64, .1); color: var(--civic-green); }
.new-resident-review-note { padding: 16px; border-left: 3px solid var(--civic-blue); background: var(--surface-alt); }
.new-resident-review-note > span { display: block; margin-bottom: 6px; font-weight: 700; }
.new-resident-next-steps { display: grid; gap: 16px; margin: 20px 0 0; padding-left: 22px; }
.new-resident-next-steps li { padding-left: 5px; }
@media (max-width: 960px) { .new-resident-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .new-resident-fields { grid-template-columns: 1fr; gap: 16px; } .new-resident-form-actions .btn, .new-resident-secondary-actions .btn { width: 100%; } .new-resident-section legend { font-size: 16px; } .new-resident-reference { font-size: 21px; } }

body.dark-mode .new-resident-status[data-application-state=approved] .new-resident-status-badge { color: var(--civic-green-soft); }

.registration-path-option { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.registration-path-option > div { min-width: 0; }
.registration-path-option strong { display: block; font-size: 15px; color: var(--ink); }
.registration-path-option p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.registration-path-option .btn { flex-shrink: 0; min-height: 44px; text-align: center; }
@media (max-width: 700px) { .registration-path-option { align-items: stretch; flex-direction: column; gap: 14px; } .registration-path-option .btn { width: 100%; } }

/* Keep intrinsic content inside its grid cell, including long translated labels. */
.site-main, .container, .site-header-inner, .site-brand-text,
.service-info > *, .auth-layout > *, .profile-layout > *, .request-layout > *,
.two-column > *, .cert-grid > *, .site-footer-inner > *, .service-item > *,
.new-resident-fields > *, .portal-band-inner > * { min-width: 0; }
.site-main :is(h1, h2, h3, p, dd, label), .site-footer :is(p, a) { overflow-wrap: anywhere; }
.form-input, .form-group, fieldset { min-width: 0; max-width: 100%; }
input[type="file"] { width: 100%; min-width: 0; max-width: 100%; }
input:is([type="date"], [type="time"]) { min-width: 0; max-width: 100%; box-sizing: border-box; }
.doc-rates-table { table-layout: fixed; }
.doc-rates-table th { overflow-wrap: anywhere; }
.doc-rates-table :is(th, td):last-child { width: 108px; padding-inline: 12px; }
.service-item .btn { white-space: normal; overflow-wrap: anywhere; }
.tag-unconfirmed { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1280px) {
    .site-nav.is-open,
    body.has-hero-header:not(.hero-header-scrolled) .site-nav.is-open {
        background: var(--civic-card);
        opacity: 1;
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgba(3, 23, 55, .18);
    }
    .site-nav-list a, .site-nav-account a { white-space: normal; overflow-wrap: anywhere; }
    .site-nav-account li { min-width: 0; }
}
@media (max-width: 700px) {
    .service-info, .auth-layout, .profile-layout, .request-layout, .two-column { grid-template-columns: minmax(0, 1fr); }
    .portal-hero-actions { align-items: stretch; flex-wrap: wrap; }
    .portal-hero-actions .btn { max-width: 100%; white-space: normal; text-align: center; }
    .doc-rates-table :is(th, td) { padding-inline: 8px; }
    .doc-rates-table :is(th, td):last-child { width: 92px; padding-inline: 8px; }
    .hotline-list li { flex-wrap: wrap; }
    .site-brand { min-width: 0; }
    .site-brand-text strong { overflow-wrap: anywhere; }
    .menu-toggle { flex-shrink: 0; }
}
@media (max-width: 380px) {
    .service-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .service-item .service-fee, .service-item .btn { grid-column: auto; grid-row: auto; }
    .service-item .btn { justify-self: start; }
    .portal-hero-actions .btn { width: 100%; }
}

/* Equal tracks keep related actions aligned when translated labels wrap. */
.btn:not(.btn-link) { box-sizing: border-box; min-height: 44px; line-height: 1.4; white-space: normal; text-align: center; }
.portal-hero-actions, .btn-row, .page-band-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 12px; }
:is(.portal-hero-actions, .btn-row, .page-band-actions) > .btn { width: 100%; height: 100%; min-width: 0; margin: 0; }
.btn-row:has(> .btn:only-child) { grid-template-columns: minmax(0, 1fr); max-width: 24rem; }
.page-band-actions { min-width: min(100%, 320px); }
.service-item .btn { width: 120px; min-height: 44px; justify-self: end; }
.two-column > article.panel { display: flex; flex-direction: column; align-self: stretch; }
.two-column:has(> article.panel) { grid-auto-rows: 1fr; }
.two-column > article.panel > :is(details, .next-note):last-child { margin-top: auto; padding-top: 16px; }
.two-column > article.panel .btn { width: 100%; }
.cert-grid { align-items: stretch; grid-auto-rows: 1fr; }
.cert-grid .cert-btn { height: 100%; min-width: 0; }
@media (max-width: 600px) {
    .portal-hero-actions, .page-band-actions { grid-template-columns: minmax(0, 1fr); }
    .btn-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .btn-row > .btn { padding-inline: 12px; }
    .btn-row:has(> .btn:only-child) { max-width: none; }
}
@media (max-width: 380px) { .service-item .btn { width: 100%; justify-self: stretch; } }

.site-main :is(.card, .panel) { border-radius: var(--civic-panel-radius); }
.site-main .record-sheet { padding: 0; }
@media (max-width: 700px) {
    .record-sheet-head { padding: 20px 22px; }
    .record-sheet .details-list { padding: 12px 22px 18px; }
}
.btn, .form-input { border-radius: var(--civic-control-radius); font-family: var(--civic-font-body); }
.btn { font-size: var(--civic-control-font-size); }
.form-input { min-height: var(--civic-control-height); font-weight: 400; }
body.dark-mode .site-main .btn-outline { background: var(--civic-soft); border-color: var(--civic-line); color: var(--civic-ink); }
body.dark-mode .site-main .btn-outline:hover { background: var(--civic-card); border-color: var(--civic-blue); }

/* Keep the resident home actions visible without making the mobile hero feel empty. */
@media (max-width: 700px) {
    body.has-hero-header .portal-band,
    body.dark-mode.has-hero-header .portal-band {
        min-height: max(520px, calc(100svh - 220px));
    }

    body.has-hero-header .portal-band-inner {
        justify-content: center;
        padding: 36px 16px 32px;
    }

    body.has-hero-header .portal-hero-photo img,
    body.dark-mode.has-hero-header .portal-hero-photo img {
        object-position: 62% center;
    }

    body.has-hero-header .portal-hero-photo::after {
        background: linear-gradient(180deg, rgba(3, 23, 55, .42) 0%, rgba(3, 23, 55, .62) 38%, rgba(3, 23, 55, .92) 100%);
    }

    body.has-hero-header .portal-hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.has-hero-header .portal-hero-actions .btn {
        display: flex;
        justify-content: center;
        gap: 7px;
        min-height: 46px;
        padding-inline: 10px;
        font-size: 13px;
    }

    body.has-hero-header .portal-hero-actions .btn span {
        min-width: 0;
        font-size: inherit;
        line-height: 1.3;
    }

    body.has-hero-header .portal-hero-actions .btn span[aria-hidden="true"] {
        flex: 0 0 auto;
        font-size: 16px;
        line-height: 1;
    }

    .portal-band + .container .digital-services { margin-top: 18px; }
    .digital-services { margin-bottom: 30px; }
    .portal-service-card { min-height: 76px; padding: 14px 42px 14px 14px; }
    .portal-service-card strong { font-size: 14px; line-height: 1.3; }
    .portal-service-card > span:not(.service-icon):not(.service-start) { font-size: 12px; line-height: 1.45; }
    .home-section { margin-top: 40px; }
    .office-section { margin-top: 40px; padding-top: 24px; }
    .site-footer-inner { gap: 20px; }
}

@media (max-width: 360px) {
    body.has-hero-header .portal-hero-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Keep hotline numbers on one line and prevent fee amounts clipping on phones. */
@media (max-width: 700px) {
    .hotline-list li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 12px;
    }

    .hotline-list li > span { min-width: 0; }
    .hotline-list a { white-space: nowrap; font-size: 17px; }
    .doc-rates-table { width: 100%; max-width: 100%; }
    .doc-rates-table :is(th, td):last-child { width: 104px; padding-inline: 8px; font-size: 13px; }
    .doc-rates-table tbody th { overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
    .hotline-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .hotline-list a { justify-self: start; font-size: 18px; }
    .doc-rates-table :is(th, td):last-child { width: 98px; font-size: 12px; }
}

/* Keep touch controls usable and avoid cramped action rows on the narrowest phones. */
@media (max-width: 700px) {
    .gov-actions .theme-toggle {
        width: 44px;
        height: 44px;
        min-height: 44px;
        margin-right: 0;
    }

    #toast-wrap {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        left: max(12px, env(safe-area-inset-left));
        max-width: none;
    }
}

@media (max-width: 380px) {
    .btn-row { grid-template-columns: minmax(0, 1fr); }
    .btn-row > .btn { width: 100%; min-height: 46px; }
    .resident-auth-heading { align-items: flex-start; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; }
    .resident-auth-heading h2 { font-size: 20px; }
    .request-item { padding: 16px; }
    .request-meta { gap: 6px 14px; }
    .registration-path-option { padding: 14px; }
}

@media (max-width: 700px) and (max-height: 520px) and (orientation: landscape) {
    body.has-hero-header .portal-band { min-height: max(380px, calc(100svh - 96px)); }
    body.has-hero-header .portal-band-inner { padding-top: 24px; padding-bottom: 28px; }
}

/* Create account: eligibility step and the record matched by the activation code (Work Group 4). */
.registration-eligibility { display: grid; gap: 12px; margin: 18px 0 24px; padding: 0; list-style: none; counter-reset: eligibility; }
.registration-eligibility > li { position: relative; padding: 16px 18px 16px 52px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); counter-increment: eligibility; }
.registration-eligibility > li::before { content: counter(eligibility); position: absolute; top: 16px; left: 16px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--civic-primary, #17663a); color: #fff; font-size: 13px; font-weight: 700; }
.registration-eligibility strong { display: block; color: var(--ink); font-size: 15px; }
.registration-eligibility p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.registration-eligibility .btn { margin-top: 12px; min-height: 44px; }
.registration-verified-record { display: grid; gap: 10px; margin: 0 0 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.registration-verified-record > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.registration-verified-record dt { color: var(--muted); font-size: 13px; }
.registration-verified-record dd { margin: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.registration-verified-record + .form-note { margin: 0 0 20px; }

.portal-announcement-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-announcement-gallery:empty { display: none; }
.portal-announcement-gallery .portal-announcement-image { width: 100%; height: auto; min-width: 0; align-self: center; margin: 10px 0 12px; }
.portal-announcement-gallery .portal-announcement-image:only-child { grid-column: 1 / -1; width: auto; }
@media (max-width: 600px) { .portal-announcement-gallery { grid-template-columns: minmax(0, 1fr); } }
