/* Casanova — estilos. Mobile-first, sin dependencias. */

:root {
  --bg: #0f0a0b;
  --bg-2: #150e11;
  --panel: #1c1116;
  --panel-2: #24161b;
  --panel-3: #2a1a20;
  --line: #3c242c;
  --line-soft: #2b1a21;
  --cream: #f6ecdc;
  --cream-dim: #e7d8c4;
  --muted: #b8a59c;
  --muted-2: #8f7a74;
  --wine: #77202f;
  --wine-2: #9c2f44;
  --gold: #d3ad68;
  --gold-2: #ecd3a2;
  --ok: #93c2a2;
  --warn: #e0b276;
  --danger: #cf6478;
  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 22px 48px -28px rgba(0, 0, 0, 0.95);
  --pad: 16px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 50% -180px, rgba(119, 32, 47, 0.34), transparent 70%),
    radial-gradient(760px 420px at 100% 20%, rgba(211, 173, 104, 0.06), transparent 70%),
    var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, blockquote {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--cream); }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  background: var(--gold);
  color: #24150f;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}
.skip:focus { left: 12px; }

/* ── barra superior ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(15, 10, 11, 0.96), rgba(15, 10, 11, 0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(60, 36, 44, 0.55);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(28, 17, 22, 0.7);
  color: var(--cream);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, #a2324a, #6d1c2b);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(236, 211, 162, 0.22);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.brand-text small { color: var(--muted-2); font-size: 10.5px; letter-spacing: 0.02em; }

.chrome { display: flex; align-items: center; gap: 6px; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(36, 22, 27, 0.8);
  border-radius: 999px;
  font-size: 12px;
  color: var(--cream-dim);
  white-space: nowrap;
}

.chip b { font-weight: 700; font-size: 12.5px; color: var(--cream); }
.chip-label { color: var(--muted-2); font-size: 10px; letter-spacing: 0.08em; }
.ico { width: 14px; height: 14px; }
.ico--flame { fill: #e08a52; }
.ico--bolt { fill: var(--gold); }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip--state { font-size: 11px; padding: 5px 9px; }
.chip--state.is-ok { border-color: rgba(147, 194, 162, 0.35); color: var(--ok); }
.chip--state.is-off { border-color: rgba(207, 100, 120, 0.28); color: var(--muted-2); }

/* ── estructura ─────────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px var(--pad) 40px;
  outline: none;
}

.card {
  position: relative;
  background: linear-gradient(168deg, rgba(36, 22, 27, 0.92), rgba(24, 14, 18, 0.94));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 17px;
  margin-bottom: 13px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: break-word;
}

.card--soft { background: rgba(28, 17, 22, 0.55); box-shadow: none; }
.card--mini { padding: 14px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 { font-size: clamp(30px, 8.4vw, 42px); line-height: 1.05; }
h2 { font-size: 22px; }
h3 { font-size: 18px; line-height: 1.3; }
.card h3 { margin-bottom: 6px; }

.hero { padding: 6px 2px 20px; }
.hero .eyebrow { margin-bottom: 8px; }
.hero h1 { margin-bottom: 10px; }
.hero--slim { padding-bottom: 16px; }
.hero--slim h1 { font-size: clamp(26px, 7.4vw, 36px); }

.lede {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 54ch;
  margin: 0;
}

.muted { color: var(--muted); font-size: 13.5px; }
.tiny { color: var(--muted-2); font-size: 11.5px; line-height: 1.5; }
.center { text-align: center; }
.body { color: var(--cream-dim); font-size: 14.5px; }

/* ── hoy ────────────────────────────────────────────────── */
.card--quote {
  background:
    radial-gradient(420px 180px at 85% -20%, rgba(211, 173, 104, 0.12), transparent 70%),
    linear-gradient(160deg, #2b161d, #1a1014);
  border-color: #4a2a33;
}

.card--quote blockquote {
  font-size: 21px;
  line-height: 1.35;
  color: var(--cream);
  margin: 2px 0 10px;
}

.quote-src { color: var(--muted-2); font-size: 11.5px; }

.card--session { border-color: rgba(211, 173, 104, 0.22); }

.session-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.session-top h2 { font-size: 24px; margin: 2px 0; }

.ring {
  --p: 0;
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(246, 236, 220, 0.09) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #1a1014;
}
.ring span { position: relative; font-size: 13px; font-weight: 650; color: var(--cream); }
.ring--gold { width: 70px; height: 70px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 10, 12, 0.45);
  border: 1px solid rgba(60, 36, 44, 0.5);
  color: var(--cream);
  min-width: 0;
}
.step:hover { border-color: rgba(211, 173, 104, 0.45); color: var(--cream); }
.step.is-done { opacity: 0.72; }
.step.is-done .step-icon { color: var(--ok); border-color: rgba(147, 194, 162, 0.4); }

.step-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(119, 32, 47, 0.25);
  border: 1px solid rgba(211, 173, 104, 0.22);
  color: var(--gold-2);
  font-size: 15px;
}

.step-body { display: flex; flex-direction: column; min-width: 0; }
.step-body strong { font-size: 14.5px; font-weight: 600; overflow-wrap: break-word; }
.step-body small { color: var(--muted-2); font-size: 11.5px; }
.step-chev { margin-left: auto; color: var(--muted-2); font-size: 20px; flex: none; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.grid-2 > .card { margin-bottom: 13px; }

.mini-value {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  margin: 4px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mini-value span { font-size: 16px; }

.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(246, 236, 220, 0.08);
  overflow: hidden;
  margin-top: 8px;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #a2324a, var(--gold));
  transition: width 0.35s ease;
}
.bar--line { margin-top: 10px; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(16, 10, 12, 0.4);
  color: var(--cream-dim);
  font-size: 11px;
  min-width: 0;
}
.quick-item b { font-size: 16px; color: var(--gold); font-weight: 400; }
.quick-item:hover { border-color: rgba(211, 173, 104, 0.4); }

/* ── botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  max-width: 100%;
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; filter: none; transform: none; }

.btn--gold {
  background: linear-gradient(180deg, #ecd3a2, #c99f5c);
  border-color: #b98f4e;
  color: #2a1a12;
}
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--cream-dim);
}
.btn--quiet { background: rgba(119, 32, 47, 0.3); border-color: rgba(211, 173, 104, 0.3); color: var(--cream); }
.btn--danger { background: transparent; border-color: rgba(207, 100, 120, 0.5); color: var(--danger); }
.btn--sm { padding: 9px 13px; font-size: 12.5px; }

.lesson-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

.link { color: var(--gold-2); font-size: 13.5px; border-bottom: 1px solid rgba(211, 173, 104, 0.3); }
.link-row { display: flex; flex-wrap: wrap; gap: 16px; padding: 6px 2px 14px; }
.link-inline { color: var(--gold-2); font-size: 12.5px; }

/* ── etiquetas ──────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag--hecho { background: rgba(147, 194, 162, 0.12); border-color: rgba(147, 194, 162, 0.4); color: #a9d3b6; }
.tag--opinion { background: rgba(211, 173, 104, 0.12); border-color: rgba(211, 173, 104, 0.42); color: var(--gold-2); }
.tag--ejercicio { background: rgba(162, 50, 74, 0.18); border-color: rgba(162, 50, 74, 0.55); color: #e9a6b3; }
.tag--done { background: rgba(147, 194, 162, 0.14); border-color: rgba(147, 194, 162, 0.4); color: #b6dcc2; }
.tag--warn { background: rgba(207, 100, 120, 0.14); border-color: rgba(207, 100, 120, 0.45); color: #efa3b1; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 2px 16px; }

/* ── progreso de bloque / temario ───────────────────────── */
.card--progress {
  display: flex;
  align-items: center;
  gap: 16px;
}
.card--progress h3 { margin-bottom: 2px; }
.card--progress > div { min-width: 0; flex: 1; }

.block { margin-bottom: 26px; }
.block-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.block-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(211, 173, 104, 0.32);
  background: rgba(119, 32, 47, 0.22);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 16px;
}
.block-title { min-width: 0; flex: 1; }
.block-title h2 { font-size: 20px; margin-bottom: 2px; }
.block-title p { color: var(--muted-2); font-size: 12.5px; margin: 0; }
.count { color: var(--muted-2); font-size: 11.5px; flex: none; padding-top: 4px; }

.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(28, 17, 22, 0.66);
  color: var(--cream);
  min-width: 0;
}
.lesson-row:hover { border-color: rgba(211, 173, 104, 0.35); color: var(--cream); }
.lesson-num {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(16, 10, 12, 0.6);
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 650;
}
.lesson-num.is-done { color: var(--ok); border-color: rgba(147, 194, 162, 0.4); background: rgba(147, 194, 162, 0.1); }
.lesson-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lesson-body strong { font-size: 14px; font-weight: 600; }
.lesson-body small { color: var(--muted-2); font-size: 11.5px; line-height: 1.45; }
.lesson-meta { color: var(--muted-2); font-size: 10.5px; flex: none; }

/* ── lección ────────────────────────────────────────────── */
.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.back { color: var(--muted); font-size: 12.5px; }
.back:hover { color: var(--cream); }
.crumb { color: var(--muted-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; }

.card--fact { border-left: 3px solid rgba(147, 194, 162, 0.55); }
.card--opinion { border-left: 3px solid rgba(211, 173, 104, 0.55); }
.card--practice { border-left: 3px solid rgba(162, 50, 74, 0.6); }
.card--principle { background: linear-gradient(160deg, #2a161d, #1a1014); border-color: #4a2a33; }

.ticks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 18px; font-size: 14px; color: var(--cream-dim); }
.ticks li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }

.ordered { margin: 8px 0 12px; padding-left: 20px; color: var(--cream-dim); font-size: 14px; }
.ordered li { margin-bottom: 6px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(16, 10, 12, 0.4);
  font-size: 13px;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.q { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.q:last-of-type { border-bottom: 0; }
.q-title { font-size: 14px; color: var(--cream); margin-bottom: 10px; }
.q-title span { color: var(--gold); font-weight: 700; }

.opts { display: grid; gap: 7px; }
.opts--stack { margin-top: 12px; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(16, 10, 12, 0.42);
  color: var(--cream-dim);
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: rgba(211, 173, 104, 0.4); }
.opt-key {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 1px;
}
.opt.is-correct { border-color: rgba(147, 194, 162, 0.6); background: rgba(147, 194, 162, 0.1); color: #d6ebdc; }
.opt.is-correct .opt-key { border-color: rgba(147, 194, 162, 0.5); color: var(--ok); }
.opt.is-wrong { border-color: rgba(207, 100, 120, 0.6); background: rgba(207, 100, 120, 0.1); color: #f2c6cf; }
.opt.is-best { box-shadow: inset 0 0 0 1px rgba(211, 173, 104, 0.35); }
.opt[aria-disabled="true"] { cursor: default; }
.opt--long { font-size: 13.5px; }

.q-fb { font-size: 12.5px; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.q-fb strong { color: var(--gold-2); }

.flash-list { display: grid; gap: 8px; }
.flash {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(16, 10, 12, 0.4);
  border: 1px solid var(--line-soft);
}
.flash b { font-size: 13px; color: var(--cream); font-weight: 600; }
.flash span { font-size: 12.5px; color: var(--muted); }

.source { margin-top: 12px; color: var(--muted-2); font-size: 11px; line-height: 1.5; }

/* ── hilos ──────────────────────────────────────────────── */
.levels { display: grid; gap: 11px; }
.level-card {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(168deg, rgba(36, 22, 27, 0.9), rgba(22, 13, 16, 0.92));
  color: var(--cream);
  min-width: 0;
}
.level-card:hover { border-color: rgba(211, 173, 104, 0.4); color: var(--cream); }
.level-card.is-locked { opacity: 0.55; }
.level-card.is-locked:hover { border-color: var(--line-soft); }
.level-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-n { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.level-card h3 { margin: 6px 0 3px; font-size: 21px; }
.level-card .muted { margin-bottom: 10px; }
.level-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--muted-2); }

.banner {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid rgba(147, 194, 162, 0.4);
  background: rgba(147, 194, 162, 0.1);
  color: #cfe7d6;
}
.banner a { color: var(--gold-2); }

.challenge-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.challenge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(28, 17, 22, 0.7);
}
.challenge.is-done { border-color: rgba(147, 194, 162, 0.32); background: rgba(147, 194, 162, 0.06); }
.challenge-check {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(16, 10, 12, 0.6);
  color: var(--ok);
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.challenge.is-done .challenge-check { border-color: rgba(147, 194, 162, 0.55); background: rgba(147, 194, 162, 0.14); }
.challenge-body { min-width: 0; flex: 1; }
.challenge-body h3 { font-size: 14.5px; font-family: var(--sans); font-weight: 650; margin-bottom: 2px; }
.challenge-body p { color: var(--muted); font-size: 12.5px; margin: 0; }
.xp { color: var(--muted-2); font-size: 10.5px; flex: none; }

/* ── voz ────────────────────────────────────────────────── */
.card--privacy { border-color: rgba(211, 173, 104, 0.3); background: linear-gradient(160deg, rgba(60, 30, 38, 0.55), rgba(24, 14, 18, 0.94)); }
.card--mic { border-color: rgba(211, 173, 104, 0.2); }
.card--turn { border-color: rgba(211, 173, 104, 0.2); }
.card--summary { border-color: rgba(147, 194, 162, 0.3); }

.alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(207, 100, 120, 0.35);
  background: rgba(207, 100, 120, 0.08);
  color: #efa9b6;
  font-size: 12.5px;
  line-height: 1.5;
}

.voice-list { display: grid; gap: 6px; margin-top: 8px; }
.voice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(16, 10, 12, 0.36);
  color: var(--cream);
}
.voice-row:hover { border-color: rgba(211, 173, 104, 0.35); color: var(--cream); }
.voice-n {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 11.5px;
}
.voice-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.voice-body strong { font-size: 13.5px; font-weight: 600; }
.voice-body small { color: var(--muted-2); font-size: 11.5px; }
.voice-meta { color: var(--muted-2); font-size: 11px; flex: none; }

.turn-prompt {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.38;
  color: var(--cream);
  margin: 4px 0 8px;
}
.turn-hint { color: var(--muted); font-size: 12.5px; border-left: 2px solid rgba(211, 173, 104, 0.4); padding-left: 10px; }
.turn-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }

.meters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; margin: 12px 0 14px; }
.meter { min-width: 0; }
.meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted-2); }
.meter-top b { font-size: 11.5px; color: var(--cream-dim); font-weight: 600; }
.meter .bar { margin-top: 5px; height: 5px; }

.mic-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 8px; }

.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 8, 9, 0.6);
  color: var(--cream);
  padding: 11px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  min-height: 84px;
  margin-bottom: 10px;
}
.textarea:focus { border-color: rgba(211, 173, 104, 0.5); outline: none; }
.textarea--code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: 0.01em; word-break: break-all; }

.notes { margin-top: 14px; display: grid; gap: 8px; }
.note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 10, 12, 0.4);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--cream-dim);
}
.note .tiny { display: block; margin-bottom: 2px; }

.sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 10px; }
.sum { padding: 10px; border-radius: 12px; background: rgba(16, 10, 12, 0.4); border: 1px solid var(--line-soft); min-width: 0; }
.sum span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }
.sum b { font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--gold-2); }

/* ── social ─────────────────────────────────────────────── */
.switch {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(16, 10, 12, 0.6);
  margin-bottom: 14px;
}
.switch-btn {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.switch-btn.is-active { background: linear-gradient(180deg, #ecd3a2, #c99f5c); color: #2a1a12; }
.switch-btn:hover { color: var(--cream); }
.switch-btn.is-active:hover { color: #2a1a12; }

.guia-list { display: grid; gap: 7px; }
.guia-item { border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(28, 17, 22, 0.66); overflow: hidden; }
.guia-item.is-open { border-color: rgba(211, 173, 104, 0.3); background: rgba(36, 22, 27, 0.85); }
.guia-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--cream);
}
.guia-title { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.guia-title strong { font-size: 13.5px; font-weight: 600; }
.guia-plus { color: var(--gold); font-size: 17px; flex: none; line-height: 1; }
.guia-body { padding: 0 12px 13px; }
.guia-body p { font-size: 13px; color: var(--muted); line-height: 1.6; }

.scenarios { display: grid; gap: 11px; }
.scenario {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(168deg, rgba(36, 22, 27, 0.9), rgba(22, 13, 16, 0.92));
  color: var(--cream);
}
.scenario:hover { border-color: rgba(211, 173, 104, 0.4); color: var(--cream); }
.scenario-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.scenario h3 { font-size: 20px; margin-bottom: 6px; }
.scenario .muted { margin-bottom: 10px; }

.progress-dots { display: flex; gap: 6px; margin: 2px 0 14px; }
.dot { height: 4px; flex: 1; border-radius: 999px; background: rgba(246, 236, 220, 0.1); }
.dot.is-done { background: rgba(147, 194, 162, 0.7); }
.dot.is-now { background: var(--gold); }

.feedback { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.feedback p { font-size: 13px; color: var(--cream-dim); margin-bottom: 10px; }
.feedback .tag { margin-right: 4px; }

/* ── repaso ─────────────────────────────────────────────── */
.card--flash { padding: 22px 18px; text-align: center; }
.flash-q { font-family: var(--serif); font-size: 23px; line-height: 1.35; margin: 12px 0 6px; }
.flash-a {
  margin: 14px 0 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(211, 173, 104, 0.28);
  background: rgba(211, 173, 104, 0.07);
  color: var(--cream-dim);
  font-size: 14px;
}
.grades { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.card--flash .btn { margin-top: 8px; }

/* ── progreso ───────────────────────────────────────────── */
.card--xp { border-color: rgba(211, 173, 104, 0.28); background: linear-gradient(160deg, #2b161d, #190f13); }
.xp-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.xp-top h2 { font-size: 34px; margin: 2px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.stat {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(28, 17, 22, 0.7);
  min-width: 0;
}
.stat b { display: block; font-family: var(--serif); font-size: 23px; font-weight: 500; margin: 3px 0 1px; color: var(--cream); }
.stat small { display: block; color: var(--muted-2); font-size: 11px; }

.achievements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.achievements li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(16, 10, 12, 0.35);
  opacity: 0.6;
  min-width: 0;
}
.achievements li.is-on { opacity: 1; border-color: rgba(211, 173, 104, 0.32); background: rgba(211, 173, 104, 0.06); }
.ach-dot {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted-2);
}
.achievements li.is-on .ach-dot { color: var(--gold); border-color: rgba(211, 173, 104, 0.5); }
.achievements b { display: block; font-size: 12.5px; font-weight: 600; }
.achievements small { display: block; color: var(--muted-2); font-size: 10.5px; }

/* ── fuentes ────────────────────────────────────────────── */
.sources { display: grid; gap: 9px; }
.source-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(28, 17, 22, 0.66);
}
.source-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.source-top h3 { font-size: 15px; font-family: var(--sans); font-weight: 650; margin: 0; }
.source-work { color: var(--gold-2); font-size: 12.5px; margin: 3px 0 8px; }
.source-card .body { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.source-card .body b { color: var(--cream-dim); }
.caution { font-size: 12px; color: #d9a5ae; margin: 0; }
.caution b { color: #eebac3; }

/* ── barra de pestañas ──────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18, 11, 14, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(60, 36, 44, 0.6);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -14px 34px -22px #000;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 1px;
  border-radius: 11px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.tab-ico { font-size: 14px; line-height: 1; color: inherit; }
.tab:hover { color: var(--cream-dim); }
.tab[aria-current="page"] { color: var(--cream); background: rgba(211, 173, 104, 0.13); }
.tab[aria-current="page"] .tab-ico { color: var(--gold); }

/* ── avisos ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 60;
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(236, 211, 162, 0.97);
  color: #2a1a12;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  max-width: 620px;
  margin: 20px auto;
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: #f0b7c1;
  background: rgba(207, 100, 120, 0.1);
  font-size: 14px;
}

/* ── responsive ─────────────────────────────────────────── */
@media (min-width: 560px) {
  :root { --pad: 22px; }
  .card { padding: 20px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .achievements { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { font-size: 10.5px; }
  .tab-ico { font-size: 16px; }
  .meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  .tabbar { border-radius: 20px; bottom: 12px; left: 50%; right: auto; margin: 0; transform: translateX(-50%); width: min(720px, calc(100% - 24px)); border: 1px solid rgba(60, 36, 44, 0.6); }
  body { padding-bottom: 110px; }
  .toast { bottom: 104px; }
}

@media (max-width: 359px) {
  .brand-text small { display: none; }
  .chip { padding: 6px 8px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { font-size: 8.2px; padding-left: 0; padding-right: 0; }
  .tab span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text strong { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
