/* ---------- 1. TOKENS ---------- */
:root {
    --c-bg: #F3F3F0;        /* separaciones entre filas */
    --c-surface: #FAFAF8;   /* hoja de la app */
    --c-sunken: #E9E9E4;    /* controles en reposo, barra inferior */
    --c-hover: #F5F5F2;
    --c-text: #16181D;
    --c-text-2: #555963;    /* 6.7:1 sobre surface */
    --c-text-off: #A9ABB0;  /* solo días fuera del mes (decorativos) */
    --c-control: #8A8D94;   /* borde de controles vacíos (≥3:1) */
    --ai-1: #E4EAF4; --ai-2: #B7C6DF; --ai-3: #6F8CBD; --ai-4: #2D5394; --ai-5: #1A2E5C;
    --c-primary: var(--ai-4);
    --c-primary-press: var(--ai-5);
    --c-ok: #2F7D57;
    --c-partial: #D3E8DB; --c-partial-ink: #1F5A3D;
    --c-miss-ink: #A6402C; --c-miss-ring: #D98B7B;
    --c-danger: #B42318; --c-danger-soft: #FBEDEB;
    --focus: var(--ai-4);
 
    --font-ui: 'Jost', ui-sans-serif, system-ui, sans-serif;
    --font-kanji: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
    /* Escala 16 · 18 · 22 · 28 · 44. Nada debajo de 16 salvo el menú inferior (14) */
    --fs-nav: .875rem; --fs-m: 1rem; --fs-l: 1.125rem; --fs-xl: 1.375rem; --fs-xxl: 1.75rem; --fs-title: 2.75rem;
 
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
    --gutter: 20px;
    --r-cell: 8px; --r-group: 18px; --r-full: 999px;
 
    --ease-out: cubic-bezier(.23, 1, .32, 1);
    --dur-press: 140ms; --dur-ui: 220ms;
 
    --nav-h: 76px; --fab: 60px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    color-scheme: light;
}
 
/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body {
    display: flex; justify-content: center; overflow-x: hidden;
    background: var(--c-sunken); color: var(--c-text);
    font: var(--fs-m)/1.5 var(--font-ui);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
button:disabled { cursor: default; }
[role="button"] { cursor: pointer; }
button, a, [role="button"] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; }
p { text-wrap: pretty; }
:focus { outline: none; }
/* outline sigue el radio de cada elemento y se ve en modo alto contraste */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--ai-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
 
/* ---------- 3. ESTRUCTURA ---------- */
#root {
    position: relative; isolation: isolate;
    display: flex; flex-direction: column;
    width: 100%; max-width: 480px; min-height: 100dvh;
    background: var(--c-surface);
    /* barra inferior + botón + aire: nada queda tapado */
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + var(--fab) + var(--s-8));
}
.page { flex: 1; padding: var(--s-2) var(--gutter) 0; }
.page--float { padding-top: calc(var(--s-4) + var(--safe-t)); } /* la carita flota a la altura del título */
.page__title { margin: var(--s-4) 0 var(--s-5); font-size: var(--fs-title); font-weight: 700; line-height: 1; letter-spacing: -.045em; }
.page--float .page__title { margin-top: 0; line-height: 44px; }
.page__lede { max-width: 36ch; margin: calc(var(--s-2) * -1) 0 var(--s-6); font-size: var(--fs-l); line-height: 1.45; }
 
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin: var(--s-8) 0 var(--s-3); font-weight: 600; }
.section-title__count { color: var(--c-text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
 
/* Grupo de filas separadas por un paso de tono, no por líneas */
.group { display: flex; flex-direction: column; gap: 4px; overflow: hidden; border-radius: var(--r-group); background: var(--c-bg); }
 
.badge { display: inline-block; padding: 0 8px; border-radius: var(--r-full); background: var(--ai-1); color: var(--ai-5); font-weight: 600; }
 
/* ---------- 4. ENCABEZADO ---------- */
.site-header { padding: calc(var(--s-4) + var(--safe-t)) var(--gutter) var(--s-6); background: var(--c-surface); }
.site-header--compact { padding-bottom: var(--s-2); }
.site-header--float { position: absolute; top: 0; right: 0; z-index: 5; padding-bottom: 0; background: transparent; }
.site-header__top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.site-header__title { margin: var(--s-3) 0 0; }
.site-header__date { display: flex; align-items: center; gap: var(--s-1); margin-left: -12px; color: var(--c-text-2); font-weight: 500; }
.site-header__arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-full); color: var(--c-text-2); }
.site-header__today { min-height: 36px; margin-top: var(--s-1); padding: 0 var(--s-3); }
.site-header__benefit { margin-top: var(--s-3); padding: 4px 12px; }
 
/* Barra de nivel: cada bloque, una inmersión más oscura */
.site-header__blocks { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: var(--s-5); }
.site-header__block { height: 10px; background: var(--c-sunken); transition: background-color var(--dur-ui) var(--ease-out); }
.site-header__block--on { background: var(--ai-2); }
.site-header__block--on:nth-child(n+4) { background: var(--ai-3); }
.site-header__block--on:nth-child(n+7) { background: var(--ai-4); }
.site-header__block--on:nth-child(n+9) { background: var(--ai-5); }
.site-header__xp { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px var(--s-3); margin-top: var(--s-3); color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.site-header__xp-value { color: var(--c-text); font-weight: 700; white-space: nowrap; }
 
.face-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-full); background: var(--c-sunken); transition: transform var(--dur-press) var(--ease-out); }
.face-btn:active { transform: scale(.94); }
.face-btn__img { width: auto; height: 28px; }
 
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 var(--s-4) 0 var(--s-3);
    border-radius: var(--r-full); background: var(--c-sunken); font-weight: 600;
    transition: transform var(--dur-press) var(--ease-out);
}
.back-link:active { transform: scale(.97); }
.back-link svg, .site-header__arrow svg, .icon-btn svg { width: 16px; height: 16px; }
 
/* ---------- 5. CONTROL SEGMENTADO (filtros y frecuencia) ---------- */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-full); background: var(--c-sunken); }
.segmented__btn {
    min-height: 44px; padding: 0 6px; border-radius: var(--r-full);
    color: var(--c-text-2); font-weight: 600;
    transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}
.segmented__btn--active { background: var(--c-text); color: #fff; }
 
/* ---------- 6. FILAS (hábitos y premios) ---------- */
.card {
    position: relative; display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-4) var(--s-4) var(--s-4) 18px; background: var(--c-surface);
    transition: background-color var(--dur-ui) var(--ease-out);
}
.card--done { background: var(--ai-1); }
.card__body { flex: 1; min-width: 0; }
.card__title { margin-bottom: 2px; font-size: var(--fs-l); font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.card__meta { color: var(--c-text-2); }
.card__meta + .card__meta { margin-top: 1px; }
.card__em { color: var(--c-text); font-weight: 700; white-space: nowrap; }
.card--done .card__meta, .card--done .card__em { color: var(--ai-5); }
 
/* Al marcar: la fila se tiñe de abajo hacia arriba */
.card--flash { background: var(--c-surface); }
.card--flash::before { content: ""; position: absolute; inset: 0; background: var(--ai-1); transform-origin: bottom; pointer-events: none; animation: dip 320ms var(--ease-out) both; }
.card--flash > * { position: relative; }
.card__xp { position: absolute; top: 10px; right: 68px; color: var(--ai-4); font-weight: 700; pointer-events: none; animation: xp-float 900ms var(--ease-out) forwards; }
 
/* Check del hábito: 40px visibles, 48px de área táctil */
.card__check {
    position: relative; flex-shrink: 0; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 50%;
    color: transparent; box-shadow: inset 0 0 0 2px var(--c-control);
    transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) ease;
}
.card__check::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.card__check svg { width: 18px; height: 18px; }
.card__check:active { transform: scale(.9); }
.card__check--done { background: var(--c-primary); color: #fff; box-shadow: none; }
.card__check--done svg { animation: check-in 260ms var(--ease-out) both; }
 
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.price__value { color: var(--c-text); font-weight: 700; }
.price__old { text-decoration: line-through; }
 
.meter { width: 150px; max-width: 100%; height: 6px; margin-top: var(--s-2); overflow: hidden; border-radius: var(--r-full); background: var(--c-sunken); }
.meter__fill { display: block; height: 100%; background: var(--ai-3); }
 
/* ---------- 7. BOTONES ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    width: 100%; min-height: 52px; padding: 0 var(--s-5);
    border-radius: var(--r-full); font-weight: 600;
    transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-press) ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:active { background: var(--c-primary-press); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--ghost, .btn--ghost-danger { min-height: 48px; margin-top: var(--s-2); color: var(--c-text-2); }
.btn--ghost-danger { color: var(--c-danger); }
.btn--ghost-danger:active { background: var(--c-danger-soft); }
.btn--small { flex-shrink: 0; width: auto; min-height: 44px; padding: 0 var(--s-4); white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--c-sunken); color: var(--c-text-2); transform: none; }
 
.icon-btn {
    display: grid; place-items: center; flex-shrink: 0;
    width: 44px; height: 44px; border-radius: var(--r-full);
    background: var(--c-sunken); font-size: 15px;
    transition: transform var(--dur-press) var(--ease-out);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn--plain { background: transparent; color: var(--c-text-2); }
 
.fab {
    position: fixed; z-index: 30;
    right: max(var(--gutter), calc(50vw - 240px + var(--gutter)));
    bottom: calc(var(--nav-h) + var(--safe-b) + var(--s-4));
    display: grid; place-items: center;
    width: var(--fab); height: var(--fab); border-radius: 50%;
    background: var(--c-primary); color: #fff; font-size: 22px;
    box-shadow: 0 8px 20px -6px rgba(26, 46, 92, .45); /* única sombra junto a menú y diálogos */
    transition: transform var(--dur-press) var(--ease-out);
}
.fab:active { transform: scale(.92); }
 
/* ---------- 8. ACCESOS "TAMBIÉN HOY" ---------- */
.shortcut {
    display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
    min-height: 64px; padding: var(--s-3) var(--s-4) var(--s-3) 18px;
    background: var(--c-surface); font-weight: 600;
}
.shortcut:active { background: var(--c-bg); }
.shortcut__sub { display: block; color: var(--c-text-2); font-weight: 400; }
.shortcut__icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--c-text-2); }
 
/* Filas dentro de un .group: el foco va por dentro para que no se recorte */
.card:focus-visible, .shortcut:focus-visible, .mood:focus-visible { outline-offset: -3px; }
 
/* ---------- 9. CALENDARIO ---------- */
.calendar__nav { display: flex; justify-content: space-between; align-items: center; margin: var(--s-6) 0 var(--s-3); }
.calendar__label { font-size: clamp(1.25rem, 6.4vw, var(--fs-xl)); font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.calendar__year { color: var(--c-text-2); font-weight: 500; }
.calendar__arrows { display: flex; gap: 6px; }
.calendar__weekdays, .calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar__weekdays { margin-bottom: 6px; color: var(--c-text-2); font-weight: 500; }
.calendar__day { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r-cell); background: var(--c-sunken); font-weight: 500; font-variant-numeric: tabular-nums; }
.calendar__day--outside { background: transparent; color: var(--c-text-off); }
.calendar__day--future { color: var(--c-text-2); }
.calendar__day--ok, .calendar__swatch--ok { background: var(--c-ok); color: #fff; }
.calendar__day--partial, .calendar__swatch--partial { background: var(--c-partial); color: var(--c-partial-ink); }
.calendar__day--miss, .calendar__swatch--miss { background: var(--c-surface); color: var(--c-miss-ink); box-shadow: inset 0 0 0 2px var(--c-miss-ring); }
.calendar__day--pending, .calendar__swatch--pending { background: var(--c-primary); color: #fff; }
.calendar__day--today { font-weight: 700; box-shadow: inset 0 0 0 3px var(--c-text); }
.calendar__day--today.calendar__day--ok,
.calendar__day--today.calendar__day--pending { box-shadow: inset 0 0 0 3px var(--c-text), inset 0 0 0 5px #fff; }
.calendar__legend { display: grid; grid-template-columns: auto auto; justify-content: start; gap: var(--s-2) var(--s-6); margin-top: var(--s-4); color: var(--c-text-2); }
.calendar__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.calendar__swatch { width: 14px; height: 14px; border-radius: 4px; }
 
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: var(--s-5); overflow: hidden; border-radius: 16px; }
.facts__item { padding: 14px var(--s-4); background: var(--c-bg); }
.facts__value { display: block; font-size: var(--fs-xxl); font-weight: 700; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.facts__label { color: var(--c-text-2); }
 
/* ---------- 10. SALDO (premios) ---------- */
.wallet { container-type: inline-size; margin-bottom: var(--s-3); padding: var(--s-5); border-radius: 20px; background: var(--ai-5); color: #fff; }
.wallet__amount { display: block; font-size: clamp(2.5rem, 17cqi, 4rem); font-weight: 700; line-height: .95; letter-spacing: -.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wallet__label { color: var(--ai-2); }
.wallet-note { margin-bottom: var(--s-5); color: var(--c-text-2); line-height: 1.45; }
 
/* ---------- 11. ESTADOS VACÍOS ---------- */
.empty-state { display: flex; flex-direction: column; align-items: flex-start; padding: var(--s-6) var(--s-5); border-radius: var(--r-group); background: var(--c-bg); }
.empty-state__img { width: 48px; height: auto; margin-bottom: var(--s-3); }
.empty-state__title { margin-bottom: 2px; font-size: var(--fs-l); font-weight: 600; letter-spacing: -.015em; }
.empty-state__text { max-width: 32ch; color: var(--c-text-2); }
 
/* ---------- 12. FORMULARIOS ---------- */
.field { margin-bottom: var(--s-4); }
.field__label { display: block; margin-bottom: 6px; font-weight: 600; }
.field__hint { margin-top: 6px; color: var(--c-text-2); }
 
.input {
    width: 100%; min-height: 52px; padding: 12px var(--s-4);
    border: none; border-radius: 14px; background: var(--c-sunken);
    font-size: 16px; /* evita el zoom de iOS */
    font-variant-numeric: tabular-nums;
    -webkit-user-select: text; user-select: text;
    transition: box-shadow var(--dur-press) ease;
}
.input::placeholder { color: var(--c-text-2); }
.input:focus { box-shadow: inset 0 0 0 2px var(--c-primary); }
.input:focus-visible { outline: none; }
.input--select {
    appearance: none; -webkit-appearance: none;
    padding-right: 44px; border-radius: var(--r-full); font-weight: 600; cursor: pointer;
    background: var(--c-sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 18px center;
}
.input--textarea { display: block; min-height: 150px; margin-bottom: var(--s-3); line-height: 1.55; resize: vertical; }
.composer__footer { display: flex; justify-content: space-between; align-items: center; margin: calc(var(--s-1) * -1) 0 var(--s-4); color: var(--c-text-2); font-variant-numeric: tabular-nums; }
 
/* Estado de ánimo: cada opción es una fila dentro de un .group */
.mood {
    display: flex; align-items: center; gap: var(--s-4);
    min-height: 76px; padding: var(--s-4) 18px;
    background: var(--c-surface); text-align: left;
    transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out);
}
.mood--selected { background: var(--ai-5); color: #fff; }
.mood--selected:focus-visible { outline-color: #fff; }
.mood__text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.mood__title { font-size: var(--fs-l); font-weight: 600; letter-spacing: -.015em; }
.mood__sub { color: var(--c-text-2); }
.mood--selected .mood__sub { color: var(--ai-2); }
 
.energy { display: inline-flex; align-items: flex-end; gap: 3px; flex-shrink: 0; height: 22px; }
.energy__bar { width: 6px; border-radius: 2px; background: var(--c-sunken); }
.energy__bar:nth-child(1) { height: 8px; }
.energy__bar:nth-child(2) { height: 15px; }
.energy__bar:nth-child(3) { height: 22px; }
.energy__bar--on { background: var(--ai-3); }
.mood--selected .energy__bar { background: var(--ai-4); }
.mood--selected .energy__bar--on { background: #fff; }
 
/* ---------- 13. LISTAS DE ENTRADAS (notas, historial) ---------- */
.entry { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) 0; }
.entry + .entry { margin-top: var(--s-1); }
.entry--center { align-items: center; }
.entry__body { flex: 1; min-width: 0; }
.entry__date { display: block; margin-bottom: 2px; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.entry__text { line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.entry__value { display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 600; }
 
/* ---------- 14. DIÁLOGOS Y HOJAS ---------- */
.overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: var(--gutter); background: rgba(22, 24, 29, .42);
    animation: fade-in var(--dur-ui) ease both;
}
.overlay--sheet { align-items: flex-end; padding: 0; }
.dialog {
    width: 100%; max-width: 360px; padding: var(--s-6);
    border-radius: 22px; background: var(--c-surface);
    box-shadow: 0 24px 48px -12px rgba(22, 24, 29, .3);
    animation: rise-in 240ms var(--ease-out) both;
}
.dialog__title, .sheet__title { font-size: var(--fs-xl); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.dialog__title { margin-bottom: var(--s-2); }
.dialog__text { margin-bottom: var(--s-6); color: var(--c-text-2); }
.dialog__actions { display: flex; flex-direction: column; gap: var(--s-2); }
 
.sheet {
    width: 100%; max-width: 480px; max-height: 92dvh;
    overflow-y: auto; overscroll-behavior: contain;
    padding: var(--s-2) var(--gutter) calc(var(--s-6) + var(--safe-b));
    border-radius: 24px 24px 0 0; background: var(--c-surface);
    animation: sheet-in 300ms cubic-bezier(.32, .72, 0, 1) both;
}
.sheet__grabber { width: 36px; height: 5px; margin: 0 auto var(--s-4); border-radius: 3px; background: var(--c-sunken); }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-5); }
.sheet__submit { margin-top: var(--s-2); }
 
/* ---------- 15. MENÚ PERSONAL ---------- */
.menu { position: fixed; inset: 0; z-index: 1000; background: rgba(22, 24, 29, .14); animation: fade-in 150ms ease both; }
.menu__panel {
    position: absolute;
    top: calc(68px + var(--safe-t));
    right: max(var(--s-4), calc(50vw - 240px + var(--s-4)));
    display: flex; flex-direction: column; gap: 2px;
    width: 240px; padding: var(--s-2);
    border-radius: 18px; background: var(--c-surface);
    box-shadow: 0 16px 40px -12px rgba(22, 24, 29, .3);
    transform-origin: top right;
    animation: menu-in 180ms var(--ease-out) both;
}
.menu__item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 48px; padding: 0 var(--s-3); border-radius: 12px; font-weight: 600; text-align: left; }
.menu__item:active { background: var(--c-sunken); }
.menu__icon { width: 18px; color: var(--c-text-2); text-align: center; }
.menu__item[aria-current="page"], .menu__item[aria-current="page"] .menu__icon { color: var(--c-primary); }
 
/* ---------- 16. NAVEGACIÓN INFERIOR ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; z-index: 20;
    display: grid; grid-template-columns: repeat(4, 1fr);
    width: 100%; max-width: 480px;
    height: calc(var(--nav-h) + var(--safe-b));
    padding: 0 var(--s-2) var(--safe-b);
    background: var(--c-sunken);
    transform: translateX(-50%);
}
.bottom-nav__button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; color: var(--c-text-2); }
.bottom-nav__button--active { color: var(--c-text); }
.bottom-nav__pill {
    display: grid; place-items: center; width: 48px; height: 30px;
    border-radius: var(--r-full); font-size: 16px; line-height: 1;
    transition: background-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.bottom-nav__pill svg { width: 18px; height: 18px; }
.bottom-nav__button--active .bottom-nav__pill { background: var(--c-text); color: #fff; }
.bottom-nav__button:active .bottom-nav__pill { transform: scale(.94); }
.bottom-nav__button:focus-visible { outline: none; }
.bottom-nav__button:focus-visible .bottom-nav__pill { outline: 3px solid var(--focus); outline-offset: 2px; }
.bottom-nav__label { font-size: var(--fs-nav); font-weight: 600; }
 
/* ---------- 17. PÁGINA KAIZEN ---------- */
.about { padding: calc(var(--s-10) + var(--safe-t)) var(--s-6) var(--s-8); }
.about__kanji { font-family: var(--font-kanji); font-size: 8.25rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.about__reading { margin: var(--s-3) 0 var(--s-8); color: var(--c-text-2); }
.about__lead { max-width: 22ch; margin-bottom: var(--s-6); font-size: var(--fs-xxl); font-weight: 600; line-height: 1.2; letter-spacing: -.03em; }
.about__body { max-width: 38ch; line-height: 1.6; }
.about__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-8); }
 
/* ---------- 17b. PRIVACIDAD Y TÉRMINOS ---------- */
.legal__summary { padding: var(--s-5); border-radius: var(--r-group); background: var(--ai-1); color: var(--ai-5); font-weight: 500; line-height: 1.45; }
.legal__section { margin-top: var(--s-10); scroll-margin-top: var(--s-4); }
.legal__title { margin-bottom: var(--s-3); font-size: var(--fs-xl); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.legal__subtitle { margin: var(--s-6) 0 var(--s-1); font-size: var(--fs-l); font-weight: 600; letter-spacing: -.015em; }
.legal__text { max-width: 60ch; line-height: 1.6; }
.legal__text + .legal__text { margin-top: var(--s-3); }
.legal__list { max-width: 60ch; padding-left: 1.25em; list-style: disc; line-height: 1.6; }
.legal__list li + li { margin-top: var(--s-2); }
.legal__note { padding: var(--s-4); border-radius: 14px; background: var(--c-bg); color: var(--c-text-2); }
.legal__updated { margin-top: var(--s-10); }
.legal__erase { margin-top: var(--s-4); }
/* Enlaces de texto: subrayados para no depender solo del color */
.legal__link, .about__link { color: var(--c-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
 
/* ---------- 18. ANIMACIONES (sin "to": vuelven al estilo del elemento) ---------- */
@keyframes fade-in  { from { opacity: 0; } }
@keyframes rise-in  { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes menu-in  { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
@keyframes check-in { from { opacity: 0; transform: scale(.6); } }
@keyframes dip      { from { transform: scaleY(0); } }
@keyframes xp-float {
    0%   { opacity: 0; transform: translateY(6px); }
    20%  { opacity: 1; transform: none; }
    70%  { opacity: 1; transform: translateY(-6px); }
    100% { opacity: 0; transform: translateY(-12px); }
}
 
/* ---------- 19. HOVER SOLO CON MOUSE ---------- */
@media (hover: hover) and (pointer: fine) {
    .card:not(.card--done):hover, .shortcut:hover { background: var(--c-hover); }
    .segmented__btn:not(.segmented__btn--active):hover,
    .bottom-nav__button:not(.bottom-nav__button--active):hover { color: var(--c-text); }
    .btn--primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--c-primary-press); }
    .btn--ghost-danger:hover { background: var(--c-danger-soft); }
    .card__check:not(.card__check--done):hover { box-shadow: inset 0 0 0 2px var(--c-primary); }
    .icon-btn:hover { background: var(--c-bg); }
    .menu__item:hover { background: var(--c-sunken); }
}
 
/* ---------- 20. MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
    .card__xp { display: none; }
}
