/* Becario · Sombra — una columna móvil, barra inferior, captura en el centro */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5b6780;
  --line: #dde3ef;
  --brand: #103273;
  --brand-soft: #e6ecf8;
  --accent: #2f6fde;
  --good: #1e8c50;
  --good-soft: #e3f4ea;
  --bad: #c43c32;
  --bad-soft: #fbe7e5;
  --idea: #b7790f;
  --idea-soft: #fbf1dc;
  --font-display: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --tabs-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1424; --surface: #151f35; --ink: #e8edf7; --muted: #9aa7c2; --line: #26324d;
    --brand: #8fb0ff; --brand-soft: #1c2a4a; --accent: #8fb0ff;
    --good: #5fd08f; --good-soft: #14331f; --bad: #ff8a80; --bad-soft: #3a1a18;
    --idea: #f0c060; --idea-soft: #3a2e12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--brand); color: #fff;
}
@media (prefers-color-scheme: dark) { .top { background: #0b1a3d; } }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-family: var(--font-display); font-size: 1.05rem; display: block; }
.brand small { opacity: .8; font-size: .75rem; }
.logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; color: #103273; font: 800 1.1rem var(--font-display);
}
.icon-btn { background: none; border: 0; color: #9fe3b4; font-size: 1.1rem; padding: 6px; cursor: pointer; }
.icon-btn.off { color: #ffb4ac; }
.icon-btn.local { color: #c9d4ee; }

main { max-width: 680px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
main:focus { outline: none; }

/* Barra inferior */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a { display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.active { color: var(--brand); }
.tabs a.cta svg { width: 44px; height: 44px; padding: 10px; margin-top: -18px; border-radius: 50%; background: var(--brand); stroke: #fff; box-shadow: 0 6px 16px rgba(16,50,115,.35); }
@media (prefers-color-scheme: dark) { .tabs a.cta svg { stroke: #0b1530; } }

/* Bloques */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hero { background: var(--brand); color: #fff; border: 0; }
@media (prefers-color-scheme: dark) { .hero { background: #1b3270; } }
.hero p { margin: 0; opacity: .9; }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero .stat { background: rgba(255,255,255,.12); border-radius: 10px; padding: 8px 10px; }
.hero .stat b { display: block; font: 800 1.35rem var(--font-display); font-variant-numeric: tabular-nums; }
.hero .stat span { font-size: .75rem; opacity: .85; }

/* Listas de items */
.list { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit; min-width: 0;
}
.item .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.item .t { font-weight: 600; overflow-wrap: anywhere; }
.item .m { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.dot.bueno { background: var(--good); } .dot.malo { background: var(--bad); }
.dot.oportunidad { background: var(--idea); } .dot.decision { background: var(--accent); }
.dot.captura { background: #8a6fd1; } .dot.reunion { background: var(--brand); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.pill.bueno { background: var(--good-soft); color: var(--good); }
.pill.malo { background: var(--bad-soft); color: var(--bad); }
.pill.idea { background: var(--idea-soft); color: var(--idea); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { color: #0b1530; } }

.empty { text-align: center; padding: 18px 10px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

/* Formularios */
label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface);
  font-size: 16px; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff; font-family: var(--font-display); }
@media (prefers-color-scheme: dark) { .btn { color: #0b1530; } }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Captura */
.modes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mode { display: grid; justify-items: center; gap: 4px; padding: 12px 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .85rem; }
.mode[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.mode svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic.listening { background: var(--bad); color: #fff; }
.why { border-left: 4px solid var(--accent); background: var(--brand-soft); padding: 12px; border-radius: 0 12px 12px 0; }
.why b { color: var(--brand); font-family: var(--font-display); }
.photo-preview { max-width: 100%; border-radius: 10px; }

/* Detalle */
.props { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.picker { max-height: 240px; overflow-y: auto; display: grid; gap: 4px; }
.picker label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: .9rem; }
.picker input { width: auto; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 9;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 14px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; max-width: 90vw;
}
@media (prefers-reduced-motion: no-preference) { .item, .btn, .chip, .mode { transition: transform .12s ease; } .item:active, .btn:active { transform: scale(.98); } }
.mode.rec { color: var(--bad); }
.mode.rec.listening { background: var(--bad); color: #fff; border-color: var(--bad); }
details summary { cursor: pointer; }

.link-btn { text-decoration: none; display: inline-block; }
.warn { color: var(--bad); }
.brandtxt { color: var(--brand); }
.lbl-check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.auto { width: auto; }
.mb6 { margin-bottom: 6px; }
.center { text-align: center; }
