/* ==========================================================================
   HELP BANK — design system
   Palette: deep-sea ink, trust teal, blue accent for giving, brick red for emergencies.
   To change the site colours, edit the variables below (e.g. --accent for buttons and highlights).
   ========================================================================== */

:root {
    --ink: #0E2F3F;
    --ink-2: #184456;
    --ink-3: #2A5A6E;
    --teal: #0F766E;
    --teal-600: #0B5F58;
    --teal-50: #E4F3F0;
    --accent: #3B8FE8;        /* accent: donate buttons, highlights, logo coin (was yellow) */
    --accent-600: #2270C9;    /* accent, darker (hover) */
    --accent-50: #E8F2FD;     /* accent, very light (backgrounds) */
    --accent-light: #8CC8FF;  /* accent on dark backgrounds (hero title, "BANK" in the dark sidebar) */
    --urgent: #C2412D;
    --urgent-50: #FBEAE6;
    --bg: #F4F7F6;
    --surface: #FFFFFF;
    --surface-2: #F8FBFA;
    --line: #E0E8E6;
    --line-2: #CBD7D4;
    --text: #15232B;
    --muted: #5A6B73;
    --success: #13795B;
    --success-50: #E3F4EC;
    --warning: #A3401A;
    --warning-50: #FDEDE6;
    --danger: #B42318;
    --danger-50: #FDECEA;
    --info: #1D5B8C;
    --info-50: #E6F0F8;
    --dark-bg: #0E2F3F;       /* dark areas: sidebar, hero, footer */
    --dark-bg-2: #184456;

    --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    --font-head: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(14, 47, 63, .06);
    --shadow: 0 1px 2px rgba(14, 47, 63, .05), 0 8px 24px rgba(14, 47, 63, .07);
    --shadow-lg: 0 24px 60px rgba(14, 47, 63, .18);
    --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-600); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--dark-bg); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.icon { flex: none; vertical-align: middle; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.container.narrow { width: min(100% - 40px, 760px); }
.container.mid { width: min(100% - 40px, 960px); }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font: 600 .95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-600); color: #fff; }
.btn-give { background: var(--accent); color: #fff; }
.btn-give:hover { background: var(--accent-600); color: #fff; }
.btn-dark { background: var(--dark-bg); color: #fff; }
.btn-dark:hover { background: var(--dark-bg-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #f1c6c1; }
.btn-danger-ghost:hover { background: var(--danger-50); color: var(--danger); }
.btn-urgent { background: var(--urgent); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row.center { justify-content: center; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Brand & public header ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand strong { font-weight: 800; color: var(--teal); }
.brand-logo { width: 49px; height: 40px; flex: none; display: block; }
.brand-light .brand-logo { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.brand-mark { display: none; }

.brand-light { color: #fff; }
.brand-light strong { color: var(--accent-light); }


.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.site-nav > a:not(.btn):hover, .site-nav > a.active { background: var(--teal-50); color: var(--teal-600); }
.site-nav .btn { margin-left: 6px; }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: var(--ink); cursor: pointer; }
@media (max-width: 960px) {
    .nav-toggle { display: inline-flex; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 20px 20px; box-shadow: var(--shadow); }
    .site-nav.open { display: flex; }
    .site-nav .btn { margin: 6px 0 0; }
    .nav-sep { display: none; }
}
.flash-area:empty { display: none; }
.flash-area { padding-top: 16px; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid; font-size: .95rem; }
.alert p:last-child { margin: 0; }
.alert-success { background: var(--success-50); border-color: #bfe3d2; color: #0c5a43; }
.alert-error { background: var(--danger-50); border-color: #f4c6c0; color: #8a1c12; }
.alert-warning { background: var(--warning-50); border-color: #F4C7B6; color: #7A2E12; }
.alert-info { background: var(--info-50); border-color: #c6dbee; color: #15466d; }
.alert-close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }
.notice { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px 16px; font-size: .92rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { background: var(--dark-bg); color: #D9E6EA; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background:
    radial-gradient(900px 400px at 85% -10%, rgba(15,118,110,.55), transparent 60%),
    radial-gradient(600px 300px at -10% 110%, rgba(232,163,61,.18), transparent 60%);
}
.hero::after { content: ""; position: absolute; inset: 0; opacity: .08; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 84px 0 92px; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.04; letter-spacing: -.025em; margin-bottom: 20px; }
.hero h1 span { color: var(--accent-light); }
.hero-lead { font-size: 1.15rem; max-width: 540px; color: #C4D6DC; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; font-size: .9rem; color: #A9C0C8; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .icon { color: var(--accent-light); }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; padding: 56px 0 64px; gap: 36px; } }

/* Live ledger (hero card) */
.ledger { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg); padding: 22px; backdrop-filter: blur(6px); }
.ledger-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ledger-head h2 { color: #fff; font-size: 1.05rem; margin: 0; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: #9FE1D6; font-weight: 600; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3CD3B8; box-shadow: 0 0 0 4px rgba(60,211,184,.2); }
.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .9rem; }
.ledger-row strong { color: #fff; font-weight: 600; }
.ledger-row .amt { color: #fff; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ledger-row .split { grid-column: 1 / -1; font-size: .78rem; color: #93AEB7; }
.ledger-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); color: #fff; font-weight: 700; }
.ledger-empty { color: #A9C0C8; font-size: .92rem; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.1); }

/* ---------- Stats band ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: -44px; position: relative; z-index: 2; box-shadow: var(--shadow); }
.stats-band > div { background: var(--surface); padding: 22px 24px; }
.stats-band strong { display: block; font-family: var(--font-head); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats-band span { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .stats-band { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h2, .card-title h3 { margin: 0; font-size: 1.1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-title { padding: 18px 22px 0; }

.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.campaign-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.campaign-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.campaign-card.is-urgent { border-color: #EDB9AE; }
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--teal-50); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--dark-bg-2), var(--teal)); }
.card-media-fallback.type-disaster { background: linear-gradient(135deg, #7a2419, var(--urgent)); }
.card-media-fallback.type-patient, .card-media-fallback.type-hospital { background: linear-gradient(135deg, var(--dark-bg), #1d6a86); }
.card-media-fallback span { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: rgba(255,255,255,.9); letter-spacing: .04em; }
.urgent-flag { position: absolute; top: 12px; left: 12px; background: var(--urgent); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-meta { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.card-body h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--teal); }
.card-text { font-size: .92rem; color: var(--muted); flex: 1; }
.card-stats { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.card-stats strong { color: var(--ink); }

.progress { height: 8px; background: var(--teal-50); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #18A395); border-radius: inherit; }
.is-urgent .progress span, .progress.urgent span { background: linear-gradient(90deg, var(--urgent), #E0664F); }
.progress.lg { height: 12px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--dark-bg); color: #fff; font-family: var(--font-head); font-weight: 700; margin-bottom: 14px; }
.step p { color: var(--muted); font-size: .93rem; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Split / CTA */
.cta-band { background: var(--teal); color: #E6F6F3; border-radius: var(--r-lg); padding: 44px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; max-width: 560px; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 44px 0 36px; }
.page-hero p { color: var(--muted); max-width: 680px; margin: 0; font-size: 1.05rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.req { color: var(--urgent); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,118,110,.14); }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); font: inherit; font-size: .9rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .93rem; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--teal); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; font-weight: 700; color: var(--ink); }
.input-group input { border-radius: 0 10px 10px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; }
.filters .field { margin: 0; min-width: 160px; flex: 1; }
.filters .grow { flex: 2; }

/* Auth */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--dark-bg); color: #C4D6DC; padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 360px at 100% 0%, rgba(15,118,110,.5), transparent 60%); }
.auth-side > * { position: relative; }
.auth-side h2 { color: #fff; font-size: 2rem; }
.auth-side ul { list-style: none; padding: 0; margin: 20px 0 0; }
.auth-side li { display: flex; gap: 10px; margin-bottom: 12px; }
.auth-side .icon { color: var(--accent-light); margin-top: 4px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: min(100%, 460px); }
.auth-card.wide { width: min(100%, 640px); }
.auth-card h1 { font-size: 1.9rem; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }
.role-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.role-picker label { border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; cursor: pointer; text-align: center; font-weight: 600; font-size: .9rem; transition: border-color .15s, background .15s; }
.role-picker label small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.role-picker input { position: absolute; opacity: 0; pointer-events: none; }
.role-picker label:has(input:checked) { border-color: var(--teal); background: var(--teal-50); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.role-picker label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .role-picker { grid-template-columns: 1fr; } }

/* ---------- Badges & tables ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-urgent { background: var(--urgent); color: #fff; }
.badge-neutral { background: #EDF1F0; color: #4A5A61; }
.badge-info { background: var(--info-50); color: var(--info); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -24px -24px; }
.card.flush .table-wrap { margin: 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted); text-transform: none; letter-spacing: .02em; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFCFC; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn, .table .actions form + form, .table .actions .btn + form, .table .actions form + .btn { margin-left: 6px; }
.table .sub { display: block; color: var(--muted); font-size: .8rem; }
.table a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--teal); text-decoration: underline; }

dl.details { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 0; margin: 0; }
dl.details dt { color: var(--muted); font-size: .88rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
dl.details dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; word-break: break-word; }
dl.details dt:last-of-type, dl.details dd:last-of-type { border-bottom: 0; }
@media (max-width: 560px) { dl.details { grid-template-columns: 1fr; } dl.details dt { border: 0; padding-bottom: 0; } }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 22px; }
.pager a { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.pager a:hover { border-color: var(--teal); }
.pager a.current { background: var(--dark-bg); border-color: var(--dark-bg); color: #fff; }
.pager-gap { align-self: center; color: var(--muted); }

.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); }
.empty-state.big { padding: 80px 20px; }
.error-code { font-family: var(--font-head); font-size: 5rem; font-weight: 800; color: var(--teal); line-height: 1; margin-bottom: 10px; }

/* ---------- Campaign detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-media { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 8; background: var(--teal-50); margin-bottom: 24px; }
.detail-media img, .detail-media .card-media-fallback { width: 100%; height: 100%; object-fit: cover; }
.donate-panel { position: sticky; top: 88px; }
.donate-panel .raised { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.donate-panel .of { color: var(--muted); margin-bottom: 14px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv-row:last-child { border-bottom: 0; }
.kv-row span:first-child { color: var(--muted); }
.kv-row strong { font-variant-numeric: tabular-nums; }
.kv-row.total { font-size: 1.05rem; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.prose { font-size: 1.02rem; }
.prose p { white-space: pre-line; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.owner-chip { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.avatar-lg { width: 46px; height: 46px; border-radius: 12px; background: var(--dark-bg); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); flex: none; }
.donor-list { list-style: none; padding: 0; margin: 0; }
.donor-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.donor-list li:last-child { border-bottom: 0; }
.donor-list .msg { display: block; color: var(--muted); font-size: .85rem; font-style: italic; }
.emergency-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--urgent-50); border: 1px solid #F0C3B9; color: #7a2419; padding: 14px 16px; border-radius: var(--r); margin-bottom: 20px; }
.emergency-banner .icon { color: var(--urgent); margin-top: 2px; }

/* Amount chooser */
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.amount-grid button { padding: 12px 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; font: 700 .95rem var(--font-body); color: var(--ink); cursor: pointer; }
.amount-grid button:hover { border-color: var(--teal); }
.amount-grid button.selected { background: var(--teal-50); border-color: var(--teal); color: var(--teal-600); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
@media (max-width: 440px) { .amount-grid { grid-template-columns: repeat(2, 1fr); } }
.big-amount input { font-size: 1.5rem; font-weight: 700; padding: 14px; }
.summary-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin: 18px 0; }
#payment-element { min-height: 60px; margin: 14px 0 6px; }
.pay-error { color: var(--danger); font-size: .92rem; min-height: 1.4em; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: .84rem; color: var(--muted); margin-top: 12px; }
.test-banner { background: var(--accent-50); border: 1px solid #BFD9F7; color: #1D4E89; border-radius: var(--r); padding: 12px 14px; font-size: .88rem; margin-bottom: 16px; }
.result-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.result-icon.ok { background: var(--success-50); color: var(--success); }
.result-icon.wait { background: var(--warning-50); color: var(--warning); }
.result-icon.bad { background: var(--danger-50); color: var(--danger); }

/* Directory */
.dir-card { display: flex; gap: 16px; align-items: flex-start; }
.dir-card h3 { margin-bottom: 4px; }
.dir-card h3 a { color: var(--ink); text-decoration: none; }
.dir-card h3 a:hover { color: var(--teal); }
.verified-tick { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-size: .8rem; font-weight: 700; }

/* Map */
#map { height: 560px; border-radius: var(--r-lg); border: 1px solid var(--line); z-index: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .88rem; color: var(--muted); margin-top: 12px; }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* FAQ */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--teal); }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark-bg); color: #A9C0C8; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 36px; }
.footer-grid h3 { color: #fff; font-size: .95rem; margin-bottom: 12px; font-family: var(--font-body); }
.footer-grid a:not(.brand) { display: block; color: #A9C0C8; text-decoration: none; font-size: .92rem; padding: 4px 0; }
.footer-grid a:not(.brand):hover { color: #fff; }
.footer-brand p { margin-top: 14px; font-size: .92rem; max-width: 320px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px 0 28px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.footer-secure { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   Dashboard shell
   ========================================================================== */
.is-app { background: var(--app-bg, #F1F5F4); }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; background: var(--dark-bg); color: #B7CBD2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px; }
.sidebar .brand { padding: 4px 10px 18px; font-size: 1.1rem; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-heading { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6F8C97; margin: 18px 10px 6px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #C5D6DC; text-decoration: none; font-size: .92rem; font-weight: 500; }
.side-nav a:hover, .side-foot a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--teal); color: #fff; }
.side-nav a .count { margin-left: auto; font-style: normal; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; margin-top: 10px; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title p { margin: 0; font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--urgent); box-shadow: 0 0 0 2px #fff; }
.avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; text-decoration: none; }
.avatar:hover { color: #fff; background: var(--teal-600); }
.side-toggle { display: none; }
.app-content { padding: 28px; max-width: 1280px; width: 100%; }
.side-scrim { display: none; }
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
    body.side-open .sidebar { transform: none; }
    body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(14,47,63,.45); z-index: 55; }
    .side-toggle { display: grid; }
    .topbar { padding: 0 16px; }
    .app-content { padding: 20px 16px; }
    .hide-sm { display: none; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 1.7rem; margin: 0 0 4px; }
.page-head p { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-tile { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }
.stat-tile.accent .stat-icon { background: var(--accent-50); color: var(--accent-600); }
.stat-tile.urgent .stat-icon { background: var(--urgent-50); color: var(--urgent); }
.stat-tile.ink .stat-icon { background: #E3ECEF; color: var(--ink); }
.stat-label { margin: 0; font-size: .84rem; color: var(--muted); }
.stat-value { margin: 2px 0 0; font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat-hint { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: #fff; }
.checklist .done .tick { background: var(--success); border-color: var(--success); }
.checklist a { font-weight: 600; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: .75rem; color: var(--muted); }
.bar-chart .bar i { display: block; width: 100%; max-width: 44px; background: linear-gradient(180deg, #18A395, var(--teal)); border-radius: 6px 6px 2px 2px; min-height: 3px; }

.notif { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #F5FBFA; }
.notif.unread h3::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-left: 8px; vertical-align: middle; }
.notif h3 { font-size: .98rem; margin: 0 0 2px; font-family: var(--font-body); }
.notif p { margin: 0; color: var(--muted); font-size: .92rem; }
.notif time { font-size: .8rem; color: var(--muted); }

.doc-preview { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.doc-preview img { max-height: 540px; margin: 0 auto; }
.doc-preview iframe { width: 100%; height: 600px; border: 0; }

/* Receipt / print */
.receipt { max-width: 720px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 18px; }
@media print {
    .sidebar, .topbar, .site-header, .site-footer, .no-print, .alert { display: none !important; }
    body, .is-app { background: #fff; }
    .app-content { padding: 0; }
    .card { border: 0; box-shadow: none; }
}

/* Reason dialog (reject / refund / reply) */
.reason-pop { display: inline-block; text-align: left; }
.reason-pop > summary { list-style: none; cursor: pointer; }
.reason-pop > summary::-webkit-details-marker { display: none; }
.reason-pop[open]::before { content: ""; position: fixed; inset: 0; background: rgba(14,47,63,.42); z-index: 90; }
.reason-pop > form { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 91; width: min(420px, 92vw); background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(14,47,63,.28); padding: 20px; display: grid; gap: 12px; white-space: normal; }
.reason-title { font-family: var(--font-head, inherit); font-size: 1.1rem; color: var(--ink); }
.reason-pop textarea { width: 100%; font: inherit; font-size: .95rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.reason-pop textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.reason-actions { display: flex; justify-content: flex-end; gap: 8px; }
.table .actions .reason-pop { margin-left: 6px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-list li:last-child { border-bottom: 0; }
.alert-urgent { background: var(--urgent-50); border-color: #f0c2b8; color: #7a2419; }
.field .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink); }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 500; }
.choice:has(input:checked) { border-color: var(--teal); background: #eef8f6; box-shadow: 0 0 0 1px var(--teal) inset; }
.choice input { accent-color: var(--teal); width: auto; margin: 0; }

/* OTP */
.otp-card { max-width: 440px; margin: 0 auto; padding: 32px 28px; }
.otp-icon { width: 56px; height: 56px; border-radius: 16px; background: #e6f4f2; color: var(--teal); display: grid; place-items: center; margin: 0 auto 12px; }
.otp-form { display: grid; gap: 14px; margin-top: 8px; }
.otp-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 2rem !important; letter-spacing: .6em; text-align: center; padding: 14px 10px 14px 24px !important; font-weight: 700; }
.otp-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: .92rem; }
.otp-links form { margin: 0; }
.link-btn[disabled] { opacity: .5; cursor: default; text-decoration: none; }

/* Cards & checkout */
.accepted-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.accepted-cards span, .card-brand { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink); background: var(--surface-2); }
.card-brand.brand-visa { background: #1a1f71; color: #fff; border-color: #1a1f71; }
.card-brand.brand-mastercard { background: #231f20; color: #fff; border-color: #231f20; }
.card-brand.brand-jcb { background: #0e4c96; color: #fff; border-color: #0e4c96; }
.card-brand.brand-amex { background: #2e77bc; color: #fff; border-color: #2e77bc; }
.cc-wrap { position: relative; }
.cc-wrap .card-brand { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.pay-h { font-size: 1rem; margin: 0 0 10px; }
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 22px 0 16px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.saved-card-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: linear-gradient(135deg, #0E2F3F, #14485d); color: #fff; }
.saved-card-tile .muted { color: #b7cfd6; }
.saved-card-tile.expired { opacity: .6; }
.two-col > *, .detail-grid > * { min-width: 0; }
.bar-chart { overflow-x: auto; }
@media (max-width: 560px) { .bar-chart .bar { font-size: .62rem; min-width: 8px; } }
.doc-upload { border: 1px dashed #b9cfcb; border-radius: 12px; padding: 14px 16px 4px; margin: 4px 0 18px; background: #f7fbfa; }
.doc-upload legend { font-weight: 700; color: var(--ink); padding: 0 6px; }
.doc-upload input[type=file] { width: 100%; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.card-brand[hidden] { display: none; }

/* Language menu */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 10px; border-radius: 9px; font-size: .88rem; font-weight: 600; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu[open] > summary { border-color: var(--teal); }
.lang-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(420px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(14,47,63,.18); padding: 10px; }
.lang-pop a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.lang-pop a:hover { background: var(--surface-2); }
.lang-pop a.active { background: #e6f4f2; color: var(--teal); font-weight: 700; }
.lang-sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 8px 10px 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
@media (max-width: 900px) { .site-nav .lang-menu { margin: 6px 0; } .site-nav .lang-pop { position: static; width: 100%; box-shadow: none; } }
/* Google auto-translate: hide its banner */
.goog-te-banner-frame, .skiptranslate iframe, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.flow-steps > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: relative; }
.flow-steps strong { display: block; color: var(--ink); font-size: .92rem; }
.flow-steps span { font-size: .84rem; color: var(--muted); }
@media (max-width: 900px) { .flow-steps { grid-template-columns: 1fr 1fr; } }
.wallet-demo { max-width: 420px; margin: 0 auto; text-align: center; }
.wallet-logo { display: inline-block; color: #fff; font-weight: 800; font-size: 1.4rem; padding: 10px 22px; border-radius: 12px; margin-bottom: 14px; letter-spacing: .02em; }
.wallet-amount { font-size: 2.4rem; font-weight: 800; color: var(--ink); margin: 6px 0 10px; font-family: var(--font-head); }
/* Payment method picker */
.pay-methods { display: grid; gap: 10px; margin-bottom: 18px; }
.pay-method { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.pay-method:hover { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.pay-method .pm-badge { min-width: 74px; text-align: center; color: #fff; font-weight: 800; font-size: .85rem; padding: 7px 10px; border-radius: 8px; }
.pay-method .pm-text strong { display: block; }
.pay-method .pm-text span { font-size: .84rem; color: var(--muted); }
.pay-method .pm-amt { margin-left: auto; font-weight: 700; white-space: nowrap; }
.pay-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pay-settings .card { margin: 0; }
.pay-settings h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.pay-settings .pm-badge, .card .pm-badge { color: #fff; font-weight: 800; font-size: .78rem; padding: 4px 9px; border-radius: 6px; }
.admin-donate > summary { cursor: pointer; list-style: none; } .admin-donate > summary::-webkit-details-marker{display:none}
/* Payment brand logos */
.pay-logos { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pay-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; vertical-align: middle; flex: none; }
img.pay-logo { background: #fff; border: 1px solid var(--line); object-fit: contain; padding: 2px 4px; }
.pay-logo-text { color: #fff; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.pay-logo-sm { height: 24px; min-width: 38px; font-size: .66rem; padding: 0 6px; }
img.pay-logo-sm { width: 40px; }
.pay-logo-md { height: 32px; min-width: 64px; font-size: .8rem; padding: 0 9px; }
img.pay-logo-md { width: 64px; }
.pay-logo-lg { height: 48px; min-width: 110px; font-size: 1.15rem; padding: 0 16px; border-radius: 10px; }
img.pay-logo-lg { width: 120px; }
.footer-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #b7cfd6; }
.record-donation > summary { cursor: pointer; list-style: none; } .record-donation > summary::-webkit-details-marker { display: none; }
.patient-box { background: var(--teal-50); border: 1px solid #C7E5DF; border-radius: var(--r); padding: 18px 20px; }
.patient-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.patient-head h3 { margin: 0; font-size: 1.1rem; display: flex; gap: 8px; align-items: center; color: var(--ink); }
.patient-info dt { font-weight: 600; }


/* ===================== Dark mode ===================== */
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #E3EEF1; --ink-2: #CFE0E5; --ink-3: #A9C2CA;
    --teal: #2BB3A3; --teal-600: #24998B; --teal-50: #12302E;
    --accent: #4C9BF0; --accent-600: #3B8FE8; --accent-50: #13263B; --accent-light: #9ED0FF;
    --urgent: #F0735C; --urgent-50: #3A1A15;
    --bg: #0B161C; --surface: #12212A; --surface-2: #172A34;
    --line: #22363F; --line-2: #2E4752;
    --text: #DCE7EA; --muted: #93A8B0;
    --success: #4ADE9B; --success-50: #0F2D23;
    --warning: #F39C7A; --warning-50: #34190F;
    --danger: #F2877C; --danger-50: #3A1614;
    --info: #7DB6E8; --info-50: #10263A;
    --dark-bg: #08151B; --dark-bg-2: #102632;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
}
:root[data-theme="dark"] .site-header { background: rgba(12,24,31,.92); border-color: var(--line); }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-give { color: #06141A; }
:root[data-theme="dark"] .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
:root[data-theme="dark"] .test-banner { background: #13263B; border-color: #24496F; color: #BFDDFF; }
:root[data-theme="dark"] .alert-warning { border-color: #5B2E1D; color: #F7C2AC; }
:root[data-theme="dark"] .alert-error { color: #F7B7AF; }
:root[data-theme="dark"] .alert-success { color: #A6F0CD; }
:root[data-theme="dark"] .alert-info { color: #BFDDFF; }
:root[data-theme="dark"] img.pay-logo { background: #fff; }
:root[data-theme="dark"] .patient-box { border-color: #1F4440; }
:root[data-theme="dark"] .choice:has(input:checked) { background: #12302E; }
:root[data-theme="dark"] .brand { color: var(--text); }
.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--teal); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
/* Inquiry phone */
.phone-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.phone-card .ph-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }
.phone-card strong { font-size: 1.3rem; color: var(--ink); letter-spacing: .02em; }
:root[data-theme="dark"] { --app-bg: #0B161C; }
:root[data-theme="dark"] .topbar { background: rgba(12,24,31,.92); border-color: var(--line); }
:root[data-theme="dark"] .site-nav a:hover, :root[data-theme="dark"] .site-nav a.active { background: #12302E; }
:root[data-theme="dark"] .stat-tile.ink .stat-icon { background: #1C3340; color: #CFE0E5; }

/* Inquiry block at the bottom of every page */
.footer-inquiry { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.04); }
.footer-inquiry .inq-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(140,200,255,.14); color: var(--accent-light); flex: none; }
.footer-inquiry .inq-label { display: block; font-size: .8rem; color: #A9C0C8; letter-spacing: .04em; }
.footer-inquiry .inq-number { color: #fff; font-size: 1.45rem; font-weight: 800; text-decoration: none; letter-spacing: .03em; font-family: var(--font-head); }
.footer-inquiry .inq-hours { display: inline-flex; align-items: center; gap: 8px; color: #DCE7EA; font-weight: 600; margin-left: auto; background: rgba(255,255,255,.06); padding: 8px 14px; border-radius: 999px; }
@media (max-width: 640px) { .footer-inquiry .inq-hours { margin-left: 0; } }
.app-inquiry { margin-top: 40px; padding: 14px 0 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-inquiry a { color: var(--ink); font-weight: 700; text-decoration: none; }
.app-inquiry .icon { color: var(--teal); }

/* ---- Dark mode: calm, readable selected / active states (nothing glaring) ---- */
:root[data-theme="dark"] .btn-primary { background: #1E8A7E; border-color: #1E8A7E; color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: #23A090; border-color: #23A090; color: #fff; }
:root[data-theme="dark"] .btn-give { background: #2F7FD8; color: #fff; }
:root[data-theme="dark"] .btn-give:hover { background: #3B8FE8; color: #fff; }
:root[data-theme="dark"] .side-nav a.active { background: #17403C; color: #A7F0E6; box-shadow: inset 3px 0 0 #2BB3A3; }
:root[data-theme="dark"] .side-nav a.active .icon { color: #7FE0D3; }
:root[data-theme="dark"] .lang-pop a.active { background: #17403C; color: #A7F0E6; }
:root[data-theme="dark"] .lang-pop a:hover { background: var(--surface-2); }
:root[data-theme="dark"] .site-nav > a.active, :root[data-theme="dark"] .site-nav > a:not(.btn):hover { background: #17403C; color: #A7F0E6; }
:root[data-theme="dark"] .tab.active { color: #7FE0D3; border-bottom-color: #2BB3A3; }
:root[data-theme="dark"] .role-picker label:has(input:checked),
:root[data-theme="dark"] .choice:has(input:checked),
:root[data-theme="dark"] .amount-grid button.selected { background: #17403C; border-color: #2BB3A3; color: #E3EEF1; box-shadow: 0 0 0 2px rgba(43,179,163,.25); }
:root[data-theme="dark"] .role-picker label small { color: var(--muted); }
:root[data-theme="dark"] .badge-neutral { background: #22363F; color: #CFE0E5; }
:root[data-theme="dark"] .table tbody tr:hover { background: #172A34; }
:root[data-theme="dark"] .notif.unread { background: #12302E; }
:root[data-theme="dark"] .otp-icon { background: #17403C; color: #7FE0D3; }
:root[data-theme="dark"] .doc-upload { background: #12212A; border-color: #2E4752; }
:root[data-theme="dark"] .pager a.current { background: #17403C; border-color: #2BB3A3; color: #E3EEF1; }
/* drop-down menus and their options */
:root[data-theme="dark"] select, :root[data-theme="dark"] select option, :root[data-theme="dark"] optgroup { background-color: var(--surface); color: var(--text); }
:root[data-theme="dark"] select option:checked { background-color: #17403C; color: #E3EEF1; }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #6F8790; }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus, :root[data-theme="dark"] textarea:focus { border-color: #2BB3A3; box-shadow: 0 0 0 3px rgba(43,179,163,.18); }
/* browser autofill and text selection stay dark */
:root[data-theme="dark"] input:-webkit-autofill, :root[data-theme="dark"] input:-webkit-autofill:hover, :root[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px var(--surface) inset; caret-color: var(--text); transition: background-color 9999s; }
:root[data-theme="dark"] ::selection { background: #1E5F78; color: #fff; }
:root[data-theme="dark"] input[type=file] { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
:root[data-theme="dark"] input[type=file]::file-selector-button { background: #22363F; color: #E3EEF1; border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 10px; }
:root[data-theme="dark"] .check input, :root[data-theme="dark"] .choice input { accent-color: #2BB3A3; }
:root[data-theme="dark"] .badge-urgent { background: #5A2219; color: #FFC2B6; }
:root[data-theme="dark"] .emergency-banner, :root[data-theme="dark"] .alert-urgent { background: #3A1A15; color: #FFC2B6; border-color: #6B2A20; }

/* "HelpBank" name in the logo's lettering style */
.brand-name { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 800; font-size: 1.45rem; letter-spacing: -.01em; line-height: 1; }
.bn-help { color: #1F64C3; }
.bn-bank { color: #2E9A6A; background: linear-gradient(90deg, #1F78C8 0%, #3FAE5B 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar .brand-name { font-size: 1.3rem; }
/* on dark backgrounds (footer, sidebar, dark mode) use lighter tones of the same colours */
.brand-light .bn-help, :root[data-theme="dark"] .bn-help { color: #6FB2FF; }
.brand-light .bn-bank, :root[data-theme="dark"] .bn-bank { background: linear-gradient(90deg, #5FB6F5 0%, #7FD88E 100%); -webkit-background-clip: text; background-clip: text; }
@media print { .bn-bank { -webkit-text-fill-color: #2E9A6A; background: none; } }
/* Map location picker */
.loc-picker { display: grid; gap: 8px; }
.loc-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-map { height: 280px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.loc-msg { margin: 0; }
:root[data-theme="dark"] .loc-map .leaflet-tile-pane { filter: brightness(.82) contrast(1.05); }
