/* ============================================================================
   日本語 SRS · estilos
   Lenguaje visual del CV: esquinas rectas, bordes finos, acento rosa sólido,
   Inter + Space Grotesk, títulos en mayúsculas espaciadas. Claro/oscuro,
   responsive (móvil app-like + escritorio multi-columna).
   ============================================================================ */
:root {
  --pink: #ff3d81;
  --pink-2: #ff6fa3;
  --green: #16a34a;
  --red: #e5484d;
  --gold: #d9930a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --disp: "Space Grotesk", "Inter", system-ui, sans-serif;
  --jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;

  --r: 3px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --maxw: 1240px;
  --tick: 22px;
}

/* ---------------- Tema oscuro (por defecto) ---------------- */
:root, html[data-theme="dark"] {
  --bg: #0b0b0d;
  --panel: #141417;
  --panel-2: #18181c;
  --ink: #f3f3f5;
  --ink-2: #c9c9d1;
  --muted: #8b8b96;
  --line: #26262c;
  --line-2: #33333b;
  --field: #101013;
  --shadow: none;
  --hover: #1d1d22;
  color-scheme: dark;
}
/* ---------------- Tema claro ---------------- */
html[data-theme="light"] {
  --bg: #f7f7f9;
  --panel: #ffffff;
  --panel-2: #f4f4f6;
  --ink: #14141a;
  --ink-2: #3a3a44;
  --muted: #6c6c78;
  --line: #e4e4ea;
  --line-2: #d3d3db;
  --field: #ffffff;
  --shadow: none;
  --hover: #f0f0f3;
  color-scheme: light;
}

@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body.lock { overflow: hidden; }
h1, h2, h3, h4, .disp { font-family: var(--disp); line-height: 1.15; margin: 0; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.jp { font-family: var(--jp); }

#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ============================ TOP BAR ============================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: calc(var(--safe-t) + 13px) 24px 13px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand .mark {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-family: var(--jp); font-size: 21px; font-weight: 700; color: #fff;
  background: var(--pink);
}
.brand-txt { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-self: center; }
.brand h1 { font-size: 14px; font-weight: 700; letter-spacing: .02em; font-family: var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub {
  font-family: var(--jp); font-size: 9px; color: var(--ink-2); letter-spacing: .18em;
  font-weight: 500; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .brand .sub { letter-spacing: .08em; }
  .brand h1 { font-size: 13px; }
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2);
  padding: 8px 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.chip .ic { color: var(--pink); display: grid; place-items: center; }
.icon-btn {
  width: 38px; height: 38px;
  background: transparent; border: 1px solid var(--line-2); color: var(--muted);
  display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { border-color: var(--pink); color: var(--pink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-sun { display: none; }
html[data-theme="light"] .theme-sun { display: block; }
html[data-theme="light"] .theme-moon { display: none; }

/* ============================ LAYOUT ============================ */
.main { flex: 1; }
.view {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 34px 24px 46px;
  display: flex; flex-direction: column; gap: 34px;
}
.view.fade { animation: fadeUp .3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* como .sect-title del CV: barrita rosa + texto en mayúsculas + línea */
.section-title {
  font: 700 12.5px/1 var(--font); text-transform: uppercase; letter-spacing: .2em;
  color: var(--ink); display: flex; align-items: center; gap: 14px; margin: 0 0 20px;
}
.section-title::before { content: ""; width: var(--tick); height: 2px; background: var(--pink); flex: 0 0 auto; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* etiqueta de bloque tipo sidebar del CV (rosa, mayúsculas, con línea) */
.block-label {
  font: 700 11px/1 var(--font); letter-spacing: .18em; text-transform: uppercase;
  color: var(--pink); display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
}
.block-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* sección home: columna en móvil, 2 columnas en escritorio */
.home-grid { display: flex; flex-direction: column; gap: 34px; }
@media (min-width: 900px) {
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 34px 30px;
  }
  .home-grid .col-2 { grid-column: span 2; }
  .home-grid .col-3 { grid-column: 1 / -1; }
}

/* ============================ HERO ============================ */
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 26px;
}
.hero.contact { padding: 0; }
.hero-row { display: flex; align-items: center; gap: 24px; }
.ring {
  --p: 0;
  width: 96px; height: 96px; flex: 0 0 auto;
  background: conic-gradient(var(--pink) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  transition: --p .8s cubic-bezier(.22,.9,.3,1);
}
.ring .inner { width: 76px; height: 76px; background: var(--panel); display: grid; place-items: center; text-align: center; }
.ring .num { font-family: var(--disp); font-size: 22px; font-weight: 700; line-height: 1; }
.ring .lbl { font-size: 8.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; font-weight: 700; }
.hero-info { min-width: 0; }
.hero-info h2 { font-size: clamp(20px, 3.4vw, 26px); font-weight: 700; letter-spacing: -.01em; }
.hero-info p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.hero-info .go { margin-top: 18px; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  font: 700 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { border-color: var(--pink); color: var(--pink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-2); border-color: var(--pink-2); color: #fff; }
.btn-indigo { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-indigo:hover { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-sm { padding: 8px 12px; }

/* ============================ CARDS / STATS ============================ */
/* rejilla de tarjetas separadas por 1px, como .contact-row del CV */
.grid-cells { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-cells.cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cells.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cell { background: var(--panel); padding: 22px 20px; }
.cell .ic-row { display: flex; align-items: center; gap: 11px; }

.stat { background: var(--panel); padding: 22px 20px; text-align: left; }
.stat .v { font-family: var(--disp); font-size: clamp(26px, 5vw, 38px); font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.stat .v.pink { color: var(--pink); }
.stat .k { font: 700 10.5px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .16em; margin-top: 11px; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* filas unidas tipo .contact-row: icono rosa a la izquierda */
.rowcell {
  display: flex; align-items: center; gap: 13px; padding: 16px 17px;
  background: var(--panel); color: var(--ink-2); transition: background .15s, color .15s;
  width: 100%; text-align: left;
}
.rowcell:hover { background: var(--hover); color: var(--pink); }
.rowcell .ic { color: var(--pink); flex: 0 0 auto; display: grid; place-items: center; width: 17px; }
.rowcell .ic svg { width: 17px; height: 17px; }
.rowcell .grow { flex: 1; min-width: 0; }
.rowcell .t { font-size: 13.5px; font-weight: 600; }
.rowcell .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rowcell .meta { font-family: var(--disp); font-size: 15.5px; font-weight: 700; color: var(--ink); }

.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.mini {
  background: var(--panel); padding: 22px 20px; display: flex; flex-direction: column; gap: 4px; text-align: left;
  transition: background .15s;
}
.mini:hover { background: var(--hover); }
.mini .v { font-family: var(--disp); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.mini .k { font: 700 10.5px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.mini.accent .v { color: var(--pink); }

/* ============================ SRS BAR ============================ */
.srsbar { display: flex; height: 10px; overflow: hidden; background: var(--line); }
.srsbar span { height: 100%; transition: width .6s ease; }
.srs-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.srs-legend div { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.dot { width: 8px; height: 8px; flex: 0 0 auto; }
.dot.round { border-radius: 50%; }

/* ============================ LISTS ============================ */
.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.list.flush { border: 0; }
.row {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); padding: 16px 17px;
  transition: background .15s;
}
.row.interactive:hover { background: var(--hover); }
.row .jp-big { font-family: var(--jp); font-size: 24px; font-weight: 600; flex: 0 0 auto; min-width: 46px; }
.row .grow { flex: 1; min-width: 0; }
.row .ro { font-size: 12.5px; color: var(--muted); }
.row .es { font-size: 14px; color: var(--ink-2); }
/* etiqueta estilo .tag del CV */
.pill {
  font: 700 10px/1 var(--font); padding: 6px 9px; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap; border: 1px solid var(--line-2); color: var(--ink-2);
}
/* etiqueta como .lbl de skills */
.lbl {
  font: 700 10px/1 var(--font); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}

/* ============================ CATEGORY PROGRESS ============================ */
.cat-card { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; }
.cat-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cat-card .top .jp { font-family: var(--jp); font-size: 16px; font-weight: 700; }
.cat-card .top .es { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.cat-card .pct { font-size: 12px; color: var(--muted); margin: 12px 0 8px; }
.cat-bar { height: 6px; background: var(--line); overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--pink); transition: width .6s ease; }
@media (min-width: 900px) {
  .cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
  .cat-list .cat-card { border: 0; }
}

/* ============================ SETTINGS ============================ */
.settings-grid { display: grid; gap: 22px; }
@media (min-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 22px 30px; } }
.settings-group { border: 1px solid var(--line); overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-row .t { font-size: 14px; font-weight: 600; }
.set-row .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.switch { width: 44px; height: 24px; flex: 0 0 auto; position: relative; background: var(--line-2); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; transition: transform .2s; }
.switch.on { background: var(--pink); }
.switch.on::after { transform: translateX(20px); }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 30px; height: 30px; border: 1px solid var(--line-2); font-size: 17px; font-weight: 700; display: grid; place-items: center; transition: .15s; }
.stepper button:hover { border-color: var(--pink); color: var(--pink); }
.stepper .val { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================ EMPTY ============================ */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-family: var(--jp); font-size: 54px; color: var(--pink); }
.empty h3 { color: var(--ink); margin: 16px 0 8px; font-size: 19px; }
.empty p { margin: 0 auto; font-size: 13.5px; line-height: 1.7; max-width: 440px; }

/* ============================ TAB BAR (móvil) ============================ */
.tabbar { display: none; }
@media (max-width: 899px) {
  .tabbar {
    position: sticky; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(var(--safe-b) + 6px);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; transition: color .15s; position: relative; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--pink); }
  .tab .badge { position: absolute; top: 2px; right: 50%; transform: translateX(20px); min-width: 16px; height: 16px; padding: 0 4px; background: var(--pink); color: #fff; font-size: 9px; line-height: 16px; font-weight: 800; text-align: center; }
  .tab .badge.indigo { background: var(--ink); color: var(--bg); }
}
.ic { display: grid; place-items: center; }

/* ============================ DESKTOP NAV ============================ */
.desktop-nav { display: none; }
@media (min-width: 900px) {
  .desktop-nav { display: flex; align-items: center; gap: 2px; }
  .dnav {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 10px 14px;
    font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
    border: 1px solid transparent; transition: .15s;
  }
  .dnav svg { width: 17px; height: 17px; }
  .dnav:hover { color: var(--ink); }
  .dnav.active { color: var(--pink); border-color: color-mix(in srgb, var(--pink) 40%, transparent); }
  .dnav .badge { min-width: 16px; height: 16px; padding: 0 4px; background: var(--pink); color: #fff; font-size: 9px; line-height: 16px; font-weight: 800; text-align: center; }
  .dnav .badge.indigo { background: var(--ink); color: var(--bg); }
}

/* ============================ SESSION ============================ */
/* La animación va en el contenedor, que se crea una vez por sesión.
   (Antes estaba en .session, que se recreaba en cada card y hacía
   parpadear el dashboard entre preguntas al reiniciarse el fadeUp.) */
#session-root { position: fixed; inset: 0; z-index: 60; animation: fadeUp .25s ease both; }
.session {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.ses-inner { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 720px; margin: 0 auto; min-height: 0; }
.ses-head { display: flex; align-items: center; gap: 14px; padding: calc(var(--safe-t) + 16px) 24px 12px; }
.ses-head .close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 18px; color: var(--muted); transition: .15s; }
.ses-head .close:hover { border-color: var(--pink); color: var(--pink); }
.progress { flex: 1; height: 6px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--pink); transition: width .35s ease; }
.ses-head .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; font-weight: 700; letter-spacing: .06em; }
.ses-body { flex: 1; display: flex; flex-direction: column; padding: 10px 24px 24px; overflow-y: auto; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 16px; }
.q-tag { font: 700 10.5px/1 var(--font); text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }
.pill-srs { font: 700 10px/1 var(--font); padding: 6px 9px; letter-spacing: .1em; text-transform: uppercase; color: #fff; }

.q-card {
  background: var(--panel); border: 1px solid var(--line);
  padding: 40px 24px; text-align: center;
  animation: pop .28s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.q-card .prompt-jp { font-family: var(--jp); font-size: clamp(52px, 17vw, 88px); font-weight: 700; line-height: 1.1; }
.q-card .prompt-es { font-family: var(--disp); font-size: clamp(26px, 7.5vw, 36px); font-weight: 700; line-height: 1.25; }
.q-card .sub { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

.answer-zone { margin-top: 22px; }
.answer-input {
  width: 100%; text-align: center; font-size: 22px; font-weight: 700;
  padding: 16px 14px;
  background: var(--field); border: 1px solid var(--line-2); outline: none;
  transition: border-color .15s; color: var(--ink);
}
.answer-input.jp { font-family: var(--jp); }
.answer-input::placeholder { color: var(--muted); font-weight: 500; }
.answer-input:focus { border-color: var(--pink); }
.answer-hint { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 22px; }
.options .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.opt {
  min-height: 108px; padding: 18px 12px;
  background: var(--panel);
  display: grid; place-items: center; text-align: center;
  font-size: 19px; font-weight: 700; line-height: 1.25; color: var(--ink);
  transition: background .15s, color .15s;
}
.opt.jp { font-family: var(--jp); font-size: 27px; }
.opt:hover { background: var(--hover); }
.opt.correct { background: var(--green); color: #fff; }
.opt.wrong { background: var(--red); color: #fff; }
.opt.dim { opacity: .35; }

.ses-actions { margin-top: auto; padding-top: 20px; }

/* feedback sheet */
.feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  padding: 22px 24px calc(var(--safe-b) + 24px);
  padding-left: max(24px, calc((100vw - var(--maxw)) / 2 + 24px));
  padding-right: max(24px, calc((100vw - var(--maxw)) / 2 + 24px));
  background: var(--panel);
  border-top: 2px solid var(--line-2);
  transform: translateY(115%); transition: transform .3s cubic-bezier(.22,.9,.3,1);
}
@media (min-width: 720px) {
  .feedback { bottom: 24px; border: 1px solid var(--line-2); border-top-width: 2px; }
}
.feedback.show { transform: none; }
.feedback.ok { border-top-color: var(--green); }
.feedback.close { border-top-color: var(--gold); }
.feedback.bad { border-top-color: var(--red); }
.fb-verdict { display: flex; align-items: center; gap: 12px; font-family: var(--disp); font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.fb-verdict .icon { width: 28px; height: 28px; display: grid; place-items: center; font-size: 15px; color: #fff; }
.feedback.ok .icon { background: var(--green); }
.feedback.close .icon { background: var(--gold); }
.feedback.bad .icon { background: var(--red); }
.fb-answer { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.fb-answer b { color: var(--ink); font-size: 16px; }
.fb-answer .jp { font-size: 20px; }
.fb-actions { margin-top: 18px; display: flex; gap: 10px; }

/* frase de ejemplo expandible en el feedback */
.fb-example { margin-top: 14px; border: 1px solid var(--line-2); background: var(--panel); }
.fb-example > summary {
  cursor: pointer; list-style: none; padding: 12px 14px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--pink); display: flex; align-items: center; gap: 8px;
}
.fb-example > summary::-webkit-details-marker { display: none; }
.fb-example > summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.fb-example[open] > summary::before { transform: rotate(90deg); }
.fb-example > summary:hover { background: var(--hover); }
.fb-ex-jp { padding: 4px 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fb-ex-jp .jp { font-size: 18px; font-weight: 700; }
.fb-ex-kana { padding: 2px 14px 0; color: var(--muted); font-size: 13px; }
.fb-ex-es { padding: 6px 14px 0; font-size: 14px; color: var(--ink); }
.fb-ex-alt { padding: 4px 14px 14px; font-size: 12.5px; color: var(--muted); }

/* botón grande para facilitar el paso al siguiente ejercicio */
.btn-lg { padding: 18px 24px; font-size: 14px; letter-spacing: .16em; gap: 10px; }
.btn-lg .arw { font-size: 17px; line-height: 1; }

/* summary */
.summary { text-align: center; padding: 20px 8px; }
.summary .big { font-family: var(--jp); font-size: 58px; color: var(--pink); }
.summary h2 { margin: 12px 0 4px; font-size: 23px; }
.summary p { color: var(--muted); margin: 0 auto 22px; max-width: 440px; }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 4px 0 24px; }
.sum-grid .stat .v { font-size: 22px; }

/* toast (solo avisos puntuales: export/import/reset) */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 84px); transform: translate(-50%, -12px);
  background: var(--ink); color: var(--bg); font: 700 11px/1 var(--font);
  padding: 12px 18px; letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 100;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.fb-hint { margin-top: 10px; text-align: center; font: 600 10px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.glow-burn { animation: burnPulse .9s ease; }
@keyframes burnPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }

.small-link { color: var(--muted); font-size: 11px; text-decoration: underline; text-align: center; background: none; letter-spacing: .04em; }
.small-link:hover { color: var(--pink); }

/* ============================ ABOUT / HISTORIA ============================ */
.about { max-width: 760px; width: 100%; min-width: 0; }
.about-intro { margin-bottom: 30px; }
.about-lead {
  font-family: var(--disp); font-size: clamp(20px, 3.2vw, 27px); font-weight: 700;
  line-height: 1.3; letter-spacing: -.01em; color: var(--ink); max-width: 620px;
}
.about-by {
  margin-top: 12px; font: 700 10.5px/1.5 var(--font); letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.chapters { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.chapter {
  display: flex; gap: 18px; padding: 22px 20px; background: var(--panel);
}
.chapter > div { min-width: 0; flex: 1; }
.chapter-k {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--disp); font-size: 14px; font-weight: 700; color: #fff; background: var(--pink);
}
.chapter h3 {
  font-family: var(--disp); font-size: 16px; font-weight: 700; letter-spacing: -.005em;
  margin: 4px 0 8px;
}
.chapter p { font-size: 14px; line-height: 1.7; color: var(--ink-2); margin: 0; max-width: 58ch; overflow-wrap: anywhere; }
.about-foot { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) {
  .chapter { gap: 14px; padding: 18px 16px; }
  .chapter-k { width: 28px; height: 28px; font-size: 12px; }
  .chapter p { font-size: 13.5px; }
}
.divider { height: 1px; background: var(--line); }

/* ============================ REVIEW CHOICE ============================ */
.review-choice { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 760px) { .review-choice { grid-template-columns: 1fr 1fr; } }
.choice-card {
  background: var(--panel); text-align: left; padding: 26px 24px;
  display: flex; flex-direction: column; gap: 10px; color: var(--ink);
  transition: background .15s;
}
.choice-card:hover { background: var(--hover); }
.choice-card .choice-ic { width: 30px; height: 30px; color: var(--pink); }
.choice-card .choice-ic svg { width: 30px; height: 30px; }
.choice-card .choice-t { font-family: var(--disp); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.choice-card .choice-d { font-size: 13.5px; color: var(--muted); line-height: 1.6; flex: 1; }
.choice-card .choice-go { font: 700 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--pink); margin-top: 6px; }
.choice-card.primary { background: var(--pink); color: #fff; }
.choice-card.primary:hover { background: var(--pink-2); }
.choice-card.primary .choice-ic,
.choice-card.primary .choice-d,
.choice-card.primary .choice-go { color: rgba(255,255,255,.92); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  font: 700 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 14px; border: 1px solid var(--line-2); color: var(--ink-2); background: transparent;
  transition: .15s;
}
.chip-btn:hover { border-color: var(--pink); color: var(--pink); }
.chip-btn.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.hint-line { margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.6; max-width: 60ch; }

/* ---------------- Sesión / cuenta ---------------- */
.account-btn svg { width: 20px; height: 20px; }
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--ink); cursor: pointer; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 14px/1 var(--font); transition: .15s;
}
.avatar-btn:hover { border-color: var(--pink); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .12s ease;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
.modal {
  position: relative; width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line-2); padding: 30px 28px 26px; text-align: center;
}
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px;
}
.modal-x:hover { color: var(--ink); }
.modal-title { font-family: var(--disp); font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.modal-sub { font-size: 13px; color: var(--muted); margin: 0 0 22px; line-height: 1.6; }
.modal-input {
  width: 100%; margin-bottom: 10px; padding: 13px 14px; background: var(--field);
  border: 1px solid var(--line-2); color: var(--ink); font: 500 14px var(--font);
}
.modal-input:focus { outline: none; border-color: var(--pink); }
.modal-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.modal-or::before, .modal-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.modal-hint { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.modal-err { font-size: 12.5px; color: var(--red); margin: 10px 0 0; min-height: 16px; }

/* ficha de término (clic en la lista de una categoría) */
.word-modal { max-width: 440px; text-align: center; }
.wm-top { display: flex; align-items: center; justify-content: center; gap: 12px; }
.wm-jp { font-family: var(--jp); font-size: 40px; font-weight: 700; line-height: 1.1; }
.wm-kana { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.wm-romaji { font-size: 12.5px; color: var(--muted); }
.wm-es { font-family: var(--disp); font-size: 18px; font-weight: 700; margin: 14px 0 16px; }
.lvl-bar.wm-lvl { width: 100%; }
.lvl-bar.wm-lvl .lvl-track { height: 7px; }
.wm-next { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.wm-next svg { width: 11px; height: 11px; vertical-align: -1px; color: var(--gold); }
.wm-ex { border: 1px solid var(--line-2); background: var(--panel-2); padding: 14px 16px; text-align: left; margin-bottom: 16px; }
.wm-ex-label { font: 700 10px/1 var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--pink); margin-bottom: 10px; }
.wm-ex-jp { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wm-ex-jp .jp { font-family: var(--jp); font-size: 20px; font-weight: 700; }
.wm-ex-kana { font-size: 13px; color: var(--muted); margin-top: 6px; }
.wm-ex-es { font-size: 14px; color: var(--ink); margin-top: 8px; }
.wm-ex-empty { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.wm-cat { font: 700 10px/1 var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
}
.btn-google:hover { background: #f5f5f5; }
.acct-head { display: flex; align-items: center; gap: 14px; text-align: left; margin-bottom: 16px; }
.acct-av {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  background: var(--pink); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font: 700 20px/1 var(--font); flex-shrink: 0;
}
.acct-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.acct-mail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.acct-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.acct-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.acct-status .dot.on { background: #40c057; }

/* ---------------- Color por dirección de pregunta ---------------- */
:root, html[data-theme="dark"] {
  --dir-jpes: #4c8dff;   /* Japonés -> Español */
  --dir-esjp: #b06bff;   /* Español -> Japonés */
  --dir-read: #f5a623;   /* Japonés -> Lectura */
}
html[data-theme="light"] {
  --dir-jpes: #2f6fe0;
  --dir-esjp: #8b46e0;
  --dir-read: #d98a00;
}

.q-top .q-tag { display: inline-flex; align-items: center; gap: 8px; }
.q-top .dir-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }

/* barra superior de color en la tarjeta de pregunta */
.q-card { position: relative; overflow: hidden; padding-top: 44px; }
.q-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--muted);
}
.q-card.dir-jpes::before { background: var(--dir-jpes); }
.q-card.dir-esjp::before { background: var(--dir-esjp); }
.q-card.dir-read::before { background: var(--dir-read); }

/* borde del input según dirección */
.answer-input.dir-jpes { border-left: 5px solid var(--dir-jpes); }
.answer-input.dir-esjp { border-left: 5px solid var(--dir-esjp); }
.answer-input.dir-read { border-left: 5px solid var(--dir-read); }

/* borde de las opciones según dirección */
.options.dir-jpes { border-color: var(--dir-jpes); }
.options.dir-esjp { border-color: var(--dir-esjp); }
.options.dir-read { border-color: var(--dir-read); }

/* barra de progreso según dirección */
.progress.dir-jpes i { background: var(--dir-jpes); }
.progress.dir-esjp i { background: var(--dir-esjp); }
.progress.dir-read i { background: var(--dir-read); }

/* ---------------- Home acción-primero ---------------- */
.home2 { display: flex; flex-direction: column; gap: 22px; }

.action-card {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--panel); border: 1px solid var(--line-2); position: relative; overflow: hidden;
}
.action-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--pink); }

.action-live {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.flame-live { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.flame-live svg { width: 24px; height: 24px; color: var(--pink); }
.flame-live span { font-family: var(--disp); font-size: 26px; font-weight: 700; color: var(--ink); }
.hearts { display: inline-flex; align-items: center; gap: 3px; }
.hearts .heart { display: inline-flex; color: var(--line-2); }
.hearts .heart svg { width: 15px; height: 15px; }
.hearts .heart.on { color: #ff3d81; }
.goal-wrap { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 180px; }
.goal-bar { width: 180px; height: 6px; background: var(--line); overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: var(--pink); transition: width .35s ease; }
.goal-txt { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.goal-txt.done { color: #40c057; }

.action-main { padding: 28px 22px 30px; }
.action-main h2 { font-family: var(--disp); font-size: clamp(24px, 6vw, 34px); font-weight: 700; letter-spacing: -.01em; margin: 8px 0 8px; }
.action-main p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 20px; max-width: 56ch; }

.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .mini-stats { grid-template-columns: repeat(4, 1fr); } }

/* resumen de racha en el resumen de sesión */
.streak-summary {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line-2); background: var(--panel-2);
}
.streak-summary .flame { display: flex; }
.streak-summary .flame svg { width: 30px; height: 30px; color: var(--pink); }
.streak-summary .ss-t { font-weight: 700; font-size: 15px; }
.streak-summary .ss-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.streak-summary .ss-bar { flex-basis: 100%; height: 6px; background: var(--line); overflow: hidden; }
.streak-summary .ss-bar i { display: block; height: 100%; background: var(--pink); }

/* estado de racha en Ajustes */
.streak-status { display: flex; align-items: center; gap: 14px; width: 100%; }
.streak-status .flame-big { display: flex; }
.streak-status .flame-big svg { width: 30px; height: 30px; color: var(--pink); }
.streak-status .grow { flex: 1; }
.streak-status .t { font-weight: 700; }
.streak-status .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.streak-status .ss-now { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.streak-status .heart { display: inline-flex; color: var(--line-2); }
.streak-status .heart svg { width: 15px; height: 15px; }
.streak-status .heart.on { color: #ff3d81; }

/* ---------------- Botón de audio (TTS) ---------------- */
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--ink-2); cursor: pointer; transition: .15s; flex: 0 0 auto;
}
.speak-btn:hover { border-color: var(--pink); color: var(--pink); }
.speak-btn svg { width: 20px; height: 20px; }
.speak-btn:active { transform: scale(.94); }
.q-card .speak-abs { position: absolute; top: 14px; right: 14px; }
/* vista de categoría */
.row-btn { width: 100%; text-align: left; cursor: pointer; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: inherit; display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.row-btn:hover { background: var(--hover); }
.row-chev { color: var(--muted); font-size: 22px; line-height: 1; }
.back-link { background: transparent; border: 0; color: var(--muted); cursor: pointer; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 6px 0; margin-bottom: 6px; }
.back-link:hover { color: var(--pink); }
.word-counts { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 18px; }
.word-counts .wc { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.word-counts .wc b { color: var(--ink); }
.word-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.word-row { display: flex; flex-direction: column; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.word-row[data-action] { cursor: pointer; transition: background .15s; }
.word-row[data-action]:hover { background: var(--hover); }
.word-row.new { opacity: .55; }
.word-main { display: flex; align-items: center; gap: 12px; width: 100%; }
.word-row .jp-big { font-family: var(--jp); font-size: 24px; font-weight: 600; flex: 0 0 auto; min-width: 78px; }
.word-main .grow { flex: 1; min-width: 0; }
.word-row .ro { font-size: 12.5px; color: var(--muted); }
.word-row .w-ro { opacity: .7; }
.word-row .es { font-size: 13.5px; color: var(--ink-2); }
.word-state { font-family: var(--disp); font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; flex: 0 0 auto; min-width: 82px; text-align: right; color: var(--muted); }
.word-state svg, .lvl-num svg { width: 11px; height: 11px; vertical-align: -1px; }
.word-bar { height: 7px; background: var(--line-2); overflow: hidden; }
.word-bar i { display: block; height: 100%; transition: width .4s ease; }
.srs-tag { font: 700 9.5px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: #fff; padding: 5px 8px; white-space: nowrap; }
.due-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 25%, transparent); flex: 0 0 auto; }
.due-dot.off { visibility: hidden; }
.speak-sm { width: 32px; height: 32px; flex: 0 0 auto; }
.speak-sm svg { width: 16px; height: 16px; }
.speak-spacer { width: 32px; height: 32px; flex: 0 0 auto; }

/* barra de nivel por término */
.lvl-bar { display: flex; align-items: center; gap: 8px; }
.lvl-bar .lvl-track { flex: 1; height: 8px; background: var(--line); overflow: hidden; }
.lvl-bar .lvl-fill { height: 100%; transition: width .3s; }
.lvl-num { font-family: var(--disp); font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.lvl-bar.q-lvl { margin-left: auto; width: 96px; }
.lvl-bar.q-lvl .lvl-track { height: 6px; }
.lvl-bar.q-lvl .lvl-num { font-size: 11px; }
/* barra de nivel dentro del feedback (al acertar / fallar) */
.fb-level { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.lvl-bar.fb-lvl { flex: 1; }
.lvl-bar.fb-lvl .lvl-track { height: 6px; }
.fb-delta { font: 700 10px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; padding: 5px 8px; white-space: nowrap; }
.fb-delta.up { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.fb-delta.down { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
