:root {
  color-scheme: light;
  --bg-dark: #f7f8f5; --bg-surface: #fff; --bg-card: #fff; --bg-card-hover: #f1f5f0;
  --border: #e1e6df; --border-focus: #427263;
  --text-main: #293b34; --text-muted: #627068; --text-dim: #6d7971;
  --blue: #376b59; --emerald: #376b59; --red: #aa5047; --amber: #94723c; --whatsapp: #376b59;
  --soft-green: #edf3ed; --soft-red: #faeeeb; --soft-amber: #f6f0e4;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-full: 999px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: background .18s ease, border-color .18s ease, color .18s ease;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg-dark: #18231f; --bg-surface: #202e27; --bg-card: #202e27; --bg-card-hover: #2a3931;
  --border: #37473e; --border-focus: #a1c9b4;
  --text-main: #edf2ec; --text-muted: #b5c2b8; --text-dim: #a5b6aa;
  --blue: #a1c9b4; --emerald: #a1c9b4; --red: #efaaa0; --amber: #d8be87;
  --soft-green: #2b4034; --soft-red: #493430; --soft-amber: #403c2b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
body { font-family: var(--font); background: var(--bg-dark); color: var(--text-main); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--border-focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: -80px; padding: 12px; background: var(--bg-card); z-index: 2000; }
.skip-link:focus { top: 12px; }
.app-shell { width: 100%; min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 1000; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1160px; margin: auto; min-height: 88px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-box { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--emerald); background: var(--soft-green); border-radius: 12px; }
.brand-title { font-size: 21px; font-weight: 750; letter-spacing: -.7px; line-height: 1.2; }
.brand-title span { color: var(--emerald); }
.brand-subtitle { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.brand-subtitle .pulse-dot { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-btn, .theme-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); min-height: 42px; border-radius: 10px; transition: var(--transition); }
.lang-btn { padding: 8px 14px; font-size: 13px; }
.theme-btn { width: 42px; display: grid; place-items: center; }
.lang-btn:hover, .theme-btn:hover { background: var(--soft-green); }
.app-content { max-width: 1160px; padding: 42px 32px 116px; margin: auto; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.page-intro { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 10px; }
.page-intro h1 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.intro-link { color: var(--emerald); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; padding-bottom: 3px; }
.card { min-width: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 25px; display: flex; flex-direction: column; gap: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.card-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.card-icon.blue, .card-icon.emerald { background: var(--soft-green); color: var(--emerald); }
.card-icon.red { background: var(--soft-red); color: var(--red); }
.card-icon.amber { background: var(--soft-amber); color: var(--amber); }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -.3px; line-height: 1.35; }
.card-subtitle { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.location-hero-card, #section-emergency { align-self: stretch; }
.live-status-badge { display: flex; align-items: center; gap: 5px; padding: 7px 10px; min-height: 36px; background: var(--soft-green); color: var(--emerald); border: 0; border-radius: 8px; font-size: 11px; font-weight: 600; }
.pulse-dot { display: inline-block; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
#live-time { font-size: 9px !important; margin-top: 4px; white-space: nowrap; }
.address-hero-box { background: var(--soft-green); border-radius: 12px; padding: 22px; }
.address-headline { font-size: 23px; font-weight: 600; line-height: 1.3; letter-spacing: -.6px; }
.address-subline { font-size: 12px; color: var(--text-muted); margin-top: 7px; }
.gps-chip-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.gps-chip { font-family: ui-monospace, monospace; color: var(--emerald); font-size: 10px; overflow-wrap: anywhere; }
.sos-photo-opt { margin-top: -3px; }
.sos-friend summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-muted); overflow-wrap: anywhere; }
.sos-friend form { display: grid; gap: 8px; margin-top: 12px; }
.sos-sms-fallback { display: grid; gap: 8px; }
.sos-photo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sos-checkbox-container { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sos-checkbox-container input { width: 16px; height: 16px; accent-color: var(--emerald); flex-shrink: 0; }
.sos-checkbox-text { font-size: 11px; color: var(--text-muted); }
.camera-select-pill { max-width: 45%; min-height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 5px; background: var(--bg-card); color: var(--text-muted); font-size: 10px; }
.btn-big-sos { width: 100%; min-height: 48px; border: 1px solid var(--red); border-radius: 10px; color: var(--red); background: var(--soft-red); font-weight: 600; font-size: 13px; padding: 12px; transition: var(--transition); }
.btn-big-sos:hover { background: var(--red); color: var(--bg-card); }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 600; text-decoration: none; text-align: center; transition: var(--transition); }
.btn.primary, .btn.whatsapp { background: #376b59; color: #fff; }
.btn.primary:hover, .btn.whatsapp:hover { background: #295343; }
.btn.outline { background: var(--bg-card); border-color: var(--border); color: var(--text-main); }
.btn.outline:hover { background: var(--soft-green); border-color: var(--emerald); }
.btn.danger { color: var(--red); background: var(--soft-red); }
.speed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 1; }
.speed-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 19px 5px; text-decoration: none; transition: var(--transition); }
.speed-card:hover { background: var(--soft-green); border-color: var(--emerald); }
.speed-icon { color: var(--text-muted); margin-bottom: 3px; }
.speed-name { font-size: 11px; font-weight: 600; line-height: 1.3; }
.speed-num { font-size: 10px; color: var(--text-muted); }
#section-map { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; }
#section-map .card-header, #map-filters { grid-column: 1 / -1; }
#chry-map { width: 100%; height: 310px; border-radius: 12px; border: 1px solid var(--border); z-index: 1; }
.filter-scroll, .blood-pills { display: flex; gap: 7px; overflow-x: auto; padding: 3px 3px 6px; }
.pill { flex-shrink: 0; min-height: 38px; padding: 8px 14px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); font-size: 11px; border-radius: 8px; }
.pill.active { background: var(--soft-green); color: var(--emerald); border-color: var(--emerald); }
.places-list { display: flex; flex-direction: column; overflow-y: auto; max-height: 310px; padding-right: 6px; }
.place-card { padding: 13px 4px; border-bottom: 1px solid var(--border); }
.place-card:first-child { padding-top: 0; }
.items-list { display: flex; flex-direction: column; gap: 12px; }
.lf-card { display: grid; grid-template-columns: 94px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.lf-img-wrap { position: relative; background: var(--soft-amber); }
.lf-img { width: 100%; height: 100%; object-fit: cover; }
.lf-badge { position: absolute; top: 7px; left: 7px; border-radius: 5px; padding: 3px 6px; font-size: 9px; font-weight: 600; }
.lf-badge.lost { background: var(--soft-red); color: var(--red); }
.lf-badge.found { background: var(--soft-green); color: var(--emerald); }
.lf-body { padding: 13px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.lf-title { font-size: 13px; font-weight: 600; }
.lf-desc { font-size: 11px; color: var(--text-muted); }
.blood-pill { width: 40px; min-height: 40px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.blood-pill.active { background: var(--soft-red); border-color: var(--red); color: var(--red); }
.donor-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding: 15px 0; }
.donor-row > div { min-width: 0; }
.bottom-nav { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; width: min(500px, 94%); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 6px 28px #18362512; z-index: 999; }
.tab-btn { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; font-size: 10px; font-weight: 500; color: var(--text-muted); border-radius: 10px; min-height: 49px; }
.tab-btn.active { color: var(--emerald); background: var(--soft-green); }
.tab-icon { display: flex; }
.ui-icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon .ui-icon { width: 25px; height: 25px; }
dialog.custom-modal { margin: auto; background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border); border-radius: 18px; width: min(440px, 92%); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0; box-shadow: 0 18px 60px #182d3325; }
dialog::backdrop { background: #12231c70; backdrop-filter: blur(3px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-close-btn { background: transparent; border: 0; color: var(--text-muted); width: 36px; height: 36px; font-size: 25px; }
.modal-body { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.form-input, .form-select, .form-textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text-main); font-size: 14px; }
.form-textarea { resize: vertical; }
.modal-footer { padding: 16px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.toast-container { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); width: min(440px, 90%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; gap: 8px; background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; box-shadow: 0 5px 25px #182d331a; font-size: 13px; }
@media (max-width: 760px) {
  html { scroll-padding-top: 90px; }
  .header-inner { min-height: 74px; padding: 14px 20px; }
  .app-content { grid-template-columns: minmax(0, 1fr); padding: 30px 20px 110px; gap: 18px; }
  .page-intro { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 4px; }
  .page-intro h1 { font-size: 18px; }
  .card { padding: 20px; gap: 18px; }
  #section-map { display: flex; }
  #chry-map { height: 260px; }
  .places-list { max-height: 230px; }
  .speed-card { padding: 18px 5px; }
  .bottom-nav { bottom: 0; width: 100%; border-radius: 0; border-bottom: 0; border-left: 0; border-right: 0; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .form-input, .form-select, .form-textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .header-inner { padding: 12px; gap: 8px; }
  .brand-box { gap: 7px; } .brand-icon { width: 32px; height: 36px; }
  .brand-title { font-size: 19px; } .brand-subtitle { font-size: 9px; }
  .header-actions { gap: 5px; } .lang-btn { padding: 8px; font-size: 11px; }
  .app-content { padding-inline: 12px; } .card { padding: 16px; }
  .card-title { font-size: 15px; } .card-icon { width: 30px; height: 34px; }
  .card-header-left { gap: 8px; } .address-headline { font-size: 21px; }
  .card-header { flex-wrap: wrap; } .sos-photo-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
.place-card > div:first-child { gap: 10px; flex-wrap: wrap; }
.place-card > div:first-child > span { flex: 1; min-width: 160px; }
.place-card > div:last-child { align-items: center; min-height: 34px; }
.place-card > div:last-child a, .place-card > div:last-child button { padding: 9px 0 !important; }
.lf-body > div:last-child { flex-wrap: wrap; gap: 8px; }
.lf-body > div:last-child .btn { min-height: 38px !important; }
.donor-row > div:last-child { flex-shrink: 0; }
.donor-row .btn { min-height: 38px !important; }
@media (max-width: 420px) { .donor-row { flex-wrap: wrap; } }
[hidden] { display: none !important; }
.btn:disabled { opacity: .6; cursor: wait; }
.community-note, .lf-meta, .board-toolbar p { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board-toolbar p { flex: 1; }
.empty-state { padding: 20px 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13px; }
.lf-no-photo { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 110px; padding: 30px 8px 8px; font-size: 11px; color: var(--text-muted); text-align: center; }
.lf-img-wrap { min-height: 110px; }
.lf-desc, .lf-title { overflow-wrap: anywhere; white-space: pre-wrap; }
.community-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.consent-label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.consent-label input { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.form-error { color: var(--red); font-size: 13px; }
.photo-page { width: min(700px, 100%); margin: auto; padding: 30px 18px; }
.photo-page > a { display: inline-block; margin-bottom: 22px; text-decoration: none; }
.shared-sos-photo { width: 100%; height: auto; border-radius: 10px; }

.btn-big-sos:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
