:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface2: #f0f2f7; --border: #e2e6ef;
  --text: #141a2a; --text2: #4a5469; --muted: #6b7489;
  --accent: #1e40af; --accent-soft: #e5ebfb; --accent-text: #ffffff;
  --rojo: #c92a2a; --rojo-soft: #fde8e8; --amarillo: #b45309; --amarillo-soft: #fdf1dc; --verde: #15803d; --verde-soft: #e2f5e8; --bien: #0e7490; --bien-soft: #dff3f8;
  --violet: #6d28d9; --violet-soft: #efe8fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1220; --surface: #151b2c; --surface2: #1c2438; --border: #273049;
    --text: #e8ecf5; --text2: #b3bcd0; --muted: #8590a8;
    --accent: #6d8ff5; --accent-soft: #1f2a4d; --accent-text: #0d1220;
    --rojo: #f27474; --rojo-soft: #3a1c22; --amarillo: #f0b44c; --amarillo-soft: #3a2c15; --verde: #4cc77a; --verde-soft: #15321f; --bien: #4cc3dc; --bien-soft: #12303a;
    --violet: #a98bf5; --violet-soft: #2a2145;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1220; --surface: #151b2c; --surface2: #1c2438; --border: #273049;
  --text: #e8ecf5; --text2: #b3bcd0; --muted: #8590a8;
  --accent: #6d8ff5; --accent-soft: #1f2a4d; --accent-text: #0d1220;
  --rojo: #f27474; --rojo-soft: #3a1c22; --amarillo: #f0b44c; --amarillo-soft: #3a2c15; --verde: #4cc77a; --verde-soft: #15321f; --bien: #4cc3dc; --bien-soft: #12303a;
  --violet: #a98bf5; --violet-soft: #2a2145;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 26px; line-height: 1.2; margin: 2px 0 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 2px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.cap { font-size: 13px; }
.cap::first-letter, .cap1::first-letter { text-transform: uppercase; }
.error { color: var(--rojo); }
code { background: var(--surface2); padding: 1px 5px; border-radius: 5px; }
.ico { flex: none; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: none; position: sticky; top: 0; height: 100vh;
  padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 18px; }
.brand b { display: block; font-size: 15px; }
.brand span { display: block; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text2); font-weight: 500; }
.nav:hover { background: var(--surface2); }
.nav.on { background: var(--accent-soft); color: var(--accent); }
.side-f { margin-top: auto; padding: 8px 10px; }
main { flex: 1; min-width: 0; }
.page { max-width: 980px; margin: 0 auto; padding: 28px 28px 48px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.nav-t { display: flex; gap: 4px; }

.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-transform: capitalize; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.ok i { background: var(--verde); } .sync.bad i { background: var(--rojo); } .sync.mid i { background: var(--amarillo); }

@media (max-width: 760px) {
  .shell { display: block; }
  .side {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: auto; height: auto; z-index: 20;
    flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .brand, .side-f { display: none; }
  .nav { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; min-width: 0; }
  .nav span { white-space: nowrap; }
  .page { padding: 18px 16px 96px; }
  h1 { font-size: 23px; }
}

/* Cards & KPIs */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 18px 0 6px; }
.card .pad { padding: 0 18px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-h h2 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.inner { margin: 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpis.inner .kpi { background: var(--surface2); border: 0; box-shadow: none; }
.k-l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.k-v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.k-v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.k-v.sm { font-size: 20px; }
.k-v.bad { color: var(--rojo); }
.k-s { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid2 > .card, .grid3 > .card { margin: 0; }
.grid3 { margin-bottom: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } .grid2 { gap: 0; } .grid2 > .card { margin-bottom: 16px; } }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  padding: 9px 14px; border-radius: 10px; white-space: nowrap;
}
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.danger { color: var(--rojo); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text2); cursor: pointer; }
.icon-btn:hover { background: var(--surface2); }
.icon-btn.sm { width: 30px; height: 30px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.link:hover { color: var(--accent); }
.note .link { color: var(--accent); font-weight: 600; margin-left: 4px; }
input, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; min-width: 0; width: 100%;
}
input:focus, select:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin: 14px 0 6px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text2); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.inline input { flex: 1 1 140px; width: auto; }
.inline .quick { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text2); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip:hover { background: var(--surface2); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.filters, .days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface2); padding: 3px; border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--text2); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.navs { display: flex; align-items: center; gap: 2px; }

/* Notes, tags, semáforo */
.note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; background: var(--accent-soft); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.note.warn { background: var(--amarillo-soft); }
.note.warn .ico { color: var(--amarillo); }
.hint { font-size: 14px; color: var(--text2); background: var(--surface2); padding: 8px 12px; border-radius: 10px; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: var(--surface2); color: var(--text2); }
.tag.nuevo, .tag.estudio { background: var(--accent-soft); color: var(--accent); }
.tag.repaso { background: var(--violet-soft); color: var(--violet); }
.tag.fisico { background: var(--verde-soft); color: var(--verde); }
.tag.simulacro { background: var(--amarillo-soft); color: var(--amarillo); }
.sem { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text2); }
.sem i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.sem.rojo { color: var(--rojo); } .sem.amarillo { color: var(--amarillo); } .sem.verde { color: var(--verde); }
.sem.vacio { color: var(--muted); font-weight: 500; }
.sem.sm { font-size: 12px; }
.semsel { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sembtn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; }
.sembtn i { width: 10px; height: 10px; border-radius: 50%; }
.sembtn.rojo i { background: var(--rojo); } .sembtn.amarillo i { background: var(--amarillo); } .sembtn.verde i { background: var(--verde); }
.sembtn.rojo.on { background: var(--rojo-soft); border-color: var(--rojo); }
.sembtn.amarillo.on { background: var(--amarillo-soft); border-color: var(--amarillo); }
.sembtn.verde.on { background: var(--verde-soft); border-color: var(--verde); }
.barra { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.barra .fill { height: 100%; border-radius: 99px; }
.fill.rojo { background: var(--rojo); } .fill.amarillo { background: var(--amarillo); } .fill.verde { background: var(--verde); }
.progress { height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; flex: 1; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; }
.due { color: var(--amarillo); font-weight: 600; }
.warn-ico { color: var(--amarillo); vertical-align: -2px; }

/* Hoy */
.choice { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
@media (max-width: 760px) { .choice { grid-template-columns: 1fr; } }
.opt { background: var(--surface2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.opt-h { display: flex; justify-content: space-between; align-items: center; }
.opt-t { font-size: 15px; }
.opt .btn { align-self: flex-start; }
.mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; background: var(--surface); padding: 8px 10px; border-radius: 10px; }
.mini li .muted { grid-row: 2; }
.mini li .btn { grid-row: 1 / span 2; grid-column: 2; }
.pick { display: flex; gap: 8px; }

/* Tareas */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tasks li:last-child { border-bottom: 0; }
.tasks li.done .t-title { text-decoration: line-through; color: var(--muted); }
.chk { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--accent-text); padding: 0; }
.chk.on { background: var(--accent); border-color: var(--accent); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-weight: 500; }
.t-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.addtask { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.addtask input { flex: 2 1 180px; width: auto; }
.addtask select { flex: 1 1 130px; width: auto; }
.tasks.compact li { padding: 5px 0; gap: 6px; font-size: 13px; border: 0; }
.tasks.compact .chk { width: 18px; height: 18px; border-radius: 5px; }
.tasks.compact .icon-btn { display: none; }
.tasks.compact li:hover .icon-btn { display: inline-grid; width: 22px; height: 22px; }

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.wday { background: var(--surface2); border-radius: 12px; padding: 8px; min-height: 140px; display: flex; flex-direction: column; }
.wday.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.wday-h { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--text); padding: 2px 2px 6px; cursor: pointer; text-align: left; }
.wday .empty { margin: 0 2px; }
.qadd { margin-top: auto; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; cursor: pointer; }
.qadd:hover { color: var(--accent); }
.qinput { font-size: 13px; padding: 6px 8px; margin-top: auto; }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .wday { min-height: 0; }
}

/* Mes */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.mh { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.mday { aspect-ratio: 1 / .9; border: 0; background: var(--surface2); border-radius: 10px; display: flex; flex-direction: column; align-items: flex-start; padding: 6px; gap: 2px; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.mday:hover { outline: 1px solid var(--accent); }
.mday.out { opacity: .4; }
.mday.today { outline: 2px solid var(--accent); }
.mnum { font-weight: 700; font-size: 14px; }
.mtasks { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 0 5px; font-weight: 700; }
.mhours { font-size: 11px; color: var(--muted); }
@media (max-width: 520px) { .mday { padding: 4px; } .mhours { display: none; } }

/* Temario */
.tlist { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 36px 1fr 120px; gap: 12px; align-items: center; padding: 10px 18px; color: var(--text); border-top: 1px solid var(--border); }
.trow:hover { background: var(--surface2); }
.tnum { width: 32px; height: 32px; border-radius: 9px; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--text2); }
.trow:hover .tnum { background: var(--surface); }
.tmain { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ttit { font-weight: 600; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.tdom { display: flex; flex-direction: column; gap: 4px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .trow { grid-template-columns: 32px 1fr 64px; gap: 10px; padding: 10px 14px; } .card .pad { padding: 0 14px; } }

.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.hist li:first-child { border-top: 0; }
.hist li a { color: var(--text); }
details summary { cursor: pointer; margin-top: 12px; }

/* Físicas & charts */
.fis-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.chart { width: 100%; height: auto; display: block; margin: 6px 0; overflow: visible; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .bar { fill: var(--accent); opacity: .75; }
.chart .bar.hl { opacity: 1; }
.chart g:hover .bar { opacity: 1; }
.chart .tick { font-size: 10px; fill: var(--muted); }
.hbar { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; margin: 6px 0; }
.hbar .progress, .hbar .barra { margin: 0; }
.hbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.dist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.dist > div { display: flex; justify-content: space-between; align-items: center; background: var(--surface2); padding: 8px 12px; border-radius: 10px; }
.acct { display: flex; align-items: center; gap: 12px; }
.acct img { width: 40px; height: 40px; border-radius: 50%; }
.acct > div { flex: 1; min-width: 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 10, 25, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(460px, 100%); padding: 20px; max-height: 92vh; overflow: auto; border: 1px solid var(--border); }
.modal-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal .seg { width: 100%; }
.modal .seg button { flex: 1; }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rating { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 10px 4px; border-radius: 12px; cursor: pointer; }
.rating .emo { font-size: 24px; }
.rating.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.barchart { margin: 6px 0; }
.chart.bars { height: 160px; border-bottom: 1px solid var(--border); margin: 0; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* v3: registro de estudio, objetivos de vuelta */
textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.seg.three button { padding: 7px 8px; font-size: 13px; }
.self-c { align-self: center; }
.modal .row2 { margin-bottom: 0; }
.modal textarea { margin-bottom: 4px; }
.quedaste { font-size: 14px; background: var(--surface); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.quedaste-card { border-left: 4px solid var(--accent); }
.quedaste-card p { margin: 6px 0 0; font-size: 15px; white-space: pre-wrap; }
.reg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.regbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit; padding: 14px; border-radius: 12px; cursor: pointer; }
.regbtn:hover { border-color: var(--accent); }
.regbtn .ico { color: var(--accent); }
.regbtn span { font-size: 12px; color: var(--muted); }
.regbtn.main { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.regbtn.main .ico, .regbtn.main span { color: var(--accent-text); opacity: .9; }
@media (max-width: 520px) { .reg3 { grid-template-columns: 1fr; } .regbtn { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 10px; } .regbtn span { flex-basis: 100%; padding-left: 30px; margin-top: -4px; } }
.kpi-date { margin: 6px 0 4px; padding: 6px 8px; font-weight: 600; }
.k-s.due { color: var(--amarillo); font-weight: 600; }
.chip .cnt { opacity: .6; margin-left: 2px; }
.hist2 { list-style: none; margin: 0; padding: 0; }
.hist2 li { padding: 8px 0; border-top: 1px solid var(--border); }
.hist2 li:first-child { border-top: 0; }
.h-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.h-date { font-weight: 600; min-width: 52px; }
.h-note { font-size: 14px; color: var(--text2); margin: 4px 0 0 62px; white-space: pre-wrap; }
@media (max-width: 520px) { .h-note { margin-left: 0; } }
.push { margin-left: auto; }
.objs { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-width: 420px; }
.objrow { display: grid; grid-template-columns: 80px 1fr 110px; gap: 10px; align-items: center; }
.toggle { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.hbar span:first-child { line-height: 1.2; }

/* v4: nivel "Bien" y "Sin empezar" */
.sem.bien { color: var(--bien); }
.sem.vacio i { background: transparent; border: 1.5px solid currentColor; }
.sembtn.bien i { background: var(--bien); }
.sembtn.bien.on { background: var(--bien-soft); border-color: var(--bien); }
.sembtn.vacio { color: var(--text2); }
.sembtn.vacio i { border: 1.5px solid var(--muted); background: transparent; }
.sembtn.vacio.on { background: var(--surface2); border-color: var(--muted); }
.dist > a { display: flex; justify-content: space-between; align-items: center; background: var(--surface2); padding: 8px 12px; border-radius: 10px; color: var(--text); }
.dist > a:last-child { grid-column: 1 / -1; }

/* ===== v5: venta (portada, pago, prueba, admin, legal) ===== */
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
a.btn { text-decoration: none; }
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 8px; }
.trial { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: center; background: var(--accent-soft); color: var(--text); padding: 9px 16px; font-size: 14px; text-align: center; }
.trial .link { color: var(--accent); font-weight: 700; }
.onboard ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.onboard li.ok { color: var(--muted); text-decoration: line-through; }
.side-f { display: flex; flex-direction: column; gap: 8px; }
.legal-links { font-size: 12px; color: var(--muted); }
.legal-links a { color: var(--muted); }
@media (max-width: 760px) { .nav.desk { display: none; } }

.landing { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.l-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; }
.l-top .brand { padding: 0; color: var(--text); }
.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; padding: 40px 0 56px; }
.hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.02em; margin: 14px 0; }
.lead { font-size: 18px; color: var(--text2); margin: 0 0 22px; }
.cta { margin-bottom: 10px; }
.pill { display: inline-block; background: var(--verde-soft); color: var(--verde); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; }
.hero-img img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(16, 24, 40, .14); display: block; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 8px 0 56px; }
.feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feat h3 { font-size: 16px; margin: 10px 0 6px; }
.feat p { margin: 0; color: var(--text2); font-size: 14px; }
.f-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.price-wrap { display: grid; place-items: center; padding: 8px 0 56px; }
.price { background: var(--surface); border: 2px solid var(--accent); border-radius: 20px; padding: 28px; width: min(460px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.price h1 { font-size: 26px; }
.p-num { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.price ul { list-style: none; padding: 0; margin: 14px 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.price ul li { display: flex; gap: 8px; align-items: center; }
.price ul li .ico { color: var(--verde); }
.steps { text-align: left; margin: 16px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text2); }
.pay .price .btn.big { margin-top: 10px; }
.faq { max-width: 760px; margin: 0 auto; padding: 0 0 48px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; margin: 0; }
.faq p { margin: 8px 0 0; color: var(--text2); }
.l-foot { border-top: 1px solid var(--border); padding: 22px 0 40px; text-align: center; font-size: 14px; }
.l-foot a { color: var(--text2); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; gap: 28px; }
  .hero h1 { font-size: 30px; }
  .feats { grid-template-columns: 1fr; }
  .landing { padding: 0 16px; }
}
.legal-body { max-width: 760px; margin: 0 auto; padding: 10px 0 40px; }
.legal-body h3 { margin: 22px 0 6px; font-size: 16px; }
.legal-body p, .legal-body li { color: var(--text2); }
mark { background: var(--amarillo-soft); color: var(--amarillo); font-weight: 700; padding: 0 4px; border-radius: 4px; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--text2); }
.badge.pago, .badge.pendiente { background: var(--verde-soft); color: var(--verde); }
.badge.prueba { background: var(--accent-soft); color: var(--accent); }
.badge.caducada { background: var(--amarillo-soft); color: var(--amarillo); }
.badge.admin { background: var(--violet-soft); color: var(--violet); }
.buy { background: var(--surface2); border-radius: 12px; padding: 14px; margin: 10px 0; }
.buy p { margin: 0 0 10px; }
.search { max-width: 260px; }
.ulist { display: flex; flex-direction: column; }
.urow { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px 16px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.u-main, .u-est { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.u-main b { overflow: hidden; text-overflow: ellipsis; }
.u-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .urow { grid-template-columns: 1fr; } .u-act { justify-content: flex-start; } .search { max-width: none; } }
.l-top .brand { display: flex; }
.price .btn.big + .muted { margin-top: 6px; }
.oferta { display: inline-block; background: var(--amarillo-soft); color: var(--amarillo); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; }
.p-antes { font-size: 22px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.oferta-pill { background: var(--amarillo-soft); color: var(--amarillo); }
