/* Pauta — la agenda como la esfera de un reloj.
   Esfera verde "sunburst", índices de latón, esmalte blanco, una aguja roja para "ahora". */

/* Jost (tipografía libre, licencia SIL OFL 1.1), guardada dentro de la app: funciona sin internet */
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("../fonts/jost-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: "Jost"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("../fonts/jost-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------ tokens */
:root {
  --ground: oklch(0.972 0.006 165);
  --surface: oklch(0.995 0.003 165);
  --sunken: oklch(0.94 0.01 165);
  --ink: oklch(0.24 0.03 170);
  --ink-2: oklch(0.42 0.025 170);
  --ink-3: oklch(0.5 0.02 170);
  --line: oklch(0.885 0.012 165);
  --line-strong: oklch(0.8 0.015 165);

  --dial: oklch(0.335 0.066 165);
  --dial-hi: oklch(0.4 0.075 162);
  --dial-lo: oklch(0.27 0.058 168);
  --dial-window: oklch(0.25 0.052 168);
  --dial-ink: oklch(0.965 0.012 120);
  --dial-ink-2: oklch(0.82 0.03 150);

  --brass: oklch(0.8 0.105 82);
  --brass-deep: oklch(0.5 0.09 75);
  --brass-wash: oklch(0.93 0.045 85);
  --now: oklch(0.62 0.2 27);
  --danger: oklch(0.5 0.18 25);

  --accent: oklch(0.38 0.075 165);
  --on-accent: oklch(0.97 0.015 120);
  --fab: var(--dial);
  --fab-ink: var(--brass);
  --sel: var(--dial);
  --sel-ink: var(--dial-ink);

  --t-verde: oklch(0.52 0.1 160);   --d-verde: oklch(0.84 0.11 155);
  --t-laton: oklch(0.66 0.12 78);   --d-laton: var(--brass);
  --t-cobre: oklch(0.58 0.11 48);   --d-cobre: oklch(0.76 0.09 52);
  --t-plata: oklch(0.56 0.015 240); --d-plata: oklch(0.88 0.01 240);

  --shadow-sheet: 0 -12px 40px oklch(0.2 0.03 170 / 0.18);
  --shadow-float: 0 10px 28px oklch(0.2 0.04 170 / 0.24), 0 2px 6px oklch(0.2 0.04 170 / 0.12);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Jost", var(--font-ui);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);

  --gutter: 20px;
  --tabbar: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: oklch(0.165 0.018 170);
    --surface: oklch(0.205 0.02 170);
    --sunken: oklch(0.245 0.022 170);
    --ink: oklch(0.945 0.012 150);
    --ink-2: oklch(0.79 0.016 160);
    --ink-3: oklch(0.67 0.016 160);
    --line: oklch(0.29 0.02 170);
    --line-strong: oklch(0.38 0.022 170);
    --dial: oklch(0.25 0.05 165);
    --dial-hi: oklch(0.3 0.06 162);
    --dial-lo: oklch(0.2 0.045 168);
    --dial-window: oklch(0.17 0.035 168);
    --brass-deep: oklch(0.8 0.1 82);
    --brass-wash: oklch(0.32 0.05 80);
    --danger: oklch(0.72 0.15 25);
    --accent: var(--brass);
    --on-accent: oklch(0.2 0.04 165);
    --fab: var(--brass);
    --fab-ink: oklch(0.22 0.05 165);
    --sel: var(--brass);
    --sel-ink: oklch(0.22 0.05 165);
    --t-verde: oklch(0.76 0.11 158);
    --t-laton: var(--brass);
    --t-cobre: oklch(0.74 0.1 50);
    --t-plata: oklch(0.82 0.012 240);
    --shadow-sheet: 0 -12px 40px oklch(0 0 0 / 0.5);
    --shadow-float: 0 10px 28px oklch(0 0 0 / 0.5), 0 2px 6px oklch(0 0 0 / 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: oklch(0.165 0.018 170);
  --surface: oklch(0.205 0.02 170);
  --sunken: oklch(0.245 0.022 170);
  --ink: oklch(0.945 0.012 150);
  --ink-2: oklch(0.79 0.016 160);
  --ink-3: oklch(0.67 0.016 160);
  --line: oklch(0.29 0.02 170);
  --line-strong: oklch(0.38 0.022 170);
  --dial: oklch(0.25 0.05 165);
  --dial-hi: oklch(0.3 0.06 162);
  --dial-lo: oklch(0.2 0.045 168);
  --dial-window: oklch(0.17 0.035 168);
  --brass-deep: oklch(0.8 0.1 82);
  --brass-wash: oklch(0.32 0.05 80);
  --danger: oklch(0.72 0.15 25);
  --accent: var(--brass);
  --on-accent: oklch(0.2 0.04 165);
  --fab: var(--brass);
  --fab-ink: oklch(0.22 0.05 165);
  --sel: var(--brass);
  --sel-ink: oklch(0.22 0.05 165);
  --t-verde: oklch(0.76 0.11 158);
  --t-laton: var(--brass);
  --t-cobre: oklch(0.74 0.1 50);
  --t-plata: oklch(0.82 0.012 240);
  --shadow-sheet: 0 -12px 40px oklch(0 0 0 / 0.5);
  --shadow-float: 0 10px 28px oklch(0 0 0 / 0.5), 0 2px 6px oklch(0 0 0 / 0.3);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--ground);
  scrollbar-color: var(--line-strong) transparent;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--accent);
}
::selection { background: var(--brass-wash); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, [role="button"], label.chip, .chip {
  touch-action: manipulation;
}
button, [role="button"], .chip, .nav__item, .seg__opt {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
input, textarea, select { font-size: 16px; }
a { color: inherit; }
svg { display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.today__panel :focus-visible, .toast--reminder :focus-visible { outline-color: var(--brass); }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--ground); }
::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: calc(12px + var(--safe-top)); z-index: 100;
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 12px;
  transform: translateY(-200%); text-decoration: none; font-weight: 600;
}
.skip:focus { transform: none; }
.noscript { padding: 40px var(--gutter); }

.ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------ shell / navegación */
.shell { min-height: 100dvh; }
.main {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 96px);
}

.nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar) + var(--safe-bottom));
  padding: 0 8px var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.nav__brand, .nav__new { display: none; }
.nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  position: relative;
  transition: color 160ms var(--ease-out);
}
.nav__item .ico { transition: transform 160ms var(--ease-out); }
.nav__item:active .ico { transform: scale(0.9); }
.nav__item[aria-current="page"] { color: var(--accent); }
.nav__item[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 2px; margin-left: -14px;
  background: var(--brass); border-radius: 0 0 2px 2px;
}

.fab {
  position: fixed; z-index: 21;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px);
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--fab); color: var(--fab-ink);
  box-shadow: var(--shadow-float);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fab:active { transform: scale(0.93); }
body[data-view="ajustes"] .fab { display: none; }

.view.is-entering { animation: view-in 280ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ botones y controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--ink);
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn .ico { width: 20px; height: 20px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--soft { background: var(--sunken); color: var(--ink); }
.btn--ghost { color: var(--ink-2); padding-inline: 12px; }
.btn--danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 40%, transparent); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--on-dark { background: var(--brass); color: oklch(0.22 0.05 165); }
.btn--ghost-dark { color: var(--dial-ink); border-color: color-mix(in oklch, var(--dial-ink) 35%, transparent); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2);
  display: inline-grid; place-items: center; transition: background-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.92); background: var(--sunken); }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm .ico { width: 20px; height: 20px; }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: color-mix(in oklch, var(--accent) 88%, var(--ink)); }
  .btn--soft:hover { background: color-mix(in oklch, var(--sunken) 80%, var(--ink) 8%); }
  .btn--ghost:hover { color: var(--ink); }
  .btn--danger:hover { background: color-mix(in oklch, var(--danger) 8%, transparent); }
  .icon-btn:hover { background: var(--sunken); color: var(--ink); }
  .nav__item:hover { color: var(--ink); }
  .fab:hover { transform: translateY(-1px); }
  .row__main:hover .row__title { color: var(--accent); }
  .cal__day:hover:not(.is-selected) { background: var(--sunken); }
  .chip:hover:not([aria-checked="true"]):not([aria-pressed="true"]):not(.is-on) { border-color: var(--line-strong); }
  .peek:hover { background: var(--sunken); }
  .toast__action:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ------------------------------------------------------------ HOY */
.today__panel {
  position: relative;
  color: var(--dial-ink);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--dial-hi), transparent 70%),
    var(--dial);
  padding: calc(var(--safe-top) + 16px) var(--gutter) 20px;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
}
/* Rayos del "sunburst": la textura de la esfera */
.today__panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 62%, oklch(1 0 0 / 0.04) 0 0.8deg, transparent 0.8deg 1.6deg);
  -webkit-mask-image: radial-gradient(closest-side at 50% 62%, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 62%, #000 30%, transparent 100%);
}
.today__panel > * { position: relative; }
.today__date {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 14px; align-items: end;
}
.today__num {
  grid-row: 1 / span 3; grid-column: 1;
  font: 300 clamp(70px, 21vw, 104px)/0.82 var(--font-num);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.today__weekday { grid-column: 2; font: 500 17px/1.1 var(--font-num); color: var(--brass); letter-spacing: 0.02em; }
.today__month { grid-column: 2; font-size: 14px; color: var(--dial-ink-2); }
.today__summary { grid-column: 2; font-size: 13px; color: var(--dial-ink-2); padding-bottom: 6px; }

.dial {
  position: relative;
  width: min(68vw, 276px);
  aspect-ratio: 1;
  margin: 12px auto 0;
}
.dial__svg { width: 100%; height: 100%; overflow: visible; }
.dial__stop-a { stop-color: var(--dial-hi); }
.dial__stop-b { stop-color: var(--dial-lo); }
.dial__face { fill: url(#dial-sunburst); stroke: color-mix(in oklch, var(--brass) 45%, transparent); stroke-width: 1; }
.dial__rays line { stroke: var(--dial-ink); stroke-opacity: 0.04; stroke-width: 1; }
.dial__rays line:nth-child(even) { stroke-opacity: 0.1; }
.tick { stroke: var(--dial-ink-2); stroke-opacity: 0.45; stroke-width: 0.8; }
.tick--hour { stroke: var(--brass); stroke-opacity: 0.8; stroke-width: 1.6; }
.tick--main { stroke: var(--brass); stroke-opacity: 1; stroke-width: 4.5; stroke-linecap: butt; }
.num { fill: var(--dial-ink-2); font: 500 10px var(--font-num); }
.num--big { fill: var(--brass); font-size: 17px; }
.dial__track { fill: none; stroke: var(--dial-ink); stroke-opacity: 0.08; stroke-width: 12; }
.dial__past { fill: none; stroke: oklch(0 0 0); stroke-opacity: 0.16; stroke-width: 12; }
.arc { fill: none; stroke-width: 12; stroke-linecap: round; pointer-events: none; transition: opacity 200ms var(--ease-out); }
.arc--verde { stroke: var(--d-verde); }
.arc--laton { stroke: var(--d-laton); }
.arc--plata { stroke: var(--d-plata); }
.arc--cobre { stroke: var(--d-cobre); }
.arc.is-past { opacity: 0.5; }
.arc.is-done { opacity: 0.32; }
.arc__hit { fill: none; stroke: transparent; stroke-width: 30; pointer-events: stroke; cursor: pointer; }
.dial__window { fill: var(--dial-window); stroke: var(--brass); stroke-opacity: 0.55; stroke-width: 1; pointer-events: none; }
.dial__hand { transform: rotate(var(--angle, 0deg)); transform-origin: 150px 150px; transform-box: view-box; pointer-events: none; }
.dial__hand.is-sweeping { transition: transform 1200ms cubic-bezier(0.16, 1, 0.3, 1); }
.hand__lance { fill: var(--dial-ink); }
.hand__tip { fill: var(--now); }
.hand__collar { fill: var(--brass); }

.dial__center {
  position: absolute; inset: 0; margin: auto;
  width: 42%; height: 42%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px;
  pointer-events: none;
}
.next__time { font: 300 clamp(26px, 8.4vw, 34px)/1 var(--font-num); color: var(--brass); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.next__title {
  pointer-events: auto; border: 0; background: none; padding: 2px 4px; color: var(--dial-ink);
  font-size: 14px; font-weight: 600; line-height: 1.25; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.next__until { font-size: 12px; color: var(--dial-ink-2); }
.next__free { font: 400 20px/1.1 var(--font-num); color: var(--dial-ink); }

.today__list { padding: 8px var(--gutter) 0; }
.section-title { font: 500 20px/1.2 var(--font-num); letter-spacing: -0.005em; padding: 26px 0 6px; }
.section-title--late { color: var(--danger); font-size: 17px; }

/* filas */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.row__main {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 82px minmax(0, 1fr); column-gap: 8px; align-items: baseline;
  padding: 15px 0; min-height: 58px;
  background: none; border: 0; text-align: left; color: inherit;
  border-radius: 0;
}
.row__main:active { background: color-mix(in oklch, var(--sunken) 70%, transparent); }
.row__time {
  display: flex; align-items: center; gap: 8px;
  font: 400 17px/1.3 var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink);
}
.row__time--day { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.swatch { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--t-verde); }
.swatch[data-color="laton"] { background: var(--t-laton); }
.swatch[data-color="plata"] { background: var(--t-plata); }
.swatch[data-color="cobre"] { background: var(--t-cobre); }
.swatch--lg { width: 16px; height: 16px; }
.row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row__title { font-size: 16px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; transition: color 160ms var(--ease-out); }
.row__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.row__meta .ico { width: 15px; height: 15px; stroke-width: 1.8; }
.meta-ico { display: inline-flex; align-items: center; gap: 4px; }
.row__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row.is-past .row__time { color: var(--ink-3); }
.row.is-done .row__title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in oklch, var(--ink-3) 70%, transparent); }
.row.is-done .row__time { color: var(--ink-3); }

.row__check {
  flex: none; width: 52px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-3);
  margin-right: -10px;
}
.row__check svg { width: 28px; height: 28px; transition: transform 160ms var(--ease-out); }
.row__check:active svg { transform: scale(0.88); }
.cm__ring { fill: transparent; stroke: var(--line-strong); stroke-width: 1.5; transition: fill 220ms var(--ease-out), stroke 220ms var(--ease-out); }
.cm__tick { fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 260ms var(--ease-out) 60ms; }
.row__check[aria-pressed="true"] .cm__ring { fill: var(--accent); stroke: var(--accent); }
.row__check[aria-pressed="true"] .cm__tick { stroke-dashoffset: 0; }

.empty { padding: 18px 0 8px; max-width: 46ch; }
.empty__title { font: 400 22px/1.25 var(--font-num); margin-bottom: 6px; }
.empty__text { color: var(--ink-2); }
.empty__text q { color: var(--ink); font-weight: 600; quotes: "“" "”"; }

.peek {
  margin-top: 24px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center;
  padding: 14px 4px 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-decoration: none; transition: background-color 160ms var(--ease-out);
}
.peek__label { font: 500 15px/1.3 var(--font-num); grid-column: 1; }
.peek__items { grid-column: 1; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek .ico { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-3); width: 20px; height: 20px; }

/* ------------------------------------------------------------ AGENDA */
.page-head { padding: calc(var(--safe-top) + 22px) var(--gutter) 6px; }
.page-title { font: 400 34px/1.05 var(--font-num); letter-spacing: -0.02em; }
.month-nav { display: flex; align-items: center; gap: 2px; margin-top: 14px; margin-left: -10px; }
.month-nav__label { flex: 1; font: 500 18px/1.2 var(--font-num); padding-left: 6px; order: -1; margin-left: 10px; }

.cal { padding: 6px calc(var(--gutter) - 6px) 10px; }
.cal__row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__wd { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 0; }
.cal__day {
  position: relative; border: 0; background: none; border-radius: 50%;
  aspect-ratio: 1; max-height: 52px; width: 100%; max-width: 52px; justify-self: center;
  display: grid; place-items: center; color: var(--ink);
  transition: background-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.cal__day:active { transform: scale(0.92); }
.cal__num { font: 400 16px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.cal__day.is-before .cal__num { color: var(--ink-3); }
.cal__day.is-out { opacity: 0.4; }
.cal__day.is-today .cal__num { color: var(--accent); font-weight: 600; }
.cal__day.is-today::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid var(--brass);
}
.cal__day.is-selected { background: var(--sel); }
.cal__day.is-selected .cal__num { color: var(--sel-ink); font-weight: 600; }
.cal__day.is-selected.is-today::after { border-color: var(--brass); }
/* tamaño del punto = cuánto hay ese día (1, 2, 3 o más) */
.cal__dot { position: absolute; left: 50%; bottom: 7%; border-radius: 50%; background: var(--t-laton); transform: translateX(-50%); }
.cal__dot--1 { width: 4px; height: 4px; }
.cal__dot--2 { width: 6px; height: 6px; }
.cal__dot--3 { width: 8px; height: 8px; }
.cal__day.is-selected { color: var(--sel-ink); }
.cal__day.is-selected .cal__dot { background: currentColor; }

.agenda__list { padding: 0 var(--gutter); }
.guide {
  position: sticky; top: 0; z-index: 5;
  margin: 0 calc(var(--gutter) * -1); padding: calc(var(--safe-top) + 10px) var(--gutter) 10px;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  font: 500 13px/1.2 var(--font-num); letter-spacing: 0.06em; color: var(--ink-2); text-transform: uppercase;
  min-height: calc(var(--safe-top) + 40px);
}
.day { padding-top: 18px; scroll-margin-top: 60px; }
.day__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 500 17px/1.3 var(--font-num); padding-bottom: 2px;
}
.day__head .icon-btn { margin-right: -8px; }
.day__free { color: var(--ink-3); padding: 6px 0 4px; font-size: 15px; }
.day__end { color: var(--ink-3); font-size: 14px; padding: 28px 0 0; }

/* ------------------------------------------------------------ AJUSTES */
.settings { padding-bottom: 20px; }
.set { margin: 0 var(--gutter); padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; max-width: 640px; }
.settings .page-head + .set { border-top: 0; }
.set__title { font: 500 19px/1.2 var(--font-num); }
.set__text { color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.set__fine { color: var(--ink-3); font-size: 13px; max-width: 60ch; }
.set__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.set__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 15px; }
.set--danger .set__title { color: var(--danger); }
.set--danger .btn { justify-self: start; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; display: grid; gap: 6px; }
.steps strong { color: var(--ink); }
.colophon { margin: 20px var(--gutter) 0; font-size: 12.5px; color: var(--ink-3); }

.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  background: var(--sunken); padding: 3px; border-radius: 999px; justify-self: start; max-width: 100%;
}
.seg__opt {
  border: 0; background: transparent; border-radius: 999px; min-height: 38px; padding: 0 16px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.seg__opt[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.03 170 / 0.15); }

.switch {
  width: 50px; height: 30px; flex: none; border-radius: 999px; border: 0; padding: 3px;
  background: var(--line-strong); transition: background-color 200ms var(--ease-out);
}
.switch__knob {
  display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.25); transition: transform 220ms var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(20px); }

/* ------------------------------------------------------------ hoja (agregar / editar) */
.sheet {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: 620px; max-height: min(92dvh, 860px);
  margin: 0 auto; padding: 0; border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sheet);
  transform: translateY(var(--drag, 0px));
  transition: transform 320ms var(--ease-sheet);
  overflow: hidden;
}
.sheet[open] { display: flex; animation: sheet-in 420ms var(--ease-sheet); }
.sheet.is-dragging { transition: none; }
.sheet.is-closing { animation: sheet-out 240ms var(--ease-in) forwards; }
.sheet::backdrop { background: oklch(0.16 0.03 170 / 0.42); animation: fade-in 300ms var(--ease-out); }
.sheet.is-closing::backdrop { animation: fade-out 240ms var(--ease-in) forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { from { transform: translateY(var(--drag, 0px)); } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet__form { display: flex; flex-direction: column; width: 100%; max-height: inherit; }
.sheet__grab { display: grid; place-items: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
.sheet__grab span { width: 38px; height: 5px; border-radius: 5px; background: var(--line-strong); }
.sheet__head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 2px 12px 8px; touch-action: none;
}
.sheet__head > :first-child { justify-self: start; }
.sheet__head > :last-child { justify-self: end; }
.sheet__title { font: 500 17px/1 var(--font-num); }
.sheet__body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 6px var(--gutter) calc(28px + var(--safe-bottom));
}

.field-title {
  width: 100%; border: 0; border-bottom: 1.5px solid var(--line); background: transparent;
  padding: 10px 0 12px; font: 400 25px/1.25 var(--font-num); letter-spacing: -0.01em; color: var(--ink);
  border-radius: 0; transition: border-color 200ms var(--ease-out);
}
.field-title::placeholder { color: var(--ink-3); }
.field-title:focus-visible { outline: none; border-bottom-color: var(--accent); }
.understood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; padding-top: 8px; font-size: 13px; color: var(--ink-3); }
.understood:empty { min-height: 8px; }
.understood__chip { background: var(--brass-wash); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 600; animation: pop-in 220ms var(--ease-out); }
.understood__as { flex-basis: 100%; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.92); } }
.field-error { color: var(--danger); font-size: 14px; font-weight: 600; }
.field-error:empty { display: none; }

.group { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.group legend, .legend { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.chip[aria-checked="true"], .chip[aria-pressed="true"], .chip.is-on {
  background: var(--sel); border-color: var(--sel); color: var(--sel-ink);
}
.chip--date input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0;
}
.chip--time { padding: 0 6px 0 14px; }
.chip--time input {
  border: 0; background: transparent; color: inherit; min-width: 5.6em; min-height: 40px;
  font: 400 17px/1 var(--font-num); font-variant-numeric: tabular-nums; padding: 0;
}
.chip--time input::-webkit-calendar-picker-indicator { filter: none; opacity: 0.55; cursor: pointer; }
.chip.is-on input::-webkit-calendar-picker-indicator { filter: invert(1); }
.chip--swatch { padding: 0 14px 0 12px; }

.more { margin-top: 22px; border-top: 1px solid var(--line); }
.more summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; color: var(--ink-2); font-weight: 600; font-size: 15px; cursor: pointer;
}
.more summary::-webkit-details-marker { display: none; }
.more summary .ico { width: 20px; height: 20px; transition: transform 220ms var(--ease-out); }
.more[open] summary .ico { transform: rotate(180deg); }
.more .group:first-of-type { margin-top: 4px; }
textarea {
  width: 100%; resize: vertical; min-height: 84px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--ground);
  padding: 12px 14px; line-height: 1.45; color: var(--ink);
}
textarea::placeholder { color: var(--ink-3); }
textarea:focus-visible { outline: none; border-color: var(--accent); }
#f-delete { margin-top: 28px; }

/* ------------------------------------------------------------ confirmación */
.confirm {
  border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink);
  width: min(92vw, 420px); box-shadow: var(--shadow-float);
}
.confirm[open] { animation: confirm-in 240ms var(--ease-out); }
.confirm::backdrop { background: oklch(0.16 0.03 170 / 0.45); animation: fade-in 240ms var(--ease-out); }
@keyframes confirm-in { from { opacity: 0; transform: scale(0.96); } }
.confirm__box { padding: 24px; display: grid; gap: 10px; }
.confirm h2 { font: 500 21px/1.2 var(--font-num); }
.confirm p { color: var(--ink-2); }
.confirm__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ------------------------------------------------------------ avisos en pantalla */
.toasts {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 88px);
  width: min(calc(100vw - 24px), 440px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; min-height: 52px; border-radius: 16px;
  background: var(--ink); color: var(--ground);
  box-shadow: var(--shadow-float);
  animation: toast-in 300ms var(--ease-out);
  transition: opacity 200ms var(--ease-in), transform 200ms var(--ease-in);
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.toast__text { flex: 1; font-size: 14.5px; line-height: 1.35; }
.toast__action {
  border: 0; background: none; color: var(--brass); font-weight: 700; font-size: 14.5px;
  min-height: 40px; padding: 0 10px; border-radius: 10px; white-space: nowrap;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast__action { color: oklch(0.42 0.08 75); } }
:root[data-theme="dark"] .toast__action { color: oklch(0.42 0.08 75); }

/* Avisos de la agenda: arriba, como una notificación del teléfono */
.alerts {
  position: fixed; z-index: 61; left: 50%; transform: translateX(-50%);
  top: calc(var(--safe-top) + 10px);
  width: min(calc(100vw - 20px), 440px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.alerts .toast { animation: alert-in 420ms var(--ease-sheet); }
.alerts .toast.is-leaving { transform: translateY(-10px); }
@keyframes alert-in { from { opacity: 0; transform: translateY(-24px) scale(0.97); } }
.toast--reminder {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 10px;
  padding: 14px; background: var(--dial); color: var(--dial-ink);
  border: 1px solid color-mix(in oklch, var(--brass) 40%, transparent);
}
.toast__bell { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--now); color: oklch(0.99 0 0); }
.toast__bell .ico { width: 20px; height: 20px; animation: ring 900ms var(--ease-out) 200ms 2; transform-origin: 50% 20%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
.toast__title { font-weight: 650; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.toast--reminder .toast__text { color: var(--dial-ink-2); font-size: 13.5px; }
.toast__actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------ compu */
@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .main { padding-bottom: 64px; }
  .nav {
    position: sticky; top: 0; inset: auto; height: 100dvh;
    display: flex; flex-direction: column; gap: 4px;
    padding: 28px 16px; border-top: 0; border-right: 1px solid var(--line);
  }
  .nav__brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font: 500 23px/1 var(--font-num); letter-spacing: -0.01em; }
  .brandmark { width: 28px; height: 28px; color: var(--accent); }
  .brandmark .tip { stroke: var(--now); }
  .nav__new { display: inline-flex; order: 1; margin: 0 0 18px; justify-content: flex-start; padding: 0 18px; }
  .nav__new { min-height: 44px; border: 0; border-radius: 999px; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; background: var(--fab); color: var(--fab-ink); box-shadow: 0 4px 14px oklch(0.2 0.04 170 / 0.18); transition: transform 140ms var(--ease-out); }
  .nav__new:active { transform: scale(0.97); }
  .nav__new .ico { width: 20px; height: 20px; stroke-width: 2.2; }
  .nav__item { order: 2; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
  .nav__item .ico { width: 22px; height: 22px; }
  .nav__item[aria-current="page"] { background: var(--sunken); color: var(--ink); }
  .nav__item[aria-current="page"] .ico { color: var(--accent); }
  .fab { display: none; }

  .today { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 40px; padding: 28px var(--gutter) 0; align-items: start; }
  .today__panel { position: sticky; top: 28px; border-radius: 30px; padding: 30px 28px 32px; }
  .dial { width: 100%; max-width: 360px; }
  .today__list { padding: 0; max-width: 720px; }
  .today__list > .section-title:first-child { padding-top: 6px; }

  .page-head { padding-top: 34px; }
  .agenda { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 40px; padding-right: var(--gutter); }
  .agenda__side { position: sticky; top: 0; align-self: start; }
  .agenda__list { padding: 34px 0 0; max-width: 720px; }
  .guide { margin: 0; padding: 12px 0; min-height: 0; }
  .toasts { left: auto; right: 28px; transform: none; bottom: 28px; }
  .alerts { left: auto; right: 28px; transform: none; top: 24px; }
  .sheet { inset: 0; margin: auto; border-radius: 26px; max-height: min(86vh, 820px); height: fit-content; }
  .sheet[open] { animation: confirm-in 260ms var(--ease-out); }
  .sheet.is-closing { animation: fade-out 180ms var(--ease-in) forwards; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 14px; touch-action: auto; }
}

@media (min-width: 1280px) {
  .today { grid-template-columns: 460px minmax(0, 1fr); gap: 56px; }
}

/* ------------------------------------------------------------ movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* textos distintos según el dispositivo */
.only-wide { display: none; }
@media (min-width: 900px) {
  .only-narrow { display: none; }
  .only-wide { display: inline; }
  .nav__item[aria-current="page"]::before { display: none; }
}
.empty__text .ico { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; stroke-width: 2.2; }

/* ------------------------------------------------------------ entrar / crear cuenta */
body[data-auth] .shell { display: none; }
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--ground); }
.auth__brand {
  position: relative; overflow: hidden; color: var(--dial-ink);
  background: radial-gradient(120% 80% at 50% 0%, var(--dial-hi), transparent 70%), var(--dial);
  padding: calc(var(--safe-top) + 20px) var(--gutter) 22px;
  border-radius: 0 0 30px 30px;
  display: grid; justify-items: center; gap: 6px;
}
.auth__brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 58%, oklch(1 0 0 / 0.04) 0 0.8deg, transparent 0.8deg 1.6deg);
  -webkit-mask-image: radial-gradient(closest-side at 50% 58%, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 58%, #000 30%, transparent 100%);
}
.auth__brand > * { position: relative; }
.auth__mark { justify-self: start; display: flex; align-items: center; gap: 10px; font: 500 22px/1 var(--font-num); }
.auth__mark .brandmark { width: 28px; height: 28px; color: var(--brass); }
.brandmark .tip { stroke: var(--now); }
.auth__dial { width: min(46vw, 190px); aspect-ratio: 1; margin-top: 6px; }
.auth__dial svg { width: 100%; height: 100%; overflow: visible; }
.auth__tagline { font: 400 15px/1.3 var(--font-num); color: var(--dial-ink-2); letter-spacing: 0.01em; }

.auth__panel { width: 100%; max-width: 440px; margin: 0 auto; padding: 26px var(--gutter) calc(28px + var(--safe-bottom)); display: grid; gap: 16px; align-content: start; }
.auth__title { font: 400 28px/1.15 var(--font-num); letter-spacing: -0.015em; }
.auth__seg { display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; }
.auth__seg .seg__opt[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.03 170 / 0.15); }
.auth__form { display: grid; gap: 14px; }
.auth__link { justify-self: center; border: 0; background: none; color: var(--ink-2); font-size: 14.5px; font-weight: 600; min-height: 40px; padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.auth__fine { font-size: 13.5px; color: var(--ink-3); }
.auth__fine--lead { font-size: 14.5px; color: var(--ink-2); }
.auth__legal { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.auth__legal a { color: inherit; text-underline-offset: 3px; }

.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 500; color: var(--ink-3); }
.field input {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.field input::placeholder { color: var(--ink-3); letter-spacing: 0.04em; }
.field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field__pw { position: relative; display: block; }
.field__pw input { padding-right: 64px; }
.field__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--ink-2); font-size: 13px; font-weight: 600; min-height: 38px; padding: 0 10px; border-radius: 10px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--ink); text-underline-offset: 3px; }
.btn--block { width: 100%; min-height: 50px; font-size: 16px; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

@media (min-width: 900px) {
  .auth { grid-template-rows: none; grid-template-columns: minmax(380px, 46%) 1fr; }
  .auth__brand { border-radius: 0 30px 30px 0; align-content: center; padding: 40px; gap: 14px; }
  .auth__mark { position: absolute; top: 32px; left: 36px; }
  .auth__dial { width: min(30vw, 380px); }
  .auth__tagline { font-size: 18px; }
  .auth__panel { align-content: center; min-height: 100dvh; padding: 48px 40px; }
}

/* ------------------------------------------------------------ cuenta y administración */
.account-line { display: grid; gap: 2px; }
.account-line strong { font-weight: 600; }
.account-line span { color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; }
.sync-note { font-size: 13px; color: var(--ink-3); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people .who { display: grid; min-width: 0; }
.people .who strong { font-weight: 600; font-size: 15px; }
.people .who span { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.codebox {
  display: grid; gap: 8px; padding: 16px; border-radius: 16px; background: var(--brass-wash);
}
.codebox code { font: 500 22px/1.2 var(--font-num); letter-spacing: 0.08em; color: var(--ink); user-select: all; -webkit-user-select: all; }
.codebox p { font-size: 13.5px; color: var(--ink-2); }
.inline-form { display: grid; gap: 12px; max-width: 420px; }
