/* ReinventAR — componentes y pantallas sobre los tokens de Brick v2 (css/tokens.css, css/base.css). */

/* --- botones --------------------------------------------------------------- */
.ra-btn {
  font: var(--t-body-strong); min-height: 48px; padding: var(--space-3) 20px; border-radius: var(--radius-m);
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease), border-color var(--ease);
}
.ra-btn:active:not([disabled]) { transform: scale(.98); }
.ra-btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-1); }
.ra-btn-primary:hover { box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--brand) 92%, #000); }
.ra-btn-secondary { background: var(--surface-1); color: var(--ink); border-color: var(--line-strong); }
.ra-btn-secondary:hover { background: var(--surface-3); }
.ra-btn-ghost { background: transparent; color: var(--brand-ink); }
.ra-btn-ghost:hover { background: var(--surface-3); }
.ra-btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.ra-btn-danger:hover { background: color-mix(in srgb, var(--error) 8%, transparent); }
.ra-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* --- botón de grabar ----------------------------------------------------- */
.ra-recwrap { display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.ra-rec {
  width: 88px; height: 88px; border-radius: var(--radius-pill); border: 3px solid var(--line-strong); background: var(--surface-1);
  display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: var(--shadow-2);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.ra-rec:active { transform: scale(.96); }
.ra-rec-glyph { width: 36px; height: 36px; border-radius: var(--radius-pill); background: var(--rec); transition: all var(--ease); }
.ra-rec.is-recording { background: var(--rec); border-color: var(--rec); box-shadow: var(--glow-rec), var(--shadow-2); }
.ra-rec.is-recording .ra-rec-glyph { width: 28px; height: 28px; border-radius: var(--radius-s); background: var(--on-rec); }
.ra-rec.is-paused .ra-rec-glyph { width: 30px; height: 30px; border-radius: 0; background: linear-gradient(90deg, var(--rec) 0 35%, transparent 35% 65%, var(--rec) 65%); }
.ra-rec-label { font: var(--t-micro); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--ink-muted); }
.ra-rec-time { font: var(--t-data); color: var(--ink); }

/* --- pill de estado (colores de estado de Brick; el punto lleva el color, el texto queda legible) --- */
.ra-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--ink); font: var(--t-micro); letter-spacing: var(--track-micro); text-transform: uppercase; white-space: nowrap;
}
.ra-pill-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--ink-muted); flex: none; }
.ra-pill-recording .ra-pill-dot { background: var(--rec); animation: ra-pulse 1.2s ease-in-out infinite; }
.ra-pill-uploading .ra-pill-dot, .ra-pill-queued .ra-pill-dot { background: var(--warning); }
.ra-pill-transcribing .ra-pill-dot, .ra-pill-translating .ra-pill-dot, .ra-pill-summarizing .ra-pill-dot { background: var(--info); animation: ra-pulse 1.6s ease-in-out infinite; }
.ra-pill-ready { color: var(--success); }
.ra-pill-ready .ra-pill-dot { background: var(--success); }
.ra-pill-error { color: var(--error); }
.ra-pill-error .ra-pill-dot { background: var(--error); border-radius: 0; }
@keyframes ra-pulse { 50% { opacity: .25; } }

/* --- medidor de nivel ---------------------------------------------------- */
.ra-meter { display: flex; flex-direction: column; gap: var(--space-2); min-width: 240px; }
.ra-meter-head { display: flex; justify-content: space-between; gap: var(--space-2); font: var(--t-small); color: var(--ink-muted); }
.ra-meter-head strong { color: var(--ink); font-weight: 600; }
.ra-meter-track { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 14px; }
.ra-seg { border-radius: 2px; background: var(--surface-3); transition: background 80ms linear; }
.ra-seg.is-ok.is-lit { background: var(--success); }
.ra-seg.is-hot { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--warning) 55%, transparent); }  /* zona marcada aunque esté apagada */
.ra-seg.is-hot.is-lit { background: var(--warning); }
.ra-seg.is-clip { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--error) 55%, transparent); }
.ra-seg.is-clip.is-lit { background: var(--error); }
.ra-meter-word { font: var(--t-small-strong); padding: 0 var(--space-2); border-radius: var(--radius-pill); }
.ra-meter-word[data-state="ok"] { color: var(--success); }
.ra-meter-word[data-state="hot"] { color: var(--ink); background: color-mix(in srgb, var(--warning) 30%, transparent); }
.ra-meter-word[data-state="clip"] { color: #fff; background: var(--error); }

/* --- card de grabación --------------------------------------------------- */
.ra-card {
  background: var(--surface-1); border-radius: var(--radius-m); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
  box-shadow: var(--edge), var(--shadow-1); width: 100%; border: 0; text-align: left; cursor: pointer; color: inherit;
  transition: box-shadow var(--ease), transform var(--ease);
}
.ra-card:hover { box-shadow: var(--edge), var(--shadow-2); }
.ra-card:active { transform: scale(.995); }
.ra-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.ra-kind { font: var(--t-micro); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--brand-ink); }
.ra-card-title { font: var(--t-heading); letter-spacing: -0.01em; color: var(--ink); }
.ra-card-meta { font: var(--t-small); color: var(--ink-muted); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.ra-card-meta .ra-mono { font-family: var(--font-data); }

/* --- transcripción ------------------------------------------------------- */
.ra-tb { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.ra-tc { font: var(--t-data); color: var(--ink-muted); background: var(--surface-3); border-radius: var(--radius-s); padding: 2px 6px; align-self: start; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ra-tb-body { display: flex; flex-direction: column; gap: var(--space-2); }
.ra-tb-lang { font: var(--t-micro); letter-spacing: var(--track-micro); margin-right: var(--space-2); }
.ra-tb-en { font: var(--t-small); color: var(--ink-muted); }
.ra-tb-en .ra-tb-lang { color: var(--ink-muted); }
.ra-tb-es { font: 400 17px/26px var(--font-ui); color: var(--ink); padding-left: var(--space-3); box-shadow: inset 2px 0 0 var(--brand); }
.ra-tb-es .ra-tb-lang { color: var(--brand-ink); }

/* --- chips y etiquetas (R3 separa Tag pasivo de FilterChip) -------------- */
.ra-chip { font: var(--t-micro); background: var(--surface-3); color: var(--ink); border-radius: var(--radius-s); padding: 3px 8px; white-space: nowrap; }
button.ra-chip {
  cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface-1); min-height: 32px; padding: 0 10px;
  font: 500 13px/18px var(--font-ui); transition: background var(--ease-chip), border-color var(--ease-chip), box-shadow var(--ease-chip);
}
button.ra-chip:hover { box-shadow: var(--shadow-1); }
.ra-chip-on { border-color: var(--brand) !important; background: var(--brand-soft) !important; color: var(--ink) !important; font-weight: 600 !important; }
.ra-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* Tag: dato, no se toca (sin borde ni sombra); el chip-botón tiene borde y estado */
/* Aviso de perfil sin confirmar (web/js/knowledge.js): --warning como fondo, texto oscuro en los dos temas. */
.ra-disclaimer { background: color-mix(in srgb, var(--warning) 35%, var(--surface-1)); color: var(--ink); font: var(--t-small); border-radius: var(--radius-s); padding: var(--space-2) var(--space-3); }
.ra-tag { font: var(--t-micro); background: var(--surface-3); color: var(--ink-muted); border-radius: var(--radius-s); padding: 2px 6px; white-space: nowrap; }
.ra-tag.is-new { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
:root[data-theme="dark"] .ra-tag.is-new { background: var(--surface-3); color: var(--brand-ink); }

/* --- resumen ------------------------------------------------------------- */
.ra-sum { background: var(--surface-1); border-radius: var(--radius-m); padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); box-shadow: var(--edge), var(--shadow-1); }
.ra-sum h3 { font: var(--t-heading); color: var(--ink); margin: 0 0 var(--space-2); }
.ra-sum p, .ra-sum li { font: var(--t-body); color: var(--ink); }
.ra-sum ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space-2); }
.ra-tldr { font: 400 18px/28px var(--font-ui) !important; }
.ra-hl { background: var(--brand-soft); color: var(--ink); border-radius: var(--radius-s); padding: 0 4px; font-weight: 600; }

/* --- layout de la app ---------------------------------------------------- */
.app { max-width: 720px; margin: 0 auto; padding: 0 var(--space-4) calc(var(--space-12) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .app { max-width: 960px; } }
/* Modo prueba (web/js/sandbox.js): --warning solo sirve como fondo; el texto va oscuro en los dos temas (≥ 8:1). */
.top-banners { position: sticky; top: 0; z-index: 30; }
.sandbox-banner { background: var(--warning); color: #1a1a1a; font: var(--t-small-strong); text-align: center; padding: var(--space-1) var(--space-4); }
.sandbox-banner[hidden] { display: none; }

/* Countdown de lo fijado (web/js/countdown.js): el tono cambia según cuánto falta. Texto oscuro sobre los fondos de color. */
.countdown-banner { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); font: var(--t-small-strong); background: var(--surface-1); box-shadow: var(--edge); }
.countdown-banner[hidden] { display: none; }
.countdown-banner.is-soon { background: var(--brand-soft); }
.countdown-banner.is-urgent { background: var(--error); color: #ffffff; }
.countdown-banner.is-event { background: color-mix(in srgb, #8a50f7 22%, var(--surface-1)); }
.countdown-banner.is-live { background: color-mix(in srgb, #258825 22%, var(--surface-1)); }
.countdown-text { flex: 1; color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.countdown-close { background: none; border: 0; color: inherit; font-size: 1.25rem; min-width: 32px; min-height: 32px; cursor: pointer; }
.changes-banner { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); font: var(--t-small); background: var(--brand-soft); box-shadow: var(--edge); }
.changes-banner[hidden] { display: none; }
.changes-banner p { flex: 1; margin: 0; }
.ra-check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ra-check-list .is-ok strong { color: var(--success, #258825); }
.ra-check-list .is-fail strong { color: var(--error); }
.ra-countdown { font: var(--t-small-strong); font-variant-numeric: tabular-nums; color: var(--brand-ink); }

/* "Llevame" (web/js/location.js): distancia y tiempo a pie, con el link a Google Maps. */
.ra-go { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.ra-go-info { font: var(--t-small); color: var(--ink-muted); }
.ra-go-btn { flex: 0 0 auto; text-decoration: none; }

/* Eventos (web/js/events.js) */
.ra-event { background: var(--surface-1); border-radius: var(--radius-m); box-shadow: var(--edge), var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; }
.ra-event-cover { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--surface-2, var(--surface-1)); }
.ra-event-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.ra-event-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-m); }
.ra-event-row { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-2); align-items: baseline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) 0 var(--space-3); margin-bottom: var(--space-4);
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2, 8px); font: 800 24px/1 var(--font-ui); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand img { border-radius: var(--radius-s); flex: none; }
.brand-word span { color: var(--brand-ink); }
/* Botones de ícono (tema, ajustes): 44×44, nombre accesible en aria-label */
.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-m); border: 0; background: transparent;
  color: var(--ink-muted); cursor: pointer; text-decoration: none; transition: background var(--ease), color var(--ease), transform var(--ease);
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.iconbtn:active { transform: scale(.94); }
.iconbtn[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); }
.toolbar { display: flex; gap: var(--space-1); align-items: center; }
.ra-icon { display: block; flex: none; }

/* Navegación principal: ícono + nombre. En escritorio va en la barra de arriba; en el celular, barra inferior al alcance del pulgar. */
.navbar { display: flex; gap: var(--space-1); margin-left: auto; }
.navitem {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-m);
  color: var(--ink-muted); text-decoration: none; font: var(--t-small-strong); position: relative;
  transition: background var(--ease), color var(--ease);
}
.navitem:hover { background: var(--surface-3); color: var(--ink); }
.navitem[aria-current="page"] { color: var(--ink); }
.navitem[aria-current="page"] .ra-icon { color: var(--brand-ink); }
.navitem[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 2px; height: 3px; border-radius: 3px; background: var(--brand);
}
.is-guest .navbar, .is-guest .toolbar a { display: none; }

/* Títulos: escala con contraste; las secciones (h2.label / h3.label en el markup) pasan a ser títulos de verdad */
h1.title { font: var(--t-display); letter-spacing: var(--track-tight); margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
h2.label, h3.label { font: var(--t-heading); letter-spacing: -0.005em; text-transform: none; color: var(--ink); }
summary.label { font: var(--t-small-strong); letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; }
.muted { color: var(--ink-muted); }
.caption { font: var(--t-small); color: var(--ink-muted); }
h2.caption { font: var(--t-small); text-transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.label { font: var(--t-micro); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--ink-muted); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-8); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.actions .ra-btn { flex: 1 1 auto; }
.actions.is-center { align-items: center; }
.actions.is-between { justify-content: space-between; }
.fieldset-plain { border: 0; padding: 0; margin: 0; }
.fieldset-plain > legend { margin-bottom: var(--space-2); }
.notice.is-plain { text-decoration: none; display: block; }
.empty { padding: var(--space-12) var(--space-4); text-align: center; color: var(--ink-muted); background: var(--surface-1); border-radius: var(--radius-m); box-shadow: var(--edge); }

/* --- formularios ---------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field input, .field select, .field textarea {
  min-height: 48px; padding: var(--space-3); background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  color: var(--ink); width: 100%; transition: border-color var(--ease), box-shadow var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.segmented label {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  cursor: pointer; font: var(--t-body-strong); background: var(--surface-1); transition: background var(--ease), border-color var(--ease);
}
.segmented label:hover { background: var(--surface-3); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + label { background: var(--brand-soft); border: 2px solid var(--brand); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.notice { background: var(--surface-1); border-radius: var(--radius-m); padding: var(--space-3) var(--space-4); box-shadow: var(--edge); }
.notice.err { color: var(--error); box-shadow: inset 3px 0 0 var(--error), var(--edge); }

/* --- grabación ------------------------------------------------------------ */
.recorder { display: flex; flex-direction: column; align-items: center; gap: var(--space-6); padding-top: var(--space-6); }
.counter { font: 500 clamp(48px, 16vw, 72px)/1 var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; color: var(--ink); transition: color var(--ease); }
.counter[data-state="paused"] { color: var(--ink-muted); }
.ra-clock { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.ra-recstatus { display: inline-flex; align-items: center; gap: var(--space-2); font: var(--t-small-strong); color: var(--ink-muted); }
.ra-recstatus::before { content: ""; width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--line-strong); }
.ra-recstatus[data-state="recording"] { color: var(--rec); }
.ra-recstatus[data-state="recording"]::before { background: var(--rec); animation: ra-blink 1.2s ease-in-out infinite; }
.ra-recstatus[data-state="paused"]::before { background: var(--warning); }
@keyframes ra-blink { 50% { opacity: .25; } }
.recorder .ra-rec-label { display: none; }  /* el estado ya se dice arriba, bajo el contador */
.ra-input { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); background: var(--surface-1); border-radius: var(--radius-m); box-shadow: var(--edge); }
.recorder .ra-meter { width: 100%; }
.recorder .actions { width: 100%; }
.upl { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; }
.sala { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); color: #8a8a8a; }
.sala .counter { color: #8a8a8a; }
.sala .ra-pill { background: #111; color: #a3a3a3; }

/* --- detalle de grabación -------------------------------------------------- */
.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--line); position: sticky; top: 68px; background: var(--bg); z-index: 2; }
.ra-tab {
  min-height: 48px; padding: 0 var(--space-4); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  font: var(--t-small-strong); color: var(--ink-muted); transition: color var(--ease), border-color var(--ease);
}
.ra-tab:hover { color: var(--ink); }
.ra-tab[aria-selected="true"] { color: var(--ink); border-color: var(--brand); }
.quote { font-style: italic; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: var(--space-3) var(--space-4); border-radius: var(--radius-m);
  box-shadow: var(--shadow-3); z-index: 60; max-width: calc(100% - 32px); font: var(--t-small-strong);
  animation: ra-rise var(--ease-sheet);
}
@keyframes ra-rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* --- itinerario ----------------------------------------------------------- */
.chipgroup { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chipgroup input { position: absolute; opacity: 0; pointer-events: none; }
.chipgroup label {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line-strong);
  background: var(--surface-1); cursor: pointer; font: 500 14px/18px var(--font-ui); color: var(--ink); transition: background var(--ease-chip), border-color var(--ease-chip);
}
.chipgroup label:hover { background: var(--surface-3); }
.chipgroup input:checked + label { background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.chipgroup input:checked + label::before { content: "✓"; margin-right: 6px; color: var(--brand-ink); }
.chipgroup input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }

.ra-minicard {
  background: var(--surface-1); border-radius: var(--radius-m); padding: var(--space-4); display: grid; grid-template-columns: 56px 1fr; gap: var(--space-3);
  box-shadow: var(--edge), var(--shadow-1); transition: box-shadow var(--ease);
}
.ra-minicard:hover { box-shadow: var(--edge), var(--shadow-2); }
.ra-minicard[hidden] { display: none; }
/* riel de tiempo: la hora manda, el día abajo; la línea conecta visualmente con el contenido */
.ra-rail { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-right: var(--space-3); border-right: 2px solid var(--line); }
.ra-rail-time { font: var(--t-time); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ra-rail-day { font: var(--t-micro); color: var(--ink-muted); }
.ra-minicard-body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ra-minicard-title { font: var(--t-body-strong); font-size: 17px; line-height: 23px; color: var(--ink); }
.ra-minicard-title .ra-link { text-decoration: none; }
.ra-minicard-title .ra-link:hover { text-decoration: underline; }
.ra-minicard-meta { font: var(--t-small); color: var(--ink-muted); }
.ra-abstract { font: var(--t-small); color: var(--ink-muted); }
.ra-abstract.is-folded { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ra-more { align-self: flex-start; background: none; border: 0; padding: var(--space-1) 0; min-height: 32px; cursor: pointer; font: var(--t-small-strong); color: var(--brand-ink); }
.ra-more:hover { text-decoration: underline; }
.ra-abstract-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* sin overflow:hidden a propósito: Google Maps renderiza el InfoWindow adentro de este mismo contenedor y quedaba recortado */
.mapbox { height: 320px; background: var(--surface-1); border-radius: var(--radius-m); }

.daylist { display: flex; flex-direction: column; gap: var(--space-3); }

/* speakers: nombre, cargo y empresa */
.ra-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font: var(--t-small); color: var(--ink); }
.ra-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--ease); }
.ra-link:hover, .ra-link:focus-visible { text-decoration-color: currentColor; }
.caption .ra-link, p > .ra-link { color: var(--brand-ink); }

/* --- explorar --------------------------------------------------------------- */
.ra-facet { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0; }
.ra-facet-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; min-height: 44px; padding: 0 var(--space-2);
  border-radius: var(--radius-s); cursor: pointer; font: var(--t-small);
}
.ra-facet-item:hover { background: var(--surface-3); }
.ra-facet-item input { width: 20px; height: 20px; accent-color: var(--brand); }
.ra-facet-item .caption { font: var(--t-data); }
.ra-facetgroup { border-bottom: 1px solid var(--line); padding: var(--space-2) 0; }
.ra-facetgroup > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }

/* --- buscar: modos, campo, agrupar ------------------------------------------- */
.ra-segtabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); padding: var(--space-1); background: var(--surface-3); border-radius: var(--radius-m); }
.ra-segtab {
  min-height: 40px; border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer;
  font: var(--t-small-strong); color: var(--ink-muted); transition: background var(--ease), color var(--ease);
}
.ra-segtab[aria-selected="true"] { background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-1); }
.ra-searchbar { display: flex; flex-direction: column; gap: var(--space-2); }
.ra-searchfield {
  display: flex; align-items: center; gap: var(--space-2); min-height: 52px; padding: 0 var(--space-3);
  background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: var(--radius-m); color: var(--ink-muted);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.ra-searchfield:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.ra-searchfield input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: var(--t-body); color: var(--ink); min-height: 48px; }
.ra-searchfield input::placeholder { color: var(--ink-muted); }
.ra-filterbtn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
/* fila desplazable horizontal (agrupar por): no rompe el ancho en el celular */
.ra-scrollrow { display: flex; align-items: center; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 calc(-1 * var(--space-4)); padding-inline: var(--space-4); }
.ra-scrollrow::-webkit-scrollbar { display: none; }
.ra-scrollrow .ra-chip { flex: none; }

/* --- panel de filtros: sube desde abajo en el celular, lateral derecho en la compu --- */
.ra-sheet {
  border: 0; padding: 0; margin: 0; background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-3);
  display: none; flex-direction: column; max-width: 100%; max-height: 100%;
}
.ra-sheet[open] { display: flex; }
.ra-sheet::backdrop { background: rgb(0 0 0 / .45); }
.ra-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4) var(--space-2) var(--space-6); border-bottom: 1px solid var(--line); }
.ra-sheet-body { flex: 1; overflow-y: auto; padding: 0 var(--space-6); overscroll-behavior: contain; }
.ra-sheet-foot { padding: var(--space-3) var(--space-6) calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ra-sheet-foot .ra-btn-primary { flex: 2 1 auto; }
@media (max-width: 767px) {
  .ra-sheet { inset: auto 0 0 0; width: 100%; height: 85dvh; border-radius: var(--radius-m) var(--radius-m) 0 0; }
  .ra-sheet[open] { animation: ra-sheet-up var(--ease-sheet); }
}
@media (min-width: 768px) {
  .ra-sheet { inset: 0 0 0 auto; width: 420px; height: 100dvh; }
  .ra-sheet[open] { animation: ra-sheet-side var(--ease-sheet); }
}
@keyframes ra-sheet-up { from { transform: translateY(100%); } }
@keyframes ra-sheet-side { from { transform: translateX(100%); } }
details.notice > summary { min-height: 32px; display: flex; align-items: center; }
.ra-ask-turn { border-top: 1px solid var(--line); padding-top: var(--space-4); }

@media (max-width: 767px) {
  .app { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* backdrop-filter en la barra de arriba haría que la nav fija quede atada a ella y no a la pantalla */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .navbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; /* una columna por sección, sin importar cuántas */
    padding: var(--space-1) var(--space-2) calc(var(--space-1) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-1) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .navitem { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 0; font: 600 11px/14px var(--font-ui); }
  .navitem:hover { background: transparent; }
  .navitem[aria-current="page"]::after { top: 0; bottom: auto; left: 30%; right: 30%; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }  /* por encima de la barra inferior */
}

/* --- Hoy (inicio): ahora / próxima / resto del día --------------------------- */
.ra-today {
  background: var(--surface-1); border-radius: var(--radius-m); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2); box-shadow: var(--edge), var(--shadow-1);
}
.ra-today.is-now { box-shadow: inset 4px 0 0 var(--brand), var(--edge), var(--shadow-2); }
.ra-today-when { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.ra-today-when .ra-mono { font: var(--t-data); color: var(--ink-muted); }
.ra-today.is-now .ra-today-when .label { color: var(--brand-ink); }
.ra-today .ra-card-title .ra-link { text-decoration: none; }
.ra-today-later { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ra-today-later li { display: flex; gap: var(--space-3); align-items: baseline; font: var(--t-small); }
.ra-today-later .ra-mono { font: var(--t-data); color: var(--ink-muted); flex: none; }
.ra-today-empty { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); background: var(--surface-1); border-radius: var(--radius-m); box-shadow: var(--edge); }

/* --- toast con acción (Deshacer) -------------------------------------------- */
.toast { display: flex; align-items: center; gap: var(--space-4); }
.toast-action { background: none; border: 0; padding: 0 var(--space-2); min-height: 36px; cursor: pointer; font: var(--t-small-strong); color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.toast-action:focus-visible { outline-color: var(--bg); }

/* --- diálogo ---------------------------------------------------------------- */
.ra-dialog { border: 0; padding: 0; border-radius: var(--radius-m); background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-3); width: min(420px, calc(100% - 32px)); }
.ra-dialog::backdrop { background: rgb(0 0 0 / .45); }
.ra-dialog[open] { animation: ra-pop var(--ease-sheet); }
.ra-dialog-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.ra-dialog-title { font: var(--t-title); color: var(--ink); }
.ra-dialog-text { font: var(--t-body); color: var(--ink-muted); }
@keyframes ra-pop { from { opacity: 0; transform: scale(.97); } }

/* --- skeleton ---------------------------------------------------------------- */
.ra-skeleton { display: flex; flex-direction: column; gap: var(--space-3); }
.ra-skel { border-radius: var(--radius-m); background: linear-gradient(90deg, var(--surface-3) 25%, var(--line) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: ra-shimmer 1.2s linear infinite; }
.ra-skel-title { height: 28px; width: 55%; border-radius: var(--radius-s); }
.ra-skel-card { height: 112px; }
@keyframes ra-shimmer { to { background-position: -200% 0; } }

/* --- fichas: encabezado, horarios, para conversar ----------------------------- */
.ra-entity { display: flex; gap: var(--space-4); align-items: flex-start; }
.ra-avatar {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius-pill); display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font: 700 20px/1 var(--font-ui); letter-spacing: -0.02em;
}
:root[data-theme="dark"] .ra-avatar { background: var(--surface-3); }
.ra-prose { font: var(--t-body); max-width: 68ch; }
.ra-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ra-slot {
  display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-3); align-items: center;
  padding: var(--space-3) var(--space-4); background: var(--surface-1); border-radius: var(--radius-m); box-shadow: var(--edge);
}
.ra-slot-body { display: flex; flex-direction: column; gap: 2px; font: var(--t-small); min-width: 0; }
.ra-converse { padding: var(--space-4); border-radius: var(--radius-m); background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); }
.ra-converse h2.label { color: var(--ink); }
.ra-converse .caption { color: var(--ink); }
:root[data-theme="dark"] .ra-converse { background: var(--surface-2); }
:root[data-theme="dark"] .ra-converse .caption { color: var(--ink-muted); }
.ra-skel-line { height: 14px; border-radius: var(--radius-s); }
.ra-skel-line:nth-child(2) { width: 80%; } .ra-skel-line:nth-child(3) { width: 95%; } .ra-skel-line:nth-child(4) { width: 60%; } .ra-skel-line:nth-child(5) { width: 90%; }
.ra-skel-today { height: 132px; }

/* --- accesibilidad: saltar al contenido y foco programático -------------------- */
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100; padding: var(--space-3) var(--space-4);
  background: var(--ink); color: var(--bg); border-radius: var(--radius-m); font: var(--t-small-strong); text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }
#view:focus, #view h1:focus { outline: none; }  /* foco puesto por código al cambiar de pantalla: no es una acción del usuario */
