*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
svg {
  width: 1em;
  height: 1em;
  max-width: 1em;
  max-height: 1em;
  display: inline-block;
  vertical-align: middle;
}

:root {
  --co-yellow: #FCD116;
  --co-yellow-2: #E5B800;
  --co-blue:   #003893;
  --co-blue-2: #00276b;
  --co-red:    #CE1126;

  --bg:        #F6F3EB;
  --surface:   #FFFFFF;
  --surface-2: #FBF8F0;
  --ink:       #0F1B33;
  --ink-2:     #2A3652;
  --muted:     #6A7590;
  --hair:      #EBE4D0;
  --border:    #D9D0B6;

  --brand:     #003893;
  --brand-2:   #00276b;

  --radius-lg: 16px;
  --radius:    12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(15,27,51,.06), 0 1px 3px rgba(15,27,51,.05);
  --shadow-md: 0 4px 14px rgba(15,27,51,.08), 0 2px 4px rgba(15,27,51,.05);
  --shadow-lg: 0 20px 40px -12px rgba(15,27,51,.18);

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0A1220;
    --surface:   #131E33;
    --surface-2: #0F1729;
    --ink:       #F0EEE6;
    --ink-2:     #CBD3E2;
    --muted:     #8A96B0;
    --hair:      #1E2D48;
    --border:    #23324D;
    --brand:     #6C93FF;
    --brand-2:   #4776E2;
  }
}

html, body {
  margin: 0; padding: 0;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
main.wrap {
  width: 100%;
  max-width: 640px;
}
body {
  min-width: 0;
}
body::before {
  content:""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(252,209,22,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(0,56,147,.10), transparent 60%),
    var(--bg);
  pointer-events: none;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
@media (max-width: 380px) { .wrap { padding: 0 12px; } }

/* ---------- Tricolor ---------- */
.tricolor { display: flex; height: 4px; overflow: hidden; }
.tri { display: block; height: 100%; }
.tri-y { flex: 2; background: var(--co-yellow); }
.tri-b { flex: 1; background: var(--co-blue); }
.tri-r { flex: 1; background: var(--co-red); }

/* ---------- Header / hero ---------- */
.topbar {
  background: linear-gradient(180deg, var(--co-blue) 0%, var(--co-blue-2) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -12px rgba(0,0,0,.45);
}
.topbar::after {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(600px 200px at 10% 100%, rgba(252,209,22,.14), transparent 70%),
    radial-gradient(400px 200px at 90% 0%, rgba(206,17,38,.10), transparent 70%);
  pointer-events: none;
}
.header-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  padding: 22px 0 24px;
  min-width: 0;
}
.header-inner > * { min-width: 0; }
.title-block { flex: 1 1 auto; min-width: 0; }
.title-block h1 {
  margin: 0;
  font-size: clamp(1.2rem, 4.5vw, 1.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.event-title span {
  display: inline;
}
.event-title span + span::before {
  content: " · ";
}
.title-block .sub {
  margin: 6px 0 0;
  font-size: .85rem;
  opacity: .95;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
  font-size: .78rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--co-yellow);
  box-shadow: 0 0 8px var(--co-yellow);
  animation: pulse 2.4s ease-in-out infinite;
  flex: 0 0 7px;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

@media (max-width: 640px) {
  .header-inner {
    justify-content: center;
    text-align: center;
  }
  .title-block h1 {
    max-width: 24rem;
    margin: 0 auto;
    font-size: clamp(1rem, 4.2vw, 1.18rem);
    line-height: 1.2;
  }
  .event-title span {
    display: block;
  }
  .event-title span + span::before {
    content: "";
  }
  .title-block .sub {
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .header-inner { gap: 10px; padding: 18px 0 20px; }
  .title-block h1 { max-width: 18rem; font-size: .95rem; line-height: 1.2; }
  .title-block .sub { gap: 6px; font-size: .78rem; }
  .pill { padding: 2px 8px 2px 7px; font-size: .72rem; }
}

/* ---------- Intro copy ---------- */
.intro {
  margin: 14px 0 4px;
  font-size: .92rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.public-notice {
  margin: 12px 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(0,56,147,.20);
  border-left: 3px solid var(--co-blue);
  border-radius: var(--radius-sm);
  background: rgba(0,56,147,.045);
  color: var(--ink-2);
  font-size: .84rem;
  line-height: 1.45;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}
@media (max-width: 380px) {
  .stats { gap: 8px; }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 14px 12px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
@media (max-width: 380px) {
  .stat { padding: 12px 10px; }
  .stat .lbl { font-size: .7rem; }
}
.stat::before {
  content:""; position: absolute; top:0; left:0; right:0;
  height: 3px; background: var(--co-yellow);
}
.stat.stat-p::before { background: var(--co-red); }
.stat.stat-v::before { background: #B25E00; }
.stat.stat-n::before { background: var(--co-blue); }
.stat .num {
  font-size: clamp(1.3rem, 5.5vw, 1.7rem); font-weight: 800; color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .lbl {
  font-size: .76rem; color: var(--muted);
  margin-top: 6px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Section titles ---------- */
h2 {
  font-size: 1.18rem;
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.015em;
  display: flex; align-items: center; gap: 10px;
}
h2::before {
  content:""; display: inline-block; width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--co-yellow), var(--co-yellow-2));
  border-radius: 2px;
  flex: 0 0 4px;
}
.sec-desc {
  color: var(--muted); font-size: .88rem;
  margin: 0 0 18px;
  padding-left: 14px;
}

/* ---------- Section ---------- */
.section {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 18px 0;
  min-width: 0;
  box-shadow: var(--shadow-md);
}
.section > * { min-width: 0; max-width: 100%; }
@media (max-width: 480px) { .section { padding: 18px 16px; border-radius: 12px; } }
@media (max-width: 380px) { .section { padding: 16px 14px; } }

/* ---------- Callout ---------- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(206,17,38,.07), rgba(206,17,38,.02));
  border: 1px solid rgba(206,17,38,.22);
  border-left: 3px solid var(--co-red);
  border-radius: var(--radius-sm);
  font-size: .87rem; color: var(--ink-2); line-height: 1.5;
  margin: 4px 0 20px;
}
.callout svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--co-red); margin-top: 1px; }
.callout strong { color: var(--co-red); font-weight: 700; }

/* ---------- Type picker ---------- */
.type-picker {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin: 6px 0 4px;
}
.type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.type-picker label {
  margin: 0; padding: 14px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center; cursor: pointer;
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: var(--ink-2);
  transition: all .15s;
  min-width: 0;
}
.type-picker label svg { width: 24px; height: 24px; flex: 0 0 24px; }
.type-picker input:checked + label {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,56,147,.12), var(--shadow-sm);
}
.type-picker label:hover { border-color: var(--brand); }
.type-picker .ico-p { color: var(--co-red); }
.type-picker .ico-v { color: #B25E00; }
.type-picker .ico-n { color: var(--co-blue); }

/* ---------- Fields ---------- */
form label {
  display: block;
  margin: 14px 0 0;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
}
.required { color: var(--co-red); font-weight: 800; }
.field-help {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
form label > input,
form label > select,
form label > textarea {
  margin-top: 6px;
  font-weight: 400;
}
input[type=text], input[type=email], input[type=tel], input, select, textarea {
  display: block; width: 100%;
  padding: 12px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%236A7590' d='M6 8L2 4h8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
input:hover, select:hover, textarea:hover { border-color: #b8ab88; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0,56,147,.14);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

/* ---------- Custom select (evita dropdown nativo desbordado) ---------- */
.cs { position: relative; margin-top: 6px; min-width: 0; width: 100%; }
.cs-native {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; padding: 0; margin: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0);
}
.cs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 44px;
  padding: 12px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.cs-trigger:hover { border-color: #b8ab88; }
.cs-open .cs-trigger,
.cs-trigger:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0,56,147,.14);
}
.cs-disabled .cs-trigger {
  opacity: .55; cursor: not-allowed; background: var(--surface-2);
}
.cs-label {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.cs-trigger-placeholder { color: var(--muted); }
.cs-caret {
  flex: 0 0 10px; width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s;
}
.cs-open .cs-caret { transform: rotate(-135deg) translateY(-2px); }

.cs-menu {
  position: absolute; z-index: 20;
  top: calc(100% + 4px); left: 0; right: 0;
  width: 100%; max-width: 100%;
  max-height: 260px; overflow-y: auto; overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 0;
}
.cs-item {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px; color: var(--ink); cursor: pointer;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-item:hover { background: var(--surface-2); }
.cs-item-sel { background: rgba(0,56,147,.08); color: var(--brand); font-weight: 600; }
.cs-item-empty { color: var(--muted); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > * { min-width: 0; }
@media (max-width: 500px) { .row { grid-template-columns: 1fr; gap: 0; } }

.counter {
  display: block; text-align: right;
  font-size: .72rem; color: var(--muted);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}

/* ---------- Sub-section (reportante) ---------- */
.subsection {
  margin: 22px 0 6px;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
}
.subsection h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.005em;
  display: flex; align-items: center; gap: 8px;
}
.subsection h3::before {
  content:""; display: inline-block; width: 3px; height: 16px;
  background: var(--co-yellow); border-radius: 2px;
  flex: 0 0 3px;
}
.subsection .sec-desc { margin-bottom: 14px; padding-left: 11px; }

/* ---------- Consent checkbox ---------- */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 18px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: .87rem;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
}
.check:hover { border-color: var(--brand); }
.check input {
  width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 20px;
  -webkit-appearance: auto; appearance: auto;
  accent-color: var(--brand);
  cursor: pointer;
}
.check span { min-width: 0; overflow-wrap: anywhere; }
.check a { color: var(--brand); text-decoration: underline; font-weight: 600; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer;
  min-height: 44px;
  transition: transform .05s, border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--brand); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: 0 0 16px; width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, var(--co-blue) 0%, var(--co-blue-2) 100%);
  color: #fff; border-color: transparent;
  width: 100%; margin-top: 20px;
  font-weight: 700; font-size: 1rem;
  min-height: 52px;
  box-shadow: 0 10px 24px -8px rgba(0,56,147,.55), inset 0 -3px 0 rgba(252,209,22,.6);
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--co-blue) 0%, var(--co-blue-2) 100%); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-primary svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 2.2; }
.btn-link {
  background: transparent; border: none; color: var(--brand);
  padding: 0; min-height: 0;
  font: inherit; font-weight: 600; font-size: .85rem;
  cursor: pointer; text-decoration: underline;
}
.btn-link:hover { color: var(--brand-2); }

/* ---------- Filtros ---------- */
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.filters > * { min-width: 0; width: 100%; }
.filters .btn { grid-column: 1 / -1; min-height: 44px; font-weight: 600; }
@media (max-width: 480px) { .filters { grid-template-columns: 1fr; } }

/* ---------- Lista ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.item {
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  padding: 14px 16px 14px 18px;
  background: transparent;
  position: relative;
  transition: background .15s;
  animation: itemIn .25s ease-out both;
  box-shadow: none;
  min-width: 0;
}
.item:last-child { border-bottom: 0; }
@keyframes itemIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.item:hover { background: var(--surface-2); }
.item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #60708C;
}
.item.type-missing_person::before  { background: #A33A45; }
.item.type-damaged_property::before { background: #8F6A2A; }
.item.type-need::before             { background: #335F9F; }
.item.resolved { opacity: .72; }
.item.resolved::before { background: #157A3E; }

.item-header {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; padding: 3px 8px; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-weight: 700;
  border: 1px solid var(--hair);
  max-width: 100%;
}
.chip svg { width: 12px; height: 12px; flex: 0 0 12px; stroke-width: 2; }
.chip.type-missing_person   { color: #A33A45; border-color: rgba(163,58,69,.28); }
.chip.type-damaged_property { color: #8F6A2A; border-color: rgba(143,106,42,.28); }
.chip.type-need             { color: #335F9F; border-color: rgba(51,95,159,.28); }
.chip.status                { color: #157A3E;         border-color: rgba(21,122,62,.28); }
.chip.loc                   { color: var(--ink-2);    border-color: var(--hair); }

.item h3 {
  margin: 8px 0 4px; font-size: 1.05rem; color: var(--ink);
  font-weight: 700; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.item .meta {
  color: var(--muted); font-size: .78rem;
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap;
}
.item .meta svg { width: 12px; height: 12px; flex: 0 0 12px; }
.item p { margin: 10px 0 4px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }

/* ---------- Reporter info (arreglo del svg gigante) ---------- */
.reporter-info {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair);
  font-size: .87rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--ink-2);
}
.reporter-info svg {
  width: 16px !important; height: 16px !important; flex: 0 0 16px;
  color: var(--muted);
}
.reporter-info strong { color: var(--ink); font-weight: 700; }
.reporter-info .rel {
  padding: 1px 8px; border-radius: 6px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hair);
  font-size: .72rem; font-weight: 600;
}

.contact-row {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 9px 0; font-size: .87rem;
  border-top: 1px solid var(--hair);
  overflow-wrap: anywhere; min-width: 0;
}
.contact-row:first-of-type { margin-top: 4px; }
.contact-row > svg {
  width: 14px !important; height: 14px !important; flex: 0 0 14px;
  color: var(--muted);
}
.contact-row .label { color: var(--muted); font-weight: 500; }
.contact-row .val   { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Mensajes ---------- */
.msg {
  padding: 12px 14px; border-radius: var(--radius-sm);
  margin-top: 14px; font-size: .9rem; line-height: 1.5;
  display: flex; gap: 10px; align-items: flex-start;
}
.msg svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.msg.ok  { background: rgba(21,122,62,.08); color: #157A3E; border: 1px solid rgba(21,122,62,.25); }
.msg.err { background: rgba(206,17,38,.06); color: var(--co-red); border: 1px solid rgba(206,17,38,.25); }
.banner {
  padding: 12px 14px; border-radius: var(--radius-sm);
  margin: 14px 0; font-size: .9rem;
}
.banner-warn {
  background: rgba(178,94,0,.10);
  border: 1px solid rgba(178,94,0,.3); color: #B25E00;
}

/* ---------- Empty ---------- */
.empty {
  padding: 32px 20px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty svg { width: 48px; height: 48px; flex: 0 0 48px; opacity: .45; }
.empty p { margin: 0; font-size: .9rem; }

/* ---------- Footer ---------- */
.foot {
  color: var(--muted); font-size: .82rem;
  text-align: center; padding: 32px 20px 48px;
  width: min(640px, 100%);
  margin: 0 auto;
  overflow: hidden;
}
.foot p { margin: 8px 0; }
.foot-tri { max-width: 120px; margin: 0 auto 14px; height: 4px; border-radius: 2px; overflow: hidden; }
.foot-brand { font-weight: 700; color: var(--ink); }
@media (max-width: 380px) {
  .foot {
    padding: 30px 12px 40px;
  }
}

/* ---------- Skeleton ---------- */
.skel {
  height: 92px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--hair) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
