@font-face { font-family: Barlow; src: url('/fonts/barlow-semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Barlow; src: url('/fonts/barlow-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/source-sans-3.woff2') format('woff2'); font-weight: 200 900; font-display: swap; }
/* Foundations */
:root {
  --blue: #072357; --red: #da121a; --ink: #172b46; --secondary: #546174;
  --white: #fff; --background: #f5f7fa; --soft: #edf2f8; --line: #dce3ed;
  --green: #126e58; --warning: #785318; --warning-bg: #fff5df;
  /* Semantic roles: --blue is the brand fill (buttons, white text on it); --heading is blue text. */
  --surface: #fff; --heading: #072357; --brand-hover: #12366e; --brand-active: #041b43; --brand-accent: #072357;
  --danger-bg: #faf2f1; --danger-ink: #8f1820; --danger-strong: #b90e16; --success-bg: #e5f2ed; --success-ink: #12614e;
  --soft-hover: #dce6f3; --field-border: #8a9bb2; --disabled-bg: #dce3ed; --disabled-ink: #48576f;
  --check: #126e58; --need-hover: #bc0f17;
  color-scheme: light;
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 16px; --radius: var(--radius-sm);
  --reading: 70ch; --elevation: 0 7px 20px #07235712;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  font: 18px/1.5 'Source Sans 3', Arial, sans-serif; font-synthesis: none;
  color: var(--ink); background: var(--surface); scrollbar-color: var(--field-border) var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--heading); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { color: white; background: var(--blue); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
input, textarea { caret-color: var(--heading); }
h1,h2,h3,h4 { font-family: Barlow, sans-serif; color: var(--heading); font-weight: 700; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(36px, 4.2vw, 64px); letter-spacing: -.025em; margin: 0 0 16px; max-width: 17ch; }
h2 { font-size: clamp(30px, 3vw, 42px); letter-spacing: -.02em; margin: 0 0 16px; }
h3 { font-size: 25px; margin: 36px 0 12px; letter-spacing: -.015em; }
h4 { font-size: 22px; margin: 0 0 10px; }
p { margin: 12px 0 20px; max-width: var(--reading); }
.small { font-size: 15px; line-height: 1.45; color: var(--secondary); }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.arrow { margin-left: auto; }
.skip { position: absolute; z-index: 50; top: 8px; left: 16px; padding: 12px; background: var(--surface); transform: translateY(-200%); }
.skip:focus { transform: none; }
/* Persistent orientation */
.site-header { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: auto; padding: 24px 40px; gap: 16px; }
.brand { font: 700 32px/.95 Barlow, sans-serif; letter-spacing: -.035em; text-decoration: none; color: var(--heading); }
.brand span { color: var(--red); }
.identity { display: block; font-size: 12px; font-weight: 500; letter-spacing: .035em; margin-top: 9px; color: var(--secondary); }
.login { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: 16px; font-weight: 600; text-decoration: none; }
.main-nav { display: flex; align-items: center; justify-content: center; gap: 12px; border-block: 1px solid var(--line); padding: 6px 24px; background: var(--surface); }
.main-nav a { display: flex; align-items: center; gap: 8px; padding: 12px 18px; min-height: 48px; color: var(--secondary); text-decoration: none; font-weight: 600; border-radius: var(--radius-sm); }
.main-nav a:hover { background: var(--background); }
.main-nav a[aria-current] { color: var(--heading); background: var(--soft); }
.main-nav a[aria-current] .icon { stroke-width: 2.2; }
.emergency { background: var(--danger-bg); color: var(--danger-ink); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; padding: 8px 24px; font-size: 15px; }
.emergency a { color: var(--danger-strong); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.emergency-note { font-size: 13px; }
body[data-page='inicio'] > .emergency { display: none; }
main { max-width: 1200px; padding: 0 40px; margin: auto; }
main:focus { outline: none; }
[data-view] { padding: 40px 0 64px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.section-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; background: var(--soft); border-radius: var(--radius-sm); text-decoration: none; font-size: 16px; font-weight: 600; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; }
/* Opening: distinct actions, family, nearby centers */
#inicio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 0 64px; padding-top: 52px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; grid-column: 1; grid-row: 1 / 4; align-content: start; }
.intro-copy p { color: var(--secondary); font-size: 21px; max-width: 40ch; margin: 0; }
p.intro { display: block; font-size: 18px; max-width: var(--reading); color: var(--secondary); }
.entry-actions { display: grid; gap: 12px; margin-top: 8px; }
.entry-actions > a { display: flex; gap: 18px; align-items: center; padding: 24px; min-height: 98px; border-radius: var(--radius-md); color: white; text-decoration: none; box-shadow: var(--elevation); transition: box-shadow .2s cubic-bezier(.16,1,.3,1), background-color .2s; }
.entry-actions .entry-need { background: var(--red); min-height: 124px; }
.entry-actions .entry-help { background: var(--blue); }
.entry-need:hover { box-shadow: 0 10px 24px #da121a24; }
.entry-help:hover { box-shadow: 0 10px 24px #07235724; }
.entry-actions > a:active { box-shadow: 0 2px 5px #07235720; }
.entry-actions > a:focus-visible { outline: 3px solid var(--heading); box-shadow: 0 0 0 6px var(--surface); }
.entry-actions strong { display: block; font: 700 29px/1.1 Barlow, sans-serif; letter-spacing: -.015em; }
.entry-actions span { display: block; margin-top: 6px; font-size: 16px; line-height: 1.4; }
.entry-actions .lead { width: 32px; height: 32px; }
.home-family { grid-column: 2; padding: 6px 0 20px; border-bottom: 1px solid var(--line); }
.family-heading { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.home-family h2 { font-size: 27px; margin: 0; }
.home-family p { color: var(--secondary); margin: 12px 0 8px; font-size: 17px; }
.family-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.family-shortcuts a { font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--soft); text-decoration: none; font-weight: 600; }
.home-centers { grid-column: 2; display: flex; gap: 14px; align-items: center; padding: 24px 0; text-decoration: none; }
.pin { background: var(--soft); border-radius: 10px; width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; }
.home-centers strong { display: block; font-size: 20px; }
.home-centers span:not(.pin) { display: block; font-size: 15px; color: var(--secondary); margin-top: 4px; }
.home-emergency { grid-column: 2; padding: 18px; background: var(--danger-bg); color: var(--danger-ink); display: flex; align-items: center; gap: 16px; border-radius: var(--radius-md); }
.home-emergency strong { display: block; font-size: 16px; }
.home-emergency span { display: block; font-size: 13px; color: var(--danger-ink); margin-top: 3px; }
.home-emergency a { margin-left: auto; font: 700 30px Barlow, sans-serif; color: var(--danger-strong); min-height: 44px; display: flex; align-items: center; }
.home-guide { grid-column: 1 / -1; margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 32px; }
.home-guide h2 { grid-column: 1 / -1; font-size: 27px; }
.home-guide > a { padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; }
.home-guide strong { display: block; font-size: 19px; }
.home-guide span { display: block; margin-top: 8px; font-size: 16px; color: var(--secondary); }
.home-sharing { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding: 32px; background: var(--background); border-radius: var(--radius-md); margin-top: 32px; }
.home-sharing h2 { font-size: 27px; }
.home-sharing p { font-size: 16px; }
/* Records, sources and operational detail */
.independence-note { max-width: 85ch; padding-block: 16px; border-block: 1px solid var(--line); font-size: 16px; color: var(--secondary); }
.institutional-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 24px; }
.home-institutional { grid-column: 1 / -1; margin-top: 32px; padding-block: 24px; border-block: 1px solid var(--line); }
.home-institutional h2 { font-size: 27px; }
.home-institutional > a { display: inline-flex; align-items: center; min-height: 48px; margin-right: 24px; font-weight: 600; }
.institutional-point { min-width: 0; padding: 24px; background: var(--background); border-radius: var(--radius-md); }
.institutional-point h4 { margin-top: 12px; }
.point-institution { font-weight: 600; }
.point-facts { display: grid; grid-template-columns: 1fr 1.7fr; gap: 12px; font-size: 16px; }
.point-facts dt { color: var(--secondary); }
.point-facts dd { margin: 0; overflow-wrap: anywhere; }
.point-state { font-weight: 600; color: var(--heading); }
.source-link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }
.institutional-announcement { padding-block: 24px; border-block: 1px solid var(--line); }
.institutional-directory-link{display:block;width:fit-content;margin-top:12px;padding-block:10px}
.institutional-actions { display: grid; gap: 12px; padding-left: 24px; }
.point-history { border-top: 1px solid var(--line); margin-top: 16px; }
.records { margin: 20px 0 32px; }
.card { padding: 24px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.card:first-child { border-top: 1px solid var(--line); }
.card p { margin: 8px 0 12px; }
.card h3, .card h4 { margin: 0 0 12px; }
.card.is-current, .card:target { background: var(--soft); border: 0; border-radius: var(--radius-md); padding: 24px; }
.tag { display: inline-block; font-size: 13px; line-height: 1.45; font-weight: 650; color: var(--heading); background: var(--soft); padding: 5px 9px; border-radius: 6px; margin: 0 6px 6px 0; }
.tag.verified { background: var(--success-bg); color: var(--success-ink); }
.empty, .load-error { background: var(--background); padding: 24px; border-radius: var(--radius-md); max-width: var(--reading); color: var(--secondary); }
.load-error { background: var(--warning-bg); color: var(--warning); }
.empty-action, .record-footer { display: inline-flex; align-items: center; min-height: 44px; margin: 0 16px 8px 0; font-weight: 600; }
.record-footer { font-size: 15px; margin-top: 12px; }
.card button + a { display: inline-flex; min-height: 44px; align-items: center; margin-top: 8px; }
.territory-toolbar { display: flex; gap: 24px; align-items: center; padding: 20px 0; border-block: 1px solid var(--line); margin: 24px 0; }
.territory-toolbar label { margin: 0; min-width: 220px; }
.territory-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; }
.territory-layout h3 { margin-top: 12px; }
.map { padding: 16px; background: var(--soft); border-radius: var(--radius-md); }
.map svg { width: 100%; height: auto; display: block; }
.map text { font-family: 'Source Sans 3', sans-serif; font-size: 12px; fill: var(--heading); }
.map circle { fill: var(--heading); }
.map svg circle.empty { opacity: .25; }
.map svg rect.center-point { fill: var(--red); stroke: white; stroke-width: 1.5; }
.map-layers { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.map-layers legend { font-weight: 600; margin-bottom: 8px; }
.map-layers .check { font-size: 15px; margin-bottom: 4px; }
#territory-list .card { padding: 12px 0; }
#territory-list .card p { font-size: 15px; margin: 4px 0; }
.balance-figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; padding: 24px 0; margin: 20px 0; border-block: 1px solid var(--line); }
.balance-figures dt { font-size: 15px; color: var(--secondary); }
.balance-figures dd { font: 700 34px Barlow, sans-serif; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.balance-figures dd.no-data { font-size: 18px; }
.balance-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 15px; }
.family-layout, .auth-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; margin-top: 32px; }
.auth-layout > *, .family-layout > * { min-width: 0; }
.family-layout h3 { margin-top: 0; }
.family-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-5) 0; }
.family-choices button[aria-pressed='true'] { color: #fff; background: var(--blue); }
.family-composer { max-width: 720px; padding: var(--space-5); background: var(--background); border-radius: var(--radius-md); }
.family-composer fieldset { margin: var(--space-5) 0; }
.family-composer .check { margin-bottom: var(--space-3); }
.family-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-5) 0; }
.family-location { margin: var(--space-5) 0; }
.family-location button { margin: 0 var(--space-2) var(--space-2) 0; }
.family-record { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.family-record button { margin: 0 var(--space-2) var(--space-2) 0; }
.family-record h4 { margin-top: 0; }
.family-notice { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-width: var(--reading); }
.family-private { margin: var(--space-5) 0; }
@media (max-width: 480px) {
  .family-composer { padding: var(--space-4); }
  .family-choices button, .family-actions button { flex: 1 1 100%; }
}
.guidance { background: var(--soft); border-radius: var(--radius-md); padding: 28px; align-self: start; }
.guidance > a:not(.button) { display: inline-flex; min-height: 44px; align-items: center; }
.safety-note { background: var(--danger-bg); padding: 16px 20px; border-radius: var(--radius-md); max-width: var(--reading); color: var(--danger-ink); }
.aid-panel, .mission-detail { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.task-list { padding-left: 24px; display: grid; gap: 12px; }
.task-list button { margin: 8px; }
.center-need { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
table.stock { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
table.stock caption { text-align: left; font-size: 14px; color: var(--secondary); padding-bottom: 8px; }
table.stock th, table.stock td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; overflow-wrap: anywhere; }
table.stock th { background: var(--background); }
/* Forms and recoverable states */
form { max-width: 760px; background: var(--background); padding: 28px; margin: 24px 0; border-radius: var(--radius-md); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; margin-bottom: 24px; font-size: 17px; }
input, select, textarea { width: 100%; min-width: 0; font: inherit; line-height: 1.4; padding: 12px; min-height: 48px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--secondary); opacity: 1; }
textarea { min-height: 120px; resize: vertical; }
input[type='file'] { font-size: 15px; }
input[type='file']::file-selector-button { font: inherit; background: var(--soft); border: 0; padding: 8px; color: var(--heading); cursor: pointer; }
.check { flex-direction: row; align-items: flex-start; font-weight: 400; gap: 12px; }
.check input { min-height: 20px; width: 20px; height: 20px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--heading); }
.unit-hint { color: var(--secondary); font-weight: 400; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; font: 600 17px/1.35 'Source Sans 3', sans-serif; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--blue); color: white; cursor: pointer; text-decoration: none; gap: 8px; }
button:hover, .button:hover { background: var(--brand-hover); text-decoration: none; }
button:active, .button:active { background: var(--brand-active); }
button:disabled { background: var(--disabled-bg); color: var(--disabled-ink); cursor: wait; }
button.secondary { background: var(--surface); color: var(--heading); border-color: var(--field-border); margin: 8px 8px 0 0; }
button.secondary:hover { background: var(--soft); }
.request-page form > button { background: var(--red); }
.request-page form > button:hover { background: #bc0f17; }
summary { cursor: pointer; font-weight: 600; color: var(--heading); padding: 16px 0; min-height: 48px; line-height: 1.4; }
details { border-bottom: 1px solid var(--line); }
.form-surface { max-width: 760px; margin-top: 32px; }
.form-surface h3 { margin-bottom: 16px; }
.form-feedback { padding: 16px; background: var(--warning-bg); color: var(--warning); margin-top: 16px; border-radius: var(--radius-sm); }
#notice:not(:empty), #direct-status:not(:empty) { background: var(--soft); padding: 18px 24px; margin-top: 24px; max-width: var(--reading); overflow-wrap: anywhere; border-radius: var(--radius-md); }
#notice:empty { display: none; }
.private-result:not(:empty) { padding: 24px; background: var(--soft); border-radius: var(--radius-md); font-size: 20px; margin: 0 0 16px; max-width: 40ch; overflow-wrap: anywhere; }
.authenticated .session-needed { display: none; }
form.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
form.filters label { margin: 0; }
label.filter { max-width: 420px; }
.auth-guidance { background: var(--soft); padding: 24px; border-radius: var(--radius-md); align-self: start; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
#auth-status { min-height: 1.5em; color: var(--heading); }
#auth-backup, #auth-passkey { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; }
#auth-code, #auth-recovery { width: 100%; min-width: 0; }
.google-button { min-height: 44px; width: 100%; max-width: 400px; margin: 24px 0 8px; }
.google-button iframe { max-width: 100%; }
/* Google inline positioning is blocked by the unchanged CSP. */
.google-button > div { position: relative; }
.google-button [role='button'] { max-width: 400px; }
.google-button svg { width: 18px; height: 18px; }
#google-help { color: var(--secondary); }
html:not(.js-enabled) form { display: none; }
/* Safe public sharing */
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.share-actions > a, .share-actions > button { min-height: 44px; display: inline-flex; align-items: center; padding: 9px 12px; background: var(--soft); color: var(--heading); font: 600 15px 'Source Sans 3', sans-serif; text-decoration: none; border: 0; border-radius: var(--radius-sm); }
.share-actions > a:hover, .share-actions > button:hover { background: var(--soft-hover); }
.share-status { width: 100%; font-size: 15px; }
.share-fallback { width: 100%; }
.share-fallback input { font-size: 15px; }
.piece-maker { width: 100%; margin-top: 8px; }
.piece-maker summary, .piece-maker p { font-size: 15px; }
.piece-maker canvas { width: 100%; height: auto; max-width: 440px; display: block; margin: 16px 0; }
.piece-controls { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.piece-controls label { font-size: 15px; margin-bottom: 12px; max-width: 300px; }
.card > details { margin-top: 16px; }
.share-actions .piece-maker > button { background: var(--blue); color: white; }
.session-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 40px; }
.session-strip p { margin: 0; }
.test-banner { background: var(--warning-bg); color: var(--warning); padding: 12px 24px; font-size: 14px; font-weight: 600; border-radius: var(--radius-md); }
.site-footer { max-width: 1200px; margin: auto; padding: 32px 40px 48px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.site-footer .brand { font-size: 25px; }
.site-footer p { font-size: 15px; margin: 8px 0; color: var(--secondary); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
/* Mobile keeps five stable destinations within thumb reach. */
@media (max-width: 800px) {
  :root { font-size: 17px; }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body[data-page='inicio'] { padding-bottom: calc(152px + env(safe-area-inset-bottom)); }
  .site-header { padding: 18px 24px; border-bottom: 1px solid var(--line); }
  .brand { font-size: 27px; }
  .identity { font-size: 12px; margin-top: 7px; }
  .login { font-size: 14px; }
  .login .icon { width: 18px; height: 18px; }
  .main-nav { position: fixed; z-index: 20; bottom: 0; left: 0; width: 100%; height: calc(80px + env(safe-area-inset-bottom)); gap: 0; justify-content: space-around; border-bottom: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .main-nav a { flex: 1; min-width: 0; max-width: 110px; flex-direction: column; gap: 5px; padding: 7px 2px; font-size: 12px; text-align: center; line-height: 1.15; }
  .main-nav a[aria-current] { background: transparent; }
  .main-nav a[aria-current]::after { content: ''; height: 3px; width: 20px; background: var(--red); border-radius: 3px; }
  main { padding-inline: 24px; }
  [data-view] { padding: 28px 0 40px; }
  #inicio { display: block; padding-top: 22px; }
  .intro { gap: 20px; }
  .intro h1 { font-size: 36px; max-width: 16ch; margin-bottom: 12px; }
  .intro-copy p { font-size: 17px; max-width: 40ch; }
  .entry-actions { margin-top: 0; }
  .entry-actions > a { padding: 18px; gap: 15px; min-height: 82px; }
  .entry-actions .entry-need { min-height: 102px; }
  .entry-actions strong { font-size: 24px; }
  .entry-actions span { font-size: 14px; margin-top: 5px; }
  .entry-actions .lead { width: 30px; height: 30px; }
  .home-family { margin-top: 20px; padding: 0 0 16px; }
  .home-family h2 { font-size: 23px; }
  .home-family p { font-size: 14px; margin-top: 10px; }
  .family-shortcuts a { font-size: 14px; padding: 7px 10px; }
  .home-centers { padding: 18px 0; gap: 12px; }
  .home-centers strong { font-size: 18px; }
  .home-centers span:not(.pin) { font-size: 13px; }
  .pin { width: 36px; height: 36px; }
  .home-emergency { position: fixed; z-index: 19; bottom: calc(80px + env(safe-area-inset-bottom)); left: 0; width: 100%; margin: 0; padding: 12px 24px; border-radius: 0; }
  .home-emergency strong { font-size: 14px; }
  .home-emergency span { font-size: 12px; }
  .home-emergency a { font-size: 28px; }
  .home-guide { grid-template-columns: 1fr; gap: 0; margin-top: 36px; }
  .home-guide h2, .home-sharing h2 { font-size: 25px; }
  .home-guide > a { padding: 16px 0; }
  .home-sharing, .territory-layout, .family-layout, .auth-layout { grid-template-columns: 1fr; gap: 24px; }
  .home-sharing { padding: 24px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .territory-toolbar { flex-wrap: wrap; gap: 12px; }
  .territory-toolbar label { flex: 1; min-width: 180px; }
  .territory-layout .records { margin-top: 0; }
  .balance-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
  .guidance, form { padding: 24px; }
  .site-footer { padding: 28px 24px; grid-template-columns: 1fr; gap: 12px; }
  .emergency { justify-content: flex-start; padding-inline: 24px; }
  .emergency-note { flex-basis: 100%; }
}
@media (max-width: 420px) {
  .intro h1 { font-size: 36px; }
  .intro-copy p { font-size: 15px; }
  .main-nav a { font-size: 12px; }
  .grid, form.filters, .balance-meta { grid-template-columns: 1fr; }
  form, .guidance { padding: 20px; }
  .balance-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-actions > * { width: 100%; }
  table.stock { font-size: 14px; }
  table.stock th, table.stock td { padding: 8px 4px; }
}
@media (max-width: 350px) {
  .intro h1 { font-size: 32px; }
  main, .site-header { padding-inline: 18px; }
  .home-emergency { padding-inline: 18px; }
  .entry-actions > a { gap: 10px; padding: 16px; }
  .entry-actions strong { font-size: 23px; }
  .entry-actions .lead { width: 25px; height: 25px; }
  .entry-actions .arrow { width: 18px; }
  .home-family h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  body { padding: 0; color: black; background: white; }
  .main-nav, .login, .share-actions, form, .skip, .site-footer nav { display: none !important; }
  main { max-width: none; padding: 0; }
  [data-view] { padding: 16px 0; }
  .card, .guidance, .balance-figures { break-inside: avoid; }
  .entry-actions > a { color: black; background: white; box-shadow: none; border: 1px solid #999; }
}

.stale-data { background: var(--warning-bg, #fff5df); color: var(--warning, #785318); border-radius: var(--radius-md, 10px); padding: 12px 16px; margin: 16px 0; }
/* Community stage on phones: "Necesito ayuda" and "Quiero ayudar" must both be visible without scrolling. */
@media (max-width: 800px) {
  html:not([data-stage='informative']) #inicio { padding-top: 14px; }
  html:not([data-stage='informative']) .intro { gap: 14px; }
  html:not([data-stage='informative']) .intro h1 { font-size: 28px; margin-bottom: 0; }
  html:not([data-stage='informative']) .intro-copy p { display: none; }
  html:not([data-stage='informative']) .entry-actions > a,
  html:not([data-stage='informative']) .entry-actions .entry-need { min-height: 0; padding: 16px 18px; }
  html:not([data-stage='informative']) .entry-actions strong { font-size: 24px; }
  html:not([data-stage='informative']) .entry-actions span { margin-top: 2px; font-size: 15px; }
}
/* "Quiero ayudar": other people's open requests come first, each with one clear action. */
.help-needs { margin-bottom: 32px; }
.help-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 8px 0 12px; background: none; border: 0; }
.help-filters label { font-size: 14px; }
.help-card button { background: var(--blue); color: white; border-color: var(--heading); }
.help-card button:hover { background: var(--brand-hover); }
.help-card > p:first-of-type { font-weight: 700; color: var(--red); }
.help-more { margin-top: 12px; font-weight: 600; }

/* Designed dark theme (flag palette on night blue). It follows the phone unless the person picks a theme
   with the header button (data-theme on <html>). Declaring it stops phones from auto-inverting the page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #0b1424; --background: #101c31; --soft: #16263f; --line: #24375a; --white: #0b1424;
    --ink: #e7edf6; --secondary: #a9b7cc; --heading: #a9c6ff; --check: #84d9b8;
    --blue: #1d50b0; --brand-hover: #2a62cc; --brand-active: #163f8c; --brand-accent: #5b8ff0;
    --red: #e8333b; --danger-bg: #2b1419; --danger-ink: #ffb4b8; --danger-strong: #ff7277;
    --success-bg: #0f2a20; --success-ink: #84d9b8; --warning: #f2d18f; --warning-bg: #2d2412;
    --soft-hover: #1f3356; --field-border: #3d5579; --disabled-bg: #23324a; --disabled-ink: #91a0b6;
    --elevation: 0 8px 24px #00000059; --need-hover: #f04148;
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --surface: #0b1424; --background: #101c31; --soft: #16263f; --line: #24375a; --white: #0b1424;
    --ink: #e7edf6; --secondary: #a9b7cc; --heading: #a9c6ff; --check: #84d9b8;
    --blue: #1d50b0; --brand-hover: #2a62cc; --brand-active: #163f8c; --brand-accent: #5b8ff0;
    --red: #e8333b; --danger-bg: #2b1419; --danger-ink: #ffb4b8; --danger-strong: #ff7277;
    --success-bg: #0f2a20; --success-ink: #84d9b8; --warning: #f2d18f; --warning-bg: #2d2412;
    --soft-hover: #1f3356; --field-border: #3d5579; --disabled-bg: #23324a; --disabled-ink: #91a0b6;
    --elevation: 0 8px 24px #00000059; --need-hover: #f04148;
}
:root[data-theme="light"] { color-scheme: light; }
.entry-need:hover { background: var(--need-hover); }
.entry-help:hover { background: var(--brand-hover); }
/* Access: one short card, Google first, details folded away. */
.auth-card { max-width: 520px; margin: 0 auto; }
.auth-card h1 { font-size: 34px; margin-bottom: 8px; }
.auth-card .google-button { margin: 20px 0 8px; min-height: 48px; }
.auth-points { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; gap: 10px; }
.auth-points li { padding-left: 28px; position: relative; color: var(--ink); }
.auth-points li::before { content: "✓"; position: absolute; left: 0; color: var(--check); font-weight: 700; }
body[data-page='acceso'] .session-strip { display: none; }
/* Sign-in with a code: an "or" divider, two folded options and the code shown big to copy on paper. */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px; color: var(--secondary); font-size: 15px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.code-box summary { padding: 12px 0; }
.code-form { margin: 0 0 16px; padding: 20px; display: grid; gap: 4px; }
.access-code { font: 700 clamp(19px, 6vw, 30px)/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; color: var(--heading); background: var(--soft); border: 2px dashed var(--field-border); border-radius: var(--radius-md); padding: 18px; text-align: center; overflow-wrap: anywhere; }
#code-created { padding: 20px 0; }
.on-behalf { margin-bottom: 4px; }
#code-created:not([hidden]) ~ #auth-account { display: none; }
/* Light/dark switch in the header. */
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--soft); color: var(--heading); border: 1px solid var(--line); margin: 0; }
.theme-toggle:hover { background: var(--soft-hover); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-sun { display: none; }
:root[data-effective-theme="dark"] .theme-sun { display: block; }
:root[data-effective-theme="dark"] .theme-moon { display: none; }
.login { white-space: nowrap; }
/* Bottom navigation badge and pending banner. */
.main-nav a { position: relative; }
.nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px 'Source Sans 3', sans-serif; text-align: center; }
.pending-banner { display: block; margin: 16px 0 0; padding: 14px 18px; border-radius: var(--radius-md); background: var(--red); color: #fff; font-weight: 700; text-decoration: none; }
.pending-banner:hover { background: var(--need-hover); }
/* Coordination as a guided path. */
.coordination.needs-me { border-left: 4px solid var(--red); padding-left: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; padding: 0; margin: 12px 0; counter-reset: step; }
.steps li { counter-increment: step; text-align: center; font-size: 13px; color: var(--secondary); padding-top: 30px; position: relative; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--soft); border: 2px solid var(--line); font: 700 12px/20px 'Source Sans 3', sans-serif; color: var(--secondary); }
.steps li.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.steps li.current { color: var(--heading); font-weight: 700; }
.steps li.current::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.next-step { background: var(--soft); border-radius: var(--radius-md); padding: 16px 18px; margin: 8px 0 12px; }
.next-step > p:first-child { margin-top: 0; font-weight: 600; }
.next-step button.primary { margin: 8px 8px 0 0; }
.contact-exchange { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; }
.contact-exchange h4 { margin: 0 0 8px; }
.their-contact { padding: 12px; border-radius: var(--radius-sm); background: var(--success-bg); color: var(--success-ink); margin-bottom: 12px; }
.their-contact p { margin: 4px 0 8px; color: var(--ink); font-size: 18px; overflow-wrap: anywhere; }
.contact-links { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-links .button { min-height: 44px; padding: 8px 18px; }
.contact-links .whatsapp { background: #128c4a; }
.more-options summary { padding: 8px 0; font-size: 15px; }
.history { font-size: 14px; color: var(--secondary); padding-left: 20px; }
@media (max-width: 800px) { .main-nav a span { font-size: 11px; } }
.contact-exchange textarea::placeholder { font-style: italic; font-weight: 400; color: var(--secondary); opacity: .8; }
.safety-note.compact { font-size: 15px; padding: 12px 16px; margin-top: 24px; }
