/* ============ El Cuaderno de Marta — estilos ============ */

:root {
  --bg: #FFF8F4;
  --card: #FFFFFF;
  --card2: #FBF5F8;
  --ink: #3B3350;
  --ink2: #6C6383;
  --muted: #9C94AC;
  --line: #F0E6EE;
  --accent: #9F86E8;
  --accent-ink: #5E45B5;
  --accent-soft: #EFE9FD;
  --accent2: #EE84AC;
  --pink: #EE84AC;
  --pink-soft: #FDE8F0;
  --peach-soft: #FEEEE2;
  --mint-soft: #E2F5ED;
  --sky-soft: #E5F0FC;
  --butter-soft: #FBF2D9;
  --danger: #C2456A;
  --shadow: 0 1px 2px rgba(80, 55, 110, .05), 0 8px 24px rgba(80, 55, 110, .07);
  --shadow-lg: 0 10px 40px rgba(80, 55, 110, .18);
  --hero: linear-gradient(135deg, #EDE3FC 0%, #FADDEA 55%, #FEE9D8 100%);
  --tabbar: rgba(255, 251, 253, .88);
  --btn-shadow: 0 6px 16px rgba(159, 134, 232, .35);
  --logo-shadow: rgba(150, 100, 200, .3);
  --r: 22px;
  --r-sm: 14px;

  /* rampa secuencial (nº de vueltas: 0 → 6) */
  --s0: #EEEAF3; --s1: #DACEFA; --s2: #C2AEF4; --s3: #A98EEB; --s4: #8F70DC; --s5: #7556C6; --s6: #5B3FA7;
  /* prioridades */
  --p1: #BFE5D3; --p2: #F6DD9B; --p3: #F7B98F; --p4: #EE8FA6;
  --p1-ink: #2F6B52; --p2-ink: #7A5A0E; --p3-ink: #8A4419; --p4-ink: #8E2445;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1B1722;
  --card: #26202F;
  --card2: #2D2638;
  --ink: #F2EDF8;
  --ink2: #C3BAD2;
  --muted: #8E85A0;
  --line: #3A3247;
  --accent: #B7A1F3;
  --accent-ink: #D8CBFF;
  --accent-soft: #352B4D;
  --accent2: #F08FB5;
  --pink: #F08FB5;
  --pink-soft: #43293A;
  --peach-soft: #43322A;
  --mint-soft: #233A33;
  --sky-soft: #24324A;
  --butter-soft: #3D3522;
  --danger: #FF8FB0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: linear-gradient(135deg, #3A2E58 0%, #4A2C44 55%, #4A3428 100%);
  --tabbar: rgba(32, 27, 40, .9);
  --btn-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  --logo-shadow: rgba(0, 0, 0, .45);

  --s0: #332C3E; --s1: #45396B; --s2: #574591; --s3: #6E58B4; --s4: #8A72D2; --s5: #A892E8; --s6: #CBB9FF;
  --p1: #2F5E4B; --p2: #66561F; --p3: #77452A; --p4: #7A3046;
  --p1-ink: #BDEBD7; --p2-ink: #F8E3A6; --p3-ink: #FAC9A6; --p4-ink: #FFC0D0;

  color-scheme: dark;
}

/* Paletas de colores (la de arriba es «Lavanda»). Cada una redefine las mismas variables en claro y en oscuro. */
/* «Granate»: granate y dorado, como el logo del libro */
[data-paleta="granate"] {
  --bg: #FAF6F3;
  --card: #FFFFFF;
  --card2: #F8F1EF;
  --ink: #3A2229;
  --ink2: #6E5158;
  --muted: #A38B91;
  --line: #EFE3E1;
  --accent: #7D3046;
  --accent-ink: #6A2738;
  --accent-soft: #F5E7EA;
  --accent2: #CDA24F;
  --pink: #B4566F;
  --pink-soft: #F8E6EA;
  --peach-soft: #F8EDE4;
  --mint-soft: #E6F2EC;
  --sky-soft: #E8EEF6;
  --butter-soft: #F7EFDB;
  --danger: #B23A55;
  --gold: #9C7426;
  --shadow: 0 1px 2px rgba(70, 30, 40, .05), 0 8px 24px rgba(70, 30, 40, .07);
  --shadow-lg: 0 10px 40px rgba(70, 30, 40, .18);
  --hero: linear-gradient(135deg, #F4E4E6 0%, #F7EAE3 55%, #F6EBD6 100%);
  --tabbar: rgba(252, 249, 247, .9);
  --btn-shadow: 0 6px 16px rgba(106, 39, 56, .28);
  --logo-shadow: rgba(106, 39, 56, .3);
  --s0: #F1E9EA; --s1: #E8CDD3; --s2: #D7A7B3; --s3: #C07D8F; --s4: #A2566D; --s5: #84384F; --s6: #66243A;
}
[data-paleta="granate"][data-theme="dark"] {
  --bg: #191113;
  --card: #241A1D;
  --card2: #2C2024;
  --ink: #F6EDEB;
  --ink2: #CDB8BC;
  --muted: #94797F;
  --line: #3B2A2F;
  --accent: #B35470;
  --accent-ink: #F2C4D0;
  --accent-soft: #3F2530;
  --accent2: #D9B567;
  --pink: #E58FA8;
  --pink-soft: #452630;
  --peach-soft: #42312A;
  --mint-soft: #22372F;
  --sky-soft: #232F42;
  --butter-soft: #3B3322;
  --danger: #FF8FA8;
  --gold: #D9B567;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: linear-gradient(135deg, #3F2028 0%, #45262B 55%, #433524 100%);
  --tabbar: rgba(30, 22, 25, .9);
  --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  --logo-shadow: rgba(0, 0, 0, .45);
  --s0: #34262A; --s1: #522D39; --s2: #703C4D; --s3: #925066; --s4: #B26A80; --s5: #CC8CA0; --s6: #E9B6C5;
}
/* «Rosa», «Salvia» y «Azul»: la rampa de vueltas sale del color principal */
[data-paleta="rosa"] {
  --bg: #FFF7F9; --card2: #FDF0F5; --ink: #40283A; --ink2: #725468; --muted: #A88FA0; --line: #F4E2EA;
  --accent: #DB6A9B; --accent-ink: #A93F70; --accent-soft: #FCE7F0; --accent2: #F2A1BE;
  --pink: #DB6A9B; --pink-soft: #FDE8F0;
  --shadow: 0 1px 2px rgba(120, 50, 80, .05), 0 8px 24px rgba(120, 50, 80, .07);
  --shadow-lg: 0 10px 40px rgba(120, 50, 80, .18);
  --hero: linear-gradient(135deg, #FBE1EC 0%, #FDE8EE 55%, #FEEDE3 100%);
  --tabbar: rgba(255, 250, 252, .9);
  --btn-shadow: 0 6px 16px rgba(219, 106, 155, .32); --logo-shadow: rgba(170, 70, 120, .28);
  --s0: #F4E8EE;
}
[data-paleta="rosa"][data-theme="dark"] {
  --bg: #1E1519; --card2: #32242B; --ink: #F8ECF1; --ink2: #D2B8C5; --muted: #9A8190; --line: #43303A;
  --accent: #E57BA8; --accent-ink: #FFC2DA; --accent-soft: #4A2738; --accent2: #F7A9C6;
  --pink: #F08FB5; --pink-soft: #452630;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: linear-gradient(135deg, #4A2638 0%, #4A2A35 55%, #4A3329 100%);
  --tabbar: rgba(36, 25, 31, .9);
  --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35); --logo-shadow: rgba(0, 0, 0, .45);
  --s0: #3A2A33;
  --card: #2A1E24;
}
[data-paleta="salvia"] {
  --bg: #F6F8F4; --card2: #EFF4EE; --ink: #263A2E; --ink2: #53695B; --muted: #8EA194; --line: #E2EAE2;
  --accent: #5E9470; --accent-ink: #3D6B4D; --accent-soft: #E4F0E6; --accent2: #A9CDB3;
  --pink: #D58A8A; --pink-soft: #F8E9E6;
  --shadow: 0 1px 2px rgba(40, 70, 50, .05), 0 8px 24px rgba(40, 70, 50, .07);
  --shadow-lg: 0 10px 40px rgba(40, 70, 50, .18);
  --hero: linear-gradient(135deg, #E2EFE4 0%, #EDF3E8 55%, #F5F0DF 100%);
  --tabbar: rgba(250, 252, 249, .9);
  --btn-shadow: 0 6px 16px rgba(94, 148, 112, .32); --logo-shadow: rgba(60, 100, 75, .28);
  --s0: #E8EEE9;
}
[data-paleta="salvia"][data-theme="dark"] {
  --bg: #131A16; --card2: #232F28; --ink: #EAF2EC; --ink2: #B8CABD; --muted: #7F9487; --line: #2F3D34;
  --accent: #74AD86; --accent-ink: #BFE3C9; --accent-soft: #24382B; --accent2: #A8D4B5;
  --pink: #E7A1A1; --pink-soft: #3E2B2B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: linear-gradient(135deg, #22382B 0%, #263A30 55%, #3A3826 100%);
  --tabbar: rgba(22, 30, 25, .9);
  --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35); --logo-shadow: rgba(0, 0, 0, .45);
  --s0: #2A352E;
  --card: #1C2620;
}
[data-paleta="azul"] {
  --bg: #F5F8FC; --card2: #EEF3FA; --ink: #1F2B3D; --ink2: #4E5D73; --muted: #8D99AB; --line: #E1E8F2;
  --accent: #4A78C2; --accent-ink: #2C548F; --accent-soft: #E4EDFA; --accent2: #7FB2E5;
  --pink: #E07A9A; --pink-soft: #FBE8EE;
  --shadow: 0 1px 2px rgba(30, 50, 90, .05), 0 8px 24px rgba(30, 50, 90, .07);
  --shadow-lg: 0 10px 40px rgba(30, 50, 90, .18);
  --hero: linear-gradient(135deg, #E3ECFA 0%, #E8F1FB 55%, #F1EEFA 100%);
  --tabbar: rgba(250, 252, 255, .9);
  --btn-shadow: 0 6px 16px rgba(74, 120, 194, .32); --logo-shadow: rgba(40, 80, 150, .28);
  --s0: #E7ECF4;
}
[data-paleta="azul"][data-theme="dark"] {
  --bg: #121822; --card2: #222C3B; --ink: #EAF0F8; --ink2: #B5C2D4; --muted: #7D8BA0; --line: #2E3A4C;
  --accent: #6F9BE0; --accent-ink: #C4D8FA; --accent-soft: #22324D; --accent2: #8FC3F0;
  --pink: #F08FB5; --pink-soft: #43293A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --hero: linear-gradient(135deg, #1F3150 0%, #22344C 55%, #33304E 100%);
  --tabbar: rgba(20, 27, 38, .9);
  --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35); --logo-shadow: rgba(0, 0, 0, .45);
  --s0: #2A3445;
  --card: #1B2330;
}
:is([data-paleta="rosa"], [data-paleta="salvia"], [data-paleta="azul"]) {
  --s1: color-mix(in oklab, var(--accent) 40%, var(--s0));
  --s2: color-mix(in oklab, var(--accent) 57%, var(--s0));
  --s3: color-mix(in oklab, var(--accent) 72%, var(--s0));
  --s4: color-mix(in oklab, var(--accent) 86%, var(--s0));
  --s5: var(--accent);
  --s6: color-mix(in oklab, var(--accent) 45%, var(--accent-ink));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 28px; height: 28px; }
.ic.fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ---------- barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--tabbar);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px 5px; border-radius: 16px; min-width: 0;
  color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: -.01em;
  transition: background .2s, color .2s;
}
.tabbar a.on { color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- cabeceras ---------- */
.hero {
  background: var(--hero);
  border-radius: 28px;
  padding: 20px 20px 22px;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, .35);
}
[data-theme="dark"] .hero::after { background: rgba(255, 255, 255, .05); }
.hero-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.logo { width: 46px; height: 46px; border-radius: 14px; flex: none; box-shadow: 0 4px 14px var(--logo-shadow); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.hero h1 { font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.hero .greet { margin-top: 14px; font-size: 17px; font-weight: 700; position: relative; z-index: 1; }
.hero .date { color: var(--ink2); font-size: 14px; position: relative; z-index: 1; }

.ptitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 16px; }
.ptitle h1 { font-size: 28px; font-weight: 800; letter-spacing: -.015em; line-height: 1.1; }
.ptitle p { color: var(--ink2); font-size: 14px; margin-top: 4px; }

/* ---------- tarjetas ---------- */
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card.tint { background: var(--tint); box-shadow: none; }
.card h2 { font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h2 .ic { color: var(--accent); }
.card .sub { color: var(--ink2); font-size: 13.5px; margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.link { color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.grid2 > * { min-width: 0; }
.grid2 .card { margin-bottom: 0; }

/* botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  font-weight: 800; font-size: 15px; white-space: nowrap;
  background: var(--accent); color: #fff;
  box-shadow: var(--btn-shadow);
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink2); box-shadow: none; border: 1.5px solid var(--line); }
.btn.pink { background: var(--pink); box-shadow: 0 6px 16px rgba(238, 132, 172, .35); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid currentColor; box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
[data-theme="dark"] .btn:not(.soft):not(.ghost):not(.danger) { color: #1B1722; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink2);
}
.iconbtn[disabled], .iconbtn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ---------- inicio ---------- */
.countdown { display: flex; align-items: center; gap: 16px; }
.countdown .big { font-size: 40px; font-weight: 900; line-height: 1; color: var(--accent-ink); letter-spacing: -.02em; }
.countdown .lbl { font-weight: 700; }
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { width: 118px; height: 118px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .val b { font-size: 26px; font-weight: 900; line-height: 1; }
.ring .val span { font-size: 11.5px; color: var(--ink2); font-weight: 600; margin-top: 3px; }
.minis { display: grid; gap: 10px; flex: 1; }
.mini { display: flex; align-items: center; gap: 10px; }
.mini .dot { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.mini b { font-size: 17px; font-weight: 800; display: block; line-height: 1.1; }
.mini span { font-size: 12.5px; color: var(--ink2); }

.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }

.next-card { display: flex; align-items: center; gap: 14px; background: var(--tint); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.next-card .tnum { width: 48px; height: 48px; font-size: 17px; }

/* ---------- listas de temas ---------- */
.tlist { display: grid; gap: 10px; }
.trow {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border-radius: 18px; padding: 13px 14px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--c);
}
.trow:active { transform: scale(.99); }
.tnum {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: var(--tint); color: var(--cink); font-weight: 900; font-size: 15px; line-height: 1;
}
.tnum small { font-size: 9px; font-weight: 800; opacity: .8; margin-bottom: 2px; }
.ttitle { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 7px; }
.vdots { display: inline-flex; gap: 3px; }
.vdots i { width: 9px; height: 9px; border-radius: 50%; background: var(--s0); display: block; }
.vdots i.on { background: var(--c); }
.ptag { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.pt1 { background: var(--p1); color: var(--p1-ink); }
.pt2 { background: var(--p2); color: var(--p2-ink); }
.pt3 { background: var(--p3); color: var(--p3-ink); }
.pt4 { background: var(--p4); color: var(--p4-ink); }
.estmini { display: inline-flex; gap: 3px; }
.estmini span { font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--card2); color: var(--muted); }
.estmini span.on { background: var(--mint-soft); color: #2F7D5C; }
[data-theme="dark"] .estmini span.on { color: #9EE6C5; }
.why { font-size: 12px; color: var(--ink2); font-weight: 600; }

/* bloques */
.blist { display: grid; gap: 12px; }
.bcard {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.bcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c); }
.broman {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: var(--tint); color: var(--cink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; font-family: Georgia, "Times New Roman", serif;
}
.bcard h3 { font-size: 15.5px; font-weight: 800; line-height: 1.25; }
.bcard p { font-size: 13px; color: var(--ink2); margin: 2px 0 8px; }
.bpct { font-weight: 900; font-size: 17px; color: var(--cink); min-width: 46px; text-align: right; }
.track { height: 9px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 99px; background: var(--c); min-width: 0; transition: width .5s ease; }

/* buscador y filtros */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 16px; padding: 0 14px; height: 50px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }
.search .ic { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 700;
  background: var(--card); color: var(--ink2); box-shadow: var(--shadow); white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--bg); }
.chip .n { opacity: .6; margin-left: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-weight: 600; }
.empty .ic { width: 40px; height: 40px; color: var(--accent); margin-bottom: 8px; }
mark { background: var(--butter-soft); color: inherit; border-radius: 4px; padding: 0 2px; }

/* cabecera de bloque */
.bhero { background: var(--tint); border-radius: 28px; padding: 18px; margin-bottom: 16px; }
.bhero .eyebrow { color: var(--cink); }
.bhero h1 { font-size: 23px; font-weight: 800; line-height: 1.2; margin: 4px 0 12px; }
.bstats { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.bstats div b { font-size: 19px; font-weight: 900; display: block; line-height: 1.1; }
.bstats div span { font-size: 12px; color: var(--ink2); font-weight: 600; }
.bhero .track { background: rgba(255, 255, 255, .65); height: 11px; }
[data-theme="dark"] .bhero .track { background: rgba(0, 0, 0, .25); }

details.notes { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
details.notes summary { list-style: none; padding: 14px 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; cursor: pointer; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
details.notes[open] summary .chev { transform: rotate(90deg); }
details.notes .inner { padding: 0 16px 16px; }

/* ---------- ficha de tema ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  margin: calc(-14px - env(safe-area-inset-top)) -16px 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .back { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--cink); font-size: 15px; min-height: 42px; }
.topbar .pos { margin-left: auto; font-size: 13px; color: var(--ink2); font-weight: 700; }
.thero { background: var(--tint); border-radius: 28px; padding: 20px; margin-bottom: 14px; }
.thero .eyebrow { color: var(--cink); }
.thero h1 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; margin: 2px 0 10px; }
.thero .txt { font-size: 16px; font-weight: 600; line-height: 1.5; }
.thero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: rgba(255, 255, 255, .7); color: var(--ink2); }
[data-theme="dark"] .pill { background: rgba(0, 0, 0, .22); }

.label { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg button {
  min-height: 44px; border-radius: 14px; font-weight: 800; font-size: 13.5px;
  background: var(--card2); color: var(--ink2); border: 2px solid transparent;
  transition: transform .12s;
}
.seg button:active { transform: scale(.96); }
.seg button.on.pt1 { background: var(--p1); color: var(--p1-ink); }
.seg button.on.pt2 { background: var(--p2); color: var(--p2-ink); }
.seg button.on.pt3 { background: var(--p3); color: var(--p3-ink); }
.seg button.on.pt4 { background: var(--p4); color: var(--p4-ink); }
.seg button:not(.on) { background: var(--card2); color: var(--ink2); }

.estados { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.est {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 12px; border-radius: 16px; background: var(--card2);
  font-weight: 800; font-size: 14px; color: var(--ink2); min-height: 56px;
  transition: transform .12s, background .2s;
}
.est:active { transform: scale(.96); }
.est .box { width: 30px; height: 30px; border-radius: 10px; border: 2.5px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent; background: var(--card); flex: none; }
.est-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.est.on { background: var(--mint-soft); color: #2B7355; }
[data-theme="dark"] .est.on { color: #A7EBCB; }
.est.on .box { background: #4FBF95; border-color: #4FBF95; color: #fff; }
.est small { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 2px; }

.vueltas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vt {
  position: relative;
  padding: 12px 10px 10px; border-radius: 16px; background: var(--card2);
  text-align: left; min-height: 74px;
  border: 2px dashed var(--line);
  transition: transform .12s, background .2s;
}
.vt:active { transform: scale(.96); }
.vt b { font-size: 18px; font-weight: 900; display: block; line-height: 1; }
.vt span { font-size: 12px; color: var(--muted); font-weight: 700; display: block; margin-top: 8px; }
.vt .ck { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent; }
.vt.on { background: var(--tint); border: 2px solid transparent; }
.vt.on b { color: var(--cink); }
.vt.on span { color: var(--ink2); }
.vt.on .ck { background: var(--c); border-color: var(--c); color: #fff; }
.vt.next { border-color: var(--c); border-style: dashed; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; font-weight: 600; }
.review-note { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--butter-soft); font-size: 13.5px; font-weight: 600; }
.review-note.ok { background: var(--mint-soft); }

.note { border-radius: var(--r); padding: 14px 16px 10px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); border-top: 4px solid var(--nc, var(--line)); }
.note .label { margin-bottom: 4px; }
.note .label .saved { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 700; opacity: 0; transition: opacity .3s; }
.note .label .saved.show { opacity: 1; }
textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent;
  font-size: 15.5px; line-height: 1.6; min-height: 72px; padding: 4px 0;
  background-image: repeating-linear-gradient(transparent, transparent calc(1.6em - 1px), var(--line) calc(1.6em - 1px), var(--line) 1.6em);
  background-attachment: local;
}
textarea::placeholder { color: var(--muted); }
.navbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.navbtns a { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; color: var(--ink2); font-weight: 600; }
.navbtns a b { color: var(--ink); font-size: 15px; display: flex; align-items: center; gap: 4px; }
.navbtns a.r { text-align: right; align-items: flex-end; }

/* ---------- estadísticas ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kpi { border-radius: var(--r); padding: 16px; background: var(--kbg); }
.kpi .ic { color: var(--kfg); margin-bottom: 8px; }
.kpi b { font-size: 26px; font-weight: 900; display: block; line-height: 1.05; letter-spacing: -.01em; }
.kpi b small { font-size: 14px; font-weight: 800; color: var(--ink2); }
.kpi span { font-size: 12.5px; color: var(--ink2); font-weight: 700; }

.hbars { display: grid; gap: 14px; }
.hbar .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.hbar .top b { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar .top b i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.hbar .top span { font-size: 13px; color: var(--ink2); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar .track { height: 12px; }

.cols { display: flex; align-items: flex-end; gap: 8px; box-sizing: content-box; height: 130px; border-bottom: 1.5px solid var(--line); padding-top: 20px; position: relative; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.col .cb { width: 100%; max-width: 38px; border-radius: 6px 6px 0 0; position: relative; transition: height .5s ease; }
.col .cv { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.xlabels { display: flex; gap: 8px; margin-top: 6px; }
.xlabels span { flex: 1; text-align: center; font-size: 11.5px; color: var(--ink2); font-weight: 700; }

.stack { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; margin: 4px 0 14px; }
.stack span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.legend div { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: block; }
.legend b { color: var(--ink); }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--s0); display: block; }
.heat i.l1 { background: var(--s1); } .heat i.l2 { background: var(--s2); } .heat i.l3 { background: var(--s4); } .heat i.l4 { background: var(--s6); }
.heat i.future { background: transparent; }
.heat i.today { outline: 2px solid var(--pink); outline-offset: 1px; }
.heat-legend { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink2); font-weight: 700; margin-top: 8px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.months { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink2); font-weight: 700; margin-bottom: 4px; }

.bigstat { font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; }
.proj { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--sky-soft); font-size: 14px; font-weight: 600; line-height: 1.45; }
.proj.warn { background: var(--peach-soft); }
.proj.ok { background: var(--mint-soft); }

.weak a { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.weak a:first-child { border-top: 0; }
.weak .tnum { width: 34px; height: 34px; font-size: 13px; border-radius: 11px; }
.weak p { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.weak small { display: block; font-size: 12px; color: var(--ink2); }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; min-width: 340px; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.tbl th, .tbl td { padding: 7px 3px; white-space: nowrap; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--ink2); font-weight: 800; font-size: 12px; }
.toggle-tbl { font-size: 13px; font-weight: 700; color: var(--accent-ink); margin-top: 10px; }

/* ---------- ajustes ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 800; color: var(--ink2); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card2); outline: 0; font-size: 16px;
}
.input:focus { border-color: var(--accent); }
/* 16px evita que iOS haga zoom al tocar el campo */
input[type="date"].input { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; padding-right: 8px; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
select.input { -webkit-appearance: none; appearance: none; text-overflow: ellipsis; }
textarea.input { background-image: none; min-height: 96px; line-height: 1.5; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg3 button { min-height: 44px; border-radius: 14px; background: var(--card2); font-weight: 800; font-size: 14px; color: var(--ink2); }
.seg3 button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent); }
.info { padding: 12px 14px; border-radius: 14px; background: var(--sky-soft); font-size: 13.5px; line-height: 1.5; font-weight: 600; margin-bottom: 14px; }
.info.warn { background: var(--peach-soft); }
.code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 24px; font-weight: 800; letter-spacing: .08em;
  text-align: center; padding: 14px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink);
  -webkit-user-select: all; user-select: all;
}
.code-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .1em; text-align: center; font-size: 20px; }
.sync-status { font-size: 13.5px; font-weight: 700; color: var(--ink2); margin-top: 4px; }
.syncline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink2); position: relative; z-index: 1; }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 20px 0 0; line-height: 1.6; }

/* ---------- semáforo ---------- */
.sem { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.sem.d0 { background: #E46F8E; }
.sem.d1 { background: #E2B13A; }
.sem.d2 { background: #4FBF95; }
.sem-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sem-btns button { min-height: 52px; border-radius: 14px; background: var(--card2); color: var(--ink2); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s; }
.sem-btns button:active { transform: scale(.96); }
.sem-btns button.on.d2 { background: var(--p1); color: var(--p1-ink); }
.sem-btns button.on.d1 { background: var(--p2); color: var(--p2-ink); }
.sem-btns button.on.d0 { background: var(--p4); color: var(--p4-ink); }
.sheet .sem-btns button:not(.on) { background: var(--card2); }
/* mapa del temario */
.semcard { display: block; margin-top: 20px; }
.semcard .legend { margin-bottom: 4px; }
.semb { margin-top: 12px; }
.semb p { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink2); margin-bottom: 6px; }
.semb p i, .semb-h i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; }
.semg { display: grid; grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); gap: 3px; }
.sq { aspect-ratio: 1; border-radius: 4px; background: var(--s0); padding: 0; }
.sq.d0 { background: #E46F8E; }
.sq.d1 { background: #E2B13A; }
.sq.d2 { background: #4FBF95; }
/* el mapa grande: 10 por fila y con el número, para encontrar cada tema sin contar */
.semb.big { margin: 0 0 14px; scroll-margin-top: 76px; }
.semb-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.semb-h b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; }
.semb-h span { font-size: 12.5px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.semg.big { grid-template-columns: repeat(10, minmax(0, 46px)); gap: 5px; }
.semg.big .sq { border-radius: 8px; font-size: 13px; font-weight: 800; color: var(--ink2); display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; transition: transform .12s; }
.semg.big .sq:active { transform: scale(.9); }
.semg.big .sq.d0, .semg.big .sq.d1, .semg.big .sq.d2 { color: rgba(30, 20, 40, .72); }
.chip-b { background: var(--tint); color: var(--cink); }
/* colorear por vueltas */
.semg.big .sq.v1 { background: var(--s1); }
.semg.big .sq.v2 { background: var(--s2); }
.semg.big .sq.v3 { background: var(--s3); color: #fff; }
.semg.big .sq.v4 { background: var(--s4); color: #fff; }
.semg.big .sq.v5 { background: var(--s5); color: #fff; }
.semg.big .sq.v6 { background: var(--s6); color: #fff; }
/* marcar varios a la vez */
.semg.big .sq.sel { box-shadow: inset 0 0 0 3px var(--ink); transform: scale(.92); }
.selb { display: flex; gap: 14px; }
.selb .link { font-size: 13px; }
.selbar {
  position: fixed; left: 0; right: 0; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 25;
  width: calc(100% - 32px); max-width: 528px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 99px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 800; font-size: 14px;
}
.selbar span { flex: 1; min-width: 0; }
.selbar .btn.ghost { color: var(--bg); border-color: rgba(255, 255, 255, .35); }
.vsel { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.vsel button { min-height: 44px; border-radius: 12px; background: var(--card2); color: var(--ink2); font-weight: 900; font-size: 16px; }
.vsel button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent); }

/* Días de los avisos */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.days button { min-height: 44px; border-radius: 12px; background: var(--card2); color: var(--ink2); font-weight: 900; font-size: 15px; }
.days button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- sorteo ---------- */
.sorteo { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.sorteo-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 12px; }
.sorteo-top > b:first-child { font-size: 15.5px; font-weight: 900; }
.sorteo-top span { flex: 1 1 150px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.sorteo-p { margin-left: auto; font-size: 28px; font-weight: 900; color: var(--accent-ink); letter-spacing: -.01em; line-height: 1; }

/* ---------- entrada y cuenta ---------- */
body.nologin .tabbar { display: none; }
.login { min-height: calc(100vh - 140px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px 6px; }
.login-logo { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 10px 30px var(--logo-shadow); margin-bottom: 22px; }
.login h1 { font-size: 28px; font-weight: 900; letter-spacing: -.015em; }
.login-sub { color: var(--ink2); font-size: 15.5px; line-height: 1.5; margin: 10px 0 28px; max-width: 340px; }
.btn.big { min-height: 56px; font-size: 17px; }
.gbtn { background: #fff; color: #3C4043; border: 1.5px solid var(--line); box-shadow: var(--shadow); max-width: 360px; }
[data-theme="dark"] .gbtn { color: #3C4043; }
.gbtn .gg { width: 22px; height: 22px; }
.acct { display: flex; align-items: center; gap: 12px; }
.acct-av { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 900; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.acct b { display: block; font-size: 15px; }
.acct .grow > span { display: block; font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }

/* ---------- controles ---------- */
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg2 button { min-height: 44px; border-radius: 14px; background: var(--card2); font-weight: 800; font-size: 14px; color: var(--ink2); }
.seg2 button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent); }
.step { width: 36px; height: 36px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 18px; font-weight: 800; color: var(--cink, var(--accent-ink)); display: flex; align-items: center; justify-content: center; line-height: 1; flex: none; }
.step[disabled] { opacity: .35; pointer-events: none; }
.stepval { min-width: 52px; text-align: center; font-size: 20px; font-weight: 900; }

/* ---------- hoja inferior, tooltip, toast ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(40, 25, 60, .35); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: up .25s cubic-bezier(.2, .9, .3, 1);
  max-height: 88vh; overflow-y: auto;
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-size: 19px; font-weight: 900; margin-bottom: 4px; }
.sheet p.sub { color: var(--ink2); font-size: 14px; margin-bottom: 16px; }
.sheet .btnrow { margin-top: 6px; }
/* Tutorial de instalación en iPhone y Android. */
.install { text-align: center; }
.install-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 18px var(--logo-shadow); margin: 4px auto 12px; display: block; }
.install .sub { margin-bottom: 18px; }
.install .info { text-align: left; }
.install-platform { margin-bottom: 14px; }
.install-progress { display: flex; justify-content: center; gap: 6px; margin: 20px 0 14px; }
.install-progress span { width: 36px; height: 5px; border-radius: 8px; background: var(--line); }
.install-progress span.on { background: var(--accent); }
.install-step { background: var(--card2); border-radius: 20px; padding: 22px 18px; margin-bottom: 18px; }
.install-symbol { display: inline-flex; padding: 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.install-symbol .ic { width: 30px; height: 30px; }
.install-step .eyebrow { color: var(--ink2); font-size: 12px; margin-bottom: 6px; }
.install-step h4 { font-size: 18px; margin: 0 0 10px; }
.install-step p:last-child { color: var(--ink2); font-size: 14px; line-height: 1.6; }
.install .btnrow { justify-content: center; }
.install-later { margin: 14px 0 4px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

#tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 700;
  padding: 7px 10px; border-radius: 10px; max-width: 220px; line-height: 1.35;
  box-shadow: var(--shadow-lg); white-space: pre-line;
}
#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 70; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 99px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); text-align: center;
  animation: fade .2s;
}

[hidden] { display: none !important; }

/* Netlify inyecta un aviso fijo abajo a la derecha que tapa la barra de pestañas */
#nl-badge-frame, #nl-hud-frame { display: none !important; }

@media (min-width: 600px) {
  .vueltas { grid-template-columns: repeat(6, 1fr); }
  .estados { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- aspecto: logo, colores, estadísticas ---------- */
.logos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logo-opt { display: flex; justify-content: center; padding: 14px; border-radius: 18px; background: var(--card2); }
.logo-opt img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 4px 14px var(--logo-shadow); }
.logo-opt.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2.5px var(--accent); }
.paletas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px; color: var(--ink2); min-width: 0; }
.pal i { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.pal small { font-size: 11.5px; font-weight: 700; }
.pal.on { background: var(--accent-soft); color: var(--accent-ink); }
.pal.on i { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--accent); }
.seg3.ej button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 6px 2px; font-size: 13px; }
.seg3.ej small { font-size: 11.5px; font-weight: 600; opacity: .85; }
body.nostats .tabbar a[data-tab="stats"] { display: none; }

/* ---------- bienvenida ---------- */
body.wizard .tabbar { display: none; }
.bv { padding-top: 4px; }
.bv-top { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 16px; }
.bv-dots { display: flex; gap: 6px; }
.bv-dots i { width: 26px; height: 6px; border-radius: 99px; background: var(--line); }
.bv-dots i.done { background: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.bv-dots i.on { background: var(--accent); }
.bv > .eyebrow { margin: 0 2px 6px; color: var(--accent-ink); }
.bv-h { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 0 2px 8px; }
.bv-sub { color: var(--ink2); font-size: 15px; line-height: 1.45; margin: 0 2px 16px; }
.bv-nav { position: sticky; bottom: 0; display: flex; gap: 10px; margin-top: 18px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.bv-nav .btn { flex: 1; }
.opts { display: grid; gap: 10px; }
.opt { display: block; width: 100%; text-align: left; padding: 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.opt b { display: block; font-size: 16px; font-weight: 800; }
.opt small { display: block; color: var(--ink2); font-size: 13.5px; font-weight: 600; margin-top: 3px; }
.opt.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2.5px var(--accent); }
.opt.on b { color: var(--accent-ink); }
.bvb { padding: 16px; }
.bvb-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bvb-h i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.bvb-h b { flex: 1; font-size: 15.5px; font-weight: 800; }
.bvb-h span { color: var(--muted); font-size: 13px; font-weight: 700; }
.bvb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.bvb-row > span { font-size: 14px; font-weight: 700; color: var(--ink2); }
.bvb-row .row { gap: 6px; flex: none; }
.bvb input.stepval { width: 58px; min-width: 0; padding: 6px 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 18px; font-weight: 900; -moz-appearance: textfield; appearance: textfield; }
.bvb input.stepval::-webkit-inner-spin-button, .bvb input.stepval::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bvb-sum { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--cink); }
.login-book { height: 140px; width: auto; margin-bottom: 22px; filter: drop-shadow(0 10px 22px var(--logo-shadow)); }

/* El logo del libro trae letra con serifa en los títulos y esquinas algo menos redondas */
[data-logo="elegante"] {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --r: 18px;
  --r-sm: 12px;
}
[data-logo="elegante"] body { font-family: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif; }
[data-logo="elegante"] :is(h1, h2, h3) { font-family: var(--serif); font-weight: 700; letter-spacing: 0; }
[data-logo="elegante"] .hero .eyebrow { color: var(--gold, var(--accent-ink)); }

/* ---------- entrar con correo ---------- */
.login-or { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 360px; margin: 14px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-mail { max-width: 360px; }
.login .gbtn + .gbtn, .login-mail + .login-mail { margin-top: 10px; }
#recaptcha-box { position: fixed; bottom: 0; right: 0; z-index: 80; }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 10px; text-align: left; }
.login-form-h { font-size: 15px; font-weight: 800; color: var(--ink2); margin: 0 2px 2px; }
.login-form .pass { position: relative; }
.login-form .pass .input { padding-right: 70px; }
.login-form .pass .link { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13.5px; }
.login-alt { text-align: center; font-size: 14px; color: var(--ink2); margin-top: 4px; }
.login-legal { margin-top: 18px; font-size: 12px; color: var(--muted); max-width: 320px; line-height: 1.5; }
.login-legal a, .foot a { color: inherit; text-decoration: underline; }
.login-small { justify-self: center; font-size: 13.5px; color: var(--ink2); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- tutorial ---------- */
.tour { position: fixed; inset: 0; z-index: 65; touch-action: none; }
.tour-hole { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(18, 12, 24, .7); transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none; }
.tour.nohole { background: rgba(18, 12, 24, .7); }
.tour.nohole .tour-hole { display: none; }
.tour-tip { position: fixed; left: 16px; right: 16px; max-width: 420px; margin: 0 auto; background: var(--card); color: var(--ink); border-radius: 20px; padding: 16px 16px 12px; box-shadow: var(--shadow-lg); transition: top .25s; }
.tour-n { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.tour-tip h3 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.tour-tip p { color: var(--ink2); font-size: 14.5px; line-height: 1.45; }
.tour-btns { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-btns .grow { flex: 1; }
.tour-btns .link { color: var(--ink2); }

/* ---------- suscripción ---------- */
.planes { display: grid; gap: 10px; width: 100%; max-width: 360px; margin: 0 auto; }
.plan-opt { position: relative; display: block; width: 100%; text-align: left; padding: 16px 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: 2px solid var(--line); }
.plan-opt b { display: block; font-size: 18px; font-weight: 800; }
.plan-opt small { display: block; color: var(--ink2); font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.plan-opt.dest { border-color: var(--accent); background: var(--accent-soft); }
.plan-opt.dest b { color: var(--accent-ink); }
.plan-tag { position: absolute; top: -10px; right: 14px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.card .planes { max-width: none; }
.pago .planes { margin-top: 4px; }
.pago-alt { margin-top: 22px; font-size: 14px; color: var(--muted); }
.pago-alt .link { font-size: 14px; color: var(--ink2); }

/* ---------- ¿suscribirse ahora o más adelante? ---------- */
.regalo { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; max-width: 360px; padding: 16px; border-radius: 18px; background: var(--mint-soft); margin-bottom: 16px; }
.regalo .ic { flex: none; width: 26px; height: 26px; color: var(--accent-ink); margin-top: 1px; }
.regalo b { display: block; font-size: 17px; font-weight: 900; }
.regalo span { display: block; font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--ink2); margin-top: 3px; }
.oferta .btn.big { max-width: 360px; font-size: 16px; line-height: 1.25; padding-left: 14px; padding-right: 14px; }
.oferta .login-sub { margin-bottom: 18px; }

/* ---------- beta de fundadores y modo lectura ---------- */
.beta-pill { display: inline-block; margin: -14px 0 24px; padding: 5px 12px; border-radius: 99px; background: var(--mint-soft); color: var(--ink); font-size: 13px; font-weight: 800; }
.regalo + .regalo { margin-top: -6px; }
.regalo.wide { max-width: none; margin-bottom: 12px; }
.regalo b + span b { display: inline; font-size: inherit; font-weight: 800; }
.lectura-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--peach-soft); font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.lectura-bar span { flex: 1; min-width: 160px; }
.lectura-bar .link { font-size: 13.5px; font-weight: 800; }
body.lectura textarea[readonly], body.lectura input[readonly]:not(#q) { opacity: .75; }
