:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1f2a37;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e1d8;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --rec: #dc2626;
  --warn-bg: #fff7e6;
  --warn-ink: #8a5300;
  --err-bg: #fdecec;
  --err-ink: #9b1c1c;
  --ok: #15803d;
  --yo: #0f766e;
  --otros: #7c3aed;
  --sala: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --surface: #1b1f26;
    --surface-2: #232832;
    --ink: #e7e9ee;
    --muted: #a0a7b4;
    --faint: #6b7280;
    --line: #2e343f;
    --accent: #2dd4bf;
    --accent-ink: #062a27;
    --rec: #f87171;
    --warn-bg: #3a2a0c;
    --warn-ink: #fbd38d;
    --err-bg: #3b1515;
    --err-ink: #fca5a5;
    --ok: #4ade80;
    --yo: #2dd4bf;
    --otros: #c4b5fd;
    --sala: #fbbf24;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; max-width: 860px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
nav.top a { color: var(--muted); text-decoration: none; margin-left: 14px; font-size: 15px; }
nav.top a:hover { color: var(--ink); }
h1 { font-size: 24px; margin: 8px 0 16px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 24px 0 10px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }

button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--rec); }
.btn-big { font-size: 18px; padding: 14px 22px; min-height: 56px; border-radius: 14px; }
.btn-rec { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn-rec:hover { background: var(--rec); filter: brightness(1.08); }

input[type=text], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-height: 42px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }

.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.alert-warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert-err { background: var(--err-bg); color: var(--err-ink); }

/* lista */
.sessions { list-style: none; padding: 0; margin: 0; }
.sessions li + li { border-top: 1px solid var(--line); }
.sessions a { display: flex; gap: 12px; align-items: center; padding: 12px 4px; color: inherit; text-decoration: none; }
.sessions a:hover { background: var(--surface-2); }
.sessions .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-done { color: var(--ok); }
.badge-error { color: var(--err-ink); background: var(--err-bg); }
.badge-proc { color: var(--accent); }
.badge-rec { color: var(--rec); }

/* grabador */
.recbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.timer { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; min-width: 110px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--rec); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.meters { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); min-width: 200px; flex: 1 1 200px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin: 0; }
.switch input { width: 20px; height: 20px; }
.notepad {
  width: 100%; min-height: 50vh; resize: vertical; font-size: 17px; line-height: 1.6;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
}
.savestate { font-size: 12px; color: var(--faint); }

/* sesión */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 16px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 10px 12px; min-height: 0; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.minuta p.resumen { font-size: 17px; }
.punto { padding: 8px 0; }
.punto .tema { font-weight: 650; }
.punto.inferido { color: var(--muted); }
.punto.inferido .tema::after { content: " · de la transcripción"; font-weight: 400; font-size: 12px; color: var(--faint); }
.punto .refs { font-size: 12px; color: var(--faint); }
ul.plain { padding-left: 20px; margin: 6px 0; }
.compromiso { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; }
.who { font-weight: 600; }
.seg { padding: 6px 0; display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.seg .t { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 3px; }
.seg .sp { font-weight: 650; margin-right: 6px; }
.sp-Yo { color: var(--yo); } .sp-Otros { color: var(--otros); } .sp-Sala { color: var(--sala); }
.seg.flash { background: var(--surface-2); border-radius: 6px; }
.note { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 6px 0; }
.note .t { font-size: 12px; color: var(--faint); padding-top: 3px; }
.note .t a { color: inherit; }
.note.missing { background: var(--warn-bg); border-radius: 6px; }

.login-box { max-width: 420px; margin: 10vh auto 0; text-align: center; }
.login-box img { width: 72px; height: 72px; border-radius: 18px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
@media (max-width: 560px) {
  nav.top a { margin-left: 10px; font-size: 14px; }
  .timer { font-size: 24px; min-width: 90px; }
  .seg, .note { grid-template-columns: 52px 1fr; }
}
