/* Michi Planner · estilos (tokens de DESIGN.md v0.1)
   Orden: tipografía y tokens · base · formularios · botones · componentes · pantallas */

/* --- Tipografía: Nunito (SIL OFL 1.1, fonts/OFL.txt), servida desde la app --------------------- */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #2B2D42;
  --cream: #FFF8F0;
  --peach: #FFB5A7;
  --mint: #B8E0D2;
  --lavender: #CDB4DB;
  --peach-deep: #D0705E;
  --mint-deep: #439A7C;
  --lavender-deep: #A679BF;
  --alert: #D73618;
  --ink-rgb: 43, 45, 66;  /* la tinta en r, g, b para las transparencias; cada paleta pone la suya */
  --line: rgba(var(--ink-rgb), 0.12);
  --line-strong: rgba(var(--ink-rgb), 0.28);
  --surface: #fff;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --pill: 999px;
  --shadow-float: 0 4px 16px rgba(var(--ink-rgb), 0.12);
  --tabbar-h: 64px;
  --control-h: 52px;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  accent-color: var(--peach-deep);
}

/* --- Base --------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); -webkit-tap-highlight-color: transparent; }
.page { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar-h) + 24px); }
h1 { font-size: 28px; font-weight: 800; line-height: 1.2; margin: 16px 0 12px; }
h2 { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 28px 0 8px; }
p { line-height: 1.5; margin: 8px 0; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--peach-deep); }
.muted { opacity: 0.75; }
.small { font-size: 14px; }
.error { color: var(--alert); font-weight: 700; }
.ok { color: var(--ink); font-weight: 700; }  /* texto ink: mint-deep da 3,2:1 (D23) */
.stack { display: flex; flex-direction: column; gap: 20px; }
.wrap { word-break: break-all; }
.full { width: 100%; }
.start-task { min-height: 56px; font-size: 18px; justify-content: center; text-align: center; }
.wide { width: 100%; max-width: 420px; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
.checklist { padding-left: 20px; line-height: 1.6; }

/* --- Formularios: una etiqueta encima de su control, siempre igual -------------------------------- */
label, .field { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0; margin: 0 0 8px; font-weight: 700; float: left; width: 100%; }
legend + * { clear: both; }
.field-label { font-weight: 700; }
.hint { font-weight: 400; font-size: 14px; opacity: 0.8; margin: 0; }
input, select, textarea {
  width: 100%; min-height: var(--control-h); padding: 10px 14px; font: inherit; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
}
input::placeholder { color: rgba(var(--ink-rgb), 0.45); font-weight: 400; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%232B2D42' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
/* Foco con teclado (D25): borde y anillo de 3 px en peach-deep también en campos y casillas */
input:focus, select:focus, textarea:focus { border-color: var(--peach-deep); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: auto; margin: 0; flex: none; cursor: pointer; }
label.check, .segmented label {
  flex-direction: row; align-items: center; gap: 12px; font-weight: 600; min-height: 48px; cursor: pointer;
}
.segmented { display: flex; gap: 24px; flex-direction: row; flex-wrap: wrap; }
.inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { flex: 1 1 160px; }
.inline > button { flex: 0 0 auto; }

/* Pastillas (tipo, asignatura, día): una sola elección, grandes y con color */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
label.chip {
  position: relative; flex-direction: row; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px;
  font-weight: 700; background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--pill);
  cursor: pointer; user-select: none;
}
label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.chip:has(input:checked) { background: var(--ink); color: var(--cream); border-color: var(--ink); }
label.chip:has(input:focus-visible) { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
label.chip .dot { width: 14px; height: 14px; }
/* Elegir mascota: ficha con el dibujo encima del nombre (2026-10-22) */
label.chip.pet-choice { flex-direction: column; gap: 4px; padding: 10px 16px 12px; border-radius: var(--radius-lg); }
label.chip:has(input:checked) .dot { box-shadow: 0 0 0 2px var(--cream); }

/* Selector "− 2 🍣 +" para niños: sin desplegables de números */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: var(--pill); padding: 4px; align-self: flex-start; }
.stepper button { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 0;
  background: var(--peach); font-size: 24px; font-weight: 800; line-height: 1; }
.stepper button:disabled { opacity: 0.35; }
.stepper output { min-width: 96px; text-align: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* --- Botones ----------------------------------------------------------------------------------- */
button, a.button, label.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-h);
  padding: 10px 20px; font: inherit; font-weight: 800; color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--pill);
}
button.primary, a.button.primary { background: var(--ink); color: var(--cream); }
button:disabled { opacity: 0.5; cursor: default; }
/* Botón discreto: acciones secundarias al pie de una vista */
button.quiet, a.button.quiet { min-height: 44px; padding: 8px 16px; font-weight: 600; font-size: 0.95em;
  border-width: 1px; border-color: var(--line-strong); background: transparent; }
.afternoon-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 24px; }
.link-button { background: none; border: none; min-height: 44px; padding: 8px 0; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--peach-deep); text-underline-offset: 3px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
/* Botones en la misma fila: se reparten el ancho (nunca amontonados a la izquierda) */
.actions > * { flex: 1 1 140px; min-width: 0; }
.actions > form > button, .actions > a.button, .actions > label.button, .actions > button, .confirm-done > button { width: 100%; justify-content: center; text-align: center;
  padding-left: 12px; padding-right: 12px; }
.student-row .actions > * { flex: 0 0 auto; }
.actions > .confirm-done.asking { flex-basis: 100%; }
.confirm-done-ask { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.confirm-done-ask p { flex: 1 1 100%; margin: 0; font-weight: 600; }
.confirm-done-ask button { flex: 1 1 140px; justify-content: center; }
/* Más → Asignaturas: una fila por asignatura que se despliega (2026-10-15) */
.subject-list { padding-top: 4px; padding-bottom: 4px; }
.subject-item { border-bottom: 1px solid var(--line); }
.subject-item:last-child { border-bottom: 0; }
.subject-item summary { min-height: 56px; font-weight: 700; }
.subject-item .subject-name { flex: 1 1 auto; min-width: 0; }
.subject-item .subject-count { flex: none; font-weight: 400; }
.subject-edit { padding: 4px 0 16px; }
.subject-delete { border-top: 1px dashed var(--line); padding-top: 12px; }
.subject-deleted:last-child { border-bottom: 0; }
.student-row .actions > form > button { width: auto; }
details summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800;
  list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "›"; font-size: 24px; line-height: 1; transition: transform 150ms ease-out; }
details[open] summary::before { transform: rotate(90deg); }

/* --- Componentes -------------------------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; }
.privacy-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.privacy-change p { margin: 0; flex: 1 1 16rem; }
.michi { background: var(--peach); border-radius: var(--radius-lg); padding: 24px 16px; }
.bubble { margin: 0; font-weight: 700; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tag { flex: none; font-size: 14px; font-weight: 700; background: var(--lavender); border-radius: var(--pill); padding: 4px 10px; }
.notice { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 14px; }
.note { font-size: 14px; margin: 0; font-weight: 700; }
.viewing { font-size: 14px; margin: 0 0 8px; }
.alert-title { color: var(--alert); }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.tabbar {
  position: fixed; inset: auto 0 0 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--cream); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; align-items: center; justify-content: center; min-height: 48px;
  color: var(--ink); text-decoration: none; font-weight: 800; }
/* Pestaña activa: texto ink (el naranja daba 3,2:1) y raya de color arriba (D23) */
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 900; box-shadow: inset 0 3px 0 var(--peach-deep);
  background: color-mix(in srgb, var(--peach) 35%, var(--cream)); }

/* Franja fija de acciones encima de la barra inferior (D5) */
.action-strip {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; gap: 12px; padding: 10px 16px; background: var(--cream); box-shadow: var(--shadow-float);
}
.action-strip .grow, .action-strip .start { flex: 1; min-height: 56px; }
/* Asignaturas largas («Empezar Biología y Geología»): Empezar encoge y pasa a dos líneas; el resto
   de botones de la franja no se sale de la pantalla (2026-10-06) */
.action-strip .start, .action-strip .start button, .action-strip .grow { min-width: 0; }
.action-strip .start button, .action-strip .grow { padding-left: 12px; padding-right: 12px; }
.action-strip { align-items: center; }
.action-strip .add { flex: none; width: 56px; height: 56px; min-height: 56px; padding: 0; font-size: 24px; }
.page:has(.action-strip) { padding-bottom: calc(var(--tabbar-h) + 100px); }
.fab { position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); width: 60px;
  height: 60px; border-radius: 50%; background: var(--ink); color: var(--cream); display: flex; align-items: center;
  justify-content: center; font-size: 26px; text-decoration: none; box-shadow: var(--shadow-float); }
/* La varita (D20) es de colores: fondo claro, como su botón en Hoy */
.fab.capture { background: var(--surface); border: 2px solid var(--ink); }

/* Listas y filas de tarea (D19: filas sobre una superficie, separador de 1 px) */
.list { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.task-row.closed .task-title { text-decoration: line-through; opacity: 0.75; }
.task-row.exam .task-title { font-weight: 800; }
.task-row.optional { opacity: 0.7; }
.task-row.optional .count { font-weight: 400; }
.task-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-title { font-weight: 700; }
.task-meta { font-size: 14px; opacity: 0.75; }
.task-meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count { flex: none; font-weight: 800; }

/* --- Hoy (D4, D5, D28) ---------------------------------------------------------------------------- */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.day-strip a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 4px 0;
  color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); font-size: 14px; }
.day-strip a.is-today { background: var(--ink); color: var(--cream); }
.mini-dots { display: flex; gap: 2px; min-height: 6px; }
.mini-dots i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.michi-card { display: flex; align-items: center; gap: 12px; background: var(--peach); border-radius: var(--radius-lg); padding: 12px 16px; }
.michi-card .bubble { flex: 1; }
.michi-stats { display: flex; gap: 12px; font-size: 14px; font-weight: 800; margin-top: 6px; flex-wrap: wrap; }
.pick-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.pick-row button.pick { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px;
  background: none; border: 2px solid transparent; border-radius: var(--radius-sm); text-align: left; font-weight: 400; justify-content: flex-start; }
/* La tarea elegida se tiñe con el color de su asignatura (petición de la usuaria, 2026-10-02):
   relleno claro (el texto ink sigue ≥7:1) y borde con el color pleno (≥3:1, D23). */
.pick-row button.pick[aria-pressed="true"] { background: color-mix(in srgb, var(--subj, var(--peach)) 26%, white);
  border-color: var(--subj, var(--peach-deep)); }
/* Botones de cada fila de Hoy: empezar ronda y editar (petición de la usuaria, 2026-10-03) */
.pick-row .row-action { display: contents; }
.pick-row .row-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin-left: 4px;
  border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.icon { flex: none; }
.start-task .icon { margin-right: 6px; }
.soft-note { font-size: 14px; margin: 4px 0; }
.offline { display: flex; align-items: center; gap: 16px; }

/* Avisos del plan (D14): Michi preocupado, sin lágrimas; el color de alerta solo en la sobrecarga */
.warning-card { background: var(--lavender); border-radius: var(--radius-lg); padding: 16px; margin: 12px 0; }
.warning-card p { margin: 8px 0; }
/* «Ampliar lo que haga falta» (tutora) bajo los botones del aviso: separado como entre ellos */
.warning-card .big-extension { margin-top: 12px; }
.warning-card .big-extension > button { width: 100%; justify-content: center; }
.bubble-worried { font-weight: 800; }

/* --- Semana (D19, D22) -------------------------------------------------------------------------- */
.segmented-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface);
  border-radius: var(--pill); padding: 4px; margin-bottom: 8px; }
.segmented-tabs a { display: flex; justify-content: center; align-items: center; min-height: 44px;
  border-radius: var(--pill); color: var(--ink); text-decoration: none; font-weight: 800; }
.segmented-tabs a[aria-current="page"] { background: var(--ink); color: var(--cream); }
.week-day { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.week-day.past { opacity: 0.75; }  /* 5,9:1 sobre cream (con 0,6 daba 3,8:1) */
.week-day header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-day h2 { font-size: 17px; margin: 8px 0; }
.week-day.is-today h2 { color: var(--ink); display: inline-block; padding: 2px 12px; border-radius: var(--pill);
  background: var(--peach); }  /* texto ink: el naranja daba 3,2:1 (D23) */
.load { display: flex; align-items: center; gap: 8px; }
.load .bar { width: 96px; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.load .bar span { display: block; height: 100%; background: rgba(var(--ink-rgb), 0.3); }
.load.overloaded .bar span { background: var(--alert); }
.load.overloaded .load-text { color: var(--alert); font-weight: 800; }
.load-text { font-size: 14px; font-weight: 700; }
.add-link { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; font-weight: 700; }
.reserve { font-size: 14px; margin: 4px 0; padding: 6px 12px; border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, rgba(var(--ink-rgb),0.06) 0 8px, transparent 8px 16px); }

/* --- Horario ----------------------------------------------------------------------------------- */
.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px;
  border-bottom: 1px solid var(--line); }
.schedule-row .day-name { font-weight: 800; min-width: 92px; }
/* Día y selector arriba; debajo, el tiempo efectivo con su desglose (2026-10-07) */
.schedule-row:has(.effective) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 2px 12px; padding: 8px 0; }
.schedule-row .effective { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.schedule-row .effective strong { font-size: 15px; }

/* --- Pomodoro y cierre (D3, D10, D11) ------------------------------------------------------------ */
.pomodoro, .closure { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  min-height: calc(100vh - 48px); justify-content: center; }
.pomo-subject { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 800; }
.pomo-title { margin: 0 0 8px; }
.ring { position: relative; width: min(72vw, 300px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--peach-deep); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 326.7; transition: stroke-dashoffset 1s linear; }
.ring-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stop-button { min-width: 160px; margin-top: 16px; }
.finish-task { min-width: 220px; margin-top: 16px; }
.finish-task + .stop-button { margin-top: 10px; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(var(--ink-rgb), 0.4); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { background: var(--cream); border-radius: var(--radius-lg); padding: 24px; max-width: 360px;
  box-shadow: var(--shadow-float); text-align: center; }
.dialog-title { font-size: 20px; font-weight: 800; margin-top: 0; }
.dialog .actions { justify-content: center; }
.effort { font-size: 20px; }
.aim { font-size: 18px; }
/* Momento de autor: entrada de la celebración de Michi (ease-out 300 ms; también con reduced-motion, D25) */
.celebrate-in { animation: michi-in 300ms ease-out both; }
@keyframes michi-in { from { transform: scale(0.6) translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Casita: fuego de la chimenea y peces en bucle (2026-11-20). Con «reducir movimiento», quietos y sin burbujas ni chispas. */
.hx-burbuja, .hx-chispa { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hx-llama { transform-box: fill-box; transform-origin: 50% 100%; animation: hx-llama 1.4s ease-in-out infinite; }
  .hx-llama-dentro { animation-duration: 0.9s; animation-delay: -0.4s; }
  .hx-chispa { transform-box: fill-box; animation: hx-chispa 2.2s ease-out infinite; }
  .hx-pez { animation: hx-nada 3.5s ease-in-out infinite; }
  .hx-burbuja { animation: hx-burbuja 3.8s ease-in infinite; }
}
@keyframes hx-llama {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(0.96, 1.08) skewX(-3deg); }
  50% { transform: scale(1.03, 0.94) skewX(2deg); }
  75% { transform: scale(0.98, 1.05) skewX(3deg); }
}
@keyframes hx-chispa {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(3px, -22px); opacity: 0; }
}
/* ±1,5 y ±0,8: `SWIM` y `BOB` en michi_art.py (el test comprueba que los peces no se salen del agua) */
@keyframes hx-nada {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(1.5px, -0.8px); }
  50% { transform: translate(0, 0); }
  75% { transform: translate(-1.5px, 0.8px); }
}
@keyframes hx-burbuja {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(1px, calc(var(--sube) / 2)); }
  85% { opacity: 1; }
  100% { transform: translate(-0.5px, var(--sube)); opacity: 0; }
}

/* --- Michi ------------------------------------------------------------------------------------- */
.michi-big { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; }
.stat { background: var(--surface); border-radius: var(--radius-lg); padding: 14px; text-align: center; }
.stat strong { display: block; font-size: 24px; }

/* --- Captura (D9) -------------------------------------------------------------------------------- */
.camera-drop { display: flex; align-items: center; justify-content: center; min-height: 220px; border: 3px dashed
  var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; font-weight: 800;
  font-size: 18px; overflow: hidden; padding: 16px; text-align: center; }
.photo-pick label { position: relative; flex-direction: row; text-align: center; white-space: nowrap; }
.photo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-pick label:has(input:focus-visible) { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
.camera-drop img { max-width: 100%; max-height: 360px; }
.capture-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-top: 24px; }
.reading { position: relative; }
.thumb { max-width: 220px; max-height: 260px; border-radius: var(--radius-sm); box-shadow: var(--shadow-float); }
.thumb.wide { max-width: 100%; max-height: none; }
.lens { position: absolute; right: -12px; bottom: -12px; font-size: 48px; animation: lens 1.2s ease-in-out infinite alternate; }
@keyframes lens { from { transform: translate(0, 0); } to { transform: translate(-60px, -80px); } }
.reading-pet { position: absolute; left: -48px; bottom: -28px; animation: reading-pet 1.4s ease-in-out infinite alternate; }
@keyframes reading-pet { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.proposal { display: flex; flex-direction: column; gap: 16px; border: 2px solid var(--line); background: var(--surface);
  border-radius: var(--radius-lg); padding: 16px; }
.proposal.attention { border-color: var(--peach-deep); }
.proposal.at-school { background: var(--mint); }
.proposal.skipped > :not(.take) { display: none; }
.proposal .take { font-weight: 800; }
.not-tasks { margin-top: 8px; }
select.needs { border-color: var(--peach-deep); }
.chips.needs label.chip { border-color: var(--peach-deep); }

/* --- Cuentas ------------------------------------------------------------------------------------- */
.qr svg { width: 100%; max-width: 320px; height: auto; }
/* Código corto de emparejar: grande, monoespaciado y sin letras que se confundan (Fase 1a) */
.short-code { margin: 0; font: 800 clamp(1.8rem, 9vw, 2.6rem)/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.12em; text-align: center; user-select: all; }
.short-code-input { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 1.4rem;
  letter-spacing: 0.12em; text-transform: uppercase; }
.student-row .actions button, .student-row .actions a.button { min-height: 44px; padding: 6px 14px; }
.card > h2:first-child { margin-top: 0; }
.card.stack { gap: 12px; }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.proposal details summary { min-height: 44px; }
.schedule-row .stepper button { width: 44px; height: 44px; min-height: 44px; font-size: 22px; }  /* ≥44 px (D25) */
.schedule-row .stepper output { min-width: 60px; font-size: 18px; }
.schedule-row .day-name { min-width: 0; flex: 1; }
/* El texto fluye seguido y, si no cabe, pasa a dos líneas («Empezar Biología y / Geología») */
.action-strip .start button { display: block; white-space: normal; text-align: center; line-height: 1.2; }
.action-strip a.start { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.due-tag { align-self: flex-start; margin-top: 4px; font-size: 13px; font-weight: 800; padding: 2px 10px;
  border-radius: var(--pill); background: var(--mint); }
.due-tag.today { background: var(--peach); box-shadow: inset 0 0 0 2px var(--peach-deep); }
.pomo-michi { margin-bottom: -4px; }
.michi-card a:not(.button) { display: block; line-height: 0; }  /* el dibujo; no la tienda */
/* --- Bienvenida (D8) ------------------------------------------------------------------------- */
.welcome { padding-top: 8px; }
.welcome h1 { text-align: center; margin: 0; }
.welcome .lead { text-align: center; margin: 0; }
.welcome-michi { display: flex; justify-content: center; }
.steps { display: flex; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.steps li { width: 10px; height: 10px; border-radius: 50%; background: var(--peach); }
.steps li.done { background: var(--peach-deep); }
.steps li[aria-current="step"] { width: 28px; border-radius: var(--pill); background: var(--ink); }
.how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--radius-lg);
  padding: 12px 14px; }
.how li > span:first-child { font-size: 24px; line-height: 1.2; }
.pet-name { margin: 0; }
.student-row .actions details[open] { flex: 1 1 100%; }
/* --- Notas de ronda ---------------------------------------------------------------------------- */
.note-box { text-align: left; }
.note-box textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; }
.last-note { background: var(--surface); border-radius: var(--radius-lg); padding: 10px 14px; margin: 0; max-width: 340px;
  text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notes li { overflow-wrap: anywhere; }
.notes time { display: block; font-size: 13px; opacity: 0.75; font-weight: 700; }
blockquote.typed { margin: 0; padding: 12px 14px; background: var(--surface); border-radius: var(--radius-lg);
  font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; max-width: 340px; }
#capture-text { width: 100%; font: inherit; resize: vertical; }
/* --- Pasos (D15) ---------------------------------------------------------------------------- */
.split-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps-list { list-style: none; margin: 0; padding: 0; }
.steps-list li a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; text-decoration: none;
  border-bottom: 1px solid var(--line); }
.steps-list li:last-child a { border-bottom: 0; }
.steps-list .step-check { width: 24px; height: 24px; flex: none; border: 2px solid var(--ink); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; }
.steps-list li.done .step-check { background: var(--mint); }
.steps-list li.done .step-title, .steps-list li.dropped .step-title { text-decoration: line-through; opacity: 0.75; }
.steps-list .step-title { flex: 1; font-weight: 700; }
.steps-list li:has(.step-move) { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.steps-list li:has(.step-move):last-child { border-bottom: 0; }
.steps-list li:has(.step-move) a { flex: 1; min-width: 0; border-bottom: 0; }
.step-move { display: flex; gap: 4px; flex: none; }
.step-move button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; }
.step-move button:disabled { opacity: 0.25; }
.split-offer { align-items: center; }
/* --- Nivel, casita y tienda (D18/D27) -------------------------------------------------------- */
.level { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; }
.level-name { font-weight: 900; }
.xp-bar { flex: 1 1 120px; height: 12px; border-radius: var(--pill); background: color-mix(in srgb, var(--ink) 12%, var(--cream));
  overflow: hidden; box-shadow: inset 0 0 0 2px var(--ink); }
.xp-bar > span { display: block; height: 100%; background: var(--mint-deep); border-radius: var(--pill); }
.level-next { flex-basis: 100%; font-size: 14px; text-align: center; }
.level.compact { margin-top: 6px; font-size: 14px; }
.level.compact .xp-bar { height: 10px; }
.house-wrap { display: flex; justify-content: center; }
.house-wrap svg { max-width: 100%; height: auto; }
.shop-coins { font-size: 20px; margin: 0; }
.ok { background: var(--mint); color: var(--ink); border-radius: var(--radius-lg); padding: 10px 14px; font-weight: 800; margin: 0; }
.shop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shop-item { background: var(--surface); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; text-align: center; border: 2px solid transparent; }
.shop-item.worn { border-color: var(--mint-deep); }
.shop-item .item-name { font-weight: 800; }
.shop-item form, .shop-item button { width: 100%; }
.shop-link { margin-top: 8px; min-height: 44px; padding: 6px 16px; }

/* --- Más → Tareas terminadas (reabrir) ------------------------------------------------------- */
.finished-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.finished-row .task-text { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.finished-row form { flex: none; }
.finished-row button { min-height: 44px; padding: 6px 16px; }
.more-finished { margin-top: 16px; }
.finished-row { scroll-margin-top: 16px; }
.finished-months { margin-top: 32px; }
.finished-months ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.finished-months a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 2px solid var(--ink); color: var(--ink); text-decoration: none; }
.finished-months a[aria-current="page"] { background: var(--ink); color: var(--cream); }

/* --- «Esta semana» de la tutora (D6) y racha --------------------------------------------------- */
.week-summary { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--peach-deep); }
.ws-title { font-weight: 800; font-size: 18px; display: flex; justify-content: space-between; }
.week-nav { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.week-nav h1 { flex: 1; margin: 0; text-align: center; font-size: 22px; }
.week-nav .button { flex: none; width: 48px; min-height: 48px; padding: 0; font-size: 22px; }
.week-nav-spacer { flex: none; width: 48px; }
.week-range { display: block; font-size: 15px; font-weight: 700; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.tw-main, .tw-side { display: flex; flex-direction: column; gap: 12px; }
.tw-side { margin-top: 12px; }
.tw-h2 { margin: 0; font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.tw-total { margin-left: auto; font-size: 15px; font-weight: 800; }
.tw-sub { margin: 4px 0 0; font-weight: 800; }
.tw-days, .tw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tw-days li { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.tw-days li.is-today { font-weight: 800; }
.tw-days li.future .bar span { background: var(--line-strong); }
.tw-day { width: 18px; font-weight: 800; }
.tw-days .load .bar { width: 120px; }
.tw-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.tw-streak { margin: 0; font-size: 17px; }
.streak-cal { border-collapse: separate; border-spacing: 4px; }
.streak-cal caption { text-align: left; caption-side: top; padding-bottom: 2px; }
.streak-cal th { font-size: 13px; font-weight: 800; width: 42px; }
.streak-cal td { position: relative; width: 42px; height: 46px; padding-top: 12px; text-align: center; border-radius: var(--radius-sm); font-size: 18px;
  background: color-mix(in srgb, var(--ink) 5%, white); }
.streak-cal .sc-fire { background: color-mix(in srgb, var(--peach) 45%, white); }
.streak-cal .sc-miss { background: color-mix(in srgb, var(--alert) 12%, white); color: var(--alert); font-weight: 900; }
.streak-cal .sc-pending { box-shadow: inset 0 0 0 2px var(--peach-deep); }
.streak-cal .sc-future { background: transparent; }
/* Número del día en la esquina, para seguir el calendario (petición de la usuaria, 2026-10-07) */
.streak-cal .sc-num { position: absolute; top: 5px; left: 7px; font-size: 11px; font-weight: 800; line-height: 1;
  color: color-mix(in srgb, var(--ink) 75%, transparent); }
.streak-cal .sc-miss .sc-num { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.streak-cal .sc-future .sc-num { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.streak-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.streak-legend li { display: flex; align-items: center; gap: 8px; }
.streak-legend span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 6px; font-size: 14px; background: color-mix(in srgb, var(--ink) 5%, white); }
.streak-legend .sc-fire { background: color-mix(in srgb, var(--peach) 45%, white); }
.streak-legend .sc-miss { background: color-mix(in srgb, var(--alert) 12%, white); color: var(--alert); font-weight: 900; }
.streak-legend .sc-pending { background: white; box-shadow: inset 0 0 0 2px var(--peach-deep); }

/* --- Pantalla ancha: tablet en horizontal y PC (D24, ≥ 900 px) ------------------------------
   Barra lateral en vez de la inferior; Hoy a dos columnas con Michi grande a la derecha
   (petición de la usuaria, 2026-10-03) y Semana en 7 columnas. Formularios, ficha y ronda
   siguen a 640 px. */
.wide-only { display: none; }
@media (min-width: 900px) {
  :root { --sidebar-w: clamp(150px, 16vw, 200px); }
  .narrow-only { display: none; }
  .wide-only { display: revert; }
  body:has(.tabbar) { padding-left: var(--sidebar-w); }

  .tabbar { inset: 0 auto 0 0; width: var(--sidebar-w); height: auto; padding: 24px 12px; display: flex;
    flex-direction: column; gap: 4px; border-top: none; border-right: 1px solid var(--line); }
  .tabbar a { justify-content: flex-start; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm); font-size: 17px; }
  .tabbar a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--peach-deep); }

  .page { padding: 24px clamp(20px, 2.5vw, 32px) 32px; }
  .page:has(.hoy-grid), .page:has(.week-grid), .page:has(.tw-grid) { max-width: 1200px; }
  .tw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .tw-side { margin-top: 0; }
  .page:has(.action-strip) { padding-bottom: 32px; }
  .fab { bottom: 24px; right: 24px; }
  .page:has(.fab) { padding-bottom: 104px; }  /* que la varita no tape el final */

  /* Hoy: tareas a la izquierda; Michi y la semana a la derecha, fijos al bajar */
  .hoy-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 400px);
    gap: clamp(20px, 2.5vw, 32px); align-items: start; }
  .hoy-main > :first-child, .hoy-today > h1 { margin-top: 0; }
  .hoy-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
  .h1-date { font-weight: 700; color: color-mix(in srgb, var(--ink) 70%, transparent); }
  .action-strip { position: sticky; left: auto; right: auto; bottom: 16px; margin-top: 16px; border-radius: var(--radius-lg); }

  .michi-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--peach);
    border-radius: var(--radius-lg); padding: 20px 16px 16px; }
  .michi-hero > a:not(.button) { display: block; line-height: 0; }  /* el dibujo; no el botón de la tienda (2026-11-19) */
  .michi-hero .michi-house { width: 100%; height: auto; max-width: 380px; }
  .michi-hero .speech { position: relative; margin: 0; max-width: 340px; padding: 12px 16px; background: var(--surface);
    border-radius: var(--radius-lg); font-size: 18px; font-weight: 800; text-align: center; }
  .michi-hero .speech::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -10px;
    border: 10px solid transparent; border-bottom: 0; border-top-color: var(--surface); }
  .michi-hero .michi-stats { justify-content: center; gap: 20px; font-size: 18px; }
  .michi-hero .level.compact { max-width: 320px; font-size: 15px; }

  .mini-week { background: var(--surface); border-radius: var(--radius-lg); padding: 12px 16px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
  .mini-week h2 { grid-column: 1 / -1; margin: 0 0 4px; font-size: 16px; }
  .mini-week h2 a { color: var(--ink); }
  .mw-day { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px; min-height: 48px;
    padding: 4px 6px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
  .mw-day.is-today { background: color-mix(in srgb, var(--peach) 35%, white); box-shadow: inset 0 0 0 2px var(--peach-deep); }
  .mw-day.past { opacity: 0.7; }
  .mw-name { font-weight: 800; font-size: 14px; }
  .mw-day .load { grid-column: 1; gap: 4px; }
  .mw-day .load .bar { width: 48px; height: 8px; }
  .mw-day .load-text, .mw-day .small { font-size: 12px; }
  .mw-day .mini-dots { grid-column: 2; grid-row: 1 / 3; }

  /* Semana: 7 columnas */
  .week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
  .week-grid .week-day { margin: 0; padding: 8px; background: var(--surface); border-radius: var(--radius-sm); min-width: 0; }
  .week-grid .week-day.is-today { box-shadow: inset 0 0 0 2px var(--peach-deep); }
  .week-grid .week-day header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .week-grid .week-day h2 { font-size: 15px; margin: 0; }
  .week-grid .load { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .week-grid .load .bar { flex: 1; width: auto; min-width: 24px; max-width: 72px; }
  .week-grid .load-text { white-space: nowrap; font-size: 13px; }
  /* Cada tarea: punto y título a todo el ancho; las rondas, debajo */
  .week-grid .task-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 2px 6px; padding: 6px 0;
    min-height: 48px; align-items: start; }
  .week-grid .task-row .dot { margin-top: 5px; }
  .week-grid .task-row > :not(.dot) { grid-column: 2; justify-self: start; }
  .week-grid .task-title { font-size: 14px; hyphens: auto; }
  .week-grid .task-meta { font-size: 12px; }
  .week-grid .count, .week-grid .tag { font-size: 13px; }
  .week-grid .add-link, .week-grid .reserve, .week-grid .soft-note { font-size: 12px; }
}
/* Tablet más pequeña: 7 columnas de ~95 px no se leen; 4 + 3 días */
@media (min-width: 900px) and (max-width: 1199px) {
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Tareas repetidas (2026-10-09) */
.same-task .actions, .repeated-pair .actions { flex-wrap: wrap; }
.repeated-notice { display: block; text-decoration: none; color: inherit; }
.repeated-pair { gap: 10px; }
.repeated-task { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.repeated-task .task-text { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.repeated-task .task-title { overflow-wrap: anywhere; }
.repeated-task button { flex: none; }

/* Sin conexión (D16) */
.offline-band { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--cream);
  font-size: .85rem; font-weight: 600; text-align: center; padding: max(6px, env(safe-area-inset-top)) 16px 6px; }
html[data-offline] button[disabled][data-offline-disabled] { opacity: .45; cursor: not-allowed; }
.offline-round { text-align: center; }
.offline-round textarea { width: 100%; }

/* «¿cuánto te costará?» en Hoy: enlace a la ficha, en el cálculo (antes solo elegía la fila) */
.pick-row .tag-link { color: inherit; text-decoration: none; margin-left: 4px; max-width: 92px; padding: 6px 10px;
  border-radius: var(--radius-sm); text-align: center; line-height: 1.15; }
.estimate-card { scroll-margin-top: 16px; }
.estimate-card:target { outline: 3px solid var(--lavender-deep); outline-offset: 2px; }

/* Borrar datos (2026-10-09): rojo de alerta, solo en las acciones que no se pueden deshacer */
.button.danger, button.danger { color: var(--alert); border-color: var(--alert); }
button.danger[type=submit] { background: var(--alert); color: #fff; }
.privacy-full h3 { margin-top: 12px; }

/* «¿Necesitas más?» en la ficha (2026-10-10): botón en la fila de Finalizada; para la tutora, etiqueta en su línea */
.needs-more-line { margin: 0; }
.needs-more-line .tag { display: inline-block; white-space: nowrap; }
.actions .needs-more-button { background: var(--lavender); border-color: var(--lavender); }
.drop-worked { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Premios de la familia (2026-10-11) */
.reward-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.reward { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface);
  border-radius: var(--radius-sm); border: 1px solid var(--line); }
.reward .actions { flex: none; }
.reward-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reward-title { font-weight: 700; overflow-wrap: anywhere; }
.reward-meta, .reward-missing { font-size: 14px; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.reward-bloqueado { opacity: .85; }
.reward-conseguido, .reward-won { border-color: var(--mint-deep); background: color-mix(in srgb, var(--mint) 30%, white); }
.reward-pedido { border-color: var(--lavender-deep); }
.reward-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.reward-bar > span { display: block; height: 100%; background: var(--mint-deep); }
.reward-sub { margin-left: 32px; }
.reward-admin summary { align-items: flex-start; text-align: left; }
.reward-admin summary .reward-meta { font-weight: 400; }
input.short { width: 5em; display: inline-block; }
.new-tag { font-size: 12px; padding: 2px 8px; background: var(--peach); vertical-align: middle; }

/* Sonidos (2026-10-12) */
.sound-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Ronda: bloques centrados; en pantallas apaisadas y bajas (tablet en horizontal), dos columnas y el reloj
   a la medida de la altura, para que «Parar» y «He terminado» quepan siempre (2026-10-13) */
.pomo-main, .pomo-info, .pomo-clock { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .pomodoro { min-height: calc(100vh - 32px); }
  .pomo-main { flex-direction: row; align-items: center; justify-content: center; gap: clamp(24px, 6vw, 80px); }
  .pomo-info, .pomo-clock { width: auto; flex: 0 1 420px; }
  .pomo-info .pomo-title { font-size: clamp(22px, 3vw, 30px); }
  .ring { width: min(300px, 52vh); }
  .ring-time { font-size: clamp(36px, 7vh, 52px); }
  .stop-button, .finish-task { margin-top: 8px; }
  .page:has(.pomodoro) { padding-top: 16px; padding-bottom: 16px; }
}
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .pomodoro .pomo-info .celebrate-in svg { max-height: 34vh; width: auto; }
  .pomo-clock .note-box, .pomo-clock .stack.wide, .pomo-clock .last-round { width: 100%; max-width: 420px; }
}
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .pomo-clock:has(.note-box) { align-items: stretch; flex-basis: 440px; }
  .pomo-info h1 { font-size: clamp(22px, 3vw, 30px); white-space: nowrap; }
}
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .page:has(.pomodoro) { max-width: 1040px; }
}
@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .pomo-info .pomo-michi svg { width: min(190px, 30vh); height: auto; }
}

/* --- Tablet en vertical y PC (2026-10-13) -----------------------------------------------------
   En el móvil los envoltorios no cambian nada (display: contents); en pantalla ancha, Michi y la
   tienda pasan a dos columnas y Más reparte sus tarjetas en dos columnas. */
.michi-layout, .michi-info, .shop-layout, .shop-items { display: contents; }
/* Tablet en vertical: la franja de «Empezar» del mismo ancho que el contenido, no de borde a borde */
@media (min-width: 680px) and (max-width: 899px) {
  .action-strip { left: calc(50% - 320px); right: calc(50% - 320px); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
@media (min-width: 900px) {
  .page:has(.michi-layout), .page:has(.shop-layout) { max-width: 1100px; }
  .michi-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px);
    align-items: center; }
  .michi-big { margin-bottom: 0; }
  .michi-info { display: flex; flex-direction: column; gap: 16px; }
  .michi-info .stat { padding: 20px 14px; }

  .shop-layout { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr); gap: 8px clamp(24px, 3vw, 48px);
    align-items: start; }
  .shop-layout > .house-wrap { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 24px; }
  .shop-layout > .rewards, .shop-items { grid-column: 2; }
  .shop-items { display: block; }
  .shop-items > h2:first-child { margin-top: 0; }
}
@media (min-width: 1200px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .page:has(.mas-cards) { max-width: 1100px; }
  .mas-cards { display: block; columns: 2; column-gap: 24px; }
  .mas-cards > * { break-inside: avoid; margin: 0 0 20px; }
}
/* Plazo de las fotos: siempre 2 × 2, «Guardarlas siempre» al lado de «Borrar al revisarlas» (2026-10-13) */
.chips-2x2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; }
.chips-2x2 .chip { justify-content: center; text-align: center; }

/* Más → Fotos de la agenda (2026-10-13) */
.photo-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.photo-row { display: flex; gap: 14px; align-items: flex-start; }
.photo-thumb { flex: none; width: 96px; height: 96px; border-radius: var(--radius-sm); overflow: hidden; display: flex;
  align-items: center; justify-content: center; background: color-mix(in srgb, var(--ink) 6%, white); font-size: 32px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb.gone { opacity: 0.5; }
.photo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-title { font-weight: 800; color: var(--ink); }
.photo-text form { margin-top: 2px; }
@media (min-width: 1200px) {
  .page:has(.photo-list) { max-width: 1100px; }
  .photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Descanso en su pantalla (2026-10-15): anillo en verde y Michi hablando en bocadillos */
.ring-rest .ring-fg { stroke: var(--mint-deep); }
.rest-talk { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; margin: 0 auto 6px; }
.bubble { position: relative; margin: 0; padding: 12px 16px; background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
  font-size: 17px; line-height: 1.4; text-align: left; animation: michi-in 300ms ease-out both; }
.bubble::after { content: ""; position: absolute; left: 44%; bottom: -11px; width: 18px; height: 18px;
  background: var(--surface); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg); }
.bubble-second { align-self: flex-end; background: var(--mint); }
.bubble-second::after { background: var(--mint); left: 62%; }
.bubble + .bubble-second { margin-top: 4px; }
.bubble-kind { font-weight: 800; }
.next-choice h2 { margin: 8px 0 0; }

/* Horario de clases (punto 3, 2026-11-06): una fila por clase con sus horas y la asignatura */
.timetable-day h2 { margin: 0; font-size: 18px; }
.timetable-row { display: grid; grid-template-columns: auto auto auto 1fr auto; gap: 6px; align-items: center; }
.timetable-row input[type="time"] { min-height: 44px; padding: 4px 6px; max-width: 7.5em; }
.timetable-row select { min-height: 44px; min-width: 0; }
.timetable-row .icon-button { min-width: 44px; min-height: 44px; background: none; border: 0; font-size: 18px; }
@media (max-width: 420px) {
  .timetable-row { grid-template-columns: auto auto auto 1fr; }
  .timetable-row select { grid-column: 1 / 4; }
}

/* Agenda de la tarde (punto 4, 2026-11-09) */
.afternoon-line { margin: 4px 0 0; font-size: 15px; }
.afternoon-line .warn { color: var(--alert); font-weight: 700; }
/* Palabras clave de la tarde en color de letra (2026-11-30): tonos de los colores de asignatura (azul, verde,
   frambuesa) muy oscurecidos: pasan de 4,5:1 sobre la tarjeta de Michi en todas las paletas (opción A). */
.afternoon-line .hl { font-weight: 800; white-space: nowrap; }
.hl-time { color: #173F66; }
.hl-end { color: #143D30; }
.hl-act { color: #6E1C3D; }
.window-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.window-row .day-name { grid-column: 1 / -1; font-weight: 800; }
.window-row label { font-weight: 600; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.weekday-picks label.chip { min-width: 48px; justify-content: center; padding: 6px 12px; }
.activity-actions { display: flex; flex-direction: column; gap: 4px; }
.activity-actions details[open] { padding-bottom: 8px; }
.activity { border-top: 2px solid var(--line); padding-top: 12px; }
.activity p { margin: 0 0 8px; }
.activity .paused { font-weight: 700; }
.activity details, .add-activity { min-width: 0; }
.add-activity summary, .activity summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

/* Agenda de la tarde, parte 3: «Tu tarde» */
/* «Ver plan para la tarde» es un botón (2026-11-22); `.michi-card a` le quitaba el alto de línea */
.michi-card a.afternoon-link, .michi-hero a.afternoon-link { display: inline-flex; margin-top: 8px; line-height: 1.2; }
.afternoon-sum { margin: 0 0 12px; }
.afternoon-sum .warn { color: var(--alert); font-weight: 700; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.slot { display: grid; grid-template-columns: 48px 12px 1fr auto; gap: 10px; align-items: start;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.slot-time { font-size: 14px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.slot-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--line-strong); }
.slot-body { display: flex; flex-direction: column; min-width: 0; }
.slot-title { font-weight: 700; overflow-wrap: anywhere; }
.slot-meta { font-size: 14px; opacity: 0.75; }
.slot-descanso, .slot-libre { background: transparent; border-style: dashed; padding-top: 6px; padding-bottom: 6px; }
.slot-libre .slot-dot { background: var(--mint); }
.slot-descanso .slot-dot { background: var(--peach); }
.slot-ida, .slot-vuelta, .slot-extraescolar { background: color-mix(in srgb, var(--lavender) 25%, white); border-color: var(--lavender); }
.slot-extraescolar .slot-dot, .slot-ida .slot-dot, .slot-vuelta .slot-dot { background: var(--lavender-deep); }
.slot.is-pasado { opacity: 0.6; }
.slot.is-ahora { border-color: var(--peach-deep); box-shadow: var(--shadow-float); opacity: 1; }
.now-badge { font-size: 13px; font-weight: 800; color: var(--ink); background: var(--peach); border-radius: var(--pill);
  padding: 2px 8px; align-self: center; }

/* Panel de monitorización (2026-11-10). Paleta validada para daltonismo sobre blanco (guía de visualización) */
.mon { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --grid: #e6e4e0; --tick: #5a5c6e; }
.page:has(.mon) { max-width: 1200px; }
.mon-head .segmented-tabs { margin-top: 8px; }
.mon-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }
.mon-kpi { background: var(--surface); border-radius: var(--radius-sm); padding: 12px; display: flex;
  flex-direction: column; gap: 2px; border: 2px solid var(--line); }
.mon-kpi-label { font-size: 13px; font-weight: 700; opacity: 0.8; }
.mon-kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mon-kpi-hint { font-size: 12px; opacity: 0.75; }
.mon-group { margin: 24px 0 8px; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.mon-chart { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mon-chart h2 { font-size: 17px; margin: 0; }
.mon-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.mon-legend li { display: flex; align-items: center; gap: 6px; }
.mon-legend .sw { width: 12px; height: 12px; border-radius: 50%; }
.sw.s1, .mon-hbar-fill.s1 { background: var(--s1); }
.sw.s2 { background: var(--s2); }
.sw.s3 { background: var(--s3); }
/* Media de todos (2026-11-19): tinta, discontinua y más gruesa, para distinguirla de las de cada estudiante */
.mon-legend .sw.s0 { width: 18px; height: 0; border-radius: 0; border-top: 3px dashed var(--ink); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { font-size: 10px; fill: var(--tick); font-family: inherit; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s0 { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 6 4; }
.chart .dot.s0 { fill: var(--ink); }
.chart .line.s1 { stroke: var(--s1); } .chart .line.s2 { stroke: var(--s2); } .chart .line.s3 { stroke: var(--s3); }
.chart .area.s1 { fill: var(--s1); fill-opacity: 0.1; }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart .dot.s1, .chart .bar.s1 { fill: var(--s1); }
.chart .dot.s2, .chart .bar.s2 { fill: var(--s2); }
.chart .dot.s3, .chart .bar.s3 { fill: var(--s3); }
.chart .hit rect { fill: transparent; }
.chart .hit line { stroke: var(--tick); stroke-width: 1; opacity: 0; }
.chart .hit:hover line { opacity: 0.6; }
.chart .hit:hover rect { fill: rgba(var(--ink-rgb), 0.04); }
.mon-note { font-size: 12px; opacity: 0.75; margin: 0; }
.mon-hbars { display: flex; flex-direction: column; gap: 6px; }
.mon-hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 5ch; gap: 8px; align-items: center; font-size: 14px; }
.mon-hbar-track { height: 16px; }
.mon-hbar-fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; }
.mon-hbar-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.mon-table summary { font-size: 13px; font-weight: 700; cursor: pointer; }
.mon-table-scroll { max-height: 260px; overflow: auto; margin-top: 6px; }
.mon-table table { border-collapse: collapse; font-size: 13px; width: 100%; font-variant-numeric: tabular-nums; }
.mon-table th, .mon-table td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.mon-table th[scope=row] { text-align: left; font-weight: 600; }
.mon-system { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.mon-system dt { font-size: 13px; font-weight: 700; opacity: 0.8; }
.mon-system dd { margin: 0; font-weight: 700; }
.mon-periods { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mon-periods a { padding: 8px 14px; border-radius: var(--pill); border: 2px solid var(--line-strong); font-weight: 700;
  text-decoration: none; color: var(--ink); }
.mon-periods a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Cómo calcula y estudio del cálculo (2026-11-10) */
.est-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.est-table th, .est-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.est-table th[scope=row], .est-table thead th:first-child { text-align: left; }
.est-table th[scope=row] { font-weight: 700; }
.est-table-wrap { overflow-x: auto; }
.est-table td { white-space: nowrap; }
.est-table th .small { font-weight: 400; }

/* --- Paletas de colores (2026-11-15): selector con una pantalla Hoy en miniatura por opción ------- */
.theme-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
label.theme-choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px;
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-lg); cursor: pointer; }
label.theme-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.theme-choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
label.theme-choice:has(input:focus-visible) { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
label.theme-choice:has(input:checked) .theme-name::before { content: "✓ "; }
.theme-name { font-weight: 800; }
.theme-mood { font-size: 14px; }
.theme-preview { display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow: hidden;
  background: var(--cream); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  font-size: 11px; font-weight: 700; line-height: 1.25; }
.tp-michi { display: flex; align-items: center; gap: 6px; background: var(--peach); border-radius: 10px; padding: 4px 6px; }
.tp-michi svg { flex: none; }
.tp-col { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tp-xp { height: 6px; border-radius: var(--pill); background: var(--surface); overflow: hidden; }
.tp-xp span { display: block; width: 60%; height: 100%; background: var(--mint-deep); border-radius: var(--pill); }
.tp-list { background: var(--surface); border-radius: 10px; padding: 0 6px; }
.tp-row { display: flex; align-items: center; gap: 5px; min-height: 24px; border-bottom: 1px solid var(--line); }
.tp-row:last-child { border-bottom: 0; }
.tp-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tp-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-done { text-decoration: line-through; opacity: 0.75; }
.tp-tag { flex: none; background: var(--lavender); border-radius: var(--pill); padding: 1px 6px; font-size: 10px; }
.tp-tag-main { background: var(--peach); box-shadow: inset 0 0 0 1.5px var(--peach-deep); }
.tp-tag-done { background: var(--mint); }
.tp-warn { display: flex; flex-direction: column; gap: 5px; background: var(--lavender); border-radius: 10px; padding: 6px; }
.tp-buttons { display: flex; gap: 4px; }
.tp-btn { flex: 1; text-align: center; padding: 3px 0; font-size: 10px; border-radius: var(--pill);
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--cream); }
.tp-btn-2 { background: var(--surface); color: var(--ink); }
.tp-swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.tp-swatches span { height: 12px; border-radius: 4px; }
.tp-swatches .tp-sw-cream { box-shadow: inset 0 0 0 1px var(--line-strong); }
.tp-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -8px -8px;
  border-top: 1px solid var(--line); font-size: 10px; text-align: center; }
.tp-tabs span { padding: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-tabs .tp-on { font-weight: 800; box-shadow: inset 0 2px 0 var(--peach-deep);
  background: color-mix(in srgb, var(--peach) 35%, var(--cream)); }

/* Lista de dispositivos en Más (Fase 1a): filas que se ajustan en el móvil */
.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.device-list .row > div { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.device-list form > button { width: auto; min-height: 44px; }
.device-list .row > .actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.device-list details.rename { flex-basis: 100%; }
.device-list details form { margin-top: 8px; }
/* «¿Quién va a usar Michi?» en /login (Fase 1b) */
.who-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.who-list .button { min-height: 48px; }

/* Pasos para añadir Michi a la pantalla de inicio en iPhone y iPad (Más → Notificaciones, 2026-11-18) */
.apple-install ol { margin: 8px 0; padding-left: 1.4em; }
.apple-install li { margin: 4px 0; }

/* --- Pestaña «Tareas» (2026-11-22): «Por días» y «Todas» ------------------------------------------- */
.tasks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tasks-head h1 { margin: 0; }
.tasks-head .button { flex: none; }
.tasks-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
/* La varita junto a «+ Nueva»: botón claro y cuadrado-redondo, como su botón en Hoy */
.tasks-head .capture-button { width: 48px; min-width: 48px; padding: 0; background: var(--surface);
  border: 2px solid var(--ink); }
/* Selector secundario de 7 días («Próximos 7 días / Los 7 siguientes»): más discreto que el de la vista */
.segmented-tabs.sub { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented-tabs.sub a[aria-current="page"] { background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink); }
.list-tools { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 4px 0 8px; }
.sort-form select { min-height: 48px; border-radius: var(--pill); font-weight: 700; }
/* «Filtrar»: botón que abre un panel flotante bajo la barra (capa flotante: con sombra, DESIGN.md) */
.filter-panel > summary { list-style: none; display: inline-flex; align-items: center; min-height: 48px;
  padding: 10px 20px; font-weight: 800; background: var(--surface); border: 2px solid var(--ink);
  border-radius: var(--pill); cursor: pointer; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::marker { content: ""; }
.filter-panel > summary::before { content: none; }  /* es un botón, no un desplegable con flecha */
.filter-panel > summary:focus-visible { outline: 3px solid var(--peach-deep); outline-offset: 2px; }
.filter-form { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 6; background: var(--cream);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-float); }
.active-filters { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px;
  border-radius: var(--pill); background: var(--mint); color: var(--ink); font-weight: 700; text-decoration: none; }
.list-row { align-items: flex-start; }
.list-row .dot { margin-top: 6px; }
.list-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-line .task-title { min-width: 0; overflow-wrap: anywhere; }
.list-row .due { flex: none; font-size: 16px; white-space: nowrap; }
.list-row .due.overdue { color: var(--alert); font-weight: 800; }
.list-row .task-meta { min-width: 0; }
.tag.tag-calc { background: var(--peach); align-self: center; }

/* Contador de rondas con su tiempo al lado, «− 2 🍣 + = 50 min»; debajo si no cabe (2026-11-22, compacto 2026-12-04) */
.stepper-with-time { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.stepper-with-time .stepper { align-self: center; }
.stepper-with-time .stepper output { min-width: 64px; }
.stepper-time { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Hoy en el móvil (2026-11-22): Michi está a la izquierda del bocadillo, así que la punta sale por la izquierda y
   apunta hacia él; abajo tapaba los contadores de racha, monedas y rondas */
.michi-card .bubble { margin-left: 10px; }
.michi-card .bubble::after { left: -11px; top: auto; bottom: 16px; border-right: 0;
  border-left: 2px solid var(--ink); }
.michi-card .michi-stats { margin-top: 10px; }

/* Bocadillos (2026-11-22): la punta siempre señala a la mascota. Con Michi encima (pantalla de Michi, estados de la
   captura, emparejar), sale por arriba, centrada; con el icono a la izquierda (sin conexión), por la izquierda; sin
   mascota al lado, no lleva punta */
.capture-state .bubble::after, .michi-big .bubble::after { top: -11px; bottom: auto; left: calc(50% - 9px);
  transform: rotate(225deg); }
.capture-state .bubble, .michi-big .bubble { margin-top: 6px; }
.offline .bubble { margin-left: 10px; }
.offline .bubble::after { left: -11px; top: auto; bottom: 16px; border-right: 0; border-left: 2px solid var(--ink); }
.bubble.no-tail::after { content: none; }
/* Leyendo: Michi baja al centro, debajo de la foto, para que la punta del bocadillo le señale sea cual sea el ancho
   de la foto o del texto */
.reading-pet { left: 50%; margin-left: -60px; bottom: -64px; }
.reading + .bubble { margin-top: 74px; }
/* «¿La partimos en pasos?»: Michi arriba, a la altura de la punta, y sin encogerse */
.michi-card.split-offer { align-items: flex-start; }
.michi-card > svg, .michi-card > a { flex-shrink: 0; }
/* Descanso: la respuesta del chiste o la solución, centrada sobre Michi para que su punta le señale */
.bubble-second { align-self: center; }
.bubble-second::after { left: calc(50% - 9px); }
.bubble::after { left: calc(50% - 9px); }

/* Hoy en el móvil, más compacto (2026-11-22): bocadillo arriba con la punta hacia Michi, que queda debajo a la
   izquierda con la racha, la tarde y el nivel al lado; «Ver plan para la tarde», más bajo */
.michi-today { flex-direction: column; align-items: stretch; gap: 14px; }
.michi-today .bubble { margin-left: 0; }
.michi-today .bubble::after { left: 39px; top: auto; bottom: -11px; border-left: 0; border-right: 2px solid var(--ink); }
.michi-today-row { display: flex; align-items: flex-start; gap: 12px; }
.michi-today-row > a { flex-shrink: 0; }
.michi-today-row > div { flex: 1; min-width: 0; }
.michi-today .michi-stats { margin-top: 8px; }
.michi-stats { justify-content: center; }  /* encima del nivel, centradas (2026-11-30) */
.michi-stats + .level.compact { margin-top: 4px; }
a.button.afternoon-link { min-height: 44px; padding: 6px 14px; font-size: 15px; }

/* Aviso de mudanza (2026-11-23): quien entra por la dirección antigua ve arriba el enlace a la nueva */
.moved-band { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; background: var(--peach);
  border: 2px solid var(--ink); }
.moved-band p { margin: 0; }
.moved-band .button { align-self: center; }  /* botones centrados (DESIGN.md, 2026-11-23) */
/* Botones centrados (DESIGN.md «Botones», 2026-11-23): el botón suelto en su propio párrafo y los de cada estudiante */
.lone-button { text-align: center; }
.student-row .actions { justify-content: center; }

/* --- Recorrido por Hoy (2026-11-24, app.js startTour) ------------------------------------------- */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour[hidden], .tour [hidden] { display: none; }
.tour-spot { position: fixed; border-radius: var(--radius-sm); pointer-events: none;
  box-shadow: 0 0 0 4px var(--peach), 0 0 0 9999px rgba(var(--ink-rgb), 0.62);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.tour-card { position: fixed; background: var(--surface); color: var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); padding: 16px; display: grid; gap: 12px; }
.tour-head { display: flex; gap: 12px; align-items: flex-start; }
.tour-head svg, .tour-head img { flex: none; }
.tour-head p { margin: 0; font-size: 1.05rem; line-height: 1.45; }
.tour-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tour-count { margin-right: auto; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* Altas y códigos de invitación (/admin/altas, /admin/codigos, 2026-11-29) */
.adm-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.adm-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 16px; }
.adm-who { min-width: 0; flex: 1 1 220px; }
.adm-item form { margin: 0; }
.adm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); justify-content: start; gap: 4px 24px;
  margin: 0; font-size: 14px; }
@media (min-width: 700px) { .adm-facts { grid-template-columns: repeat(4, minmax(0, auto)); } }
.adm-facts dt { font-size: 12px; opacity: 0.75; }
.adm-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.adm-sub { display: block; font-weight: 400; font-size: 13px; opacity: 0.75; overflow-wrap: anywhere; }
.adm-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--line); }
.adm-state-activo { background: var(--mint); }
.adm-state-agotado, .adm-state-caducado, .adm-state-desactivado { background: var(--peach); }
.adm-new summary { cursor: pointer; }
.adm-code { margin-top: 12px; }
.adm-code-name { margin: 0; font-size: 20px; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.adm-meta { margin: 0; }
.adm-use { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adm-use meter { width: 160px; height: 14px; }
.adm-casi, .adm-agotado { outline: 2px solid var(--peach-deep); }
.adm-warn { margin: 0; font-weight: 700; }
.adm-code details summary { cursor: pointer; font-weight: 700; }
.adm-link { display: grid; gap: 4px; }
.adm-link input { font-size: 14px; }

/* Saludo al principio de Más (2026-11-29) */
.mas-hello { margin: 0 0 -8px; font-size: 20px; overflow-wrap: anywhere; }

/* Administración (2026-11-29): pestañas arriba en el móvil y menú anidado bajo Más en la barra lateral */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 6px;
  scrollbar-width: none; }
.admin-tabs a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.admin-tabs a[aria-current="page"] { background: var(--ink); color: var(--cream); }
.admin-side { margin-top: 4px; }
.tabbar .admin-side a { min-height: 40px; font-size: 15px; }
.tabbar .admin-side .admin-side-title { font-weight: 900; }
.admin-side ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line);
  margin-left: 16px; display: grid; gap: 2px; }
.tabbar .admin-side ul a { padding: 6px 12px; font-weight: 700; font-size: 14px; min-height: 36px; line-height: 1.2; }
@media (min-width: 900px) { .admin-tabs { display: none; } }

/* Mochila (Plan Familia, 2026-11-30, docs/mochila.md) */
.pack-group h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15em; margin: 0; }
.pack-list, .pack-reminders, .pack-config-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pack-list form { margin: 0; }
button.pack-item { width: 100%; justify-content: flex-start; text-align: left; gap: 12px; border-radius: var(--radius-sm);
  font-weight: 600; }
button.pack-item.is-on { background: color-mix(in srgb, var(--mint) 45%, var(--surface)); border-color: var(--mint-deep); }
.pack-box { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--line-strong); background: var(--surface); font-weight: 800; color: var(--mint-deep); }
.is-on .pack-box { border-color: var(--mint-deep); }
.pack-config-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line); }
.pack-config-list li:last-child { border-bottom: 0; }
.pack-config-list form { margin: 0; }
.pack-config-list button.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.pack-add { display: flex; gap: 8px; align-items: stretch; }
.pack-add input[name="label"] { flex: 1; min-width: 0; }
.pack-day summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
.pack-day[open] { padding-bottom: 8px; }
.pack-subject { border-top: 1px solid var(--line); padding-top: 12px; }
.pack-reminders a { font-weight: 600; }

/* Cuentas de tutor/a en /admin/altas: filtros, tabla ordenable y páginas (2026-11-30). En el móvil, cada fila es
   una tarjeta con su etiqueta delante de cada dato. */
.adm-filters { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.adm-filters label:first-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .adm-filters { grid-template-columns: repeat(3, 1fr); align-items: end; } }
.adm-filters label { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.adm-filter-actions { display: flex; gap: 16px; align-items: center; grid-column: 1 / -1; }
.adm-table-wrap { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { padding: 10px 12px; text-align: left; vertical-align: top; }
.adm-table thead th { font-size: 13px; white-space: nowrap; border-bottom: 2px solid var(--line-strong); }
.adm-table thead a { color: inherit; text-decoration: none; }
.adm-table thead a:hover, .adm-table thead a:focus-visible { text-decoration: underline; }
.adm-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.adm-table tbody th { font-weight: 400; }
.adm-table td { font-variant-numeric: tabular-nums; }
.adm-plan-on { background: color-mix(in srgb, var(--mint) 55%, var(--surface)); }
.adm-plan-off { opacity: 0.75; }
.adm-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.adm-pages a, .adm-pages span { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center;
  padding: 0 10px; border-radius: var(--pill); }
.adm-pages [aria-current="page"] { background: var(--ink); color: var(--cream); font-weight: 800; }
.adm-plan-kind { border: 0; padding: 0; margin: 0; }
.adm-plan-kind legend { font-weight: 700; margin-bottom: 4px; }
.adm-plan-kind label.check { flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-plan-kind input[type="date"], .adm-plan-kind select { width: auto; }
.adm-amount { width: 6em; }
@media (max-width: 699px) {
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table th, .adm-table td { display: block; width: 100%; }
  .adm-table tbody tr { padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .adm-table tbody tr + tr > * { border-top: 0; }
  .adm-table tbody tr + tr { border-top: 1px solid var(--line); }
  .adm-table th, .adm-table td { padding: 0; }
  .adm-table tbody th, .adm-table td:last-child, .adm-table td[data-label="Plan Familia"] { grid-column: 1 / -1; }
  .adm-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; opacity: 0.75; }
}

/* Hoy: «Plan de tarde» y, al lado, el botón redondo de la mochila (2026-11-30) */
.hoy-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.hoy-quick a.afternoon-link { margin-top: 0; }
a.button.pack-round { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 20px;
  flex: none; }
/* En los móviles más estrechos, menos relleno para que «Plan de tarde» y 🎒 quepan en una línea */
@media (max-width: 379px) {
  .hoy-quick { gap: 4px; }
  .hoy-quick a.button.afternoon-link { padding: 6px 8px; gap: 4px; }
  .hoy-quick a.button.pack-round { width: 40px; height: 40px; min-height: 40px; font-size: 18px; }
}

/* Hoy en el móvil (2026-11-30): Michi un poco más grande; racha, monedas y rondas bajo Michi, en la misma línea que
   el nivel (más corto); «Plan de tarde» y 🎒 más pequeños */
.michi-today-foot { display: flex; align-items: center; gap: 12px; }
.michi-today-foot .michi-stats { margin: 0; flex: none; justify-content: flex-start; gap: 10px; }
.michi-today-foot .level.compact { margin: 0; flex: 1; min-width: 0; flex-wrap: nowrap; }
.michi-today-foot .xp-bar { flex: 1 1 60px; min-width: 40px; }
.michi-today .hoy-quick a.button.afternoon-link { min-height: 38px; padding: 4px 12px; font-size: 14px; }
.michi-today .hoy-quick a.button.pack-round { width: 38px; height: 38px; min-height: 38px; font-size: 17px; }
@media (max-width: 380px) {
  .michi-today .hoy-quick a.button.afternoon-link { padding: 4px 8px; gap: 4px; font-size: 13px; }
  .michi-today .hoy-quick a.button.pack-round { width: 36px; height: 36px; min-height: 36px; font-size: 16px; }
  .michi-today-row { gap: 8px; }
}
.michi-today .hoy-quick { justify-content: center; }  /* centrados en la columna del texto (2026-11-30) */
