/* ============================================================
   Bikinis al Crochet — sistema de diseño "hilo & arena"
   Paleta pastel femenina · tipografías Fraunces + DM Sans
   ============================================================ */
:root{
  color-scheme: light;
  /* superficie */
  --bg:#FDF8F5; --bg-2:#F8EEE9; --surface:#FFFFFF; --surface-2:#FBF3EF;
  --line:#EFDFD9; --line-2:#E3CCC5;
  /* tinta */
  --ink:#45302E; --ink-2:#6D5551; --ink-3:#9B857F;
  /* marca */
  --brand:#C4837C; --brand-deep:#B06860; --brand-ink:#8B4A44;
  --brand-soft:#F8EAE7; --brand-soft-2:#EFD8D3;
  --accent:#E3A47C; --accent-soft:#FBEADD;
  --sage:#96B394; --sage-soft:#E7F0E6;
  --gold:#D6A455; --gold-soft:#FAEFDA;
  --lilac:#B79ECF; --lilac-soft:#F0E9F7;
  /* sistema */
  --radius:18px; --radius-s:12px; --radius-xs:8px;
  --shadow-1:0 1px 2px rgba(69,48,46,.05), 0 4px 14px rgba(69,48,46,.06);
  --shadow-2:0 8px 30px rgba(69,48,46,.13);
  --shadow-brand:0 8px 26px rgba(176,104,96,.24);
  --paper:#FFFCFA; --pad-page:46px;
  --measure:36rem;              /* ~72 caracteres reales con DM Sans 17px */
  --sidebar:300px;
  --header-h:60px;
  --ff-display:"Fraunces","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --ff-body:"DM Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --ease:cubic-bezier(.22,.61,.36,1);
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--ff-body); font-size:16.5px; line-height:1.62;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img{max-width:100%; height:auto; display:block}
button,input,select,textarea{font:inherit; color:inherit}
button{cursor:pointer; background:none; border:0; padding:0}
a{color:var(--brand-ink); text-decoration-color:var(--brand-soft-2); text-underline-offset:3px}
h1,h2,h3,h4{font-family:var(--ff-display); font-weight:600; line-height:1.18; letter-spacing:-.012em; margin:0}
:focus-visible{outline:2.5px solid var(--brand-deep); outline-offset:2px; border-radius:6px}
::selection{background:var(--brand-soft-2)}

/* ---------- scrollbar suave ---------- */
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-thumb{background:var(--line-2); border-radius:99px; border:3px solid var(--bg)}
*::-webkit-scrollbar-track{background:transparent}

/* ============================ APP SHELL ============================ */
.app{min-height:100dvh}
.scrollbar{position:fixed; top:0; left:0; height:3px; z-index:60;
  background:linear-gradient(90deg,var(--brand),var(--accent)); width:0; transition:width .1s linear}

.topbar{
  position:sticky; top:0; z-index:45; height:var(--header-h);
  display:flex; align-items:center; gap:10px;
  padding:0 14px; padding-top:env(safe-area-inset-top);
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:saturate(1.5) blur(14px); -webkit-backdrop-filter:saturate(1.5) blur(14px);
  border-bottom:1px solid var(--line);
}
.topbar .brand{display:flex; align-items:center; gap:9px; font-family:var(--ff-display);
  font-weight:600; font-size:1.06rem; letter-spacing:-.02em; min-width:0}
.topbar .brand b{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600}
.topbar .spacer{flex:1}
.iconbtn{width:44px; height:44px; display:grid; place-items:center; border-radius:12px;
  color:var(--ink-2); transition:background .18s var(--ease), color .18s var(--ease)}
.iconbtn:hover{background:var(--brand-soft); color:var(--brand-ink)}
.iconbtn svg{width:21px;height:21px;stroke-width:1.9}
#menuBtn{display:none}

.xp-pill{display:flex; align-items:center; gap:8px; height:38px; padding:0 12px 0 8px;
  border-radius:99px; background:var(--surface); border:1px solid var(--line);
  box-shadow:var(--shadow-1); white-space:nowrap}
.xp-pill .lvl{width:24px;height:24px;display:grid;place-items:center;border-radius:50%;
  background:var(--brand-soft); font-size:13px}
.xp-pill .meta{display:flex; flex-direction:column; line-height:1.05}
.xp-pill .meta small{font-size:9.5px; color:var(--ink-3); letter-spacing:.04em; text-transform:uppercase}
.xp-pill .meta span{font-size:12.5px; font-weight:600}
.streak{display:flex;align-items:center;gap:4px;font-size:13px;font-weight:600;color:var(--accent);
  padding:0 4px}
.streak.off{color:var(--ink-3); filter:grayscale(1); opacity:.55}

/* ---------- layout ---------- */
.layout{display:grid; grid-template-columns:var(--sidebar) minmax(0,1fr); align-items:start}
.sidebar{
  position:sticky; top:var(--header-h); height:calc(100dvh - var(--header-h));
  overflow-y:auto; overscroll-behavior:contain; padding:18px 12px 40px;
  border-right:1px solid var(--line); background:var(--bg);
}
.main{min-width:0; padding:0 24px 120px}
.wrap{max-width:var(--measure); margin:0 auto}
.wrap-wide{max-width:62rem; margin:0 auto}

/* ---------- índice lateral ---------- */
.nav-search{position:relative; margin:0 6px 14px}
.nav-search input{width:100%; height:40px; padding:0 12px 0 34px; border-radius:11px;
  border:1px solid var(--line); background:var(--surface); font-size:14px}
.nav-search input::placeholder{color:var(--ink-3)}
.nav-search svg{position:absolute; left:10px; top:10px; width:18px; height:18px; color:var(--ink-3)}
.nav-group{margin-bottom:6px}
.nav-group > .nav-head{display:flex; align-items:center; gap:8px; width:100%;
  padding:9px 10px; border-radius:11px; font-size:13.5px; font-weight:600; color:var(--ink-2);
  transition:background .16s}
.nav-group > .nav-head:hover{background:var(--surface-2)}
.nav-head .chev{margin-left:auto; transition:transform .22s var(--ease); color:var(--ink-3)}
.nav-group[data-open="1"] .chev{transform:rotate(90deg)}
.nav-head .count{font-size:11px; color:var(--ink-3); font-weight:500;
  background:var(--surface-2); padding:1px 7px; border-radius:99px}
.nav-list{display:none; padding:2px 0 8px 8px; margin-left:14px; border-left:1.5px solid var(--line)}
.nav-group[data-open="1"] .nav-list{display:block}
.nav-list a{display:flex; gap:8px; align-items:flex-start; padding:7px 10px; border-radius:9px;
  font-size:13.5px; line-height:1.35; color:var(--ink-2); text-decoration:none;
  transition:background .16s, color .16s}
.nav-list a:hover{background:var(--surface-2); color:var(--ink)}
.nav-list a.active{background:var(--brand-soft); color:var(--brand-ink); font-weight:600}
.nav-list a .tick{flex:0 0 15px; margin-top:3px; color:var(--sage); opacity:0}
.nav-list a.done .tick{opacity:1}
.nav-list a.done span{color:var(--ink-3)}
.nav-cta{display:flex;align-items:center;gap:9px;width:100%;padding:10px;border-radius:11px;
  font-size:13.5px;font-weight:600;color:var(--ink-2)}
.nav-cta:hover{background:var(--surface-2)}
.nav-sep{height:1px;background:var(--line);margin:12px 8px}

/* ---------- drawer móvil ---------- */
.scrim{display:none}

/* ============================ HOME ============================ */
.hero{position:relative; overflow:hidden; border-radius:26px; margin:22px 0 26px;
  padding:38px 30px; background:
    radial-gradient(120% 130% at 8% 0%, var(--brand-soft) 0%, transparent 58%),
    radial-gradient(110% 120% at 100% 100%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  border:1px solid var(--line); box-shadow:var(--shadow-1)}
.hero h1{font-size:clamp(1.85rem, 4.4vw, 2.7rem); letter-spacing:-.028em; margin-bottom:10px}
.hero h1 em{font-style:italic; color:var(--brand-deep)}
.hero p{margin:0; color:var(--ink-2); max-width:33rem; font-size:1.02rem}
.hero .knit{position:absolute; right:-30px; top:-24px; font-size:150px; opacity:.06; transform:rotate(-12deg); pointer-events:none}

.stat-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin:0 0 26px}
.stat{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:15px 16px; box-shadow:var(--shadow-1)}
.stat .k{font-size:11px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-3); font-weight:600}
.stat .v{font-family:var(--ff-display); font-size:1.6rem; font-weight:600; line-height:1.2; margin-top:3px}
.stat .v small{font-size:.85rem; color:var(--ink-3); font-weight:400}

.progress-card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow-1); margin-bottom:26px}
.progress-head{display:flex; align-items:center; gap:12px; margin-bottom:14px}
.progress-head .badge-lvl{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;
  font-size:22px;background:linear-gradient(140deg,var(--brand-soft),var(--accent-soft));
  border:1px solid var(--line)}
.progress-head h3{font-size:1.12rem}
.progress-head p{margin:2px 0 0; font-size:13px; color:var(--ink-3)}
.bar{height:10px; border-radius:99px; background:var(--bg-2); overflow:hidden; position:relative}
.bar > i{display:block; height:100%; border-radius:99px;
  background:linear-gradient(90deg,var(--brand),var(--accent)); transition:width .7s var(--ease)}
.bar-legend{display:flex; justify-content:space-between; font-size:12px; color:var(--ink-3); margin-top:7px}

.sec-head{display:flex; align-items:baseline; gap:12px; margin:34px 0 14px}
.sec-head h2{font-size:1.42rem}
.sec-head .more{margin-left:auto; font-size:13.5px; font-weight:600; color:var(--brand-ink)}

/* ---------- tarjetas ---------- */
.grid{display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(232px,1fr))}
.card{position:relative; display:flex; flex-direction:column; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; text-decoration:none;
  color:inherit; box-shadow:var(--shadow-1); transition:transform .24s var(--ease), box-shadow .24s var(--ease), border-color .2s}
.card:hover{transform:translateY(-3px); box-shadow:var(--shadow-2); border-color:var(--line-2)}
.card .thumb{position:relative; aspect-ratio:4/3.1; background:var(--bg-2); overflow:hidden}
.card .thumb img{width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease)}
.card:hover .thumb img{transform:scale(1.045)}
.card .thumb .ph{width:100%;height:100%;display:grid;place-items:center;font-size:38px;opacity:.28}
.card .body{padding:13px 14px 15px; display:flex; flex-direction:column; gap:9px; flex:1}
.card h3{font-size:1.02rem; line-height:1.28; letter-spacing:-.014em}
.card .badges{display:flex; flex-wrap:wrap; gap:5px; margin-top:auto}
.card .done-flag{position:absolute; top:10px; right:10px; width:28px;height:28px;border-radius:50%;
  background:var(--sage); color:#fff; display:grid;place-items:center; box-shadow:0 3px 10px rgba(0,0,0,.16)}
.card .fav{position:absolute; top:10px; left:10px; width:32px;height:32px;border-radius:50%;
  background:rgba(255,255,255,.86); backdrop-filter:blur(6px); display:grid;place-items:center;
  color:var(--ink-3); box-shadow:0 2px 8px rgba(0,0,0,.12); transition:color .18s, transform .18s}
.card .fav:hover{transform:scale(1.1)}
.card .fav.on{color:var(--brand-deep)}

.chip{display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px;
  font-size:11.5px; font-weight:600; letter-spacing:.005em; white-space:nowrap;
  background:var(--surface-2); color:var(--ink-2); border:1px solid var(--line)}
.chip.lv1{background:var(--sage-soft); color:#4B6B49; border-color:#D3E4D1}
.chip.lv2{background:var(--gold-soft); color:#8A6320; border-color:#F0DFBE}
.chip.lv3{background:#FBE4DE; color:#9A4A38; border-color:#F2D2C8}
.chip.time{background:var(--accent-soft); color:#96522A; border-color:#F3DAC6}
.chip.tech{background:var(--lilac-soft); color:#5F4682; border-color:#E3D8F0}
.chip.ghost{background:transparent}


/* ---------- filtros ---------- */
.filters{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 18px}
.fbtn{padding:7px 14px; border-radius:99px; border:1px solid var(--line); background:var(--surface);
  font-size:13.5px; font-weight:600; color:var(--ink-2); transition:all .18s var(--ease)}
.fbtn:hover{border-color:var(--brand-soft-2); color:var(--brand-ink)}
.fbtn[aria-pressed="true"]{background:var(--brand-deep); border-color:var(--brand-deep); color:#fff;
  box-shadow:var(--shadow-brand)}
.fsel{height:36px; padding:0 30px 0 12px; border-radius:99px; border:1px solid var(--line);
  background:var(--surface) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239B857F' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size:13.5px; font-weight:600; color:var(--ink-2); appearance:none; -webkit-appearance:none}
.count-line{font-size:13.5px; color:var(--ink-3); margin:0 0 16px}

/* ============================ PATRÓN ============================ */
.crumbs{display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-3);
  padding:20px 0 0; flex-wrap:wrap}
.crumbs a{color:var(--ink-3); text-decoration:none}
.crumbs a:hover{color:var(--brand-ink)}
.pattern-head{padding:10px 0 6px}
.pattern-head h1{font-size:clamp(1.7rem,3.6vw,2.35rem); letter-spacing:-.028em; margin-bottom:12px}
.pattern-head .badges{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px}
.lede{font-size:1.06rem; color:var(--ink-2); line-height:1.66}
.hero-img{border-radius:var(--radius); overflow:hidden; margin:20px 0 6px; border:1px solid var(--line);
  box-shadow:var(--shadow-1); background:var(--bg-2)}

.meta-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; margin:22px 0 28px}
.meta-grid > div{background:var(--surface); padding:13px 15px}
.meta-grid .k{font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-3); font-weight:700}
.meta-grid .v{font-size:14.5px; font-weight:600; margin-top:3px; line-height:1.4}

article{font-size:17px}
article h2{font-size:1.5rem; margin:2.1em 0 .6em; letter-spacing:-.022em; scroll-margin-top:80px}
article h2:first-child{margin-top:1em}
article h3{font-size:1.16rem; margin:1.7em 0 .45em; scroll-margin-top:80px}
article h4{font-size:1.02rem; margin:1.4em 0 .35em; color:var(--ink-2); font-family:var(--ff-body); font-weight:700}
article p{margin:0 0 1.05em}
article ul{margin:0 0 1.15em; padding-left:1.15em; list-style:none}
article ul li{position:relative; margin-bottom:.5em; padding-left:.35em}
article ul li::before{content:""; position:absolute; left:-.85em; top:.68em; width:6px; height:6px;
  border-radius:50%; background:var(--brand-soft-2); border:1.5px solid var(--brand)}
article .figure{margin:1.6em 0; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line);
  background:var(--bg-2); box-shadow:var(--shadow-1); cursor:zoom-in; position:relative}
article .figure img{width:100%}
article .figure.graphic{background:#fff}
article .figure::after{content:"⤢"; position:absolute; right:10px; bottom:8px; width:28px;height:28px;
  display:grid;place-items:center; border-radius:8px; background:rgba(255,255,255,.9); color:var(--ink-2);
  font-size:14px; opacity:0; transition:opacity .2s}
article .figure:hover::after{opacity:1}

/* pasos numerados */
.steps{counter-reset:st; margin:1.3em 0 1.6em; padding:0; list-style:none}
.steps li{counter-increment:st; position:relative; padding:12px 14px 12px 50px; margin-bottom:8px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-s);
  font-size:15.6px; line-height:1.55}
.steps li::before{content:counter(st); position:absolute; left:13px; top:12px; width:25px;height:25px;
  border-radius:50%; background:var(--brand-soft); color:var(--brand-ink);
  display:grid;place-items:center; font-size:12.5px; font-weight:700; font-family:var(--ff-body)}
.steps li.checked{background:var(--sage-soft); border-color:#D3E4D1}
.steps li.checked::before{background:var(--sage); color:#fff; content:"✓"}

/* callouts */
.callout{display:flex; gap:12px; padding:14px 16px; border-radius:var(--radius-s); margin:1.4em 0;
  border:1px solid var(--line); background:var(--surface-2); font-size:15.5px; line-height:1.55}
.callout .ic{flex:0 0 22px; font-size:19px; line-height:1.2}
.callout.tip{background:var(--sage-soft); border-color:#D3E4D1}
.callout.warn{background:var(--gold-soft); border-color:#F0DFBE}
.callout.note{background:var(--brand-soft); border-color:var(--brand-soft-2)}
.callout p:last-child{margin-bottom:0}

.tablewrap{overflow-x:auto; -webkit-overflow-scrolling:touch; margin:1.4em 0;
  border:1px solid var(--line); border-radius:var(--radius-s); background:var(--surface)}
.tablewrap table{border-collapse:collapse; width:100%; min-width:420px; font-size:14.5px}
.tablewrap th,.tablewrap td{padding:9px 13px; text-align:left; border-bottom:1px solid var(--line)}
.tablewrap th{background:var(--surface-2); font-weight:700; font-size:12.5px; text-transform:uppercase;
  letter-spacing:.05em; color:var(--ink-2)}

mark{background:var(--gold-soft); color:inherit; padding:1px 3px; border-radius:4px; box-shadow:0 0 0 1px #F0DFBE}

/* completar */
.complete-bar{position:sticky; bottom:0; z-index:20; margin:34px -24px 0; padding:14px 24px;
  padding-bottom:calc(14px + env(safe-area-inset-bottom));
  background:color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter:blur(12px);
  border-top:1px solid var(--line); display:flex; gap:10px; align-items:center}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; height:46px; padding:0 20px;
  border-radius:13px; font-weight:700; font-size:15px; transition:transform .16s var(--ease), box-shadow .2s, background .2s}
.btn:active{transform:scale(.975)}
.btn-primary{background:var(--brand-deep); color:#fff; box-shadow:var(--shadow-brand)}
.btn-primary:hover{background:var(--brand-ink)}
.btn-ghost{border:1px solid var(--line); background:var(--surface); color:var(--ink-2)}
.btn-ghost:hover{border-color:var(--line-2); background:var(--surface-2)}
.btn-done{background:var(--sage); color:#fff; box-shadow:0 8px 22px rgba(150,179,148,.34)}
.btn.wide{flex:1}

.prevnext{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:30px 0 0}
.prevnext a{display:flex; flex-direction:column; gap:3px; padding:14px 16px; border-radius:var(--radius-s);
  border:1px solid var(--line); background:var(--surface); text-decoration:none; color:inherit;
  transition:border-color .2s, transform .2s var(--ease)}
.prevnext a:hover{border-color:var(--brand-soft-2); transform:translateY(-2px)}
.prevnext small{font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); font-weight:700}
.prevnext span{font-size:14.5px; font-weight:600; line-height:1.32}
.prevnext .nx{text-align:right; align-items:flex-end}

/* ============================ LOGROS ============================ */
.ach-grid{display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.ach{display:flex; gap:12px; padding:14px; border-radius:var(--radius); border:1px solid var(--line);
  background:var(--surface); box-shadow:var(--shadow-1)}
.ach .ic{flex:0 0 42px; height:42px; border-radius:12px; display:grid; place-items:center; font-size:21px;
  background:var(--surface-2)}
.ach.on .ic{background:linear-gradient(140deg,var(--gold-soft),var(--brand-soft))}
.ach.off{opacity:.62}
.ach.off .ic{filter:grayscale(1)}
.ach h4{font-size:14.5px; font-family:var(--ff-body); font-weight:700; margin-bottom:2px}
.ach p{margin:0; font-size:12.5px; color:var(--ink-3); line-height:1.4}
.ach .mini-bar{height:4px;border-radius:99px;background:var(--bg-2);margin-top:7px;overflow:hidden}
.ach .mini-bar i{display:block;height:100%;background:var(--brand-soft-2)}

/* ============================ ASISTENTE ============================ */
.fab{position:fixed; right:18px; bottom:calc(18px + env(safe-area-inset-bottom)); z-index:48;
  width:56px; height:56px; border-radius:50%; display:grid; place-items:center; font-size:24px;
  background:var(--brand-deep); color:#fff; box-shadow:var(--shadow-brand);
  transition:transform .22s var(--ease), background .2s}
.fab:hover{transform:scale(1.07)}
.fab.hidden{transform:scale(0) translateY(20px); pointer-events:none}
.totop{position:fixed; right:20px; bottom:calc(84px + env(safe-area-inset-bottom)); z-index:44;
  width:44px;height:44px;border-radius:50%; display:grid;place-items:center; background:var(--surface);
  border:1px solid var(--line); color:var(--ink-2); box-shadow:var(--shadow-1);
  opacity:0; pointer-events:none; transform:translateY(10px); transition:all .25s var(--ease)}
.totop.show{opacity:1; pointer-events:auto; transform:none}

.sheet{position:fixed; inset:0; z-index:70; display:none}
.sheet.open{display:block}
.sheet .veil{position:absolute; inset:0; background:rgba(69,48,46,.34); backdrop-filter:blur(3px);
  animation:fade .25s var(--ease)}
.sheet .panel{position:absolute; right:0; top:0; bottom:0; width:min(460px,100%);
  background:var(--bg); border-left:1px solid var(--line); display:flex; flex-direction:column;
  box-shadow:-14px 0 44px rgba(69,48,46,.16); animation:slideIn .3s var(--ease)}
@keyframes fade{from{opacity:0}}
@keyframes slideIn{from{transform:translateX(28px); opacity:.4}}
.sheet .ph{display:flex; align-items:center; gap:10px; padding:14px 16px;
  padding-top:calc(14px + env(safe-area-inset-top)); border-bottom:1px solid var(--line)}
.sheet .ph h3{font-size:1.08rem; flex:1}
.sheet .pb{flex:1; overflow-y:auto; overscroll-behavior:contain; padding:14px 16px 24px}
.sheet .pf{padding:12px 16px; padding-bottom:calc(12px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line); background:var(--surface)}
.askbox{display:flex; gap:8px; align-items:flex-end}
.askbox textarea{flex:1; resize:none; min-height:44px; max-height:120px; padding:11px 13px;
  border-radius:13px; border:1px solid var(--line); background:var(--bg); font-size:15px; line-height:1.4}
.askbox button{width:44px;height:44px;border-radius:12px;background:var(--brand-deep);color:#fff;
  display:grid;place-items:center; flex:0 0 44px}
.askbox button:disabled{opacity:.4}

.qa{margin-bottom:16px}
.qa .q{display:flex; justify-content:flex-end; margin-bottom:10px}
.qa .q span{background:var(--brand-deep); color:#fff; padding:9px 14px; border-radius:16px 16px 4px 16px;
  font-size:14.5px; max-width:85%; line-height:1.45}
.qa .a{background:var(--surface); border:1px solid var(--line); border-radius:4px 16px 16px 16px;
  padding:13px 15px; font-size:14.8px; line-height:1.58; box-shadow:var(--shadow-1)}
.qa .a p{margin:0 0 .7em}
.qa .a p:last-child{margin:0}
.qa .a .src{display:block; margin-top:11px; padding-top:11px; border-top:1px dashed var(--line)}
.qa .a .src b{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3)}
.gotolesson{display:inline-flex; align-items:center; gap:6px; margin-top:7px; padding:7px 12px;
  border-radius:10px; background:var(--brand-soft); color:var(--brand-ink); font-size:13px;
  font-weight:700; text-decoration:none}
.gotolesson:hover{background:var(--brand-soft-2)}
.faq-q{display:block; width:100%; text-align:left; padding:11px 13px; margin-bottom:7px;
  border-radius:12px; border:1px solid var(--line); background:var(--surface); font-size:14px;
  line-height:1.4; color:var(--ink-2); transition:border-color .18s, background .18s}
.faq-q:hover{border-color:var(--brand-soft-2); background:var(--brand-soft)}
.hint{font-size:12.5px; color:var(--ink-3); margin:0 0 10px}
.thinking{display:flex;gap:4px;padding:6px 0}
.thinking i{width:7px;height:7px;border-radius:50%;background:var(--brand-soft-2);animation:bob 1.1s infinite}
.thinking i:nth-child(2){animation-delay:.15s}.thinking i:nth-child(3){animation-delay:.3s}
@keyframes bob{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}

/* ============================ MISC ============================ */
.toast-wrap{position:fixed; left:50%; bottom:calc(22px + env(safe-area-inset-bottom)); transform:translateX(-50%);
  z-index:90; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; width:max-content; max-width:92vw}
.toast{display:flex; align-items:center; gap:10px; padding:12px 18px; border-radius:99px;
  background:var(--ink); color:#fff; font-size:14.5px; font-weight:600; box-shadow:var(--shadow-2);
  animation:toastIn .4s var(--ease)}
.toast .ic{font-size:18px}
@keyframes toastIn{from{transform:translateY(16px) scale(.94); opacity:0}}

.levelup{position:fixed; inset:0; z-index:95; display:grid; place-items:center; padding:24px;
  background:rgba(69,48,46,.42); backdrop-filter:blur(5px); animation:fade .3s}
.levelup .box{background:var(--surface); border-radius:26px; padding:34px 30px; text-align:center;
  max-width:340px; box-shadow:var(--shadow-2); animation:pop .5s var(--ease)}
@keyframes pop{0%{transform:scale(.7) translateY(20px); opacity:0}60%{transform:scale(1.03)}100%{transform:none}}
.levelup .big{font-size:62px; line-height:1; margin-bottom:10px; animation:wob 2s var(--ease) infinite}
@keyframes wob{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(5deg)}}
.levelup h2{font-size:1.6rem; margin-bottom:8px}
.levelup p{color:var(--ink-2); margin:0 0 20px; font-size:15px}
canvas.confetti{position:fixed; inset:0; z-index:94; pointer-events:none}

.lightbox{position:fixed; inset:0; z-index:98; background:rgba(38,25,31,.94); display:grid;
  place-items:center; padding:20px; animation:fade .22s}
.lightbox img{max-width:100%; max-height:88dvh; border-radius:10px; object-fit:contain}
.lightbox .x{position:absolute; top:calc(14px + env(safe-area-inset-top)); right:14px; width:44px;height:44px;
  border-radius:50%; background:rgba(255,255,255,.14); color:#fff; display:grid;place-items:center; font-size:20px}

.empty{text-align:center; padding:56px 20px; color:var(--ink-3)}
.empty .em{font-size:44px; margin-bottom:10px; opacity:.6}

/* ---------- gate ---------- */
.gate{position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:24px;
  background:radial-gradient(120% 100% at 20% 0%, var(--brand-soft) 0%, transparent 55%),
             radial-gradient(100% 100% at 100% 100%, var(--accent-soft) 0%, transparent 50%), var(--bg)}
.gate .box{width:min(400px,100%); background:var(--surface); border:1px solid var(--line);
  border-radius:24px; padding:32px 28px; box-shadow:var(--shadow-2); text-align:center}
.gate .em{font-size:46px; margin-bottom:8px}
.gate h1{font-size:1.5rem; margin-bottom:6px}
.gate p{color:var(--ink-2); font-size:14.5px; margin:0 0 20px}
.gate input{width:100%; height:48px; text-align:center; border-radius:13px; border:1px solid var(--line);
  background:var(--bg); font-size:16px; letter-spacing:.06em; margin-bottom:12px}
.gate .err{color:var(--brand-ink); font-size:13.5px; min-height:20px; margin:0}
.gate .lang{display:flex; gap:8px; justify-content:center; margin-top:18px}

/* ---------- selector de idioma ---------- */
.langsel{display:flex; gap:3px; padding:3px; border-radius:99px; background:var(--surface-2); border:1px solid var(--line)}
.langsel button{padding:5px 11px; border-radius:99px; font-size:12.5px; font-weight:700; color:var(--ink-3);
  transition:all .18s}
.langsel button[aria-pressed="true"]{background:var(--surface); color:var(--brand-ink); box-shadow:var(--shadow-1)}

/* ============================ RESPONSIVE ============================ */
@media (max-width:1000px){
  :root{--sidebar:260px}
  .main{padding:0 20px 120px}
}
@media (max-width:820px){
  #menuBtn{display:grid}
  .layout{grid-template-columns:minmax(0,1fr)}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:80; width:min(320px,86vw); height:100dvh;
    padding-top:calc(16px + env(safe-area-inset-top)); border-right:1px solid var(--line);
    transform:translateX(-102%); transition:transform .3s var(--ease);
    box-shadow:14px 0 40px rgba(69,48,46,0);
  }
  .sidebar.open{transform:none; box-shadow:14px 0 40px rgba(69,48,46,.18)}
  .scrim{display:block; position:fixed; inset:0; z-index:79; background:rgba(69,48,46,.38);
    opacity:0; pointer-events:none; transition:opacity .3s}
  .scrim.show{opacity:1; pointer-events:auto}
  .main{padding:0 16px 130px}
  .hero{padding:28px 22px; border-radius:22px; margin:16px 0 22px}
  .complete-bar{margin:30px -16px 0; padding:12px 16px; padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .grid{grid-template-columns:repeat(auto-fill,minmax(158px,1fr)); gap:12px}
  article{font-size:16.5px}
  .prevnext{grid-template-columns:1fr}
  .sheet .panel{width:100%; top:auto; height:88dvh; border-left:0; border-top-left-radius:22px;
    border-top-right-radius:22px; animation:slideUp .32s var(--ease)}
  @keyframes slideUp{from{transform:translateY(40px); opacity:.5}}
}
@media (max-width:420px){
  .stat-row{grid-template-columns:1fr 1fr}
  .meta-grid{grid-template-columns:1fr 1fr}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important; animation-iteration-count:1 !important;
    transition-duration:.001ms !important; scroll-behavior:auto !important}
}
@media print{
  .topbar,.sidebar,.fab,.totop,.complete-bar,.prevnext{display:none !important}
  .main{padding:0}
}

/* ---------- logo de marca ---------- */
.brand img{height:26px;width:auto;display:block}
.gate .logo{width:min(310px,82%);margin:2px auto 18px;display:block}
.gate .em{display:none}
.sidebar .sb-brand{display:flex;align-items:center;gap:8px;padding:2px 10px 14px}
.sidebar .sb-brand img{height:30px}

/* ---------- tamaños de iconos SVG ---------- */
.sidebar .nav-cta > svg{width:18px;height:18px;flex:0 0 18px;stroke-width:1.9}
.sidebar .nav-head .chev svg{width:15px;height:15px}
.sidebar .nav-list .tick svg{width:13px;height:13px}
.btn svg{width:19px;height:19px;flex:0 0 19px}
.card .done-flag svg{width:15px;height:15px}
.totop svg{width:20px;height:20px}
.lightbox .x svg{width:20px;height:20px}
.askbox button svg{width:19px;height:19px}
.card .thumb .ph{background:linear-gradient(150deg,var(--brand-soft),var(--accent-soft));font-size:44px;opacity:1}
.card .thumb .ph span{opacity:.5;filter:saturate(.75)}

article .figure img, .hero-img img{width:100%;height:auto}

/* ---------- marca ---------- */
.topbar .brand img.wordmark{height:28px;width:auto;display:block}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
.topbar .brand img.markonly{display:none}
@media (max-width:600px){
  .topbar .brand img.wordmark{display:none}
  .topbar .brand img.markonly{display:block; height:27px; width:auto}
}

/* ---------- campo de clave con ojito ---------- */
.gate .pwwrap{position:relative}
.gate .pwwrap input{padding-right:46px}
.gate .pwwrap button{position:absolute; right:6px; top:6px; width:38px; height:38px;
  border-radius:10px; font-size:17px; opacity:.5; display:grid; place-items:center}
.gate .pwwrap button:hover{opacity:1; background:var(--surface-2)}

/* ============================================================
   HOJA DE LIBRO — el contenido vive dentro de una página
   ============================================================ */
.wrap-page{max-width:calc(var(--measure) + var(--pad-page)*2); margin:0 auto}
.page{
  position:relative;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:24px;
  padding:var(--pad-page);
  box-shadow:0 1px 2px rgba(69,48,46,.04), 0 14px 40px rgba(69,48,46,.08);
}
/* marco interior finito, como el filete de un libro de labores */
.page::before{
  content:""; position:absolute; inset:13px; border-radius:15px;
  border:1px solid var(--brand-soft-2); pointer-events:none;
}
.page > *:first-child{margin-top:0}
.page > *:last-child{margin-bottom:0}
.page .pattern-head{padding-top:0}
.page article h2:first-child{margin-top:1.2em}

/* separadorcito entre secciones, como en un libro */
.page article h2{position:relative}
.page article h2::after{
  content:""; display:block; width:46px; height:2px; margin-top:.42em;
  border-radius:2px; background:linear-gradient(90deg,var(--brand),var(--accent)); opacity:.55;
}

/* la barra de completar y el anterior/siguiente quedan FUERA de la hoja */
.wrap-page .complete-bar{
  margin:22px 0 0; padding:14px 18px; border:1px solid var(--line);
  border-radius:18px; background:color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow:0 -2px 20px rgba(69,48,46,.05);
}
.wrap-page .prevnext{margin-top:14px}

@media (max-width:820px){
  :root{--pad-page:22px}
  .page{border-radius:18px}
  .page::before{inset:9px; border-radius:11px}
  .wrap-page .complete-bar{margin:18px 0 0; padding:12px 14px; border-radius:16px}
}
@media (max-width:400px){ :root{--pad-page:17px} }
@media print{ .page{box-shadow:none; border:0} .page::before{display:none} }

/* ---------- diagramas de puntos: fondo blanco y aire, como en un libro ---------- */
article .figure.chart{background:#fff; padding:10px}
article .figure.chart img{border-radius:6px}

/* número de vuelta con el color de su punto, como en el PDF */
article .rc{font-weight:700}

/* ---------- tabla de símbolos por país ---------- */
.langtable{margin:1.6em 0}
.ltpick{display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px}
.ltpick button{display:inline-flex; align-items:center; gap:6px; padding:8px 13px; border-radius:99px;
  border:1px solid var(--line); background:var(--surface); font-size:13.5px; font-weight:600;
  color:var(--ink-2); transition:all .18s var(--ease)}
.ltpick button:hover{border-color:var(--brand-soft-2); color:var(--brand-ink)}
.ltpick button[aria-pressed="true"]{background:var(--brand-deep); border-color:var(--brand-deep);
  color:#fff; box-shadow:var(--shadow-brand)}
.langtable .figure{margin:0}
@media (max-width:560px){ .ltpick button{padding:9px 11px; font-size:12.5px} .ltpick button span{display:none} .ltpick button{font-size:17px} }

/* tablas de símbolos: una debajo de otra, con aire */
article .figure.chart{margin:.7em 0 2.2em}
article h3 + .figure.chart{margin-top:.5em}

/* Tablas de abreviaturas por idioma */
.abbrtab{margin:.6em 0 1.9em;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}
.abbr-row{display:grid;grid-template-columns:64px 1fr;align-items:center;gap:12px;padding:9px 14px;border-top:1px solid var(--line)}
.abbr-row:first-child{border-top:0}
.abbr-row:nth-child(odd){background:var(--soft,#FFF6F3)}
.abbr-sym{width:44px;height:44px;object-fit:contain;display:block;margin:0 auto;background:transparent;mix-blend-mode:multiply}
.abbr-tx{font-size:.97rem;line-height:1.4}
@media(max-width:480px){.abbr-row{grid-template-columns:48px 1fr;gap:10px;padding:8px 10px}.abbr-sym{width:38px;height:38px}}

/* Sumario */
.toc{margin:.4em 0 2.2em;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff}
.toc-row[data-toc]{cursor:pointer}
.toc-row{display:grid;grid-template-columns:34px 1fr;gap:12px;align-items:baseline;padding:12px 16px;
  border-top:1px solid var(--line);color:inherit;text-decoration:none;transition:background .15s}
.toc-row:first-child{border-top:0}
.toc-row[data-toc]:hover{background:var(--soft,#FFF6F3)}
.toc-n{font-variant-numeric:tabular-nums;font-weight:700;color:var(--brand,#E58AA6);text-align:right}
.toc-t{line-height:1.45}
@media(max-width:480px){.toc-row{grid-template-columns:26px 1fr;gap:10px;padding:11px 12px}}

/* Video del paso a paso */
.yt{margin:.6em 0 2em;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#12100f}
.yt-play,.yt iframe{display:block;width:100%;aspect-ratio:16/9;border:0}
.yt-play{position:relative;padding:0;cursor:pointer;background:linear-gradient(140deg,#3a2f33,#1a1416)}
.yt-play img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.yt-btn{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:74px;height:52px;border-radius:14px;background:rgba(20,16,18,.72);
  box-shadow:0 6px 24px rgba(0,0,0,.35);transition:background .18s,transform .18s}
.yt-btn::after{content:"";position:absolute;left:52%;top:50%;transform:translate(-50%,-50%);
  border-style:solid;border-width:11px 0 11px 19px;border-color:transparent transparent transparent #fff}
.yt-play:hover .yt-btn,.yt-play:focus-visible .yt-btn{background:#E0384A;transform:translate(-50%,-50%) scale(1.06)}
.yt-cap{padding:12px 16px;background:#fff;border-top:1px solid var(--line);font-size:.94rem;line-height:1.45}
.yt-cap strong{display:block}
.yt-cap span{color:var(--ink-3);font-size:.88rem;margin-right:.8em}
@media(max-width:480px){.yt-btn{width:62px;height:44px}}

/* tapa la barra superior de YouTube (título e ícono de compartir) */
.yt{position:relative}
.yt:has(iframe)::after{
  content:""; position:absolute; left:0; right:0; top:0;
  height:max(46px, 11%); background:#000; pointer-events:auto; z-index:2;
}
@media(max-width:480px){ .yt:has(iframe)::after{ height:max(38px, 12%) } }

/* ============ encabezado: la marca en su propia fila ============ */
.topbar{height:auto; flex-direction:column; align-items:stretch; gap:0; padding:0 14px}
.topbar .brandrow{display:flex; justify-content:center; align-items:center;
  padding:10px 0 6px; text-decoration:none; color:inherit; min-width:0}
.topbar .brandrow img.wordmark{height:34px; width:auto; display:block; max-width:100%; object-fit:contain}
.topbar .toprow{display:flex; align-items:center; gap:10px; height:52px}
.topbar .toprow .spacer{flex:1}
.sidebar{top:auto}

@media (min-width:901px){
  /* en escritorio, todo en una sola fila */
  .topbar{flex-direction:row; align-items:center; height:var(--header-h); gap:10px}
  .topbar .brandrow{padding:0; order:2}
  .topbar .toprow{height:auto; flex:1; order:3}
  .topbar .brandrow img.wordmark{height:28px}
}
@media (max-width:600px){
  .topbar .brandrow{padding:12px 0 4px}
  .topbar .brandrow img.wordmark{display:block; height:30px}
  .topbar .toprow{height:48px}
}

/* ============ barra inferior de secciones ============ */
.tabbar{display:none}
@media (max-width:900px){
  .tabbar{
    display:grid; grid-template-columns:repeat(6,1fr);
    position:fixed; left:0; right:0; bottom:0; z-index:48;
    background:color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter:saturate(1.6) blur(16px); -webkit-backdrop-filter:saturate(1.6) blur(16px);
    border-top:1px solid var(--line);
    padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -6px 20px rgba(80,50,60,.06);
  }
  .tabbar .tab{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    padding:8px 2px 7px; min-height:56px; border:0; background:none; cursor:pointer;
    color:var(--ink-3); font:inherit; font-size:.66rem; letter-spacing:.01em;
    text-decoration:none; transition:color .18s var(--ease);
    -webkit-tap-highlight-color:transparent;
  }
  .tabbar .tab svg{width:23px; height:23px; display:block; transition:transform .18s var(--ease)}
  .tabbar .tab span{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .tabbar .tab.on{color:var(--brand-ink)}
  .tabbar .tab.on svg{transform:translateY(-1px)}
  .tabbar .tab.on::before{
    content:""; position:absolute; margin-top:-8px; width:26px; height:3px; border-radius:0 0 4px 4px;
    background:linear-gradient(90deg,var(--brand),var(--accent));
  }
  .tabbar .tab{position:relative}
  .tabbar .tab:active svg{transform:scale(.9)}
  /* espacio para que la barra no tape el contenido */
  .main{padding-bottom:calc(74px + env(safe-area-inset-bottom))}
  /* el asistente ya está en la barra: el botón flotante sobra */
  .fab{display:none}
  .totop{bottom:calc(80px + env(safe-area-inset-bottom)); right:14px}
}

/* ============ arreglos de responsive en celular ============ */
@media (max-width:900px){
  /* el selector de idioma se partía en dos líneas y se salía de la fila */
  .langsel{flex:none; align-self:center; align-items:center; padding:2px}
  .langsel button{display:flex; align-items:center; gap:5px; white-space:nowrap; line-height:1;
    padding:8px 10px; min-height:36px}

  /* el botón de menú se aplastaba a 34px */
  #menuBtn{flex:0 0 44px; width:44px}

  /* la racha ya se ve en la portada, en la fila de arriba estorbaba */
  .topbar .streak{display:none}

  /* la píldora de XP toma el espacio libre sin empujar a los demás */
  .topbar .xp-pill{flex:0 1 auto; min-width:0; overflow:hidden}
  .topbar .xp-pill .meta{min-width:0; overflow:hidden}
  .topbar .xp-pill .meta small, .topbar .xp-pill .meta span{
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block}

  /* objetivos táctiles: nada por debajo de 40px de alto */
  .more{display:inline-flex; align-items:center; min-height:40px; padding:0 2px}
  .card .fav, button.fav{width:40px; height:40px}
  .nav-head{min-height:46px}
  .sidebar .nav-group a{min-height:42px; display:flex; align-items:center}
}

/* pantallas muy angostas */
@media (max-width:360px){
  .topbar{padding:0 10px}
  .topbar .brandrow img.wordmark{height:26px}
  .langsel button{padding:8px 8px; font-size:12px}
  .topbar .xp-pill{padding:0 9px 0 6px}
  .tabbar .tab{font-size:.62rem}
  .tabbar .tab svg{width:21px;height:21px}
  .main{padding-left:12px; padding-right:12px}
  .page{padding:14px}
}

/* el cajón lateral no debe quedar tapado por la barra inferior */
@media (max-width:900px){
  .sidebar{padding-bottom:calc(80px + env(safe-area-inset-bottom)) !important; overscroll-behavior:contain}
  /* el panel del asistente tampoco */
  .sheet .panel{padding-bottom:env(safe-area-inset-bottom)}
}

/* las etiquetas largas no deben salirse de la tarjeta */
.badges, .chips{flex-wrap:wrap; min-width:0}
.chip{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
@media (max-width:420px){
  .card .badges .chip{max-width:100%}
}

/* ---- Bloque de categorías (inicio) ---- */
.cat-tiles{display:grid;grid-template-columns:1fr;gap:12px;margin:0 0 30px}
.cat-tile{position:relative;overflow:hidden;isolation:isolate;display:flex;align-items:center;gap:15px;
  min-height:94px;padding:16px 18px;border-radius:20px;text-decoration:none;color:#fff;
  border:1px solid rgba(255,255,255,.18);box-shadow:0 8px 22px var(--sh,rgba(80,50,45,.22));
  transition:transform .22s cubic-bezier(.2,.8,.3,1),box-shadow .22s ease}
.cat-tile::before{content:"";position:absolute;inset:0;z-index:-2;
  background:linear-gradient(135deg,var(--c1) 0%,var(--c2) 52%,var(--c3) 100%)}
.cat-tile::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(118deg,rgba(255,255,255,.30) 0%,rgba(255,255,255,.06) 40%,transparent 66%)}
.cat-tile:hover{transform:translateY(-3px);box-shadow:0 14px 32px var(--sh,rgba(80,50,45,.3))}
.cat-tile .ct-ico{flex:0 0 46px;width:46px;height:46px;display:flex;align-items:center;justify-content:center;
  border-radius:14px;background:rgba(255,255,255,.20);color:#fff;
  border:1px solid rgba(255,255,255,.30);backdrop-filter:blur(2px)}
.cat-tile .ct-ico svg{width:24px;height:24px;display:block}
.cat-tile .ct-txt{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.cat-tile .ct-txt em{font-style:normal;font-size:13px;line-height:1.35;color:rgba(255,255,255,.94);
  text-shadow:0 1px 2px rgba(0,0,0,.16)}
.cat-tile .ct-txt b{font-size:16px;font-weight:700;letter-spacing:.2px;line-height:1.2;color:#fff;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 2px rgba(0,0,0,.14)}
.cat-tile .ct-txt small{margin-top:3px;font-size:11.5px;letter-spacing:.5px;text-transform:uppercase;
  font-weight:600;color:rgba(255,255,255,.75)}
.cat-tile .ct-go{margin-left:auto;font-size:17px;color:rgba(255,255,255,.72);
  transition:transform .22s ease,color .22s ease}
.cat-tile:hover .ct-go{transform:translateX(3px);color:#fff}
.cat-tile[data-c="guias"]     {--c1:#A2718F;--c2:#7E4E72;--c3:#5E3555;--sh:rgba(94,53,85,.30)}
.cat-tile[data-c="bikinis"]   {--c1:#F0728F;--c2:#D53F6C;--c3:#A81F4F;--sh:rgba(168,31,79,.30)}
.cat-tile[data-c="bolsos"]    {--c1:#D9764F;--c2:#B4502F;--c3:#8A3520;--sh:rgba(138,53,32,.30)}
.cat-tile[data-c="sombreros"] {--c1:#7FA070;--c2:#557A4E;--c3:#3A5A38;--sh:rgba(58,90,56,.30)}
.cat-tile[data-c="amigurumis"]{--c1:#E8B04A;--c2:#C9871D;--c3:#9C6210;--sh:rgba(156,98,16,.30)}
@media (max-width:600px){
  .cat-tiles{gap:10px;margin-bottom:24px}
  .cat-tile{min-height:82px;padding:13px 14px;gap:11px;border-radius:16px}
  .cat-tile .ct-ico{flex:0 0 34px;width:34px;height:34px;border-radius:11px}
  .cat-tile .ct-ico svg{width:19px;height:19px}
  .cat-tile .ct-txt b{font-size:14px;white-space:normal;line-height:1.15}
  .cat-tile .ct-txt em{font-size:12px}
  .cat-tile .ct-txt small{font-size:10.5px}

}
@media (max-width:360px){.cat-tile .ct-txt b{font-size:13px}}

/* ================= Calculadoras ================= */
.calcv{padding-bottom:20px}
.chead{margin:4px 0 16px}
.chead h1{font-size:26px;line-height:1.2;margin:0 0 6px}
.chead p{margin:0;font-size:14px;opacity:.72;max-width:56ch}
.ctabs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 18px}
.ctab{display:flex;flex-direction:column;gap:2px;padding:11px 12px;border-radius:14px;text-decoration:none;
  background:var(--card,#fff);border:1px solid rgba(140,105,95,.16);color:inherit;
  box-shadow:0 2px 8px rgba(120,86,74,.06);transition:.18s ease}
.ctab b{font-size:14.5px;font-weight:700}
.ctab small{font-size:11px;opacity:.62;line-height:1.25}
.ctab.on{background:linear-gradient(135deg,#F0728F,#B5305F);border-color:transparent;color:#fff;
  box-shadow:0 6px 18px rgba(168,31,79,.28)}
.ctab.on small{opacity:.88;color:#fff}
.cbox{background:var(--card,#fff);border:1px solid rgba(140,105,95,.14);border-radius:18px;
  padding:16px;margin:0 0 14px;box-shadow:0 2px 10px rgba(120,86,74,.06)}
.ch3{margin:0 0 12px;font-size:16px}
.cnote{margin:0 0 10px;font-size:12.5px;opacity:.7;line-height:1.45}
.cfield{display:block;margin:0 0 12px}
.cf-l{display:block;font-size:13.5px;font-weight:600;margin:0 0 6px}
.cf-l em{display:block;font-style:normal;font-weight:400;font-size:12px;opacity:.62;margin-top:2px}
.cfield input,.csel,.prow input,.mrow input,.ccheck input{width:100%;box-sizing:border-box;
  font:inherit;font-size:16px;padding:11px 12px;border-radius:12px;
  border:1.5px solid rgba(140,105,95,.22);background:#fffdfc;color:inherit;min-height:46px}
.cfield input:focus,.csel:focus,.prow input:focus,.mrow input:focus{outline:none;border-color:#E4638A;
  box-shadow:0 0 0 3px rgba(228,99,138,.14)}
.crow2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.crow3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.cmodes{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap}
.cmode{flex:1 1 0;min-width:120px;padding:10px 12px;border-radius:12px;font:inherit;font-size:13.5px;font-weight:600;
  border:1.5px solid rgba(140,105,95,.2);background:#fff;color:inherit;cursor:pointer}
.cmode.on{background:#4A3A34;color:#fff;border-color:#4A3A34}
.copts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.copts.rates{grid-template-columns:repeat(3,1fr)}
.copt{text-align:left;padding:11px 12px;border-radius:13px;border:1.5px solid rgba(140,105,95,.2);
  background:#fff;color:inherit;cursor:pointer;font:inherit;display:flex;flex-direction:column;gap:2px;min-height:56px}
.copt b{font-size:13.5px}
.copt small{font-size:11.5px;opacity:.62;line-height:1.25}
.copt.on{border-color:#E4638A;background:#FFF3F6;box-shadow:0 0 0 2px rgba(228,99,138,.14)}
.csizes{display:flex;gap:7px;flex-wrap:wrap}
.csz{min-width:48px;min-height:44px;padding:0 12px;border-radius:12px;font:inherit;font-weight:700;font-size:14px;
  border:1.5px solid rgba(140,105,95,.2);background:#fff;color:inherit;cursor:pointer}
.csz.on{background:#4A3A34;color:#fff;border-color:#4A3A34}
.prow,.mrow{display:grid;grid-template-columns:1fr 74px 12px 74px 34px;gap:6px;align-items:center;margin:0 0 8px}
.mrow{grid-template-columns:1fr 68px 12px 88px 34px}
.px{text-align:center;opacity:.45;font-size:13px}
.prm{width:32px;height:38px;border-radius:10px;border:1px solid rgba(140,105,95,.18);background:#fff;
  color:#B5305F;font-size:19px;line-height:1;cursor:pointer}
.btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 20px;
  border:none;border-radius:14px;font:inherit;font-size:15px;font-weight:700;cursor:pointer;
  background:linear-gradient(135deg,#F0728F,#B5305F);color:#fff;box-shadow:0 6px 16px rgba(168,31,79,.26)}
.btn-primary.sm{min-height:42px;font-size:14px;padding:0 16px}
.btn-ghost{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;
  border-radius:13px;border:1.5px solid rgba(140,105,95,.22);background:#fff;color:inherit;font:inherit;
  font-size:14px;font-weight:600;cursor:pointer}
.btn-ghost.sm{min-height:38px;font-size:13px;padding:0 13px}
.btn-ghost.tmr.on{background:#B5305F;color:#fff;border-color:#B5305F}
.lnk{background:none;border:none;padding:6px 0;font:inherit;font-size:13px;font-weight:600;
  color:#B5305F;text-decoration:underline;cursor:pointer}
.lnk.danger{color:#9a3a3a}
.cout-wrap{margin:0 0 14px}
.cout{background:linear-gradient(135deg,#F0728F,#A81F4F);color:#fff;border-radius:20px;padding:22px 20px;
  box-shadow:0 10px 26px rgba(168,31,79,.3)}
.co-n{font-size:30px;font-weight:800;line-height:1.15;letter-spacing:-.4px}
.co-s{margin-top:6px;font-size:14px;color:rgba(255,255,255,.92);line-height:1.4}
.co-note{margin-top:9px;font-size:12.5px;color:rgba(255,255,255,.82)}
.co-x{margin-top:12px;padding-top:12px;border-top:1px solid rgba(255,255,255,.28);font-size:15px;font-weight:600}
.cwarn{margin:10px 0 0;padding:12px 14px;border-radius:13px;font-size:13px;line-height:1.5;
  background:#FFF3F6;border:1px solid rgba(228,99,138,.28)}
.cwarn.soft{background:#F6F3F0;border-color:rgba(140,105,95,.18);opacity:.9}
.cwarn.amber{background:#FFF7E8;border-color:rgba(201,135,29,.34)}
.chow{margin:0 0 18px;border-radius:13px;border:1px solid rgba(140,105,95,.16);background:#FBF8F6;padding:0 14px}
.chow summary{cursor:pointer;padding:12px 0;font-size:13.5px;font-weight:600;list-style:none}
.chow summary::-webkit-details-marker{display:none}
.chow summary::before{content:"?";display:inline-flex;align-items:center;justify-content:center;
  width:18px;height:18px;margin-right:8px;border-radius:50%;background:#4A3A34;color:#fff;font-size:11px;font-weight:700}
.chow p{margin:0 0 14px;font-size:13px;line-height:1.55;opacity:.78}
.cdet summary{cursor:pointer;list-style:none;display:flex;flex-direction:column;gap:2px;padding:2px 0 12px}
.cdet summary::-webkit-details-marker{display:none}
.cdet summary b{font-size:16px}
.cdet summary em{font-style:normal;font-size:12.5px;opacity:.62}
.cslide{display:flex;align-items:center;gap:14px}
.cslide input[type=range]{flex:1;accent-color:#B5305F;height:34px}
.cslide b{min-width:52px;text-align:right;font-size:19px;font-weight:800;color:#B5305F}
.cempty{text-align:center;padding:8px 4px}
.ce-ico{width:52px;height:52px;margin:0 auto 12px;color:#B5305F;opacity:.75}
.ce-ico svg{width:100%;height:100%}
.cempty h2{font-size:19px;margin:0 0 8px}
.cempty>p{font-size:14px;line-height:1.6;opacity:.76;margin:0 auto 16px;max-width:52ch}
.ce-steps{list-style:none;margin:0 0 18px;padding:0;text-align:left;display:grid;gap:10px}
.ce-steps li{display:flex;gap:11px;align-items:flex-start;font-size:13.5px;line-height:1.5}
.ce-steps b{flex:0 0 24px;width:24px;height:24px;border-radius:50%;background:#B5305F;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:12.5px}
.gbar-h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.gb-t{font-size:13px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;opacity:.6}
.gchips{display:flex;gap:8px;flex-wrap:wrap}
.gchip{text-align:left;padding:9px 13px;border-radius:13px;border:1.5px solid rgba(140,105,95,.2);
  background:#fff;color:inherit;font:inherit;cursor:pointer;display:flex;flex-direction:column;gap:1px}
.gchip b{font-size:13.5px}
.gchip small{font-size:11.5px;opacity:.6}
.gchip.on{border-color:#E4638A;background:#FFF3F6}
.gbar-a{display:flex;gap:16px;margin-top:8px}
.gform-b{display:flex;gap:10px;margin-top:4px}
.bill{background:var(--card,#fff);border:1px solid rgba(140,105,95,.16);border-radius:18px;padding:16px 18px;
  box-shadow:0 2px 10px rgba(120,86,74,.06)}
.bl{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:7px 0;font-size:14px}
.bl span{opacity:.78}
.bl b{font-variant-numeric:tabular-nums;font-weight:600}
.bl.big{font-size:16.5px}
.bl.big b{font-size:19px;font-weight:800;color:#B5305F}
.bl.rule{border-top:1px solid rgba(140,105,95,.2);margin-top:6px;padding-top:11px;font-weight:700}
.bl.rule span{opacity:1}
.bl.total{border-top:2px solid #4A3A34;margin-top:8px;padding-top:12px}
.bl.total span{font-size:12.5px;font-weight:800;letter-spacing:.6px;opacity:1}
.bl.total b{font-size:24px;font-weight:800}
.cgain{margin-top:12px;padding:14px 16px;border-radius:14px;background:linear-gradient(135deg,#7FA070,#4C6B48);
  color:#fff;font-size:15.5px;font-weight:700;box-shadow:0 6px 16px rgba(58,90,56,.24)}
.cwhole{margin-top:10px;padding:12px 15px;border-radius:13px;background:#F6F3F0;border:1px solid rgba(140,105,95,.16)}
.cwhole b{display:block;font-size:14.5px}
.cwhole small{display:block;margin-top:2px;font-size:12px;opacity:.65}
.ccheck{margin-top:14px}
.cbad{margin:8px 0 0;padding:14px 16px;border-radius:14px;background:#FDE8E8;border:1.5px solid #D46A6A;
  color:#8E2323;font-size:14.5px;font-weight:700;line-height:1.45}
.cgood{margin:8px 0 0;padding:12px 15px;border-radius:13px;background:#EDF5EA;border:1px solid rgba(76,107,72,.3);
  color:#3A5A38;font-size:14px;font-weight:600}
.csave{display:grid;gap:10px}
.cphoto{display:flex;flex-direction:column;gap:6px;font-size:13.5px;font-weight:600}
.cphoto input{font-size:13px}
.hlist{display:grid;gap:8px}
.hrow{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:13px;background:#FBF8F6;
  border:1px solid rgba(140,105,95,.14)}
.hrow img{width:42px;height:42px;border-radius:10px;object-fit:cover;flex:0 0 42px}
.hph{width:42px;height:42px;border-radius:10px;background:#F0E7E1;display:flex;align-items:center;
  justify-content:center;font-size:19px;flex:0 0 42px}
.hi{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.hi b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hi small{font-size:12px;opacity:.65}
/* CTA en el inicio */
.calc-cta{display:flex;align-items:center;gap:14px;padding:16px 18px;margin:0 0 26px;border-radius:20px;
  text-decoration:none;color:#fff;background:linear-gradient(135deg,#5C4A63,#33263C);
  box-shadow:0 8px 22px rgba(51,38,60,.3);border:1px solid rgba(255,255,255,.14)}
.calc-cta .cc-ico{flex:0 0 46px;width:46px;height:46px;display:flex;align-items:center;justify-content:center;
  border-radius:14px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.24)}
.calc-cta .cc-ico svg{width:24px;height:24px}
.calc-cta .cc-t{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.calc-cta .cc-t b{font-size:16px;font-weight:700}
.calc-cta .cc-t em{font-style:normal;font-size:13px;line-height:1.35;color:rgba(255,255,255,.88)}
.calc-cta .cc-go{color:rgba(255,255,255,.7);font-size:17px}
@media (max-width:600px){
  .chead h1{font-size:22px}
  .ctabs{gap:6px}
  .ctab{padding:9px 9px;border-radius:12px}
  .ctab b{font-size:13px}
  .ctab small{display:none}
  .cbox{padding:14px;border-radius:16px}
  .crow3{grid-template-columns:1fr 1fr}
  .crow3 .cfield:last-child{grid-column:1 / -1}
  .copts{grid-template-columns:1fr}
  .copts.rates{grid-template-columns:1fr}
  .copt{flex-direction:row;align-items:center;justify-content:space-between;gap:10px;min-height:50px}
  .co-n{font-size:26px}
  .prow,.mrow{grid-template-columns:1fr 62px 10px 62px 30px;gap:5px}
  .mrow{grid-template-columns:1fr 56px 10px 76px 30px}
  .prow input,.mrow input{font-size:15px;padding:9px 8px;min-height:42px}
  .bl.total b{font-size:21px}
  .calc-cta{padding:14px;gap:11px;border-radius:16px}
  .calc-cta .cc-ico{flex:0 0 38px;width:38px;height:38px;border-radius:11px}
  .calc-cta .cc-ico svg{width:20px;height:20px}
  .calc-cta .cc-t b{font-size:14.5px}
  .calc-cta .cc-t em{font-size:12px}
  .calc-cta .cc-go{display:none}
}
@media (max-width:360px){
  .tabbar .tab span{font-size:9.5px}
  .ctab b{font-size:12px}
}
.tabbar .tab{min-width:0}
.tabbar .tab span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.csave,.csave .cfield,.cphoto{min-width:0}
.cphoto input{width:100%;max-width:100%;box-sizing:border-box}
.calcv input[type=file]{font-size:12.5px}

/* ================= Banner de clases en video ================= */
.vbanner{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;gap:18px;
  margin:0 0 26px;padding:22px 24px;border-radius:24px;text-decoration:none;color:#fff;
  background:linear-gradient(128deg,#FF7FA6 0%,#F0447C 42%,#C21B58 100%);
  box-shadow:0 14px 34px rgba(194,27,88,.34),0 2px 0 rgba(255,255,255,.35) inset;
  border:1.5px solid rgba(255,255,255,.34);
  transition:transform .24s cubic-bezier(.2,.8,.3,1),box-shadow .24s ease}
.vbanner::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(120% 150% at 88% -20%,rgba(255,255,255,.42),transparent 58%)}
.vbanner::after{content:"";position:absolute;left:-40%;top:-120%;width:46%;height:340%;z-index:-1;
  transform:rotate(18deg);pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.30),transparent);
  animation:vbShine 5.5s ease-in-out infinite}
@keyframes vbShine{0%,72%{left:-45%}100%{left:125%}}
.vb-glow{position:absolute;right:-70px;bottom:-90px;width:230px;height:230px;border-radius:50%;z-index:-1;
  background:radial-gradient(circle,rgba(255,255,255,.28),transparent 68%);pointer-events:none}
.vbanner:hover{transform:translateY(-3px);box-shadow:0 20px 44px rgba(194,27,88,.42),0 2px 0 rgba(255,255,255,.35) inset}
.vb-ico{flex:0 0 60px;width:60px;height:60px;display:flex;align-items:center;justify-content:center;
  border-radius:19px;background:rgba(255,255,255,.20);border:1.5px solid rgba(255,255,255,.42);
  box-shadow:0 4px 14px rgba(120,10,48,.24)}
.vb-ico svg{width:31px;height:31px}
.vb-t{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.vb-t small{font-size:11px;font-weight:800;letter-spacing:1.3px;text-transform:uppercase;
  color:rgba(255,255,255,.82)}
.vb-t b{font-size:21px;font-weight:800;letter-spacing:-.2px;line-height:1.15;
  text-shadow:0 1px 3px rgba(120,10,48,.28)}
.vb-t em{font-style:normal;font-size:13.5px;line-height:1.45;color:rgba(255,255,255,.94);max-width:58ch}
.vb-cta{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;padding:12px 20px;border-radius:14px;
  background:#fff;color:#C21B58;font-size:14.5px;font-weight:800;white-space:nowrap;
  box-shadow:0 6px 16px rgba(120,10,48,.26);transition:transform .2s ease}
.vb-cta i{font-style:normal;transition:transform .2s ease}
.vbanner:hover .vb-cta i{transform:translateX(3px)}
@media (max-width:760px){
  .vbanner{flex-wrap:wrap;gap:14px;padding:18px 17px;border-radius:20px;margin-bottom:22px}
  .vb-ico{flex:0 0 46px;width:46px;height:46px;border-radius:15px}
  .vb-ico svg{width:25px;height:25px}
  .vb-t{flex:1 1 60%}
  .vb-t b{font-size:18px}
  .vb-t em{font-size:12.5px}
  .vb-cta{flex:1 1 100%;justify-content:center;padding:13px 16px;min-height:48px}
}
@media (max-width:360px){.vb-t b{font-size:16.5px}.vb-t em{font-size:12px}}
@media (prefers-reduced-motion:reduce){.vbanner::after{animation:none;display:none}}

/* ==== Márgenes laterales más finos en celular: más ancho para leer ==== */
@media (max-width:600px){
  #main{padding-left:10px;padding-right:10px}
  .hero{padding-left:16px;padding-right:16px}
  .vbanner{padding-left:15px;padding-right:15px}
  .cat-tile{padding-left:13px;padding-right:13px}
  .calc-cta{padding-left:13px;padding-right:13px}
  .cbox{padding-left:13px;padding-right:13px}
  .cout{padding-left:16px;padding-right:16px}
  .bill{padding-left:14px;padding-right:14px}
  .progress-card,.stat,.chow,.cwarn,.cgain,.cwhole{padding-left:14px;padding-right:14px}
}
@media (max-width:380px){
  #main{padding-left:8px;padding-right:8px}
  .hero{padding-left:14px;padding-right:14px}
  .vbanner,.cat-tile,.calc-cta,.cbox{padding-left:12px;padding-right:12px}
}
