/* Estilo alineado con wearecity.es: Urbanist en titulares, fuente del sistema en el texto,
   blanco y gris claro con secciones oscuras, píldoras negras con degradado y burbujas grises. */
:root {
  --bg: #ffffff;
  --surface: #f3f4f6;
  --surface-2: #f9fafb;
  --bubble: rgba(243, 244, 246, 0.95);
  --bubble-line: rgba(229, 231, 235, 0.5);
  --ink: #000000;
  --ink-2: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --outline: #303030;
  --good: #059669;
  --bad: #dc2626;
  --pill: linear-gradient(to right, #000000, #1f2937);
  --pill-ink: #ffffff;
  --pill-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --stage: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.06), transparent 70%),
           radial-gradient(circle at 70% 20%, rgba(99, 102, 241, 0.04), transparent 60%),
           linear-gradient(#ffffff, #f3f4f6);
  --tint-blue: rgba(96, 165, 250, 0.14);
  --tint-green: rgba(52, 211, 153, 0.16);
  --tint-violet: rgba(167, 139, 250, 0.14);
  --tint-amber: rgba(251, 191, 36, 0.16);
  --tile-blue: #eff6ff; --tile-green: #ecfdf5; --tile-amber: #fffbeb; --tile-pink: #fdf2f8;
  --dot-blue: #60a5fa; --dot-green: #34d399; --dot-amber: #fbbf24; --dot-pink: #f472b6;
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px;
  --chat-wall-solid: #f1f2f5;
  --m-page: #f4f5f7; --m-card: #ffffff; --m-line: #e7e8eb; --m-soft: #f3f4f6;
  --tint-violet-solid: #f5f3ff; --tint-pink: rgba(244, 114, 182, 0.14);
  --chat-in: #ffffff; --chat-out: #111827; --chat-out-ink: #ffffff; --chat-out-muted: rgba(255, 255, 255, 0.6);
  --chat-wall: radial-gradient(rgba(17, 24, 39, 0.045) 1px, transparent 1.3px) 0 0 / 18px 18px,
    radial-gradient(circle at 15% 10%, rgba(96, 165, 250, 0.12), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(52, 211, 153, 0.12), transparent 50%), #f1f2f5;
  --font-head: 'Urbanist', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #171717; --surface: #212121; --surface-2: #1a1a1a; --bubble: #303030; --bubble-line: rgba(255,255,255,0.06);
  --ink: #ffffff; --ink-2: #e5e7eb; --muted: #b3b3b3; --line: #404040; --outline: #d4d4d4;
  --good: #34d399; --bad: #f87171;
  --chat-wall-solid: #141415;
  --m-page: #111112; --m-card: #1c1c1e; --m-line: #2c2c2f; --m-soft: #252528;
  --tint-violet-solid: #221d33; --tint-pink: rgba(244, 114, 182, 0.16);
  --chat-in: #2b2b2d; --chat-out: #f3f4f6; --chat-out-ink: #111111; --chat-out-muted: rgba(17, 17, 17, 0.55);
  --chat-wall: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.3px) 0 0 / 18px 18px,
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(52, 211, 153, 0.08), transparent 50%), #141415;
  --pill: linear-gradient(to right, #ffffff, #e5e7eb); --pill-ink: #171717;
  --stage: radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.1), transparent 50%),
           radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.06), transparent 50%),
           linear-gradient(#0a0a0a, #171717, #1a1a1a);
  --tile-blue: #1a1f2e; --tile-green: #1a1f1d; --tile-amber: #1f1d1b; --tile-pink: #1f1a1f;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px;
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; }

/* ---------- Cabecera ---------- */
.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 10px 24px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; overflow: hidden; }
.logo { flex: none; display: block; }
.logo img { height: 27px; display: block; }
:root[data-theme="dark"] .logo img { filter: invert(1); }
.brand h1 { margin: 0; padding-left: 16px; border-left: 1px solid var(--line); white-space: nowrap; display: flex; align-items: center; line-height: 1; min-height: 26px; }
/* Logotipo de Demópolis: solo tipografía, en negro. Marcellus, una romana de trazo abocinado inspirada en
   las inscripciones clásicas, que contrasta con la sans redondeada de WeAreCity. */
.city-brand a {
  color: var(--ink); text-decoration: none; font-family: 'Marcellus', Georgia, serif; font-size: 26px; font-weight: 400;
  letter-spacing: 0.015em; line-height: 1; white-space: nowrap;
}
.live-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--tint-green); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap;
  transition: box-shadow 0.2s;
}
.live-chip:hover { box-shadow: inset 0 0 0 1px var(--dot-green); }
.live-chip i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-green); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25); animation: blink 1.6s ease-in-out infinite; }
.live-chip span { font-weight: 600; }
.live-chip b { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.daynav { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border-radius: var(--r-sm); }
body[data-view="participa"] .daynav, body[data-view="debate"] .daynav { display: none; }
.navbtn {
  width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--ink); transition: background 0.2s;
}
.navbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.navbtn:hover:not(:disabled) { background: var(--bg); }
.navbtn:disabled { opacity: 0.25; cursor: default; }
.daylabel { display: flex; align-items: baseline; gap: 6px; padding: 0 6px; white-space: nowrap; }
.daylabel span { font-family: var(--font-head); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.daylabel small { font-size: 12px; color: var(--muted); }

/* ---------- Vistas ---------- */
main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.view.scroll { overflow-y: auto; background: linear-gradient(var(--bg), var(--surface)); }
.container { max-width: 1320px; margin: 0 auto; padding: 28px 28px 120px; }
.stage { position: absolute; inset: 0; background: var(--stage); transition: background 0.6s; }
.stage.night { background: radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.14), transparent 55%),
                           radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.08), transparent 50%),
                           linear-gradient(#0a0a0a, #121214, #1a1a1a); }
.hud { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 1; }
.stage:has(.inspector:not([hidden])) .hud { display: none; }
.hud div {
  background: rgba(243, 244, 246, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bubble-line); border-radius: var(--r-sm); padding: 8px 12px; text-align: right; color: #000;
}
.hud small { display: block; font-size: 11px; font-weight: 500; color: #6b7280; }
.hud strong { font-family: var(--font-head); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.stage.night .hud div { background: rgba(48, 48, 48, 0.8); color: #fff; }
.stage.night .hud small { color: #b3b3b3; }
#city { width: 100%; height: 100%; display: block; }
.loading {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head);
  font-size: 18px; font-weight: 600; color: var(--muted); pointer-events: none;
}
.loading[hidden] { display: none; }

h2 {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); margin: 26px 0 8px;
}
h2:first-child { margin-top: 0; }

/* ---------- Indicadores ---------- */


/* ---------- Informe ---------- */
.headline { font-family: var(--font-head); font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.chronicle { font-size: 15px; line-height: 1.55; margin: 0; color: var(--ink-2); }




/* ---------- Controles sobre la maqueta ---------- */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface); }
.segmented button {
  flex: 1; border: 0; background: transparent; padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; transition: all 0.3s;
}
.segmented button[aria-checked="true"], .segmented button[aria-selected="true"] {
  background: var(--pill); color: var(--pill-ink); box-shadow: var(--pill-shadow);
}
.tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.clock-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--surface); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: default;
}
.clock-chip svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs { margin-bottom: 20px; position: sticky; top: -20px; z-index: 1; }

.tooltip { position: absolute; pointer-events: none; width: 252px; z-index: 4; }
/* Tarjeta de un lugar (al pasar el ratón y al seleccionarlo) */
.card-pop {
  background: color-mix(in srgb, var(--bg) 94%, transparent); color: var(--ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.3), 0 3px 10px rgba(0, 0, 0, 0.08);
}
.card-body { padding: 14px 16px 16px; }
.card-body .eyebrow { margin-bottom: 4px; }
.card-title { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
.card-place { margin: 3px 0 10px; font-size: 13px; color: var(--muted); }
.basics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.basics div { background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; }
.basics small { display: block; font-size: 11px; color: var(--muted); }
.basics strong { font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.card-body .hint { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.cond { margin: 2px 0 4px; }
.cond-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.cond-head .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--dot-green); vertical-align: 1px; }
.cond-head strong { font-family: var(--font-head); font-size: 16px; white-space: nowrap; }
.cond-head strong small { display: inline; margin: 0; font-size: 11px; color: var(--muted); font-weight: 500; }
.cond small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.cond-bar { height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.cond-bar i { display: block; height: 100%; border-radius: 99px; background: var(--dot-green); }
.cond.warn .cond-bar i, .cond-bar.warn i, .cond.warn .dot { background: var(--dot-amber); }
.cond.bad .cond-bar i, .cond-bar.bad i, .cond.bad .dot { background: var(--bad); }
.cond.rep .cond-bar i { background: repeating-linear-gradient(45deg, var(--dot-amber) 0 6px, var(--ink) 6px 12px); }
.cond.rep .dot { background: var(--dot-amber); }
.cond.bad .cond-head span { color: var(--bad); }
/* Ficha completa del lugar seleccionado, junto a la maqueta */
.inspector {
  position: absolute; top: 16px; right: 16px; bottom: 104px; width: 380px; z-index: 5;
  display: flex; flex-direction: column; animation: slide-in 0.22s ease;
}
.inspector[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.inspector .close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--ink); font-size: 18px; line-height: 1; z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet-media { background: var(--surface); }
.sheet-media img, .sheet-media .img-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.sheet-body { padding: 16px 18px 8px; }
.sheet-body .eyebrow { margin-bottom: 4px; }
.sheet-title { margin: 0; font-family: var(--font-head); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; text-transform: none; display: block; color: var(--ink); }
.sheet-body .card-place { margin-bottom: 12px; }
.sheet-sections section { margin-top: 16px; }
.sheet-sections h3 { margin: 0 0 4px; font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sheet-sections .row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sheet-sections .row span:first-child { color: var(--muted); }
.sheet-sections .row span:last-child { text-align: right; font-weight: 500; }
.sheet-actions { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.sheet-actions .primary {
  width: 100%; border: 0; border-radius: var(--r-md); padding: 11px 16px; cursor: pointer;
  background: var(--pill); color: var(--pill-ink); font-size: 14px; font-weight: 600; box-shadow: var(--pill-shadow);
}
/* Estado de los equipamientos y cuentas */

/* ---------- Participa ---------- */
.card { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.card p { margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }
.support-line { color: var(--muted); }
.row-form { display: flex; gap: 6px; margin-top: 10px; }
input, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; border-radius: var(--r-md); }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.row-form button, .compose button, .chat-form button, .bubble button.join {
  border: 0; background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: 10px 18px;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
button:disabled { opacity: 0.4; cursor: default; }
button.link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: inherit; }
.form-error { color: var(--bad); font-weight: 500; }
.form-notice { color: var(--good); font-weight: 500; }

/* ---------- Dashboard ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; }
.card h2 { margin-top: 0; }

/* ---------- Dashboard en dos secciones ---------- */

/* ---------- Participa ---------- */
/* Debate a pantalla completa, como una app de mensajería */
.container.debate-page { --col: 780px; height: 100%; max-width: none; padding: 0; display: flex; }
.debate-page .debate { flex: 1; position: relative; border: 0; border-radius: 0; background: var(--chat-wall); }
.debate-page .chan-head, .debate-page .pinned { padding-left: max(18px, calc((100% - var(--col)) / 2)); padding-right: max(18px, calc((100% - var(--col)) / 2)); }
.debate-page .chan-head { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.debate-page .pinned { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.debate-page .debate .chat-log { background: transparent; padding: 8px max(16px, calc((100% - var(--col)) / 2)) 190px; }
.debate-page .debate::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 210px; pointer-events: none; z-index: 2;
  background: linear-gradient(to bottom, transparent, var(--chat-wall-solid) 55%);
}
.debate-page .jump { right: max(16px, calc((100% - var(--col)) / 2)); bottom: 196px; z-index: 4; }
.dock { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); width: min(var(--col, 780px), calc(100% - 24px)); z-index: 3; }
.debate-page .composer { padding: 0; background: transparent; border: 0; align-items: flex-end; }
.debate-page .composer textarea {
  background: var(--bg); border: 1px solid var(--line); padding: 13px 18px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.debate-page .composer textarea:focus { border-color: var(--outline); }
.debate-page .composer .send { width: 48px; height: 48px; }
.debate-page .composer .send:disabled { opacity: 1; background: var(--bg); color: var(--muted); border: 1px solid var(--line); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.18); }
.debate-page .chat-note { background: transparent; padding: 6px 18px 0; text-align: center; }
.participa { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
.part-main .props { margin-top: 0; }
.part-main .props-head h2 { font-size: 22px; }
.chat-cta { display: block; padding: 14px 16px; color: var(--ink); text-decoration: none; transition: border-color 0.2s, box-shadow 0.2s; }
.chat-cta:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.25); }
.cta-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cta-top .go { margin-left: auto; font-size: 13px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-green); animation: blink 1.6s ease-in-out infinite; }
.cta-msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; }
.cta-msg .avatar { width: 30px; height: 30px; font-size: 11px; }
.cta-msg p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cta-msg b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.debate { display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
/* Chat del debate, al estilo de un canal de mensajería */
.chan-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.chan-avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pill); color: var(--pill-ink); box-shadow: var(--pill-shadow);
}
.chan-avatar svg { width: 22px; height: 22px; }
.chan-info { flex: 1; min-width: 0; }
.chan-info h2 { margin: 0; font-family: var(--font-head); font-size: 18px; font-weight: 700; line-height: 1.2; text-transform: none; letter-spacing: -0.01em; color: var(--ink); display: block; }
.chan-info .meta { margin: 2px 0 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--tint-green); color: var(--good); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot-green); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.pinned {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 18px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.pinned[hidden] { display: none; }
.pinned svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.pinned span { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--dot-blue); padding-left: 10px; }
.pinned small { display: block; font-size: 12px; font-weight: 600; color: var(--dot-blue); }
.chat-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.debate .chat-log {
  flex: 1; overflow-y: auto; padding: 12px 16px 14px; overscroll-behavior: contain;
  background: var(--chat-wall);
}
.day-sep { display: flex; justify-content: center; margin: 14px 0 6px; }
.day-sep span {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.msg.first { margin-top: 10px; }
.msg.mine { justify-content: flex-end; }
.avatar, .avatar-gap { flex: none; width: 34px; height: 34px; }
.avatar {
  border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(160deg, color-mix(in srgb, var(--av) 75%, #fff), var(--av));
}
.bubble-msg {
  max-width: min(78%, 520px); padding: 6px 10px 6px 12px; border-radius: 16px; position: relative;
  background: var(--chat-in); color: var(--ink); box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.1);
}
.msg:not(.mine).last .bubble-msg { border-bottom-left-radius: 5px; }
.msg.mine .bubble-msg { background: var(--chat-out); color: var(--chat-out-ink); }
.msg.mine.last .bubble-msg { border-bottom-right-radius: 5px; }
.bubble-msg .who { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.who .guest { margin-left: 6px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--surface); color: var(--muted); vertical-align: 1px; }
.bubble-msg p { margin: 0; font-size: 15px; line-height: 1.38; overflow-wrap: anywhere; white-space: pre-wrap; }
.stamp {
  float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -4px 10px;
  font-size: 11px; color: var(--muted); white-space: nowrap; user-select: none;
}
.msg.mine .stamp { color: var(--chat-out-muted); }
.stamp svg { width: 15px; height: 10px; }
.chat-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: 14px; }
.chat-empty .avatar { width: 56px; height: 56px; font-size: 18px; --av: #65aadd; }
.chat-empty p { margin: 0; }
.chat-empty strong { color: var(--ink); }
.jump {
  position: absolute; right: 16px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--bg); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.jump[hidden] { display: none; }
.jump svg { width: 20px; height: 20px; }
.jump span:empty { display: none; }
.jump span {
  position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--dot-blue); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 4px; background: var(--bg); border-top: 1px solid var(--line); }
.composer .field { position: relative; flex: 1; min-width: 0; }
.composer textarea {
  display: block; width: 100%; resize: none; max-height: 140px; padding: 11px 16px; line-height: 1.4; font-size: 15px;
  border-radius: 22px; border: 1px solid transparent; background: var(--surface); overflow-y: auto;
}
.composer textarea:focus { outline: none; border-color: var(--outline); background: var(--bg); }
.composer .count { position: absolute; right: 14px; bottom: -2px; font-size: 11px; color: var(--muted); }
.composer .send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--pill); color: var(--pill-ink); box-shadow: var(--pill-shadow); transition: transform 0.15s, opacity 0.15s;
}
.composer .send svg { width: 20px; height: 20px; margin-left: 2px; }
.composer .send:not(:disabled):active { transform: scale(0.92); }
.composer .send:disabled { opacity: 0.25; box-shadow: none; }
.chat-note { margin: 0; padding: 4px 18px 12px; font-size: 12px; color: var(--muted); background: var(--bg); }
.empty { padding: 24px 0; text-align: center; }
/* Hoy decide la ciudad */
.today { padding: 18px 20px; }
.today-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.today .headline { margin: 2px 0 0; font-size: 24px; }
.clock { text-align: right; }
.clock strong { display: block; font-family: var(--font-head); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock small { color: var(--muted); font-size: 12px; }
.day-bar { height: 6px; border-radius: 99px; background: var(--surface); margin: 12px 0 14px; overflow: hidden; }
.day-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--dot-blue), var(--dot-green)); }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.today-stats div { background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; }
.today-stats strong { display: block; font-family: var(--font-head); font-size: 22px; font-weight: 700; line-height: 1.1; }
.today-stats small { color: var(--muted); font-size: 12px; line-height: 1.25; display: block; margin-top: 2px; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; padding: 0; }
.steps li { counter-increment: step; font-size: 12px; line-height: 1.3; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.steps li::before {
  content: counter(step); flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pill); color: var(--pill-ink); font-size: 11px; font-weight: 700;
}
.steps b { color: var(--ink); font-weight: 600; }
/* Entrar y lanzar una propuesta */
.compose-card { padding: 16px 18px; }
.compose-card.login { background: linear-gradient(135deg, var(--tint-blue), rgba(96, 165, 250, 0.04) 60%, var(--bg)); }
.compose-title { display: flex; gap: 12px; align-items: flex-start; }
.compose-title .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--pill); color: var(--pill-ink); }
.compose-title .ic svg { width: 20px; height: 20px; }
.compose-title strong { display: block; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.compose-title small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.compose-card .row-form { margin-top: 12px; }
.compose-card .form-error, .compose-card .form-notice { margin: 10px 0 0; font-size: 13px; }
button.link.small { font-size: 13px; margin-top: 8px; color: var(--muted); }
/* Cuenta: crear, entrar y recuperar la contraseña */
.auth-form { display: grid; gap: 10px; }
.auth-form .compose-title { margin-bottom: 2px; }
.auth-form .auth-tabs { background: var(--bg); }
.auth-form label span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 4px 2px; }
.auth-form .hint { display: block; font-size: 12px; color: var(--muted); margin: 4px 0 0 2px; }
.auth-form .hint.ok { color: var(--good); }
.auth-form .hint.bad { color: var(--bad); }
.auth-form button.go {
  border: 0; background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: 11px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 2px;
}
.auth-form button.link.small { justify-self: start; margin-top: 0; }
.auth-form .form-error, .auth-form .form-notice { margin: 0; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-row .avatar { width: 38px; height: 38px; }
.me-row strong { display: block; font-size: 15px; }
.me-row small { font-size: 12px; color: var(--muted); }
.me-row small .link { color: var(--muted); }
.support-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0 10px; padding: 9px 12px;
  border-radius: var(--r-sm); background: var(--tint-amber); font-size: 13px; line-height: 1.35;
}
.support-chip.on { background: var(--tint-green); }
.support-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.compose-card textarea { resize: none; background: var(--surface); border-color: transparent; }
.compose-card textarea:focus { background: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  border: 0; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--ink-2); transition: background 0.2s;
}
.chip:hover { background: var(--line); }
.avatar.anon { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.avatar.anon svg { width: 60%; height: 60%; }
.as-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.as-who { padding: 3px; }
.as-who button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; font-size: 13px; flex: 0 1 auto; }
.as-who .avatar { width: 22px; height: 22px; font-size: 9px; }
.as-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); text-align: right; }
.compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.compose-foot small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.compose-card .compose-foot button {
  border: 0; border-radius: var(--r-md); padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
  background: var(--pill); color: var(--pill-ink); box-shadow: var(--pill-shadow);
}
/* Listado de propuestas */
.props { margin-top: 6px; }
.props-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.props-head h2 { margin: 0; }
.props-head .meta { margin: 0; font-size: 13px; }
.props-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; }
.props-sort { flex: none; }
.props-sort button { padding: 7px 12px; font-size: 13px; }
.search { flex: 1 1 180px; min-width: 0; position: relative; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding: 9px 12px 9px 34px; font-size: 14px; border-radius: var(--r-md); background: var(--surface); border-color: transparent; }
.search input:focus { background: var(--bg); }
.prop {
  position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px 12px; margin-bottom: 10px; transition: border-color 0.2s, box-shadow 0.2s;
}
.prop:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.25); }
.prop.supported { border-color: var(--dot-green); box-shadow: inset 0 0 0 1px var(--dot-green); background: linear-gradient(135deg, var(--tint-green), transparent 55%), var(--bg); }
.prop-head { display: flex; align-items: center; gap: 10px; }
.prop-head .avatar { width: 32px; height: 32px; font-size: 12px; }
.prop-who { flex: 1; min-width: 0; }
.prop-who strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-who small { font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--tint-blue); color: var(--ink-2); }
.rank {
  flex: none; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--muted);
}
.podium.p1 .rank { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; }
.podium.p2 .rank { background: linear-gradient(135deg, #f3f4f6, #9ca3af); color: #1f2937; }
.podium.p3 .rank { background: linear-gradient(135deg, #fed7aa, #c2773a); color: #3b1d00; }
.prop-body { margin: 10px 0 12px; font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.meter { position: relative; height: 8px; border-radius: 99px; background: var(--surface); }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--muted); transition: width 0.5s ease; }
.meter.ok i { background: var(--dot-blue); }
.meter.full i { background: linear-gradient(90deg, var(--dot-blue), var(--dot-green)); }
.meter .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0.35; }
.prop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.prop-nums { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.prop-nums strong { color: var(--ink); font-family: var(--font-head); font-size: 15px; }
.state { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.state.low { background: var(--surface); color: var(--muted); }
.state.ok { background: var(--tint-blue); color: var(--ink-2); }
.state.full { background: var(--tint-green); color: var(--good); }
.prop button.join {
  flex: none; border: 0; border-radius: var(--r-sm); padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--pill); color: var(--pill-ink); box-shadow: var(--pill-shadow); white-space: nowrap;
}
.my-support {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--tint-green); color: var(--good); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.my-support em { display: none; font-style: normal; }
.my-support:hover { background: rgba(239, 68, 68, 0.12); color: var(--bad); }
.my-support:hover span { display: none; }
.my-support:hover em { display: inline; }
.prop button.join:disabled { background: var(--surface); color: var(--muted); box-shadow: none; }
.sdots { flex: none; display: inline-flex; gap: 4px; }
.sdots i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot-green); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.sdots i.used { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); opacity: 0.6; }
.support-chip { justify-content: flex-start; }
.vecino-tag { margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--tint-blue); color: var(--ink-2); vertical-align: 2px; }
.compose-blocked { margin: 10px 0 0; font-size: 13px; }
.my-support svg { width: 16px; height: 16px; }
.props-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.props-legend { margin: 8px 2px 18px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.tick-key { display: inline-block; width: 2px; height: 11px; border-radius: 2px; background: var(--ink); opacity: 0.35; margin: 0 4px -1px 0; }

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 980px) {
  .live-chip span, .daylabel small { display: none; }
}
@media (max-width: 900px) {
  body:not([data-view="debate"]):not([data-view="participa"]) .live-chip { display: none; }
}
@media (max-width: 900px) {
  .topbar { padding: 12px 16px; }
  .participa { grid-template-columns: 1fr; }
  .dock { bottom: 92px; }
  .debate-page .debate .chat-log { padding-bottom: 180px; padding-left: 10px; padding-right: 10px; }
  .debate-page .debate::after { height: 190px; }
  .debate-page .jump { bottom: 186px; }
  .hud { display: none; }
}
@media (max-width: 600px) {
  .props-tools { flex-direction: column; align-items: stretch; }
  .search { flex: none; }
  .props-sort button { flex: 1; }
  .steps { grid-template-columns: 1fr; }
  .today .headline { font-size: 21px; }
  .live-pill { font-size: 0; gap: 0; padding: 6px; }
  .chan-head { padding: 10px 14px; }
  .debate .chat-log { padding: 10px 10px 12px; }
  .avatar, .avatar-gap { width: 30px; height: 30px; font-size: 12px; }
  .bubble-msg { max-width: 82%; }
  /* En móvil, logo y nombre de la ciudad en la misma línea, más compactos */
  .brand { gap: 10px; }
  .brand h1 { padding-left: 10px; }
  .logo img { height: 19px; }
  .city-brand a { font-size: 20px; }
  .daylabel small { display: none; }
  .daylabel { padding: 0 2px; }
  .daylabel span { font-size: 14px; }
  .navbtn { width: 26px; }
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .tools { gap: 6px; }
  .clock-chip { display: none; }
  .live-chip { display: none !important; }
  .container { padding: 16px 16px 112px; }
}

/* ---------- Navegación inferior flotante ---------- */
.bottomnav {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; gap: 2px; padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
:root[data-theme="dark"] .bottomnav { box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.nav-indicator {
  position: absolute; left: 0; top: 0; border-radius: 18px; background: var(--pill); box-shadow: var(--pill-shadow);
  pointer-events: none;
}
.bottomnav.ready .nav-indicator { transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.35s ease; }
.bottomnav button {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 92px; padding: 8px 14px 7px;
  border: 0; border-radius: 18px; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; transition: color 0.25s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; }
.bottomnav button:hover:not([aria-selected="true"]) { color: var(--ink); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.bottomnav button:active svg { transform: scale(0.9); }
.bottomnav button[aria-selected="true"] { color: var(--pill-ink); }
.bottomnav button[aria-selected="true"] svg { transform: translateY(-1px); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1;
  background: #ef4444; color: #fff; box-shadow: 0 0 0 2px var(--bg);
}
.badge[hidden] { display: none; }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; left: calc(50% + 10px); background: var(--dot-amber); }
@media (max-width: 600px) {
  .inspector { left: 8px; right: 8px; width: auto; top: auto; bottom: 92px; max-height: 56vh; }
  .sheet-media img, .sheet-media .img-ph { aspect-ratio: 16 / 8; }
  .sheet-title { font-size: 21px; }
  .inspector { animation-name: rise-in; }
  .tooltip { display: none; }
  .bottomnav { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); transform: none; }
  .bottomnav button { flex: 1; min-width: 0; padding: 8px 4px 7px; font-size: 11px; }
}
@keyframes rise-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Métricas ---------- */
#view-dashboard { background: var(--m-page); }
.m-tabs {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; padding: 12px 16px;
  background: color-mix(in srgb, var(--m-page) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--m-line);
}
.m-tabs .segmented { background: var(--m-soft); }
.m-tabs button { min-width: 180px; padding: 8px 18px; }
#sec-city[hidden], #sec-report[hidden] { display: none; }
.m-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 28px 140px; }
.m-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.m-muted { color: var(--muted); font-size: 14px; margin: 0; }
.m-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink);
}
.m-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.m-ico.sm { width: 28px; height: 28px; border-radius: 9px; }
.m-ico.sm svg { width: 15px; height: 15px; }
.m-ico.t-blue { background: var(--tint-blue); color: #2563eb; }
.m-ico.t-green { background: var(--tint-green); color: #059669; }
.m-ico.t-amber { background: var(--tint-amber); color: #b45309; }
.m-ico.t-pink { background: var(--tint-pink); color: #db2777; }
.m-ico.t-violet { background: var(--tint-violet); color: #7c3aed; }
:root[data-theme="dark"] .m-ico.t-blue { color: #93c5fd; }
:root[data-theme="dark"] .m-ico.t-green { color: #6ee7b7; }
:root[data-theme="dark"] .m-ico.t-amber { color: #fcd34d; }
:root[data-theme="dark"] .m-ico.t-pink { color: #f9a8d4; }
:root[data-theme="dark"] .m-ico.t-violet { color: #c4b5fd; }

/* Cabecera del estado */
.m-hero {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 28px 32px; border-radius: 28px; margin-bottom: 16px; background: var(--m-card); border: 1px solid var(--m-line);
  background-image: radial-gradient(circle at 0% 0%, var(--tint-blue), transparent 45%), radial-gradient(circle at 100% 100%, var(--tint-green), transparent 45%);
}
.m-hero h1 { margin: 0; font-family: var(--font-head); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
.m-summary { margin: 12px 0 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); max-width: 46ch; }
.m-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.m-hero-gauge { display: flex; align-items: center; gap: 20px; padding: 18px 20px; border-radius: 22px; background: color-mix(in srgb, var(--m-card) 70%, transparent); border: 1px solid var(--m-line); }
.m-hero-gauge p { margin: 4px 0 8px; font-size: 15px; font-weight: 500; line-height: 1.35; }
.m-gauge { position: relative; flex: none; width: 128px; height: 128px; }
.m-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.m-gauge circle { fill: none; stroke-width: 11; }
.m-gauge .track { stroke: var(--m-soft); }
.m-gauge .fill { stroke-linecap: round; stroke: var(--dot-green); transition: stroke-dasharray 0.8s ease; }
.m-gauge.ok .fill { stroke: var(--dot-amber); }
.m-gauge.bad .fill { stroke: var(--bad); }
.m-gauge-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.m-gauge-in strong { font-family: var(--font-head); font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.m-gauge-in small { font-size: 12px; color: var(--muted); }

/* Indicadores clave */
.m-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.m-kpi { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: var(--m-card); border: 1px solid var(--m-line); }
.m-kpi-top { display: flex; align-items: center; gap: 8px; }
.m-kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: auto; font-size: 12px; color: var(--muted); }
.m-value { font-family: var(--font-head); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-value.big { font-size: 28px; }
.m-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.m-delta {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--m-soft); color: var(--muted);
}
.m-delta.good { background: var(--tint-green); color: var(--good); }
.m-delta.bad { background: rgba(239, 68, 68, 0.12); color: var(--bad); }
.m-meter { height: 6px; border-radius: 99px; background: var(--m-soft); overflow: hidden; }
.m-meter i { display: block; height: 100%; border-radius: 99px; background: var(--dot-green); }
.m-meter.ok i { background: var(--dot-amber); }
.m-meter.bad i { background: var(--bad); }

/* Navegación por secciones */
.m-jump {
  position: sticky; top: 62px; z-index: 4; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -28px 8px; padding: 10px 28px;
  background: color-mix(in srgb, var(--m-page) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.m-jump::-webkit-scrollbar { display: none; }
.m-jump button {
  flex: none; border: 1px solid var(--m-line); background: var(--m-card); color: var(--ink-2); cursor: pointer;
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: background 0.2s, border-color 0.2s;
}
.m-jump button:hover { border-color: var(--outline); }

/* Secciones */
.m-section { margin-top: 30px; scroll-margin-top: 130px; }
.m-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; scroll-margin-top: 130px; }
.m-sec-head h2 { margin: 0; font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-transform: none; color: var(--ink); display: block; }
.m-sec-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.m-sec-head .m-count { margin-left: auto; }
.m-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--m-soft); font-size: 13px; font-weight: 700; }
.m-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.m-tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.m-tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 118px; padding: 16px; overflow: hidden;
  border-radius: 18px; background: var(--m-card); border: 1px solid var(--m-line);
}
.m-tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.m-foot { margin-top: auto; font-size: 12px; color: var(--muted); }
.m-tile.pos { background: linear-gradient(160deg, var(--tint-green), transparent 70%), var(--m-card); }
.m-tile.neg { background: linear-gradient(160deg, rgba(239, 68, 68, 0.1), transparent 70%), var(--m-card); }
.m-tile.neg .m-value { color: var(--bad); }
.m-spark { width: 100%; height: 28px; display: block; }
.m-spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.m-spark polygon { fill: var(--m-soft); }
.m-spark.good polyline { stroke: var(--good); } .m-spark.good polygon { fill: var(--tint-green); }
.m-spark.bad polyline { stroke: var(--bad); } .m-spark.bad polygon { fill: rgba(239, 68, 68, 0.1); }
.m-card { padding: 18px 20px; border-radius: 20px; background: var(--m-card); border: 1px solid var(--m-line); }
.m-card h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-head); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.m-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.m-card-head strong { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.m-card-head strong small { font-size: 12px; color: var(--muted); font-weight: 500; }
.m-card-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.m-card-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.m-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.m-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* Hacienda */
.m-stack { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.m-stack i { min-width: 3px; }
.m-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.m-legend li { display: grid; grid-template-columns: 10px 1fr auto 44px; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--m-line); }
.m-legend li:first-child { border-top: 0; }
.m-legend i { width: 10px; height: 10px; border-radius: 3px; }
.m-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.m-legend em { font-style: normal; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Servicios públicos */
.m-svc { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 1.6fr) minmax(0, 1fr) 96px; align-items: center; gap: 18px; padding: 11px 0; border-top: 1px solid var(--m-line); font-size: 14px; }
.m-svc-headrow { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.m-svc-name { font-weight: 600; }
.m-svc-budget { display: grid; gap: 5px; }
.m-svc-budget span { font-size: 13px; }
.m-svc-budget small { color: var(--muted); }
.m-svc-budget em { font-style: normal; font-size: 12px; font-weight: 600; color: #b45309; }
:root[data-theme="dark"] .m-svc-budget em { color: var(--dot-amber); }
.m-ref { position: relative; height: 8px; border-radius: 99px; background: var(--m-soft); }
.m-ref i { display: block; height: 100%; border-radius: 99px; background: var(--dot-blue); }
.m-ref.low i { background: var(--dot-amber); }
.m-ref b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0.55; }
.m-svc-cond { display: grid; grid-template-columns: 1fr 30px; align-items: center; gap: 10px; }
.m-svc-cond strong { font-family: var(--font-head); text-align: right; font-variant-numeric: tabular-nums; }
.m-svc-trend { text-align: right; }

/* Políticas */
.m-three .m-card h3 { margin-bottom: 6px; }
.m-pol { padding: 10px 0; border-top: 1px solid var(--m-line); }
.m-pol:first-of-type { border-top: 0; }
.m-pol-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.m-pol-top span { color: var(--muted); }
.m-pol-top strong { font-family: var(--font-head); font-size: 16px; font-variant-numeric: tabular-nums; }
.m-range { position: relative; height: 6px; margin: 10px 0 4px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--dot-blue) 45%, var(--m-soft)), color-mix(in srgb, var(--dot-amber) 45%, var(--m-soft))); }
.m-range i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--m-card); }
.m-range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.m-steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 9px; }
.m-steps i { height: 6px; border-radius: 99px; background: var(--m-soft); }
.m-steps i.on { background: color-mix(in srgb, var(--ink) 35%, var(--m-soft)); }
.m-steps i.cur { background: var(--ink); }
.m-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.m-toggle { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--m-card); border: 1px solid var(--m-line); font-size: 14px; }
.m-toggle span:nth-child(2) { flex: 1; }
.m-toggle b { font-size: 12px; color: var(--muted); }
.m-switch { flex: none; position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--m-soft); box-shadow: inset 0 0 0 1px var(--m-line); }
.m-switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.2s; }
.m-toggle.on .m-switch { background: var(--dot-green); box-shadow: none; }
.m-toggle.on .m-switch i { transform: translateX(14px); background: #fff; }
.m-toggle.on b { color: var(--good); }

/* Obras */
.m-works { list-style: none; margin: 0; padding: 0; }
.m-works li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--m-line); }
.m-works li:first-child { border-top: 0; padding-top: 0; }
.m-works strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.m-works small { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Cómo funciona */
.m-how { list-style: none; counter-reset: how; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.m-how li { counter-increment: how; display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: var(--m-card); border: 1px solid var(--m-line); font-size: 13px; color: var(--muted); line-height: 1.45; }
.m-how li::before {
  content: counter(how); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pill); color: var(--pill-ink); font-size: 12px; font-weight: 700;
}
.m-how b { color: var(--ink); font-size: 14px; }

/* Informe del día */
.m-paper {
  padding: 32px 36px; border-radius: 28px; background: var(--m-card); border: 1px solid var(--m-line);
  background-image: radial-gradient(circle at 100% 0%, var(--tint-violet), transparent 45%);
}
.m-paper .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.m-paper .eyebrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.m-paper h1 { margin: 6px 0 0; max-width: 24ch; font-family: var(--font-head); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; }
.m-lead { margin: 16px 0 0; max-width: 70ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.m-rstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.m-rstats div { padding: 14px 16px; border-radius: 18px; background: var(--m-soft); }
.m-rstats strong { display: block; font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.m-rstats strong span { font-size: 18px; color: var(--muted); }
.m-rstats small { font-size: 13px; color: var(--muted); }
.m-movers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.m-mover { display: grid; gap: 6px; justify-items: start; padding: 14px 16px; border-radius: 18px; background: var(--m-card); border: 1px solid var(--m-line); }
.m-mover span { font-size: 13px; color: var(--muted); }
.m-mover strong { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.m-rgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.m-raside { display: grid; gap: 12px; margin-top: 30px; }
.m-cls { display: grid; gap: 10px; }
.m-cl { padding: 16px 18px; border-radius: 20px; background: var(--m-card); border: 1px solid var(--m-line); }
.m-cl.yes { border-color: color-mix(in srgb, var(--dot-green) 55%, var(--m-line)); }
.m-cl-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.m-cl-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--m-soft); font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.m-cl.yes .m-cl-rank { background: var(--tint-green); color: var(--good); }
.m-cl-text h3 { margin: 4px 0 0; font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }
.m-cl-text p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.m-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.m-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.m-badge.yes { background: var(--tint-green); color: var(--good); }
.m-badge.no { background: var(--m-soft); color: var(--muted); }
.m-cl-bar { position: relative; height: 8px; margin: 14px 0 8px 42px; border-radius: 99px; background: var(--m-soft); }
.m-cl-bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.m-cl.yes .m-cl-bar i { background: linear-gradient(90deg, var(--dot-blue), var(--dot-green)); }
.m-cl-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0.4; }
.m-cl-foot { display: flex; gap: 10px; align-items: baseline; margin-left: 42px; font-size: 13px; color: var(--muted); }
.m-cl-foot strong { font-family: var(--font-head); font-size: 16px; color: var(--ink); }
.m-cl-actions { margin: 10px 0 0 42px; padding: 10px 12px; list-style: none; border-radius: 12px; background: var(--m-soft); font-size: 13px; display: grid; gap: 4px; }
.m-cl-actions li::before { content: '→ '; color: var(--muted); }
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list li { position: relative; padding: 8px 0 8px 22px; border-top: 1px solid var(--m-line); font-size: 14px; line-height: 1.4; }
.m-list li:first-child { border-top: 0; padding-top: 0; }
.m-list li::before { position: absolute; left: 2px; top: 8px; font-weight: 700; font-size: 13px; }
.m-list li:first-child::before { top: 0; }
.m-list.done li::before { content: '✓'; color: var(--good); }
.m-list.not li::before { content: '✕'; color: var(--bad); }
.m-list.events li::before { content: '•'; color: var(--dot-amber); }
.m-list.rejected li::before { content: '–'; color: var(--muted); }

@media (max-width: 1100px) {
  .m-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-tiles.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-three, .m-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-rgrid { grid-template-columns: 1fr; }
  .m-raside { margin-top: 0; }
}
@media (max-width: 760px) {
  .m-wrap { padding: 16px 14px 130px; }
  .m-tabs { padding: 10px 12px; }
  .m-tabs button { min-width: 0; flex: 1; padding: 8px 10px; font-size: 13px; }
  .m-tabs .segmented { width: 100%; }
  .m-hero { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; border-radius: 24px; }
  .m-hero h1, .m-paper h1 { font-size: 32px; }
  .m-summary { font-size: 16px; }
  .m-gauge { width: 104px; height: 104px; }
  .m-gauge-in strong { font-size: 30px; }
  .m-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .m-value.big { font-size: 23px; }
  .m-jump { top: 56px; margin: 0 -14px 4px; padding: 8px 14px; }
  .m-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .m-tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-tile { min-height: 0; padding: 14px; }
  .m-value { font-size: 21px; }
  .m-two, .m-three, .m-how { grid-template-columns: 1fr; }
  .m-svc { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .m-svc-headrow { display: none; }
  .m-svc-name { grid-column: 1 / -1; }
  .m-svc-trend { text-align: left; }
  .m-paper { padding: 24px 20px; border-radius: 24px; }
  .m-lead { font-size: 16px; }
  .m-rstats, .m-movers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-cl-head { grid-template-columns: 30px minmax(0, 1fr); }
  .m-cl-head .m-badge { grid-column: 2; justify-self: start; }
  .m-cl-bar, .m-cl-foot, .m-cl-actions { margin-left: 0; }
}

/* Pista de controles de la cámara */
.cam-hint {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; color: var(--ink-2); white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.3); transition: opacity 0.4s;
}
.cam-hint[hidden] { display: none; }
.cam-hint.out { opacity: 0; }
.cam-hint b { color: var(--ink); font-weight: 600; }
.cam-hint .touch { display: none; }
@media (hover: none), (max-width: 600px) {
  .cam-hint .desk { display: none; }
  .cam-hint .touch { display: inline; }
  .cam-hint { bottom: 96px; font-size: 12px; }
}


/* Noticias del día en la ciudad (manifestaciones e incidentes) */
.news { position: absolute; left: 16px; top: 16px; z-index: 3; display: grid; gap: 6px; max-width: min(520px, calc(100% - 32px)); }
.news[hidden] { display: none; }
.news-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 13px; color: var(--ink-2); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.3);
}
.news-item b { color: var(--ink); }
.news-item svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.news-item.protest svg { color: #b45309; }
.news-item.riot { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.news-item.riot svg { color: var(--bad); }
.news-item.crime svg { color: #2563eb; }
@media (max-width: 600px) { .news { left: 8px; top: 8px; max-width: calc(100% - 16px); } .news-item { font-size: 12px; padding: 7px 10px; } }
