/* PA · paleta azul Marbella */
:root {
  --navy: #0b2545;
  --deep: #13315c;
  --sea: #1b6ca8;
  --sky: #7fc8f8;
  --sand: #f4ede1;
  --foam: #f7fafc;
  --ink: #0e1b2c;
  --muted: #5b6b7f;
  --line: #dfe6ee;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 8px 24px rgba(11, 37, 69, .08);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--foam);
}
@media (prefers-color-scheme: dark) {
  :root { --foam: #07182e; --ink: #eaf2fb; --muted: #9fb3c8; --line: #1d3557; --sand: #10284a;
          --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); }
  .block, .bubble.me, .action, .login-card { background: #0d223f !important; }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

/* acceso */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, var(--sea) 0%, var(--navy) 70%); }
.login-card { width: min(380px, 100%); background: var(--foam); border-radius: 24px; padding: 32px 24px;
  text-align: center; box-shadow: var(--shadow); }
.login-card h1 { margin: 8px 0 0; font-size: 2rem; letter-spacing: .04em; color: var(--navy); }
.login-logo { width: 72px; height: 72px; }
#form-code { display: grid; gap: 12px; margin-top: 12px; }
#code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; color: inherit; }

/* botones */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--sea); color: #fff; }
.btn.primary:hover { background: var(--deep); }
.btn.ghost { background: transparent; color: var(--sea); border: 1px solid var(--line); margin-top: 16px; }
.btn.yes { background: var(--ok); color: #fff; }
.btn.no { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: wait; }

/* cabecera */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 16px calc(12px) 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(90deg, var(--navy), var(--deep)); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.place { font-weight: 500; opacity: .7; letter-spacing: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: .75rem; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.14); }
.chip.warn { background: var(--warn); }

main { max-width: 960px; margin: 0 auto; padding: 16px 16px 96px; }
.tab { display: none; }
.tab.active { display: block; }

/* modo pasillo */
.hero { text-align: center; padding: 24px 8px 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--sea); margin: 0; font-weight: 700; }
.hero h2 { font-size: 1.7rem; margin: 6px 0; color: var(--navy); }
@media (prefers-color-scheme: dark) { .hero h2, .login-card h1 { color: var(--sky); } }
.mic { position: relative; width: 132px; height: 132px; margin: 24px auto 8px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: radial-gradient(circle at 30% 30%, var(--sky), var(--sea) 55%, var(--navy));
  box-shadow: 0 12px 32px rgba(27,108,168,.45); transition: transform .15s; }
.mic svg { width: 52px; height: 52px; fill: currentColor; position: relative; }
.mic:active { transform: scale(.96); }
.mic-ring { position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--sky); opacity: 0; }
.mic.rec { background: radial-gradient(circle at 30% 30%, #ff9a8b, var(--bad) 60%, #7b1e14); }
.mic.rec .mic-ring { animation: pulse 1.4s ease-out infinite; border-color: #ff9a8b; }
.mic.busy { opacity: .6; cursor: wait; }
@keyframes pulse { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.mic-state { font-weight: 600; min-height: 1.4em; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }

.composer { display: flex; gap: 8px; margin: 16px 0; }
.composer textarea { flex: 1; resize: none; font: inherit; padding: 12px; border-radius: 12px; min-height: 48px;
  border: 1px solid var(--line); background: transparent; color: inherit; }

.feed { display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 12px 14px; border-radius: var(--radius); max-width: 92%; white-space: pre-wrap; line-height: 1.4; }
.bubble.me { align-self: flex-end; background: var(--sand); }
.bubble.pa { align-self: flex-start; background: var(--sea); color: #fff; }
.bubble.err { align-self: flex-start; background: var(--bad); color: #fff; }
.bubble .label { display: block; font-size: .72rem; opacity: .75; margin-bottom: 4px; }

/* bloques */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.block { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.block h3 { margin: 0 0 12px; font-size: 1rem; color: var(--sea); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--muted); font-size: .85rem; min-width: 72px; }
.overdue { color: var(--bad); font-weight: 600; }
.check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--sea); background: transparent; cursor: pointer; flex: none; }
.day { font-weight: 700; margin: 12px 0 4px; font-size: .85rem; text-transform: capitalize; color: var(--muted); }
.event { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.event .time { min-width: 92px; color: var(--sea); font-weight: 600; font-size: .9rem; }
.where { display: block; font-size: .8rem; color: var(--muted); }
.grid .block { margin-bottom: 0; }

.action { background: #fff; border-left: 4px solid var(--sea); border-radius: 12px; padding: 12px;
  box-shadow: var(--shadow); margin-top: 8px; white-space: pre-wrap; }
.action .row { display: flex; gap: 8px; margin-top: 10px; }
.action.done { opacity: .6; }

/* navegación */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--navy); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { background: none; border: 0; color: rgba(255,255,255,.65); padding: 14px 4px; font: inherit;
  font-weight: 600; font-size: .9rem; cursor: pointer; position: relative; }
.tabs button.active { color: #fff; box-shadow: inset 0 3px 0 var(--sky); }
.badge { position: absolute; top: 8px; margin-left: 4px; background: var(--warn); color: #fff; border-radius: 999px;
  font-size: .7rem; padding: 1px 6px; }
@media (min-width: 900px) {
  .tabs { position: fixed; top: 56px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
    width: min(960px, 100%); border-radius: 0 0 16px 16px; padding-bottom: 0; }
  main { padding: 80px 16px 32px; }
}
