/* Hoja de hoy — línea «Mosaico»: tarjetas grandes, números protagonistas, claro y oscuro.
   Tipografía Geist, servida desde el repo (SIL OFL 1.1, ver fonts/OFL-geist.txt). */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
}

/* ---------- colores ----------
   Claro por defecto. El oscuro se aplica si el teléfono está en oscuro (salvo que se elija «claro»)
   o si se elige «oscuro» en Ajustes. Por eso el bloque oscuro está dos veces, con los mismos valores. */
:root {
  --bg: #f2f2f6; --surface: #ffffff; --surface-2: #e7e7ee; --veil: rgb(17 17 20 / .07);
  --fg: #111114; --mute: #5c5c66; --line: rgb(17 17 20 / .1); --line-strong: rgb(17 17 20 / .3); --rest: rgb(17 17 20 / .2);
  --accent: #0068d6; --on-accent: #ffffff;
  --ink: #111114; --on-ink: #ffffff; --tab-on: #ffffff;
  /* la tarjeta principal: negra de día, con luces de color de noche */
  --hero: #111114; --hero-img: none; --hero-fg: #ffffff; --hero-mute: #b9b9c3; --hero-line: rgb(255 255 255 / .16); --hero-ghost: rgb(255 255 255 / .45);
  --hero-accent: #6cb1ff; --hero-on-accent: #00213f; --hero-inner: rgb(255 255 255 / .1); --hero-btn: #ffffff; --hero-btn-fg: #111114; --hero-shadow: none;
  --hero-bar-g: #6cb1ff; --hero-bar-x: #ffffff; --hero-bar-r: rgb(255 255 255 / .28);
  --amber: #fff1b8; --green: #d6f4e2; --green-ink: #0a7a3d; --rose: #ffe2de;
  --grad-img: none; --grad-fill: currentColor;
  --float: 0 8px 28px -10px rgb(17 17 20 / .28);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 28px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --bar: 70px; /* lugar que ocupa el menú de abajo */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07070b; --surface: #15151c; --surface-2: #20202a; --veil: rgb(255 255 255 / .1);
    --fg: #f3f3f7; --mute: #a5a5b4; --line: rgb(255 255 255 / .11); --line-strong: rgb(255 255 255 / .34); --rest: rgb(255 255 255 / .24);
    --accent: #8fb8ff; --on-accent: #051226;
    --ink: #f3f3f7; --on-ink: #07070b; --tab-on: #33333f;
    --hero: #2f55d4; --hero-img: linear-gradient(135deg, #6d28d9 0%, #2563eb 55%, #0e7490 100%); --hero-mute: #eef0ff; --hero-line: rgb(255 255 255 / .26); --hero-ghost: rgb(255 255 255 / .6);
    --hero-accent: #ffffff; --hero-on-accent: #1e1b4b; --hero-inner: rgb(0 0 0 / .24); --hero-btn-fg: #1e1b4b; --hero-shadow: 0 30px 60px -28px rgb(99 102 241 / .8);
    --hero-bar-g: #ffffff; --hero-bar-x: #fbbf24; --hero-bar-r: rgb(255 255 255 / .3);
    --amber: #2a2410; --green: #0f2a1c; --green-ink: #4ade80; --rose: #2c1517;
    --grad-img: linear-gradient(120deg, #c4b5fd, #93c5fd 55%, #67e8f9); --grad-fill: transparent; --grad-color: #a9c3fd;
    --float: 0 10px 30px -8px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07070b; --surface: #15151c; --surface-2: #20202a; --veil: rgb(255 255 255 / .1);
  --fg: #f3f3f7; --mute: #a5a5b4; --line: rgb(255 255 255 / .11); --line-strong: rgb(255 255 255 / .34); --rest: rgb(255 255 255 / .24);
  --accent: #8fb8ff; --on-accent: #051226;
  --ink: #f3f3f7; --on-ink: #07070b; --tab-on: #33333f;
  --hero: #2f55d4; --hero-img: linear-gradient(135deg, #6d28d9 0%, #2563eb 55%, #0e7490 100%); --hero-mute: #eef0ff; --hero-line: rgb(255 255 255 / .26); --hero-ghost: rgb(255 255 255 / .6);
  --hero-accent: #ffffff; --hero-on-accent: #1e1b4b; --hero-inner: rgb(0 0 0 / .24); --hero-btn-fg: #1e1b4b; --hero-shadow: 0 30px 60px -28px rgb(99 102 241 / .8);
  --hero-bar-g: #ffffff; --hero-bar-x: #fbbf24; --hero-bar-r: rgb(255 255 255 / .3);
  --amber: #2a2410; --green: #0f2a1c; --green-ink: #4ade80; --rose: #2c1517;
  --grad-img: linear-gradient(120deg, #c4b5fd, #93c5fd 55%, #67e8f9); --grad-fill: transparent; --grad-color: #a9c3fd;
  --float: 0 10px 30px -8px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color: var(--fg); }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 15px; font-weight: 500; line-height: 1.4;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
body.onb-on .app, body.onb-on .add, body.onb-on .tabbar { display: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

.app { max-width: 540px; margin: 0 auto; padding-block: 8px calc(var(--bar) + 96px); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
body:not(.on-day) .app { padding-bottom: calc(var(--bar) + 30px); }
body:not(.on-day) .add { display: none; }

/* De noche, los títulos y los números llevan un degradé; de día son texto liso. */
.grad, .tile:not(.one) .tile-num {
  color: var(--grad-color, inherit); background-image: var(--grad-img);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: var(--grad-fill);
}

/* ---------- marca: queda en el armado ---------- */
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- botones ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 99px;
  background: var(--ink); color: var(--on-ink); font-size: 15px; font-weight: 700; transition: transform .12s, opacity .15s;
}
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.quiet { background: transparent; color: var(--mute); }
.btn.small { min-height: 38px; padding: 0 15px; font-size: 13.5px; }
/* Zonas táctiles de 44 px o más, sin cambiar cómo se ven los controles chicos. */
.pill, .chip, .tab, .mini, .del, .link { position: relative; }
.btn.small::before, .pill::before, .chip::before, .tab::before { content: ""; position: absolute; inset: -5px 0; }
.seg .chip::before, .checks .chip::before { inset: -3px 0; }
.mini::before { content: ""; position: absolute; inset: -7px 0; }
.del::before { content: ""; position: absolute; inset: -7px; }
.link::before { content: ""; position: absolute; inset: -13px -4px; }
.switch::before { content: ""; position: absolute; inset: -8px -2px; }
.btn:active, .pill:active, .nav:active, .go:active, .opt:active, .cell:active, .mini:active, .dump:active { transform: scale(.97); }
.pill { height: 34px; padding: 0 13px; border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 700; transition: transform .12s; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.nav { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); transition: transform .12s, color .15s; }
.nav:hover { color: var(--fg); }
.link { font-weight: 700; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- calendario ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cal-label { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--mute); }
.cal-head .nav { margin-block: -5px; }
.cal-head .nav:first-child { margin-left: -12px; }
.cal-head .nav:last-child { margin-right: -12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--mute); padding: 2px 0; }
.cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 50px; padding-bottom: 6px; border-radius: 16px; background: var(--surface); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, transform .12s;
}
.cell small { font-size: 10.5px; font-weight: 600; color: var(--mute); }
.cell.past { color: var(--mute); }
.cell.out { background: transparent; color: var(--mute); }
.cell.today { box-shadow: inset 0 0 0 1.5px var(--fg); color: var(--fg); }
.cell.sel { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.cell.sel small { color: inherit; }
.cell .mark { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; }
.cell.has-open .mark { opacity: 1; }
.cal-grid.month .cell { height: 44px; padding-bottom: 5px; border-radius: 14px; font-size: 15px; }
.cal-grid.month .cell .mark { bottom: 5px; width: 4px; height: 4px; }

/* ---------- encabezado de pantalla ---------- */
.day { margin-top: 8px; }
.day-head, .head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.day-head { align-items: center; min-height: 42px; }
.kicker { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { padding-bottom: .04em; font-size: 36px; font-weight: 700; letter-spacing: -0.045em; line-height: 1.1; }
.screen > .head { margin-top: 6px; }
.count {
  display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 99px;
  background: var(--ink); color: var(--on-ink); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.hello { margin: 6px 4px -4px; font-size: 15px; font-weight: 700; }
.quote { font-size: 15px; line-height: 1.45; }
.quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; color: var(--mute); }
.panel > .quote { margin: 8px 4px 0; }
.note { font-size: 14px; line-height: 1.45; color: var(--mute); padding: 12px 16px; border-radius: 20px; background: var(--surface-2); }
.note b { color: var(--fg); font-weight: 700; }
.note ol { margin: 6px 0 10px 18px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; padding: 4px; border-radius: 99px; background: var(--surface-2); }
.tab { height: 36px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--mute); white-space: nowrap; transition: background .15s, color .15s; }
.tab[aria-selected="true"] { background: var(--tab-on); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / .16); }
.tab .n { margin-left: 5px; font-variant-numeric: tabular-nums; }
.tab .n:empty { display: none; }
.panel { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.panel > .fine { padding: 0 6px; }

/* ---------- el mosaico ---------- */
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mosaic > * { grid-column: 1 / -1; min-width: 0; }
.mosaic > .half { grid-column: auto; }
.tile { padding: 14px 16px; border-radius: var(--r); background: var(--surface); }
.tile.half { padding: 14px; }
.tile > .list:last-child { margin-bottom: -6px; }
/* La tarjeta principal redefine los colores para todo lo que tiene adentro. */
.tile.one {
  --fg: var(--hero-fg); --mute: var(--hero-mute); --line: var(--hero-line); --line-strong: var(--hero-ghost);
  --accent: var(--hero-accent); --on-accent: var(--hero-on-accent); --ink: var(--hero-btn); --on-ink: var(--hero-btn-fg);
  --surface-2: var(--hero-inner); --veil: var(--hero-inner); --bar-g: var(--hero-bar-g); --bar-x: var(--hero-bar-x); --bar-r: var(--hero-bar-r);
  background: var(--hero) var(--hero-img); color: var(--fg); box-shadow: var(--hero-shadow);
}
.tile.five, .tile.week, .tile.care-tile, .tile.done-tile, .tile.extra { --surface-2: var(--veil); }
.tile.five, .tile.care-tile { background: var(--amber); }
.tile.week, .tile.done-tile { --bar-g: var(--green-ink); background: var(--green); }
.tile.extra { background: var(--rose); }
.tile-num { display: block; margin-bottom: 8px; font-size: 62px; font-weight: 700; letter-spacing: -0.06em; line-height: .85; font-variant-numeric: tabular-nums; }
.tile-num.mid { font-size: 50px; line-height: 1; margin-bottom: 4px; }
.tile-num.sm { font-size: 40px; letter-spacing: -0.045em; line-height: 1.05; margin-bottom: 4px; }
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* Encabezado de cada lugar: el número sigue grande, en la misma fila que el nombre. */
.slot-head { display: flex; align-items: baseline; gap: 10px; min-height: 44px; }
.slot-head .tile-num { margin: 0; font-size: 52px; line-height: 44px; }
.tile-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.tile-desc { font-size: 12.5px; line-height: 1.4; color: var(--mute); }
.tile > .list, .tile > .bar, .tile > .tl { margin-top: 10px; }
.tile > .legend, .tile > .fine, .tile > .seal + .fine { margin-top: 8px; }
.tile > .lbl { margin: 10px 0 0; }
.tile > .quote, .tile > .field, .tile > .opts, .tile > .btn, .tile > .plainlist { margin-top: 10px; }
.tile > .lbl + p { margin-top: 2px; }
.tile > .btn.quiet { margin-left: -15px; }
.slot-head + .list { margin-top: 2px; }
.tile.one .txt { font-size: 16.5px; }
.tile > .how { margin-top: 10px; font-size: 13px; }
/* Al final de la hoja, en chico: dos medias tarjetas con un número cada una. */
.tile.sum { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tile.sum > * { margin: 0; }
.tile.sum > .bar { align-self: stretch; margin-top: 6px; }
.tile.sum > :nth-last-child(2) { margin-bottom: 10px; }
.tile.sum > .btn { margin-top: auto; }
.tile.sum .tile-num.sm { font-size: 32px; }
.tile.sum .due { color: var(--fg); font-weight: 700; }

.list { list-style: none; display: flex; flex-direction: column; }
.task { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 0; border-top: 1px solid var(--line); }
.task.new { animation: in .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes in { from { opacity: 0; transform: translateY(5px); } }
.check { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--mute); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check::before { content: ""; position: absolute; inset: -12px; }
.check::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid transparent; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .check::after { border-color: var(--on-accent); }
/* El texto abre la tarea: su zona táctil toma el alto del renglón (44 px) sin cambiar cómo se ve la lista. */
.txt { flex: 1; min-width: 0; padding: 11.5px 0; margin-block: -7.5px; text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.txt small { display: block; font-size: 12px; font-weight: 600; color: var(--accent); }
.txt small .when { color: var(--mute); }
.txt small .rep { color: var(--mute); }
.habits-head { margin-top: 24px; align-items: center; }
.card.habit { gap: 2px; }
.habit-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.checks.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.checks.days .chip { justify-content: center; padding: 0; }
.note.warn { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.habit-link { align-self: flex-start; margin-top: 4px; }
.task.done .txt { color: var(--mute); text-decoration: line-through; }
.task.done .txt small { color: var(--mute); }
.meta { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.mini { flex: none; height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--ink); color: var(--on-ink); transition: transform .12s; }
.del { flex: none; width: 30px; height: 30px; border-radius: 50%; color: var(--mute); font-size: 20px; line-height: 1; }
.del:hover { color: var(--fg); background: var(--surface-2); }
.free { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 0; border-top: 1px solid var(--line); text-align: left; font-size: 13.5px; color: var(--mute); }
.free i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--mute); }
.free.ask { color: var(--fg); font-weight: 700; }
.free.ask i { border-color: var(--fg); }
.empty { padding: 34px 8px; text-align: center; color: var(--mute); font-size: 15px; font-weight: 600; }

/* tiempo cuidado: un renglón dentro de la prioridad; los botones, desde que empieza el bloque hasta que se marca */
.care { margin-top: 8px; padding: 8px 8px 8px 12px; border-radius: 18px; background: var(--hero-inner); }
.care-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.care-info { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--mute); }
.care-name { display: block; font-size: 13.5px; font-weight: 700; color: var(--fg); }
.care-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.care-top .btn { flex: none; min-height: 34px; padding: 0 10px; }
/* Con los botones a la vista, nombre y horario van en una sola línea. */
.care.active .care-top { min-height: 0; padding: 2px 4px 0 0; }
.care.active .care-info { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.care.active .care-name { display: inline; }
.care-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.care-row .btn { min-height: 34px; }
.care-row .btn.quiet { padding: 0 8px; }
/* En pantallas angostas (o con letra grande) los tres botones entran en un renglón. */
@media (max-width: 359px) {
  .care-row { flex-wrap: nowrap; gap: 6px; }
  .care-row .btn.small { padding: 0 10px; }
  .care-row .btn.quiet { padding: 0 6px; }
}
.care.done { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.care.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.care.off .care-name { color: var(--mute); }

/* horas */
.tl { position: relative; }
.tile > .tl { margin-top: 8px; }
.tl-row { height: 56px; border-top: 1px dashed var(--line); position: relative; }
.tl-row span { position: absolute; top: -9px; left: 0; padding-right: 6px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.tl-lane { position: absolute; top: 0; bottom: 0; left: 50px; right: 0; }
/* Cada bloque de Horas funciona como un renglón de la hoja: el círculo marca, el texto abre para editar. */
.blk { position: absolute; display: flex; align-items: flex-start; gap: 8px; padding: 5px 10px 5px 7px; border-radius: 14px; text-align: left; overflow: hidden; background: var(--surface-2); font-size: 14px; font-weight: 600; line-height: 1.2; }
.blk span, .blk small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-txt { flex: 1; min-width: 0; align-self: stretch; text-align: left; }
.blk .check { margin-top: 1px; }
.blk .check::before { inset: -5px; }
.blk.short .check { width: 18px; height: 18px; margin-top: 0; }
.blk.short .check::after { width: 4px; height: 8px; }
.blk.care-blk { display: block; padding: 6px 11px; }
.blk small { margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--mute); }
.blk.short small { display: none; }
.blk.one { --mute: var(--hero-mute); background: var(--hero) var(--hero-img); color: var(--hero-fg); }
.blk.five { background: var(--amber); }
.blk.extra { background: var(--rose); }
.blk.done { --mute: inherit; background: var(--surface-2); color: var(--mute); text-decoration: line-through; }
.blk.care-blk { background: transparent; border: 1.5px dashed var(--mute); pointer-events: none; }
.now { position: absolute; left: 44px; right: 0; height: 1.5px; background: var(--fg); z-index: 2; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -4px; top: -3.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }

/* ---------- carga ---------- */
.add {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bar) + env(safe-area-inset-bottom, 0px)); z-index: 5; max-width: 540px; margin: 0 auto;
  padding-block: 14px 6px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: linear-gradient(to top, var(--bg) 78%, transparent);
}
/* Los lugares aparecen al escribir, o con el día vacío. En el teléfono, mientras se escribe, se esconde el menú. */
.chips { display: none; gap: 6px; margin-bottom: 8px; }
.add.typing .chips, .add.open .chips { display: flex; }
body.typing .tabbar { display: none; }
body.typing .add { bottom: env(safe-area-inset-bottom, 0px); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface); color: var(--mute); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.chip b { font-weight: 700; }
.chip b + span::before { content: "·"; margin-right: 5px; }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chips .chip { min-width: 44px; justify-content: center; }
.chip.goal { margin-left: auto; flex: 0 1 auto; min-width: 0; max-width: 42%; }
.chip.goal span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.goal.on { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (max-width: 479px) { .chips .chip[role="radio"]:not([aria-checked="true"]):not(.extra) span { display: none; } }
/* Lo que la app entendió de lo que se escribe (otro día, la hora, la duración), antes de mandarlo. */
.hint { margin: 0 6px 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
.add-field { position: relative; display: block; min-width: 0; }
.slot-badge { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); font-size: 14px; font-weight: 700; pointer-events: none; }
.slot-badge.one { background: var(--hero) var(--hero-img); color: var(--hero-fg); }
.slot-badge.five { background: var(--amber); }
.slot-badge.extra { background: var(--rose); }
.add input, .field {
  width: 100%; height: 48px; padding: 0 20px; border: 0; border-radius: 99px; min-width: 0;
  background: var(--surface); font-size: 16px; font-weight: 500; outline: none; text-overflow: ellipsis; transition: box-shadow .15s;
}
.add input { padding-left: 48px; }
.tile .field, .card .field, .sheet-card .field { background-color: var(--surface-2); }
textarea.field { display: block; height: auto; min-height: 150px; padding: 14px 18px; border-radius: 20px; line-height: 1.5; resize: vertical; }
select.field { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.add input::placeholder, .field::placeholder { color: var(--mute); opacity: 1; }
.add input:focus, .field:focus { box-shadow: inset 0 0 0 2px var(--fg); }
.go, .dump { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s; }
.go { background: var(--hero) var(--hero-img); color: var(--hero-fg); box-shadow: var(--hero-shadow); }
.dump { background: var(--surface); }
/* En pantallas angostas la carga se achica un poco para que entren la meta y el texto de ayuda. */
@media (max-width: 379px) {
  .chips { gap: 5px; }
  .chips .chip { padding: 0 10px; font-size: 12.5px; }
  .add-row { gap: 6px; }
  .add input { padding-left: 42px; padding-right: 12px; }
  .slot-badge { left: 7px; width: 28px; height: 28px; font-size: 13px; }
  .go, .dump { width: 46px; height: 46px; }
}
@media (max-width: 339px) {
  .chips .chip[role="radio"]:not(.extra) span { display: none; }
  .add input { padding-left: 38px; padding-right: 10px; }
  .slot-badge { left: 6px; width: 26px; height: 26px; }
  .go, .dump { width: 44px; height: 44px; }
}

/* ---------- escribir en el lugar ----------
   Tocar «Lugar libre» vuelve ese renglón el campo, dentro de su tarjeta. */
.inline-add { border-top: 1px solid var(--line); padding-bottom: 4px; }
.ia-row { display: flex; align-items: center; gap: 10px; min-height: 46px; box-shadow: inset 0 -2px 0 var(--fg); }
.ia-row i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--fg); }
.ia-input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; color: var(--fg); font-size: 16px; font-weight: 600; outline: none; }
.ia-input:focus-visible { outline: none; }
.tile.one .ia-input { font-size: 16.5px; }
.ia-input::placeholder { color: var(--mute); opacity: 1; }
.inline-add .hint { margin: 6px 0 2px 32px; }
/* El «+» de abajo: anotar rápido algo que surgió, o vaciar la cabeza. */
.fab {
  position: fixed; z-index: 5; right: max(var(--gutter-r), calc((100vw - 540px) / 2 + 16px)); bottom: calc(var(--bar) + 18px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hero) var(--hero-img); color: var(--hero-fg); box-shadow: var(--float); transition: transform .12s;
}
.fab .ic { width: 24px; height: 24px; }
.fab:active { transform: scale(.95); }
body:not(.on-day) .fab, body.typing .fab, body.onb-on .fab { display: none; }

/* ---------- menú de abajo ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none;
  padding: 6px var(--gutter-r) calc(8px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: var(--bg);
}
body:not(.on-day) .tabbar { background: linear-gradient(to top, var(--bg) 70%, transparent); }
.tabbar-in { pointer-events: auto; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 508px; height: 56px; margin: 0 auto; border-radius: var(--r); background: var(--surface); box-shadow: var(--float); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: var(--r); font-size: 11.5px; font-weight: 700; color: var(--mute); }
.tabbar button[aria-current="page"] { color: var(--fg); }
.tabbar .dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar) + 84px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 99px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--ink); color: var(--on-ink); box-shadow: var(--float); font-size: 13.5px; font-weight: 700; pointer-events: none;
  opacity: 0; transform: translate(-50%, 10px); transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .25s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* El aviso con «Deshacer»: se puede tocar (solo mientras se ve) y el texto puede ocupar dos renglones. */
.toast.act { display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(calc(100vw - 32px), 508px); padding: 6px 6px 6px 16px; border-radius: 22px; white-space: normal; }
.toast.act.on { pointer-events: auto; }
.toast.act > span { flex: 1; min-width: 0; }
.toast .undo { position: relative; flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px currentColor; font-weight: 700; }
.toast .undo::before { content: ""; position: absolute; inset: -4px -2px; }
body:not(.on-day) .toast { bottom: calc(var(--bar) + 16px + env(safe-area-inset-bottom, 0px)); }

/* ---------- hoja que sube desde abajo ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgb(0 0 0 / .5); }
.sheet-card {
  position: relative; width: 100%; max-width: 540px; max-height: 90%; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r) var(--r) 0 0; animation: up .25s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px 4px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
.sheet-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.sheet-body { overflow-y: auto; padding-block: 6px 20px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 10px; }
.sheet-body > * { flex-shrink: 0; }
.sheet-body > p { color: var(--mute); font-size: 14.5px; line-height: 1.45; }
.lbl { display: block; margin: 6px 0 -4px; font-size: 13px; font-weight: 600; color: var(--mute); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .chip, .checks .chip { height: 38px; background: var(--surface-2); }
.seg .chip[aria-checked="true"], .checks .chip[aria-pressed="true"] { background: var(--ink); }
.seg.compact .chip b + span { display: none; }
/* Un lugar lleno se ve: «3 · lleno». */
.chip .full-tag { font-size: 11px; font-weight: 600; }
.seg .chip.full { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two > div { display: grid; gap: 10px; min-width: 0; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.list.plain > :first-child { border-top: 0; }
.task.col { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 0; }

/* opciones (armado y hojas) */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 18px; text-align: left;
  border-radius: 20px; background: var(--surface); font-size: 15.5px; font-weight: 600;
  transition: transform .12s, box-shadow .15s;
}
.tile .opt, .sheet-card .opt { background: var(--surface-2); }
.opt > span { flex: 1; min-width: 0; }
.opt small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--mute); }
.opt .box { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--mute); display: grid; place-items: center; }
.opt .box::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid transparent; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.opt[aria-pressed="true"], .opt[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--fg); }
.opt[aria-pressed="true"] .box, .opt[aria-checked="true"] .box { background: var(--ink); border-color: var(--ink); }
.opt[aria-pressed="true"] .box::after, .opt[aria-checked="true"] .box::after { border-color: var(--on-ink); }
.opt small.fx { color: var(--accent); font-weight: 600; }

/* ---------- armado ---------- */
.onb {
  position: fixed; inset: 0; z-index: 20; max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg);
  padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.onb-top { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.onb-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.onb-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--fg); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.skip { min-width: 44px; min-height: 44px; padding: 0 2px; font-size: 13.5px; font-weight: 700; color: var(--mute); }
.onb-body { flex: 1; overflow-y: auto; padding: 24px 2px 20px; animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.onb-brand { margin-bottom: 24px; }
.onb-q { padding-bottom: .06em; font-size: clamp(30px, 9.2vw, 38px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.08; text-wrap: balance; }
.onb-sub { margin-top: 10px; font-size: 16px; line-height: 1.45; color: var(--mute); text-wrap: pretty; }
.onb-body .opts, .onb-body .fields, .onb-body .mosaic { margin-top: 22px; }
.fields { display: flex; flex-direction: column; gap: 8px; }
.onb-foot { padding-top: 10px; }
.onb-foot .btn { width: 100%; min-height: 56px; font-size: 16px; }
.res { list-style: none; margin-top: 20px; padding: 6px 18px; border-radius: var(--r); background: var(--surface); }
.res li { display: grid; grid-template-columns: 8px 1fr; gap: 4px 12px; padding: 12px 0; font-weight: 600; line-height: 1.35; }
.res li + li { border-top: 1px solid var(--line); }
.res li::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.res small { grid-column: 2; font-size: 13px; font-weight: 500; color: var(--mute); }

/* ---------- metas y ajustes ---------- */
.lead { margin-top: 6px; font-size: 14.5px; color: var(--mute); }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.card { padding: 14px 16px; border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.card.paused { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.goal-top { display: flex; align-items: flex-start; gap: 14px; }
.goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.goal-name { width: 100%; min-width: 0; border: 0; border-bottom: 1.5px solid transparent; border-radius: 0; background: none; outline: none; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; padding: 1px 0; }
.goal-actions { display: flex; justify-content: flex-end; gap: 2px; margin: 2px -10px -6px 0; }
.goal-name:focus { border-bottom-color: var(--fg); }
.goal-week { font-size: 13.5px; color: var(--mute); }
.sq { flex: none; display: grid; grid-template-rows: repeat(4, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; margin-top: 4px; }
.sq i { border-radius: 3.5px; background: var(--surface-2); }
.sq i.on { background: var(--accent); }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.inline .field { height: 48px; font-size: 16px; }
.btns { display: flex; gap: 2px; }
.h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.fine { font-size: 12.5px; line-height: 1.45; color: var(--mute); }

/* ---------- semana ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px -12px 8px; }
.week-nav p { flex: 1; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--mute); }
.bar { display: flex; gap: 3px; height: 12px; }
.bar i { display: block; height: 100%; min-width: 0; border-radius: 99px; }
.g { background: var(--bar-g, var(--accent)); }
.x { background: var(--bar-x, var(--fg)); }
.r { background: var(--bar-r, var(--rest)); }
.legend { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend span { flex: 1; min-width: 0; }
.legend b { font-weight: 700; font-variant-numeric: tabular-nums; }
.key { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.tile.half .legend { gap: 8px; font-size: 12.5px; }
.tile.half .legend li { flex-wrap: wrap; row-gap: 0; }
.tile.half .legend b { flex-basis: 100%; margin-left: 18px; font-size: 16px; }
.days7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; text-align: center; font-size: 10.5px; font-weight: 600; color: var(--mute); }
.days7 i { display: block; aspect-ratio: 1; margin-bottom: 3px; border-radius: 5px; background: var(--veil); }
.days7 .c-used i { background: var(--fg); }
.days7 .c-half i { background: linear-gradient(to top, var(--fg) 50%, var(--veil) 50%); }
.days7 .c-released i { background: transparent; border: 1.5px dashed var(--mute); }
.days7 .c-skip i { background: transparent; }
.plainlist { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tile.half .plainlist { font-size: 13px; }
.seal { display: inline-flex; padding: 5px 11px; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: 12.5px; font-weight: 700; }

/* ---------- ajustes ---------- */
.set { display: flex; flex-direction: column; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row label { font-weight: 600; }
.set-row small { grid-column: 1 / -1; font-size: 13px; color: var(--mute); line-height: 1.4; }
.set-row .field { width: auto; min-width: 120px; max-width: 52vw; height: 44px; padding-left: 16px; font-size: 16px; }
.set-row.block { grid-template-columns: 1fr; }
.set-row.block .field { width: 100%; max-width: none; }
.switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background .15s, box-shadow .15s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--mute); transition: transform .15s, background .15s; }
.switch[aria-pressed="true"] { background: var(--accent); box-shadow: none; }
.switch[aria-pressed="true"]::after { transform: translateX(18px); background: var(--on-accent); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.brandline { display: flex; align-items: baseline; gap: 8px; margin: 22px 4px 0; font-size: 12.5px; font-weight: 600; color: var(--mute); }
.brandline .wordmark { font-size: 17px; color: var(--fg); }
.about { margin: 6px 4px 0; font-size: 12.5px; line-height: 1.45; color: var(--mute); }

/* ---------- pantallas bajas: un Android chico, o la letra grande del teléfono ----------
   El título del día y la cuenta suben a la fila del mes; el título sigue en la página para los lectores de pantalla. */
@media (max-height: 800px) {
  .day-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cal-label.as-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--fg); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
  .cal-label.as-title b { flex: none; }
  .cal-label.as-title small { min-width: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cell { height: 44px; padding-bottom: 5px; }
  .cell .mark { bottom: 5px; }
  .cal-grid.month .cell { height: 40px; }
  .day { margin-top: 6px; }
}

/* ---------- escribiendo en el teléfono ----------
   Arriba queda solo la hoja; la tarjeta donde cae lo que se escribe se lleva a la vista, arriba del campo. */
body.typing.on-day .cal, body.typing.on-day .day > .kicker, body.typing.on-day .day-head, body.typing.on-day .tabs { display: none; }
body.typing.on-day .day, body.typing.on-day .panel { margin-top: 0; }
.panel .tile { scroll-margin: 8px 0 160px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
