/* Son mis XV · estilos base de la app (mismo sistema que demo/plataforma). */
:root {
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: "Bodoni Moda", Georgia, serif;
  --font-script: "Great Vibes", "Snell Roundhand", cursive;
  /* Estética "pastel 3D": fondo crema, tarjetas blancas muy redondas y tintes suaves. */
  --bg: oklch(0.972 0.011 70);
  --surface: oklch(0.997 0.003 70);
  --surface-2: oklch(0.955 0.014 70);
  --line: oklch(0.3 0.03 300 / 0.09);
  --ink: oklch(0.27 0.035 290);
  --ink-2: oklch(0.42 0.03 290);
  --ink-3: oklch(0.5 0.025 290);
  --accent: oklch(0.62 0.13 300);
  --accent-text: oklch(0.5 0.15 300);
  --accent-ink: oklch(0.995 0 0);
  --accent-soft: oklch(0.62 0.13 300 / 0.13);
  --ok: oklch(0.68 0.12 155);
  --ok-soft: oklch(0.93 0.05 155);
  --ok-ink: oklch(0.45 0.11 155);
  --warn-soft: oklch(0.94 0.06 80);
  --warn-ink: oklch(0.5 0.11 65);
  --bad-ink: oklch(0.52 0.16 15);
  --bad-soft: oklch(0.94 0.04 10);
  /* Tintes de las tarjetas y color de los cuadritos con ícono. */
  --t-lila: oklch(0.945 0.03 300);  --c-lila: oklch(0.7 0.12 300);
  --t-durazno: oklch(0.945 0.03 45); --c-durazno: oklch(0.74 0.13 35);
  --t-menta: oklch(0.955 0.035 160); --c-menta: oklch(0.74 0.11 160);
  --t-limon: oklch(0.965 0.045 95);  --c-limon: oklch(0.83 0.12 85);
  --t-rosa: oklch(0.95 0.03 355);    --c-rosa: oklch(0.76 0.11 355);
  --t-cielo: oklch(0.95 0.03 240);   --c-cielo: oklch(0.74 0.09 240);
  --side: oklch(0.86 0.055 300);
  --r-card: 22px;
  --r-sm: 14px;
  --shadow: 0 1px 2px oklch(0.3 0.06 300 / 0.05), 0 10px 24px -14px oklch(0.3 0.08 300 / 0.28);
  --shadow-lg: 0 2px 4px oklch(0.3 0.06 300 / 0.05), 0 18px 36px -18px oklch(0.3 0.08 300 / 0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 20px;
  --z-bar: 10;
  --z-sheet: 20;
  --z-toast: 40;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), 560px); margin-inline: auto; }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
}

h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; font-weight: 800; letter-spacing: -0.01em; }
.title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 7vw, 2.2rem); letter-spacing: 0.01em; }
.script { font-family: var(--font-script); font-weight: 400; color: var(--accent); }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }

label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 700; color: var(--ink-2); }
.field {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.field:hover { border-color: var(--line); }
.field:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field::placeholder { color: oklch(0.62 0.02 290); font-weight: 500; }
textarea.field { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease), background-color 220ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn--primary { background: linear-gradient(180deg, oklch(0.68 0.12 300), var(--accent)); color: var(--accent-ink); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.35), 0 8px 16px -8px oklch(0.5 0.15 300 / 0.55); }
.btn--primary:hover { background: linear-gradient(180deg, oklch(0.65 0.13 300), oklch(0.59 0.14 300)); }
.btn--ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--t-lila); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 0.875rem; }

.notice { padding: 14px 16px; border-radius: var(--r-sm); background: var(--t-lila); color: var(--ink-2); font-size: 0.9375rem; }
.notice--bad { background: var(--bad-soft); color: var(--bad-ink); }
.notice--ok { background: var(--ok-soft); color: var(--ok-ink); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 0.9375rem; box-shadow: var(--shadow);
  animation: toast-in 260ms var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .btn { transition: none; } }

/* Logotipo: "Son mis" en caligrafía y "XV" en serif (la caligrafía no se lee en números romanos). */
.wordmark { font-family: var(--font-script); color: var(--accent); line-height: 1; white-space: nowrap; }
.wordmark b { font-family: var(--font-display); font-weight: 500; font-size: 0.62em; letter-spacing: 0.06em; margin-left: 0.1em; vertical-align: 0.06em; }

[hidden] { display: none !important; }

/* Selector de fecha y hora (js/fechas.js): botón con el valor en palabras y una hoja con calendario u horas. */
.picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: inherit; cursor: pointer; }
.picker.is-empty .picker__text { color: var(--ink-3); }
.picker svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.picker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__text::first-letter { text-transform: uppercase; }

.pick {
  width: min(100%, 400px); max-width: 100%; max-height: 92dvh;
  margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: 0 -4px 8px oklch(0.2 0.05 300 / 0.12);
  animation: pick-up 320ms var(--ease);
}
@media (min-width: 640px) { .pick { margin: auto; border-radius: var(--r-card); } }
.pick::backdrop { background: oklch(0.2 0.04 300 / 0.42); animation: pick-fade 240ms ease-out; }
.pick.is-closing { animation: pick-down 180ms ease-in forwards; }
@keyframes pick-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes pick-down { to { transform: translateY(24px); opacity: 0; } }
@keyframes pick-fade { from { opacity: 0; } }
.pick__in { display: grid; gap: 12px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.pick__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pick__head strong { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.pick__x { width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 1rem; cursor: pointer; }
.pick__foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cal__nav { display: flex; align-items: center; justify-content: space-between; }
.cal__nav button { width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cal__month { font-family: var(--font-display); font-size: 1.2rem; text-transform: capitalize; }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal__week span { font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.cal__grid button {
  aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 140ms ease-out, transform 140ms var(--ease);
}
.cal__grid button:hover { background: var(--accent-soft); }
.cal__grid button:active { transform: scale(0.94); }
.cal__grid .is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal__grid .is-sel { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.time__show { margin: 0; text-align: center; font-family: var(--font-display); font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.time__lbl { margin: 2px 0 -4px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
.time__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.time__grid button, .time__ampm button {
  min-height: 44px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 140ms ease-out;
}
.time__grid [aria-pressed="true"], .time__ampm [aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.time__ampm { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .pick, .pick::backdrop, .pick.is-closing { animation: none; } }
/* Que un texto largo nunca ensanche la página en el teléfono. */
.picker { min-width: 0; }
.picker__text { flex: 1 1 auto; min-width: 0; }
label { min-width: 0; }
.pick { width: min(100vw, 400px); }
.time__grid button { min-width: 0; }
.cal__title { display: inline-flex; align-items: center; gap: 8px; }
.cal__year {
  min-height: 40px; padding: 0 28px 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink);
}
.cal__grid button:disabled { color: var(--ink-3); opacity: 0.35; cursor: not-allowed; background: transparent; }
.cal__nav button:disabled { opacity: 0.35; cursor: not-allowed; }
