/* ==========================================================================
   TurnoTracker — La cartilla
   Tapa de vinilo verde, páginas de papel de seguridad, cifras impresas
   y un sello rojo para lo que importa.
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Tapa */
  --cover: #1d4a37;
  --cover-2: #245a43;
  --cover-ink: #eef5ea;
  --cover-ink-2: #bcd3c3;
  --cover-rule: rgba(238, 245, 234, 0.18);

  /* Páginas */
  --page: #d7e3d0;
  --sheet: #e6eedf;
  --rule: #bccdb4;
  --rule-strong: #87a387;
  --ink: #0f2419;
  --ink-2: #2f4a3b;
  --ink-3: #435c4c;
  --accent: #1d4a37;
  --accent-ink: #ffffff;
  --accent-soft: #c3d8c0;
  --stamp: #b3372a;
  --stamp-soft: rgba(179, 55, 42, 0.1);
  --night: #3f4f86;
  --night-soft: rgba(63, 79, 134, 0.1);
  --focus: #1f6fd1;

  /* Valoración */
  --rate-1: #b3372a;
  --rate-2: #c27428;
  --rate-3: #8b968d;
  --rate-4: #4f8a5f;
  --rate-5: #1d4a37;

  --shadow-pop: 0 10px 30px -12px rgba(16, 38, 28, 0.35), 0 2px 6px -2px rgba(16, 38, 28, 0.18);
}

[data-theme="dark"] {
  color-scheme: dark;

  --cover: #163a2b;
  --cover-2: #1f4a37;
  --cover-ink: #eaf3e6;
  --cover-ink-2: #a9c4b1;
  --cover-rule: rgba(234, 243, 230, 0.16);

  --page: #163a2b;
  --sheet: #1c4534;
  --rule: #2f5a44;
  --rule-strong: #4b7a60;
  --ink: #eef5ea;
  --ink-2: #c2d6c7;
  --ink-3: #a9c1af;
  --accent: #a8e0bb;
  --accent-ink: #10271d;
  --accent-soft: #245a43;
  --stamp: #ec7d68;
  --stamp-soft: rgba(236, 125, 104, 0.14);
  --night: #a9b6ec;
  --night-soft: rgba(169, 182, 236, 0.12);
  --focus: #8cc2ff;

  --rate-1: #ec7d68;
  --rate-2: #e3a35c;
  --rate-3: #8f9d93;
  --rate-4: #7fbf8f;
  --rate-5: #b9e6c6;

  --shadow-pop: 0 14px 34px -12px rgba(0, 0, 0, 0.7), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Tapas de cartilla: cada una cambia tapa, páginas y tinta
   ========================================================================== */

[data-cover="granate"] {
  --cover: #6b2330;
  --cover-2: #7d2c3a;
  --cover-ink: #fbf1f1;
  --cover-ink-2: #e5c3c7;
  --page: #ecd6d4;
  --sheet: #f5e6e3;
  --rule: #dcbfbd;
  --rule-strong: #b48a8d;
  --ink: #2a0f16;
  --ink-2: #5a2f37;
  --ink-3: #6a4249;
  --accent: #6b2330;
  --accent-ink: #ffffff;
  --accent-soft: #e5c6c7;
  --rate-5: #6b2330;
}

[data-theme="dark"][data-cover="granate"] {
  --cover: #45161f;
  --cover-2: #521b26;
  --cover-ink: #fbeef0;
  --cover-ink-2: #dfb8bd;
  --page: #45161f;
  --sheet: #521b26;
  --rule: #6e2c38;
  --rule-strong: #925060;
  --ink: #fbeef0;
  --ink-2: #e8c9cd;
  --ink-3: #d5adb3;
  --accent: #f4b6be;
  --accent-ink: #3a1219;
  --accent-soft: #62222e;
  --rate-5: #f7cdd2;
}

[data-cover="marino"] {
  --cover: #1f3557;
  --cover-2: #284369;
  --cover-ink: #eef3fa;
  --cover-ink-2: #bccae0;
  --page: #d5deec;
  --sheet: #e4eaf4;
  --rule: #bccadf;
  --rule-strong: #8a9fbf;
  --ink: #0e1a2e;
  --ink-2: #2f4364;
  --ink-3: #435776;
  --accent: #1f3557;
  --accent-ink: #ffffff;
  --accent-soft: #c5d3ea;
  --rate-5: #1f3557;
}

[data-theme="dark"][data-cover="marino"] {
  --cover: #172946;
  --cover-2: #1e3355;
  --cover-ink: #edf2fa;
  --cover-ink-2: #b5c4dc;
  --page: #172946;
  --sheet: #1e3355;
  --rule: #2f4870;
  --rule-strong: #4f6894;
  --ink: #edf2fa;
  --ink-2: #c4d1e6;
  --ink-3: #a9bad5;
  --accent: #aac4f0;
  --accent-ink: #13213a;
  --accent-soft: #29406a;
  --rate-5: #c6d8f7;
}

[data-cover="negra"] {
  --cover: #1f1f22;
  --cover-2: #2c2c30;
  --cover-ink: #f3f2ee;
  --cover-ink-2: #bdbcb6;
  --page: #e2dfd8;
  --sheet: #ecebe5;
  --rule: #cdc9c0;
  --rule-strong: #9a968d;
  --ink: #161618;
  --ink-2: #3c3c40;
  --ink-3: #515157;
  --accent: #1f1f22;
  --accent-ink: #ffffff;
  --accent-soft: #d6d3cb;
  --rate-5: #1f1f22;
}

[data-theme="dark"][data-cover="negra"] {
  --cover: #161618;
  --cover-2: #202023;
  --cover-ink: #f1f0ec;
  --cover-ink-2: #b4b3ad;
  --page: #161618;
  --sheet: #202023;
  --rule: #323236;
  --rule-strong: #4d4d53;
  --ink: #f1f0ec;
  --ink-2: #c9c8c2;
  --ink-3: #aeada7;
  --accent: #ece9e0;
  --accent-ink: #161618;
  --accent-soft: #2e2e32;
  --rate-5: #ece9e0;
}

[data-cover="ocre"] {
  --cover: #7a4f10;
  --cover-2: #8a5a16;
  --cover-ink: #fdf6e8;
  --cover-ink-2: #ead2a6;
  --page: #ecdcb6;
  --sheet: #f4e8cb;
  --rule: #dcc697;
  --rule-strong: #b5965a;
  --ink: #2a1c05;
  --ink-2: #5a4419;
  --ink-3: #67522a;
  --accent: #7a4f10;
  --accent-ink: #ffffff;
  --accent-soft: #e6cf9c;
  --rate-5: #7a4f10;
}

[data-theme="dark"][data-cover="ocre"] {
  --cover: #4a3109;
  --cover-2: #583b0d;
  --cover-ink: #fcf3e2;
  --cover-ink-2: #e2c895;
  --page: #4a3109;
  --sheet: #583b0d;
  --rule: #74521c;
  --rule-strong: #987137;
  --ink: #fcf3e2;
  --ink-2: #ecd8b3;
  --ink-3: #dcc293;
  --accent: #f2cf8c;
  --accent-ink: #3a2606;
  --accent-soft: #684814;
  --rate-5: #f6dcab;
}

/* Tapa de temporada: Halloween */
[data-cover="halloween"] {
  --cover: #241a2e;
  --cover-2: #30233c;
  --cover-ink: #fff1e2;
  --cover-ink-2: #f2a65a;
  --page: #f1d9c0;
  --sheet: #f8e7d5;
  --rule: #e2c3a3;
  --rule-strong: #c09470;
  --ink: #241a2e;
  --ink-2: #4e3a57;
  --ink-3: #5f4b67;
  --accent: #a7410f;
  --accent-ink: #ffffff;
  --accent-soft: #f0cdb0;
  --rate-5: #a7410f;
}

[data-theme="dark"][data-cover="halloween"] {
  --cover: #17101d;
  --cover-2: #221829;
  --cover-ink: #fff1e2;
  --cover-ink-2: #f2a65a;
  --page: #17101d;
  --sheet: #221829;
  --rule: #3a2a44;
  --rule-strong: #5a4466;
  --ink: #fff1e2;
  --ink-2: #e7cdb8;
  --ink-3: #cdb09a;
  --accent: #ff9a3c;
  --accent-ink: #1a0f05;
  --accent-soft: #3e2a1c;
  --rate-5: #ffb877;
}

/* Tapa Barra (madera de barra de bar, crema de servilleta y ámbar de caña) */
[data-cover="barra"] {
  --cover: #3b2417;
  --cover-2: #4a2e1d;
  --cover-ink: #f6ead6;
  --cover-ink-2: #f3b15a;
  --page: #efe4d0;
  --sheet: #f9f2e4;
  --rule: #dccbad;
  --rule-strong: #b69a72;
  --ink: #2e1d12;
  --ink-2: #5a4130;
  --ink-3: #6b5240;
  --accent: #8a4b1c;
  --accent-ink: #ffffff;
  --accent-soft: #f0d6b4;
  --rate-5: #8a4b1c;
}

[data-theme="dark"][data-cover="barra"] {
  --cover: #22150d;
  --cover-2: #2e1d12;
  --cover-ink: #f6ead6;
  --cover-ink-2: #f3b15a;
  --page: #22150d;
  --sheet: #2e1d12;
  --rule: #4a3424;
  --rule-strong: #6b4e38;
  --ink: #f6ead6;
  --ink-2: #e2cdb0;
  --ink-3: #c9b092;
  --accent: #f3b15a;
  --accent-ink: #2a1806;
  --accent-soft: #4a3020;
  --rate-5: #f7c57f;
}

/* En la tapa de Halloween la marca de la cabecera se vuelve calabaza */
/* Tapa Clásica: libro de cuentas de cuero tabaco, dorado y página marfil,
   con cifras en serif. Sobria para quien quiere una cartilla seria. */
[data-cover="clasica"] {
  --cover: #2b2620;
  --cover-2: #3a3229;
  --cover-ink: #f3e7c9;
  --cover-ink-2: #cdb98f;
  --cover-rule: rgba(201, 164, 92, 0.32);
  --page: #e9dcbd;
  --sheet: #f2e8d0;
  --rule: #d7c6a0;
  --rule-strong: #ab9466;
  --ink: #1f1b16;
  --ink-2: #4a3f2f;
  --ink-3: #5c503d;
  --accent: #5c4520;
  --accent-ink: #ffffff;
  --accent-soft: #e0d0a8;
  --rate-5: #5c4520;
  --gold: #c9a45c;
}

/* Más específico que :root para ganar a la tipografía general */
html[data-cover="clasica"] {
  --font-num: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

[data-theme="dark"][data-cover="clasica"] {
  --cover: #1d1915;
  --cover-2: #27221c;
  --cover-ink: #f3e7c9;
  --cover-ink-2: #c7b48c;
  --cover-rule: rgba(217, 184, 114, 0.26);
  --page: #1d1915;
  --sheet: #27221c;
  --rule: #3a3229;
  --rule-strong: #5e523f;
  --ink: #f3ead6;
  --ink-2: #d4c7ab;
  --ink-3: #b9ab8d;
  --accent: #d9b872;
  --accent-ink: #1d1915;
  --accent-soft: #3a3125;
  --rate-5: #e6cc8e;
  --gold: #d9b872;
}

/* Tapa Navidad: rojo Navidad, página color nieve y acebo */
[data-cover="navidad"] {
  --cover: #a3192b;
  --cover-2: #b52436;
  --cover-ink: #fff7ef;
  --cover-ink-2: #f6cfc9;
  --cover-rule: rgba(255, 247, 239, 0.24);
  --page: #f0dcd6;
  --sheet: #f7e9e4;
  --rule: #e0c3bb;
  --rule-strong: #b98f86;
  --ink: #2a1014;
  --ink-2: #5a3036;
  --ink-3: #6a4449;
  --accent: #1f6b45;
  --accent-ink: #ffffff;
  --accent-soft: #cfe3d5;
  --rate-5: #1f6b45;
}

[data-theme="dark"][data-cover="navidad"] {
  --cover: #4a0d14;
  --cover-2: #5a141c;
  --cover-ink: #fff3ea;
  --cover-ink-2: #f0b9b0;
  --cover-rule: rgba(255, 243, 234, 0.2);
  --page: #1f0d10;
  --sheet: #2b1418;
  --rule: #45242a;
  --rule-strong: #6b3c44;
  --ink: #fff3ea;
  --ink-2: #e9cfc8;
  --ink-3: #cfb0a8;
  --accent: #7fd1a3;
  --accent-ink: #0f2a1c;
  --accent-soft: #243a2e;
  --rate-5: #9be0b8;
}

:root {
  --font-ui: 'Libre Franklin', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  background: var(--page);
  caret-color: var(--accent);
  accent-color: var(--accent);
  scrollbar-color: var(--rule-strong) var(--page);
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, select, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#shift-form:focus {
  outline: none;
}

/* ==========================================================================
   Tapa (cabecera + saldo de la semana)
   ========================================================================== */

.cover {
  background: var(--cover);
  color: var(--cover-ink);
}

/* Barra superior común a las tres pestañas */
.appbar {
  background: var(--cover);
  color: var(--cover-ink);
  padding-top: env(safe-area-inset-top, 0px);
}

.appbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter-r) 0 var(--gutter);
}

.cover-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter-r) 28px var(--gutter);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

/* Icono de la app en la cabecera: la misma pieza que en la pantalla de inicio */
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
  flex: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--cover-ink);
  transition: background-color 160ms ease, transform 120ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.94);
}

.balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 18px;
}

.balance-figure {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(3.4rem, 15vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-caption {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--cover-ink);
}

.balance-tips {
  margin-top: 2px;
  font-size: 15px;
  color: var(--cover-ink-2);
}

/* Tira de la semana: un apunte por día */
.week-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 24px;
}

.day {
  display: grid;
  grid-template-rows: 64px auto auto;
  gap: 6px;
  text-align: center;
}

.day-bar {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  /* línea base: los días sin turno quedan vacíos, no grises */
  box-shadow: inset 0 -2px 0 var(--cover-rule);
}

.day-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cover-ink);
  border-radius: 4px 4px 0 0;
  transition: height 420ms var(--ease-out);
}

.day.is-future .day-bar {
  box-shadow: inset 0 -2px 0 transparent;
  background-image: linear-gradient(90deg, var(--cover-rule) 50%, transparent 0);
  background-size: 6px 2px;
  background-repeat: repeat-x;
  background-position: bottom;
}

.day-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cover-ink-2);
}

.day.is-today .day-name {
  color: var(--cover-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.day-hours {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--cover-ink-2);
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}

.btn-cover {
  margin-top: 24px;
  justify-self: start;
  background: var(--cover-ink);
  color: var(--cover);
  min-height: 52px;
  padding: 0 22px;
  font-size: 16px;
}

[data-theme="dark"] .btn-cover {
  color: var(--accent-ink);
}

/* En oscuro la tapa se funde con la página: solo un filete las separa */
[data-theme="dark"] .ledger-strip {
  border-top-color: var(--cover-rule);
}

/* ==========================================================================
   Botones
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-secondary {
  background: var(--sheet);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-quiet {
  min-height: 40px;
  padding: 0 12px;
  color: var(--accent);
  font-weight: 700;
}

.btn-danger {
  background: var(--stamp);
  color: #fff;
}

[data-theme="dark"] .btn-danger {
  color: #1a0d0a;
}

@media (hover: hover) {
  .icon-btn:hover { background: var(--cover-rule); }
  .btn-cover:hover { background: #ffffff; }
  .btn-primary:hover { background: var(--cover-2); }
  [data-theme="dark"] .btn-primary:hover { filter: brightness(1.08); }
  .btn-secondary:hover { border-color: var(--ink-3); }
  .btn-quiet:hover { background: var(--accent-soft); }
  .btn-danger:hover { filter: brightness(1.08); }
}

/* ==========================================================================
   Página
   ========================================================================== */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter-r) calc(48px + env(safe-area-inset-bottom, 0px)) var(--gutter);
}

/* Franja del mes: celdas separadas por filetes */
.ledger-strip {
  display: grid;
  border-top: 1px solid transparent;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}

.cell {
  padding: 18px 12px 18px 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.cell:nth-child(even) {
  padding-left: 16px;
  border-left: 1px solid var(--rule);
}

.cell:nth-last-child(-n+2) {
  border-bottom: 0;
}

.cell-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.cell-figure {
  margin-top: 4px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-month .cell-figure {
  color: var(--accent);
}

.cell-note {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-3);
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  margin-top: 28px;
}

/* En móvil el formulario va antes que el historial, que crece sin fin */
.entry-form {
  order: -1;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-meta {
  font-size: 14px;
  color: var(--ink-3);
}

/* ==========================================================================
   Campos
   ========================================================================== */

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px; /* evita el zoom de iOS al enfocar */
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field:focus-visible {
  outline: none;
}

/* iOS: los campos de fecha y hora tienen un ancho mínimo propio y se salen de la rejilla */
.field[type="date"],
.field[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.field::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

.field-num {
  font-family: var(--font-num);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.field[aria-invalid="true"] {
  border-color: var(--stamp);
  box-shadow: 0 0 0 3px var(--stamp-soft);
}

textarea.field {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23878d89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  text-overflow: ellipsis;
}

.label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.label-opt {
  font-weight: 500;
  color: var(--ink-3);
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--stamp);
}

.field-error-block {
  margin: -8px 0 14px;
}

/* ==========================================================================
   Filtros
   ========================================================================== */

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.filter-top {
  display: flex;
  gap: 8px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.btn-filters {
  padding: 0 14px;
  min-height: 48px;
}

.btn-filters[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Filtrar: el icono se da la vuelta al abrir y los desplegables entran en cascada */
.btn-filters svg { transition: transform 360ms var(--ease-out); }
.btn-filters[aria-expanded="true"] svg { transform: rotate(180deg); }
.btn-filters:active svg { transform: scale(0.86); }
.btn-filters[aria-expanded="true"]:active svg { transform: rotate(180deg) scale(0.86); }
@keyframes filtroIn { from { opacity: 0; transform: translateY(-8px); } }



.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search .field {
  padding-left: 40px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 639px) {
  .filters:not(.is-open) .filter-row { display: none; }
  .filters.is-open .filter-row { grid-template-columns: minmax(0, 1fr); }
  .filters.is-opening .filter-row > * { animation: filtroIn 300ms var(--ease-out) both; }
  .filters.is-opening .filter-row > :nth-child(2) { animation-delay: 45ms; }
  .filters.is-opening .filter-row > :nth-child(3) { animation-delay: 90ms; }
  .filters.is-opening .filter-row > :nth-child(4) { animation-delay: 135ms; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-filters svg { transition: none; }
  .filters.is-opening .filter-row > * { animation: none; }
}

.filter-summary {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.filter-summary strong {
  color: var(--ink);
  font-weight: 700;
}

/* ==========================================================================
   Apuntes agrupados por semana
   ========================================================================== */

.entry-list {
  display: grid;
  gap: 28px;
  margin-top: 12px;
}

.week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}

/* Cierre de la semana: doble filete de libro de cuentas y su saldo */
.week-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -1px;
  padding-top: 10px;
  border-top: 3px double var(--ink);
}

.week-foot-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}

.entry-balance {
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-name {
  font-size: 15px;
  font-weight: 800;
}

.week-range {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}

.week-total {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sello rojo de semana cerrada */
.stamp {
  display: inline-block;
  margin-right: auto;
  margin-left: 4px;
  padding: 2px 8px;
  border: 2px solid var(--stamp);
  border-radius: 4px;
  color: var(--stamp);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 2px;
  transform: rotate(-4deg);
}

.entry {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-areas:
    "date main figures"
    "date note note"
    "date actions actions";
  column-gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.entry.is-new {
  animation: entryIn 1.6s var(--ease-out);
}

.entry-date {
  grid-area: date;
  display: grid;
  justify-items: start;
  align-content: start;
  line-height: 1.1;
}

.entry-wd {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: capitalize;
}

.entry-day {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.entry-main {
  grid-area: main;
  min-width: 0;
}

.entry-times {
  font-family: var(--font-num);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

.entry-rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rate-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rate-3);
}

.rate-dot[data-rate="1"] { background: var(--rate-1); }
.rate-dot[data-rate="2"] { background: var(--rate-2); }
.rate-dot[data-rate="4"] { background: var(--rate-4); }
.rate-dot[data-rate="5"] { background: var(--rate-5); }

.entry-figures {
  grid-area: figures;
  text-align: right;
}

.entry-hours {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.entry-tips {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.entry-tips.is-zero {
  color: var(--ink-3);
}

.entry-note {
  grid-area: note;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.entry-actions {
  grid-area: actions;
  display: flex;
  gap: 4px;
  margin-top: 6px;
  margin-left: -10px;
}

.entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}

.entry-btn:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .entry-btn:hover { background: var(--accent-soft); color: var(--ink); }
  .entry-btn.is-delete:hover { background: var(--stamp-soft); color: var(--stamp); }
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.tag-night {
  background: var(--night-soft);
  color: var(--night);
}

.empty {
  padding: 40px 0;
  text-align: center;
  border-top: 2px solid var(--ink);
}

.empty-title {
  font-size: 18px;
  font-weight: 800;
}

.empty-text {
  margin: 6px auto 0;
  max-width: 34ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ==========================================================================
   Formulario (hoja de apunte)
   ========================================================================== */

.form-sheet {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 18px 16px 20px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-sheet.is-editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group {
  margin-bottom: 16px;
  border: 0;
  min-width: 0;
}

.form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end; /* si una etiqueta ocupa dos líneas, los campos siguen alineados */
}

.duration {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0 18px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.duration-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.duration-value {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.duration .tag {
  margin-left: auto;
  align-self: center;
}

.money {
  position: relative;
}

.money .field {
  padding-right: 36px;
}

.money-sign {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--ink-3);
  pointer-events: none;
}

/* Escala de valoración: cinco casillas */
.rating legend {
  padding: 0;
}

.rating-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  overflow: hidden;
}

.rating-btn {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  min-height: 64px;
  background: var(--sheet);
  color: var(--ink-2);
  transition: background-color 160ms ease, color 160ms ease;
}

.rating-btn + .rating-btn {
  border-left: 1px solid var(--rule);
}

.rating-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: transform 200ms var(--ease-out), background-color 160ms ease;
}

.rating-btn[data-value="1"] .rating-mark { color: var(--rate-1); }
.rating-btn[data-value="2"] .rating-mark { color: var(--rate-2); }
.rating-btn[data-value="3"] .rating-mark { color: var(--rate-3); }
.rating-btn[data-value="4"] .rating-mark { color: var(--rate-4); }
.rating-btn[data-value="5"] .rating-mark { color: var(--rate-5); }

.rating-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.rating-btn.active {
  background: var(--accent-soft);
  color: var(--ink);
}

.rating-btn.active .rating-mark {
  background: currentColor;
  transform: scale(1.15);
}

.rating-btn.active .rating-label {
  font-weight: 800;
}

.rating-btn:focus-visible {
  outline-offset: -3px;
}

@media (hover: hover) {
  .rating-btn:not(.active):hover { background: var(--page); }
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.form-actions .btn-primary {
  flex: 1;
  min-height: 52px;
  font-size: 16px;
}

@media (max-width: 399px) {
  .form-sheet { padding: 16px 12px 18px; }
  .rating-label { font-size: 11px; }
}

/* ==========================================================================
   Mi sueldo
   ========================================================================== */

.pay {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.pay-month {
  width: auto;
  min-height: 40px;
  font-size: 15px;
}

.pay-summary {
  display: grid;
  gap: 20px;
}

.pay-total-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.pay-total-figure {
  margin-top: 2px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pay-total-note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.pay-lines {
  border-top: 1px solid var(--ink);
}

.pay-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}

.pay-line dt {
  color: var(--ink-2);
}

.pay-line dd {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pay-line.is-sum {
  font-weight: 700;
}

.pay-line.is-sum dt {
  color: var(--ink);
}

.pay-line:last-child {
  border-bottom: 3px double var(--ink);
}

.pay-hours {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
}

.pay-hour {
  padding: 12px;
  min-width: 0;
}

.pay-hour + .pay-hour {
  border-left: 1px solid var(--rule);
}

.pay-hour span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.pay-hour strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 14px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.pay-hour.is-over strong {
  color: var(--stamp);
}

.pay-check {
  margin-top: 24px;
  max-width: 420px;
}

.pay-diff {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

.pay-diff.is-ok { color: var(--accent); }
.pay-diff.is-low { color: var(--stamp); }
.pay-diff.is-high { color: var(--ink-2); }

.pay-settings {
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.pay-settings summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.pay-settings summary::-webkit-details-marker {
  display: none;
}

.pay-settings summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 200ms var(--ease-out);
}

.pay-settings[open] summary::after {
  transform: rotate(-135deg) translateY(-3px);
}

.pay-settings-body {
  padding: 4px 0 20px;
  max-width: 560px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
}

.pay-source {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 70ch;
}

.pay-source-link {
  margin-top: 6px;
  font-size: 13px;
}

.pay-source-link a {
  color: var(--ink-2);
  text-underline-offset: 2px;
}

/* Tablas del convenio caducadas: aviso sobrio, sin alarmar */
.pay-stale {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--ink-3);
  font-size: 13px;
  color: var(--ink-2);
  max-width: 70ch;
}

/* Calabaza en la miniatura de la tapa de Halloween */
.cover-swatch-pumpkin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 15px;
  margin: -7px 0 0 -9px;
  border-radius: 50% / 55%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 2px, transparent 2px),
    linear-gradient(90deg, transparent 5px, rgba(0, 0, 0, 0.18) 5px 6px, transparent 6px 12px, rgba(0, 0, 0, 0.18) 12px 13px, transparent 13px),
    #f28c28;
}

.cover-swatch-pumpkin::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -4px;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: #5c8a3a;
}

@media (min-width: 640px) {
  .pay-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    column-gap: 48px;
  }
  .pay-hours {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Tu cartilla: selector de tapa y apariencia
   ========================================================================== */

.look {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.look-text {
  margin-top: 6px;
  color: var(--ink-2);
}

.cover-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  max-width: 560px;
}

.cover-option {
  position: relative;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 4px 8px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}

.cover-option:active {
  transform: scale(0.96);
}

/* Mini cartilla: tapa de color con la página asomando */
.cover-swatch {
  position: relative;
  width: 44px;
  height: 58px;
  border-radius: 4px 8px 8px 4px;
  background: var(--sw-cover);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6), inset 3px 0 0 rgba(0, 0, 0, 0.18);
  transition: transform 200ms var(--ease-out);
}

.cover-swatch-page {
  position: absolute;
  right: -3px;
  top: 4px;
  bottom: 4px;
  width: 6px;
  border-radius: 0 3px 3px 0;
  background: var(--sw-page);
}

.cover-name {
  font-size: 13px;
  font-weight: 600;
}

.cover-option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.cover-option[aria-checked="true"] .cover-swatch {
  transform: translateY(-3px) rotate(-4deg);
}

.cover-option[aria-checked="true"] .cover-name {
  font-weight: 800;
}

.mode-picker {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  margin-top: 16px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
}

.mode-option {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 160ms ease, color 160ms ease;
}

.mode-option[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (min-width: 640px) {
  .cover-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 480px; }
}

@media (hover: hover) {
  .cover-option:not([aria-checked="true"]):hover { background: var(--sheet); border-color: var(--rule); }
  .mode-option:not([aria-checked="true"]):hover { color: var(--ink); }
}

/* ==========================================================================
   Aviso al abrir (turno olvidado, copia antigua)
   ========================================================================== */

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 8px 12px 16px;
  border-radius: var(--r-lg);
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule-strong);
  animation: noticeIn 320ms var(--ease-out);
}

.notice-text {
  font-size: 15px;
  font-weight: 600;
  text-wrap: pretty;
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.icon-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-3);
}

@media (hover: hover) {
  .icon-close:hover { background: var(--page); color: var(--ink); }
}

@keyframes noticeIn {
  from { transform: translateY(-6px); }
}

/* ==========================================================================
   Turno partido, festivos y varios trabajos
   ========================================================================== */

[hidden] {
  display: none !important;
}

.btn-split {
  margin: -6px 0 12px -12px;
  gap: 6px;
}

.btn-split[aria-expanded="true"] svg line:first-child {
  display: none;
}

.split-row {
  animation: splitIn 220ms var(--ease-out);
}

@keyframes splitIn {
  from { opacity: 0; transform: translateY(-4px); }
}

.duration {
  flex-wrap: wrap;
  row-gap: 4px;
}

.duration-value,
.tag {
  white-space: nowrap;
}

.duration-night {
  font-size: 13px;
  font-weight: 700;
  color: var(--night);
  white-space: nowrap;
}

.duration-night:not(.hidden) + .tag {
  margin-left: 0;
}

.duration .duration-night {
  margin-left: auto;
}

.check-holiday {
  margin: -6px 0 14px;
}

.check-hint {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

.tag-holiday {
  background: var(--stamp-soft);
  color: var(--stamp);
}

.tag-job {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Segundo tramo de un turno partido, debajo del primero */
.entry-tramo {
  display: block;
}

/* Selector de trabajo: fichas que caben en una fila o bajan a la siguiente */
.job-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-chip {
  min-height: 40px;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}

.job-chip:active {
  transform: scale(0.96);
}

.job-chip[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (hover: hover) {
  .job-chip:not([aria-checked="true"]):hover { color: var(--ink); border-color: var(--ink-3); }
}

#job-group .label {
  display: block;
  margin-bottom: 8px;
}

.pay-jobs {
  margin-bottom: 18px;
}

.pay-hours-more {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.pay-rules {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
}

.pay-rule {
  font-size: 14px;
  color: var(--ink-2);
  text-wrap: pretty;
}

.pay-rule + .pay-rule {
  margin-top: 8px;
}

.pay-rules .check {
  margin-top: 6px;
}

.pay-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.pay-suggest .btn {
  margin-left: -12px;
}

/* Lista de trabajos en Ajustes */
.jobs {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.job-list {
  display: grid;
  gap: 8px;
  max-width: 480px;
  margin: 16px 0 10px;
  padding: 0;
  list-style: none;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 10px;
}

.job-count {
  min-width: 8.5ch;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}

.job-add {
  display: flex;
  gap: 8px;
  max-width: 480px;
}

.job-add .field {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Recordatorio
   ========================================================================== */

.reminder {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.reminder-form {
  display: grid;
  gap: 16px;
  justify-items: start;
  margin-top: 16px;
}

.day-toggles {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.day-toggle {
  min-height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-2);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}

.day-toggle:active {
  transform: scale(0.95);
}

.day-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.reminder-row {
  display: grid;
  gap: 2px;
}

.reminder-time {
  width: 140px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.reminder-form .hint {
  margin-top: -6px;
}

.backup-status {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}

.backup-status.is-stale {
  color: var(--stamp);
}

/* ==========================================================================
   Copias de seguridad
   ========================================================================== */

.share-app {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.share-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.backup {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.backup-text {
  margin-top: 6px;
  max-width: 60ch;
  color: var(--ink-2);
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* Estado del almacenamiento persistente */
.storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  transition: background-color 160ms ease, transform 120ms var(--ease-out);
}

.storage-badge:active {
  transform: scale(0.97);
}

.storage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.storage-badge[data-state="checking"] {
  opacity: 0.7;
  cursor: progress;
}

.storage-badge[data-state="granted"] {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

.storage-badge[data-state="prompt"] {
  background: #f2d27a;
  border-color: #f2d27a;
  color: #2a2208;
}

.storage-badge[data-state="prompt"] .storage-dot {
  background: #8a5a00;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* ==========================================================================
   Diálogos
   ========================================================================== */

.dialog {
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  overscroll-behavior: contain;
}

.dialog[open] {
  animation: dialogIn 320ms var(--ease-out);
}

/* El resumen anual se abre con más calma y su contenido llega en cascada */
.year-dialog[open] {
  animation: yearIn 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes yearIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
}

/* Con un diálogo abierto, la página de detrás no se mueve */
html:has(dialog[open]),
html:has(dialog[open]) body { overflow: hidden; overscroll-behavior: none; }

.dialog::backdrop {
  background: rgba(10, 24, 18, 0.45);
}

.dialog-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.dialog-text {
  margin-top: 8px;
  color: var(--ink-2);
  text-wrap: pretty;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.dialog-actions .btn {
  flex: 1;
}

.dialog-actions-stack {
  flex-direction: column;
}

/* ==========================================================================
   Aviso (toast) con Deshacer
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--page);
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: toastIn 260ms var(--ease-out);
}

.toast-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fe0a8;
  font-size: 0;
}

.toast.toast-error .toast-icon {
  background: #ff8a76;
}

.toast-message {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.toast-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 800;
  color: #8fe0a8;
}

[data-theme="dark"] .toast-action {
  color: var(--cover);
}

[data-theme="dark"] .toast-icon {
  background: var(--cover);
}

@media (hover: hover) {
  .toast-action:hover { background: rgba(127, 127, 127, 0.18); }
}

/* ==========================================================================
   Movimiento
   ========================================================================== */

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
}

@keyframes entryIn {
  0% { background-color: var(--accent-soft); }
  100% { background-color: transparent; }
}

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

/* ==========================================================================
   Pantallas medianas y grandes
   ========================================================================== */

@media (min-width: 640px) {
  .ledger-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cell,
  .cell:nth-child(even) {
    padding: 20px 16px;
    border-bottom: 0;
    border-left: 1px solid var(--rule);
  }
  .cell:first-child {
    padding-left: 0;
    border-left: 0;
  }
  .filter-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
  .btn-filters {
    display: none;
  }
  .entry {
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "date main figures actions"
      "date note note note";
    align-items: start;
  }
  .entry-actions {
    margin: -6px -8px 0 8px;
  }
  .entry-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

@media (min-width: 960px) {
  .cover-inner {
    padding-bottom: 36px;
  }
  .balance {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    grid-template-areas:
      "figure strip"
      "caption strip"
      "tips strip"
      "cta strip";
    column-gap: 48px;
    align-items: end;
  }
  .balance-head { grid-area: figure; }
  .balance-caption { grid-area: caption; }
  .balance-tips { grid-area: tips; }
  .btn-cover { grid-area: cta; }
  .week-strip {
    grid-area: strip;
    margin-top: 0;
    align-self: end;
  }
  .day {
    grid-template-rows: 120px auto auto;
  }
  .columns {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 48px;
    align-items: start;
  }
  .entry-form {
    order: 0;
    position: sticky;
    top: 20px;
  }
  .section-title {
    font-size: 24px;
  }
}

/* ==========================================================================
   Pestañas: vistas, cabeceras de vista y barra inferior
   ========================================================================== */

body {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.view[hidden] {
  display: none;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.view-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-top: 8px;
}

.cover-view .balance-head {
  margin-top: 20px;
}

.cover-compact .cover-inner {
  padding-bottom: 22px;
}

.cover-compact .balance-tips {
  margin-top: 4px;
}

.cover-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--cover-rule);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23ffffff' stroke-opacity='0.8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--cover-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}

.cover-select option {
  color: #18211c;
}

/* La primera sección de cada vista no necesita filete de separación */
.page > section:first-child,
.page > .pay:first-child {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--sheet);
  border-top: 1px solid var(--rule);
  --tab-bg: var(--sheet);
}

/* Teclado abierto en el móvil: la barra no sube encima del teclado */
.keyboard-open .tabbar {
  display: none;
}

.keyboard-open body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar .tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, transform 120ms var(--ease-out);
}

.tabbar .tab:active {
  transform: scale(0.94);
}

.tabbar .tab svg {
  transition: transform 220ms var(--ease-out);
}

.tabbar .tab[aria-selected="true"] {
  color: var(--accent);
}

.tabbar .tab[aria-selected="true"] svg {
  transform: translateY(-1px) scale(1.06);
}

@media (min-width: 960px) {
  body {
    padding-bottom: 104px;
  }
  .tabbar {
    left: 50%;
    right: auto;
    bottom: 20px;
    /* Ancho según las pestañas que haya, sin que ningún nombre se parta */
    width: max-content;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: auto;
    gap: 2px;
    transform: translateX(-50%);
    padding: 6px;
    border: 1px solid var(--rule);
    border-radius: 18px;
    box-shadow: var(--shadow-pop);
  }
  .tabbar .tab {
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 10px 14px;
    white-space: nowrap;
  }
  .tabbar .tab svg {
    width: 20px;
    height: 20px;
  }
  .tabbar .tab[aria-selected="true"] {
    background: var(--accent-soft);
  }
}

/* ==========================================================================
   Stickers de las tapas temáticas
   Pegatinas con reborde blanco, ladeadas junto a la cifra; nunca tapan datos
   ========================================================================== */

.balance-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.sticker {
  display: none;
  flex-shrink: 0;
  width: clamp(70px, 22vw, 104px);
  height: auto;
  margin: -14px 0 0 2px;
  transform: rotate(12deg);
  pointer-events: none;
  user-select: none;
}

.sticker-small {
  width: clamp(54px, 15vw, 72px);
  margin-top: -6px;
  transform: rotate(-10deg);
}

[data-cover="halloween"] .sticker-halloween {
  display: block;
  animation: stickerOn 520ms var(--ease-out);
}

@keyframes stickerOn {
  0% { transform: rotate(-8deg) scale(0.6); }
  70% { transform: rotate(16deg) scale(1.06); }
}

[data-cover="halloween"] .sticker-small {
  animation-name: stickerOnSmall;
}

@keyframes stickerOnSmall {
  0% { transform: rotate(10deg) scale(0.6); }
  70% { transform: rotate(-14deg) scale(1.06); }
}

/* Interruptor nativo invisible que cubre cada tapa: al tocarlo con el dedo,
   iOS da su respuesta háptica de sistema */
.haptic-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.001;
  cursor: pointer;
  z-index: 1;
}

/* ==========================================================================
   Pegatinas de la tapa Barra
   ========================================================================== */

/* La opción solo aparece donde están activas las tapas de pruebas */
.cover-option[data-test-cover] { display: none; }
.test-covers .cover-option[data-test-cover] { display: grid; }

/* La caña entra desde abajo, choca como en un brindis y la espuma se asienta */
[data-cover="barra"] .sticker-barra {
  display: block;
  animation: canaOn 760ms var(--ease-out);
}

/* La tortilla se queda quieta: solo aparece */
[data-cover="barra"] .sticker-tortilla { animation: none; }

@keyframes canaOn {
  0% { transform: translateY(40px) rotate(-18deg) scale(0.6); opacity: 0; }
  45% { transform: translateY(-6px) rotate(18deg) scale(1.06); opacity: 1; }
  65% { transform: rotate(8deg) scale(1); }
  82% { transform: rotate(14deg); }
}

.sticker-cana { width: clamp(52px, 15vw, 76px); margin: -18px 0 0 6px; transform: rotate(12deg); }
.cover-view .cover-inner { position: relative; }
.sticker-tortilla { position: absolute; right: 6px; bottom: 6px; width: clamp(56px, 16vw, 76px); margin: 0; transform: rotate(-10deg); }

/* Servilleta: cae revoloteando sobre la hoja al guardar un turno */
.sticker-servilleta {
  position: absolute;
  right: -14px;
  bottom: -22px;
  width: 58px;
  opacity: 0;
  pointer-events: none;
}

[data-cover="barra"] .is-stamped .sticker-servilleta {
  display: block;
  animation: servilletaCae 1100ms var(--ease-out) both;
}

@keyframes servilletaCae {
  0% { opacity: 0; transform: translate(-30px, -120px) rotate(-40deg) scale(0.9); }
  15% { opacity: 1; }
  45% { transform: translate(14px, -40px) rotate(18deg) scale(1); }
  70% { transform: translate(-6px, 6px) rotate(-6deg); }
  100% { opacity: 1; transform: translate(0, 0) rotate(8deg); }
}

.cover-swatch-foam {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 7px;
  height: 9px;
  border-radius: 6px 6px 3px 3px;
  background: #fbf7ee;
  box-shadow: 0 9px 0 -2px #f3b15a;
}

/* Cerveza de fondo en la tapa: burbujas que suben despacio, como la nieve de
   Navidad pero hacia arriba, y un dedo de caña con espuma que se mece al pie */
[data-cover="barra"] .cover {
  position: relative;
  overflow: hidden;
  /* Hueco para el dedo de cerveza: el texto no se queda encima de la espuma */
  padding-bottom: 16px;
}

[data-cover="barra"] .cover::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(253, 226, 164, 0.75) 0 1.8px, transparent 2.4px),
    radial-gradient(circle, rgba(243, 177, 90, 0.6) 0 1.3px, transparent 1.9px),
    radial-gradient(circle, rgba(255, 246, 225, 0.5) 0 2.4px, transparent 3px),
    radial-gradient(circle, rgba(253, 226, 164, 0.45) 0 1px, transparent 1.5px);
  background-size: 97px 113px, 61px 83px, 149px 131px, 43px 67px;
  background-position: 18px 0, 52px 34px, 96px 70px, 7px 21px;
  animation: barraBurbujas 10s linear infinite;
  opacity: 0.55;
}

[data-cover="barra"] .cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 7 C15 1 30 13 60 7 C90 1 105 13 120 7 L120 14 L0 14 Z' fill='%23fbf7ee' fill-opacity='0.85'/%3E%3C/svg%3E") 0 0 / 120px 14px repeat-x,
    linear-gradient(180deg, transparent 11px, rgba(243, 169, 60, 0.7) 11px, rgba(201, 122, 30, 0.7));
  animation: barraOla 6s linear infinite;
}

/* Cada capa sube dos veces su alto: el bucle no salta y suben a distinta velocidad */
@keyframes barraBurbujas {
  from { background-position: 18px 0, 52px 34px, 96px 70px, 7px 21px; }
  to { background-position: 18px -226px, 52px -132px, 96px -192px, 7px -113px; }
}

@keyframes barraOla {
  from { background-position: 0 0, 0 0; }
  to { background-position: 120px 0, 0 0; }
}

[data-cover="barra"] .cover > * {
  position: relative;
  z-index: 1;
}

/* Modo discreto: una servilleta de bar tapa el total y cae el servilletero encima */
.pc-servilletero {
  display: none;
}

[data-cover="barra"] .pc-tape {
  background:
    repeating-linear-gradient(90deg, rgba(47, 90, 138, 0.06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, transparent calc(100% - 7px), rgba(47, 90, 138, 0.35) calc(100% - 7px) calc(100% - 5px), transparent calc(100% - 5px)),
    linear-gradient(180deg, rgba(47, 90, 138, 0.35) 5px, transparent 5px 7px),
    #f9f6ee;
}

[data-cover="barra"] .pc-mask {
  color: #2f5a8a;
}

[data-cover="barra"] .pc-servilletero {
  display: block;
  position: absolute;
  right: -10px;
  top: -40px;
  width: 64px;
  height: auto;
  opacity: 0;
  transform: translateY(-90px) rotate(-20deg);
  transition: transform 340ms cubic-bezier(0.55, 0, 0.75, 0.2), opacity 200ms ease 100ms;
}

[data-cover="barra"] .is-private .pc-servilletero {
  opacity: 1;
  transform: rotate(6deg);
  transition: transform 620ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms, opacity 140ms 300ms;
  animation: servilleteroGolpe 420ms ease-out 900ms;
}

@keyframes servilleteroGolpe {
  0%, 100% { transform: rotate(6deg) scale(1, 1); }
  35% { transform: rotate(6deg) scale(1.06, 0.9); }
  70% { transform: rotate(6deg) scale(0.98, 1.03); }
}

[data-cover="barra"] .eye-iris {
  fill: #f3a93c;
}

@media (prefers-reduced-motion: reduce) {
  [data-cover="barra"] .sticker-barra,
  [data-cover="barra"] .is-stamped .sticker-servilleta,
  [data-cover="barra"] .cover::before,
  [data-cover="barra"] .cover::after,
  [data-cover="barra"] .is-private .pc-servilletero { animation: none; }
}

/* Candado de las tapas privadas */
.cover-lock {
  display: none;
  margin-left: 4px;
  vertical-align: -1px;
}

.cover-option[data-locked="true"] .cover-lock {
  display: inline-block;
}

.cover-option[data-locked="true"] .cover-swatch {
  filter: saturate(0.55);
}

.cover-swatch-leaf {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: #e0a23a;
  clip-path: polygon(50% 0, 60% 26%, 82% 16%, 76% 40%, 100% 44%, 80% 60%, 88% 80%, 58% 74%, 54% 100%, 46% 100%, 42% 74%, 12% 80%, 20% 60%, 0 44%, 24% 40%, 18% 16%, 40% 26%);
}

/* Código de 4 cifras */
.pin-input {
  margin-top: 18px;
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
}

.pin-input.is-wrong {
  animation: shake 360ms var(--ease-out);
}

@keyframes shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* ==========================================================================
   Informe del mes (solo al imprimir o guardar como PDF)
   ========================================================================== */

.pay-report {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: 20px;
}

/* Enlaces legales al final de Ajustes */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.legal-links a {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-underline-offset: 3px;
}

/* ==========================================================================
   Modo discreto de Mi sueldo: un ojo que se cierra y una cinta que tapa el
   total. Cada tapa puede tener su versión (Halloween: murciélago).
   ========================================================================== */

.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.privacy-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--cover-rule);
  color: var(--cover-ink);
  transition: background-color 200ms ease, transform 140ms var(--ease-out);
}

.privacy-toggle:active {
  transform: scale(0.9);
}

.privacy-toggle:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.is-private .privacy-toggle {
  background: var(--cover-rule);
}

@media (hover: hover) {
  .privacy-toggle:hover { background: var(--cover-rule); }
}

.eye {
  overflow: visible;
  pointer-events: none;
}

.eye * {
  transform-box: view-box;
}

/* Ojo abierto: al cerrarse se aplasta hacia el párpado de abajo */
.eye-open {
  transform-origin: 12px 15px;
  transition: transform 340ms cubic-bezier(0.34, 1.56, 0.64, 1) 140ms, opacity 120ms 140ms;
}

.eye-shape {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.eye-iris {
  fill: currentColor;
  transform-origin: 12px 12px;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms;
}

.eye-slit {
  display: none;
}

.eye-closed {
  opacity: 0;
  transition: opacity 120ms ease;
}

.eye-lid,
.eye-lashes,
.eye-stitches {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Las pestañas se dibujan una a una al cerrar */
.eye-lashes,
.eye-stitches {
  stroke-dasharray: 4;
  stroke-dashoffset: 4;
  transition: stroke-dashoffset 120ms ease;
}

.eye-stitches {
  display: none;
}

.privacy-toggle input:checked + .eye .eye-open {
  transform: scaleY(0.06);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.55, 0, 0.75, 0.2), opacity 80ms 150ms;
}

.privacy-toggle input:checked + .eye .eye-iris {
  transform: scale(0.4);
  transition: transform 160ms ease-in;
}

.privacy-toggle input:checked + .eye .eye-closed {
  opacity: 1;
  transition: opacity 100ms 170ms;
}

.privacy-toggle input:checked + .eye :is(.eye-lashes, .eye-stitches) {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 320ms cubic-bezier(0.22, 1, 0.36, 1) 230ms;
}

/* La cifra y lo que la tapa */
.pay-figure {
  position: relative;
  min-width: 0;
}

#pay-total {
  transition: filter 320ms ease 120ms, opacity 320ms ease 120ms;
}

.is-private #pay-total {
  filter: blur(14px);
  opacity: 0.3;
}

/* Lo demás con importes se difumina, sin tapar */
#pay-total-note,
.pay-line dd,
#pay-diff,
#pay-received {
  transition: filter 300ms ease;
}

.is-private :is(#pay-total-note, .pay-line dd, #pay-diff, #pay-received) {
  filter: blur(6px);
}

/* La cinta se desenrolla de izquierda a derecha y se despega hacia atrás */
.privacy-cover {
  position: absolute;
  inset: 4% -14px 0 -10px;
  pointer-events: none;
  clip-path: inset(-60% 100% -60% -20%);
  transition: clip-path 380ms cubic-bezier(0.55, 0, 0.45, 1);
}

.is-private .privacy-cover {
  clip-path: inset(-60% -40% -60% -20%);
  transition: clip-path 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pc-tape {
  position: absolute;
  inset: 10% 0 6% 0;
  display: flex;
  align-items: center;
  padding-left: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(90, 70, 30, 0.05) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 40%),
    #ece0c0;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.55);
  /* Bordes rasgados a mano */
  clip-path: polygon(0 0, 100% 0, 98.6% 12%, 100% 25%, 98.4% 38%, 100% 50%, 98.6% 63%, 100% 75%, 98.4% 88%, 100% 100%,
    0 100%, 1.4% 88%, 0 75%, 1.6% 63%, 0 50%, 1.4% 38%, 0 25%, 1.6% 12%);
  transform: rotate(-1.6deg);
}

.is-private .pc-tape {
  animation: tapePress 520ms cubic-bezier(0.22, 1, 0.36, 1) 260ms;
}

@keyframes tapePress {
  0% { transform: rotate(-1.6deg) scaleY(1.08); }
  100% { transform: rotate(-1.6deg) scaleY(1); }
}

.pc-mask {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  letter-spacing: -0.02em;
  color: #8b7a52;
  white-space: nowrap;
}

/* Halloween: cinta de noche y un murciélago que se posa encima */
.pc-bat,
.pc-leaves {
  display: none;
}

[data-cover="halloween"] .pc-tape {
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 241, 226, 0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 63% 72%, rgba(255, 241, 226, 0.4) 0 1px, transparent 1.5px),
    radial-gradient(circle at 84% 22%, rgba(255, 241, 226, 0.45) 0 1px, transparent 1.5px),
    linear-gradient(180deg, #3a2748, #2a1c36);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(242, 140, 40, 0.45);
}

[data-cover="halloween"] .pc-mask {
  color: #f28c28;
  text-shadow: 0 0 12px rgba(242, 140, 40, 0.45);
}

[data-cover="halloween"] .pc-bat {
  display: block;
  position: absolute;
  right: -8px;
  top: -34px;
  width: 72px;
  height: auto;
  opacity: 0;
  transform: translate(70px, -70px) rotate(-40deg) scale(0.35);
  transition: transform 360ms cubic-bezier(0.55, 0, 0.75, 0.2), opacity 240ms ease 120ms;
}

[data-cover="halloween"] .is-private .pc-bat {
  opacity: 1;
  transform: rotate(-10deg);
  transition: transform 640ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms, opacity 160ms 300ms;
  animation: batFlap 480ms ease-in-out 940ms;
}

@keyframes batFlap {
  0%, 100% { transform: rotate(-10deg) scale(1, 1); }
  30% { transform: rotate(-10deg) scale(1.08, 0.82); }
  60% { transform: rotate(-10deg) scale(0.96, 1.06); }
}

/* Halloween: ojo de gato naranja con párpado cosido */
[data-cover="halloween"] .eye-iris {
  fill: #f28c28;
}

[data-cover="halloween"] .eye-slit {
  display: block;
  fill: #17101d;
}

[data-cover="halloween"] .eye-lashes {
  display: none;
}

[data-cover="halloween"] .eye-stitches {
  display: block;
  stroke: #f28c28;
}

/* Al abrir la app con el modo discreto puesto, sin animaciones */
.no-anim *,
.no-anim *::before,
.no-anim *::after {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .privacy-cover,
  .is-private .privacy-cover {
    transition: opacity 160ms ease;
    clip-path: none;
    opacity: 0;
  }
  .is-private .privacy-cover { opacity: 1; }
}

/* Cabecera de Mi sueldo: el título no se parte; el selector de mes cede espacio */
.view-head .view-title {
  white-space: nowrap;
  flex-shrink: 0;
}

.view-actions .cover-select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-left: 12px;
  padding-right: 30px;
  background-position: right 10px center;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Tus horarios: fichas que rellenan el apunte con un toque
   ========================================================================== */

.templates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.templates-head .btn {
  margin-right: -12px;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-chip {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid var(--rule-strong);
  background: var(--page);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms var(--ease-out);
}

.template-chip:active {
  transform: scale(0.96);
}

.template-times {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.template-job {
  font-size: 12px;
  color: var(--ink-2);
}

/* Al aplicarla, la ficha se marca un instante */
.template-chip.is-applied {
  animation: chipApplied 520ms var(--ease-out);
}

@keyframes chipApplied {
  0% { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  100% { background: var(--page); }
}

.template-remove {
  display: none;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--stamp);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.templates.is-editing .template-remove {
  display: block;
  animation: removeIn 220ms var(--ease-out);
}

.templates.is-editing .template-chip {
  border-style: dashed;
  animation: chipWiggle 360ms ease-in-out;
}

@keyframes removeIn {
  from { transform: scale(0); }
}

@keyframes chipWiggle {
  25% { transform: rotate(-1.5deg); }
  75% { transform: rotate(1.5deg); }
}

@media (hover: hover) {
  .template-chip:hover { border-color: var(--ink-3); }
}

.btn-save-template {
  margin: -6px 0 12px 4px;
  gap: 6px;
}

/* «Turno partido» y «Guardar horario» en la misma línea */
.btn-split + .btn-save-template {
  margin-left: 4px;
}

/* ==========================================================================
   Mes a mes: barras finas, el mes elegido resaltado
   ========================================================================== */

.trend {
  margin-top: 28px;
}

.trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trend-title {
  font-size: 17px;
  font-weight: 800;
}

.trend-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
}

.trend-option {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 160ms ease, color 160ms ease;
}

.trend-option[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.trend-chart {
  position: relative;
  margin-top: 14px;
  padding-top: 26px;
}

/* Referencia: el valor máximo, sobre una línea discreta */
.trend-max {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--ink-3);
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  border-top: 1px dashed var(--rule);
}

.trend-bar {
  display: grid;
  grid-template-rows: 120px auto;
  justify-items: center;
  gap: 6px;
  padding: 0 2px;
  border-radius: 8px;
  min-width: 0;
}

.trend-bar:disabled {
  cursor: default;
}

/* La cifra, justo encima de su barra */
.trend-value {
  position: absolute;
  left: 50%;
  bottom: calc(var(--h) * 100% + 4px);
  translate: -50% 0;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
}

.trend-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 120px;
  border-bottom: 1px solid var(--ink);
}

.trend-fill {
  width: min(28px, 70%);
  height: calc(var(--h) * 100%);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--accent) 38%, var(--page));
  transform-origin: bottom;
  transition: background-color 200ms ease;
}

.trend-chart.grow .trend-fill {
  animation: barGrow 520ms var(--ease-out) both;
}

.trend-bar:not(.is-empty) .trend-fill {
  min-height: 3px;
}

@keyframes barGrow {
  from { transform: scaleY(0); }
}

.trend-bar:nth-child(2) .trend-fill { animation-delay: 40ms; }
.trend-bar:nth-child(3) .trend-fill { animation-delay: 80ms; }
.trend-bar:nth-child(4) .trend-fill { animation-delay: 120ms; }
.trend-bar:nth-child(5) .trend-fill { animation-delay: 160ms; }
.trend-bar:nth-child(6) .trend-fill { animation-delay: 200ms; }

.trend-month {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: capitalize;
}

.trend-bar.is-selected .trend-fill {
  background: var(--accent);
}

.trend-bar.is-selected .trend-month {
  color: var(--ink);
  font-weight: 800;
}

.trend-bar.is-selected .trend-value,
.trend-bar:not(.is-empty):focus-visible .trend-value {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .trend-bar:not(.is-empty):hover .trend-value { opacity: 1; transform: none; }
  .trend-bar:not(.is-empty):not(.is-selected):hover .trend-fill { background: color-mix(in srgb, var(--accent) 60%, var(--page)); }
}

/* En modo discreto, las cifras de sueldo de la gráfica también se difuminan */
.is-private .trend-chart[data-metric="pay"] :is(.trend-value, .trend-max) {
  filter: blur(5px);
}

/* ==========================================================================
   Tapa Clásica: detalles dorados y cifras en serif
   ========================================================================== */

/* Barra: vetas de madera muy suaves en la tapa y un filete crema al pie, como el canto de la barra */
[data-cover="barra"] .cover {
  background-image: repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 23px, rgba(0, 0, 0, 0.05) 23px 25px, transparent 25px 61px);
  border-bottom: 4px solid #e8d4b3;
}

/* Doble filete dorado al pie de la tapa */
[data-cover="clasica"] .cover {
  border-bottom: 4px double var(--gold);
}

[data-cover="clasica"] :is(.balance-figure, .cell-figure, .duration-value, .entry-hours, .entry-times,
  .pay-line dd, .pay-hour strong, .year-figure, .trend-value, .template-times, .week-total) {
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
}

[data-cover="clasica"] .balance-figure {
  font-weight: 600;
  letter-spacing: -0.02em;
}

[data-cover="clasica"] :is(.view-title, .section-title, .dialog-title, .year-title) {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

[data-cover="clasica"] .cover-swatch-clasica,
.cover-swatch-clasica {
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6), inset 3px 0 0 rgba(0, 0, 0, 0.25), inset 0 0 0 2px #c9a45c;
}

/* Modo discreto: banda marfil con filete dorado */
[data-cover="clasica"] .pc-tape {
  background: #f6f1e4;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.6), inset 0 0 0 2px #c9a45c;
  clip-path: none;
  border-radius: 3px;
  transform: rotate(0);
}

[data-cover="clasica"] .pc-mask {
  color: #8a6d35;
}

/* ==========================================================================
   Letra grande: amplía toda la interfaz para leerla sin esfuerzo
   ========================================================================== */

.look-subtitle {
  margin-top: 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}

.text-picker {
  grid-template-columns: repeat(2, auto);
  margin-top: 8px;
}

.text-option-large {
  font-size: 17px;
}

[data-text="large"] body {
  zoom: 1.14;
}

/* Tipografías a elegir (todas sin descargar nada: las de la app o las del móvil).
   :root[data-font] gana a la letra que pone una tapa, como la serif de Clásica */
:root[data-font="libro"] {
  --font-num: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

:root[data-font="sistema"] {
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-num: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

:root[data-font="redonda"] {
  --font-ui: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  --font-num: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
}

/* Ticket de caja: todo en letra de máquina */
:root[data-font="ticket"] {
  --font-ui: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-num: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

:root[data-font="sistema"] body,
:root[data-font="redonda"] body {
  font-variant-numeric: tabular-nums;
}

.font-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-width: 560px;
  margin-top: 8px;
}

.font-option {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: var(--sheet);
  color: var(--ink-2);
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}

.font-option:active {
  transform: scale(0.97);
}

.font-option[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--ink);
}

.font-sample {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.font-name {
  font-size: 13px;
  font-weight: 600;
}

/* Cada muestra en su letra, elijas la que elijas */
.font-option[data-font="tapa"] .font-sample { font-family: 'Martian Mono', ui-monospace, monospace; font-size: 16px; }
.font-option[data-font="libro"] .font-sample { font-family: 'Source Serif 4', Georgia, serif; }
.font-option[data-font="sistema"] :is(.font-sample, .font-name) { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.font-option[data-font="redonda"] :is(.font-sample, .font-name) { font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif; }
.font-option[data-font="ticket"] .font-sample { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 16px; }
.font-option[data-font="ticket"] .font-name { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.font-option[data-font="tapa"] .font-name,
.font-option[data-font="libro"] .font-name { font-family: 'Libre Franklin', system-ui, sans-serif; }

@media (hover: hover) {
  .font-option:not([aria-checked="true"]):hover { color: var(--ink); border-color: var(--ink-3); }
}

/* ==========================================================================
   Resumen anual
   ========================================================================== */

.year-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg);
  background: var(--sheet);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, transform 120ms var(--ease-out);
}

.year-entry:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .year-entry:hover { border-color: var(--ink-3); }
}

.year-entry-text {
  display: grid;
  gap: 2px;
}

.year-entry-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.year-entry-title {
  font-size: 17px;
  font-weight: 800;
}

/* Dentro de las zonas seguras del iPhone: la cabecera con «cerrar» nunca
   queda bajo la barra de estado ni el pie bajo la barra de inicio */
.year-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin-top: calc(12px + env(safe-area-inset-top, 0px));
  margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 0;
  overflow: auto;
  background: var(--page);
}

.year-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
  background: var(--cover);
  color: var(--cover-ink);
}

.year-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cover-ink-2);
}

.year-title {
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.year-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.year-select {
  width: auto;
  min-height: 40px;
  padding: 0 34px 0 12px;
  background-color: transparent;
  border-color: var(--cover-rule);
  color: var(--cover-ink);
}

.year-tools .icon-close {
  color: var(--cover-ink);
}

.year-body {
  padding: 20px;
}

.year-hero {
  position: relative;
  padding-bottom: 18px;
  border-bottom: 3px double var(--ink);
}

.year-figure {
  font-family: var(--font-num);
  font-size: clamp(3rem, 16vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.year-caption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
}

.year-stamp {
  margin: 12px 0 0;
  transform: rotate(-3deg);
}

.year-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.year-card {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
  min-width: 0;
}

.year-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.year-card strong {
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.year-card small {
  font-size: 12px;
  color: var(--ink-2);
}

.year-lines {
  margin-top: 18px;
  border-top: 1px solid var(--ink);
}

.year-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.year-row dt {
  display: grid;
  font-size: 15px;
  color: var(--ink-2);
}

.year-row dt small {
  font-size: 12px;
  color: var(--ink-3);
}

.year-row dd {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.year-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  padding: 0 20px 20px;
}

.year-actions .hint {
  grid-column: 1 / -1;
}

/* ==========================================================================
   IRPF y antigüedad en «Mis condiciones»
   ========================================================================== */

.hint-tight {
  display: block;
  margin: -8px 0 16px;
}

.irpf {
  margin: 0 0 16px;
  padding: 14px 14px 4px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sheet);
}

.irpf legend {
  padding: 0 6px;
  margin-left: -6px;
}

.irpf .check-hint {
  display: block;
}

.irpf-result {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.irpf-result:empty {
  display: none;
}

@media (max-width: 420px) {
  .year-highlights { grid-template-columns: 1fr; }
  .year-card { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; }
  .year-card span { grid-column: 1 / -1; }
}

/* ==========================================================================
   Tapa Navidad: pegatinas, nevada suave y modo discreto de papel de regalo
   ========================================================================== */

[data-cover="navidad"] .sticker-navidad {
  display: block;
  animation: stickerOn 520ms var(--ease-out);
}

[data-cover="navidad"] .sticker-navidad.sticker-small {
  animation-name: stickerOnSmall;
}

.cover-swatch-navidad::after {
  content: "";
  position: absolute;
  inset: 6px 8px 10px 6px;
  border-radius: 2px;
  background:
    radial-gradient(circle at 20% 25%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 70% 40%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 40% 70%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 80% 80%, #fff 0 1.5px, transparent 2px);
}

/* Nieve que cae despacio sobre la tapa */
[data-cover="navidad"] .cover {
  position: relative;
  overflow: hidden;
}

[data-cover="navidad"] .cover::before {
  content: "";
  position: absolute;
  inset: -200px 0 0 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.6px, transparent 2.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 0 1.2px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 255, 255, 0.45) 0 2px, transparent 2.6px);
  background-size: 120px 120px, 80px 90px, 170px 150px;
  background-position: 10px 0, 50px 30px, 90px 60px;
  animation: snowFall 18s linear infinite;
  opacity: 0.7;
}

@keyframes snowFall {
  from { transform: translateY(0); }
  to { transform: translateY(200px); }
}

[data-cover="navidad"] .cover > * {
  position: relative;
}

/* Modo discreto: papel de regalo de rayas y acebo que se posa encima */
.pc-holly {
  display: none;
}

[data-cover="navidad"] .pc-tape {
  background: repeating-linear-gradient(-45deg, #fffdf9 0 10px, #f1dcd9 10px 20px);
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.55), inset 0 0 0 2px #1f6b45;
}

[data-cover="navidad"] .pc-mask {
  color: #a3192b;
}

[data-cover="navidad"] .pc-holly {
  display: block;
  position: absolute;
  right: -6px;
  top: -26px;
  width: 70px;
  height: auto;
  opacity: 0;
  transform: translate(40px, -60px) rotate(-30deg) scale(0.4);
  transition: transform 360ms cubic-bezier(0.55, 0, 0.75, 0.2), opacity 240ms ease 120ms;
}

[data-cover="navidad"] .is-private .pc-holly {
  opacity: 1;
  transform: rotate(-8deg);
  transition: transform 640ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms, opacity 160ms 300ms;
}

[data-cover="navidad"] .eye-iris {
  fill: #2f8a5c;
}

@media (prefers-reduced-motion: reduce) {
  [data-cover="navidad"] .cover::before { animation: none; }
}

/* ==========================================================================
   Detalles de uso: zonas táctiles, textos sin viudas y respuesta al pulsar
   ========================================================================== */

/* En pantallas táctiles, todo lo pulsable mide al menos 44 px */
@media (pointer: coarse) {
  .btn-quiet,
  .entry-btn,
  .pay-month,
  .btn-small,
  .job-chip,
  .cover-select,
  .year-select {
    min-height: 44px;
  }

  .icon-close {
    width: 44px;
    height: 44px;
  }
}

/* Títulos equilibrados y párrafos sin una palabra sola en la última línea.
   Las reglas propias de cada bloque siguen mandando. */
:where(h1, h2, h3) {
  text-wrap: balance;
}

:where(p, li, dd, label) {
  text-wrap: pretty;
}

/* El selector de modo y tamaño se hunde un poco al pulsarlo, como los botones */
.mode-option {
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}

.mode-option:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .mode-option:active {
    transform: none;
  }
}

/* ==========================================================================
   Movimiento al navegar (ver «motion» en app.js)
   ========================================================================== */

/* Al cambiar de pestaña: cada bloque baja un poco y aparece, en cascada */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.motion-in {
  animation: viewIn 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d0, 0ms) + var(--i, 0) * 80ms);
}

/* Al desplazar: lo de abajo sube un poco y aparece al llegar a ello */
.reveal-wait {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-wait.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms ease, transform 820ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .motion-in {
    animation: none;
  }

  .reveal-wait {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .reveal-wait {
    opacity: 1;
    transform: none;
  }
}

/* Cambio de tapa o de modo: fundido, o círculo que se abre desde el botón */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 380ms; animation-timing-function: var(--ease-out); }
.look-reveal::view-transition-old(root),
.look-reveal::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.look-reveal::view-transition-new(root) { animation: lookReveal 520ms var(--ease-out); }
@keyframes lookReveal {
  from { clip-path: circle(0 at var(--vt-x) var(--vt-y)); }
  to { clip-path: circle(var(--vt-r) at var(--vt-x) var(--vt-y)); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Sello al guardar un apunte
   ========================================================================== */
.submit-wrap { position: relative; flex: 1; display: flex; }
.submit-wrap:has(.haptic-input:active) .btn-primary { transform: scale(0.98); }

.stamp {
  position: absolute;
  right: 20px;
  bottom: 84px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  color: var(--accent);
  /* Fondo de papel medio opaco: el texto del sello se lee aunque caiga sobre un campo */
  background: color-mix(in srgb, var(--sheet) 80%, transparent);
  border: 3px solid currentColor;
  box-shadow: inset 0 0 0 3px var(--sheet), inset 0 0 0 5px currentColor;
  font-family: var(--font-num);
  text-transform: uppercase;
  line-height: 1.1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: rotate(-12deg);
  z-index: 2;
}
:root[data-theme="light"] .stamp { mix-blend-mode: multiply; }
.stamp-word { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.stamp-date { font-size: 18px; font-weight: 700; }
.stamp-hours { font-size: 11px; letter-spacing: 0.04em; }

.is-stamped .stamp {
  visibility: visible;
  animation: stampIn 1500ms var(--ease-out) both;
}
.form-sheet.is-stamped { animation: sheetThump 260ms ease-out 300ms; }

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-20deg) scale(1.9); }
  20% { opacity: 0.92; transform: rotate(-12deg) scale(0.92); }
  28% { transform: rotate(-12deg) scale(1.03); }
  36% { transform: rotate(-12deg) scale(1); }
  78% { opacity: 0.92; transform: rotate(-12deg) scale(1); }
  100% { opacity: 0; transform: rotate(-12deg) scale(1); }
}
@keyframes sheetThump {
  40% { transform: translateY(2px) scale(0.997); }
}

@media (prefers-reduced-motion: reduce) {
  .is-stamped .stamp { animation: stampFade 1500ms ease both; }
  .form-sheet.is-stamped { animation: none; }
  @keyframes stampFade {
    0%, 100% { opacity: 0; }
    15%, 75% { opacity: 0.92; }
  }
}
@media print { .stamp { display: none; } }

/* ==========================================================================
   Bienvenida (primera vez)
   ========================================================================== */
.welcome { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.welcome-progress {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.welcome-step .dialog-title:focus { outline: none; }
/* El título recibe el foco para el lector de pantalla; no es un control, sin marco */
.welcome-step .dialog-title:focus-visible { outline: none; }
.welcome-step:not([hidden]) { animation: welcomeStep 320ms var(--ease-out); }
@keyframes welcomeStep { from { opacity: 0; transform: translateX(14px); } }
.welcome-fields { display: grid; gap: 12px; margin-top: 16px; }
.welcome-fields .form-group { margin: 0; }
.welcome-fields .hint { margin-top: -4px; }
.welcome-list { margin: 10px 0 0 1.2em; display: grid; gap: 6px; color: var(--ink-2); }
.welcome-install-btn { margin-top: 14px; width: 100%; }
.welcome .check { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .welcome-step:not([hidden]) { animation: none; } }

/* ==========================================================================
   Más números (cartilla)
   ========================================================================== */
.insights {
  margin-top: 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg);
  background: var(--sheet);
}
.insights summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.insights summary::-webkit-details-marker { display: none; }
.insights summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 200ms var(--ease-out);
}
.insights[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.insights-head { display: grid; gap: 2px; }
.insights-title { font-weight: 800; }
.insights-sub { font-size: 13px; color: var(--ink-3); }
.insights-body { padding: 0 18px 18px; }
.insights.is-opening .insights-body { animation: viewIn 560ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both; }
.insight-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.insight { min-width: 0; }
.insight .cell-figure { font-size: 18px; }
.insight-word { font-family: var(--font-ui); letter-spacing: -0.01em; }
@media (max-width: 399px) {
  .insight-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.insights-subtitle { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.weekday-bars { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 6px; }
.weekday-row {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.weekday-bar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.weekday-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink-3);
  transform-origin: left;
}
.insights.is-opening .weekday-bar > span { animation: barGrow 760ms cubic-bezier(0.22, 1, 0.36, 1) 220ms both; }
.weekday-row:nth-child(2) .weekday-bar > span { animation-delay: 290ms; }
.weekday-row:nth-child(3) .weekday-bar > span { animation-delay: 360ms; }
.weekday-row:nth-child(4) .weekday-bar > span { animation-delay: 430ms; }
.weekday-row:nth-child(5) .weekday-bar > span { animation-delay: 500ms; }
.weekday-row:nth-child(6) .weekday-bar > span { animation-delay: 570ms; }
.weekday-row:nth-child(7) .weekday-bar > span { animation-delay: 640ms; }
@keyframes barGrow { from { transform: scaleX(0); } }
.weekday-row.is-top .weekday-bar > span { background: var(--accent); }
.weekday-row.is-top .weekday-name { font-weight: 700; }
.weekday-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; white-space: nowrap; }
.weekday-count { color: var(--ink-3); font-family: var(--font-ui); }
@media (prefers-reduced-motion: reduce) {
  .insights .insights-body, .insights .weekday-bar > span, .year-dialog[open] { animation: none !important; }
}

/* ==========================================================================
   Calendario
   ========================================================================== */
.cal { margin-top: 20px; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.cal-month { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-align: center; flex: 1; }
.cal-nav {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--rule-strong);
  background: var(--sheet);
  color: var(--ink);
  transition: transform 120ms var(--ease-out);
}
.cal-nav:active { transform: scale(0.94); }
.cal-weekdays, .cal-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-weekdays li { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding-bottom: 4px; }
.cal-day {
  position: relative;
  width: 100%;
  min-height: 52px;
  aspect-ratio: 1 / 1.05;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  align-content: start;
  gap: 2px;
  padding: 6px 2px 4px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink);
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.cal-day:active { transform: scale(0.95); }
.cal-num { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.cal-info {
  font-family: var(--font-num);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: end;
}
.cal-day.is-weekend .cal-num { color: var(--ink-2); }
.cal-day.is-holiday .cal-num { color: var(--stamp); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.is-worked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cal-day.is-worked .cal-info, .cal-day.is-worked .cal-num { color: var(--accent-ink); }
.cal-day.is-planned:not(.is-worked) { border: 2px dashed var(--accent); }
.cal-day.is-vacaciones:not(.is-worked) { background: color-mix(in srgb, var(--rate-2) 22%, var(--sheet)); border-color: var(--rate-2); }
.cal-day.is-libre:not(.is-worked) { background: var(--night-soft); border-color: var(--night); }
.cal-day.is-baja:not(.is-worked), .cal-day.is-baja-at:not(.is-worked) { background: var(--stamp-soft); border-color: var(--stamp); }
.cal-blank { min-height: 52px; }
@media (hover: hover) {
  .cal-day:not(.is-worked):hover { border-color: var(--ink-3); }
}

.cal-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--rule-strong); }
.key-worked { background: var(--accent); border-color: var(--accent); }
.key-planned { border: 2px dashed var(--accent); }
.key-vacaciones { background: color-mix(in srgb, var(--rate-2) 22%, var(--sheet)); border-color: var(--rate-2); }
.key-libre { background: var(--night-soft); border-color: var(--night); }
.key-baja { background: var(--stamp-soft); border-color: var(--stamp); }
.cal-tip { margin-top: 8px; }

.cal-summary {
  margin-top: 14px;
  border-top: 1px solid var(--ink);
}
.cal-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.cal-summary dt { color: var(--ink-2); }
.cal-summary dd { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; }

.cal-vac, .plan-list { margin-top: 28px; }
.cal-vac-text { margin-top: 6px; color: var(--ink-2); }
.vac-bar { margin-top: 10px; height: 10px; border-radius: 5px; background: var(--rule); overflow: hidden; }
.vac-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--rate-2); transition: width 500ms var(--ease-out); }
.vac-year { margin-top: 14px; max-width: 280px; }

.plan-items { list-style: none; margin: 10px 0 0; padding: 0; }
.plan-item {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}
.plan-when { font-weight: 700; text-transform: capitalize; }
.plan-times, .plan-hours { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; }
.plan-hours { color: var(--ink-3); }
.plan-list .btn { margin-top: 12px; }
.plan-list .hint { margin-top: 10px; }

/* Aviso de turno previsto en la cartilla */
.plan-due {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--sheet);
  border: 2px dashed var(--accent);
}
.plan-due-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.plan-due-text { margin-top: 4px; font-weight: 600; text-wrap: pretty; }
.plan-due-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Fichar en directo */
.clock {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--sheet);
  border: 2px solid var(--accent);
}
.clock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.clock-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.clock-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: clockPulso 2s ease-in-out infinite; }
.clock.is-paused .clock-kicker::before { animation: none; opacity: .4; }
.clock-time { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.clock-text { margin-top: 2px; font-weight: 600; color: var(--ink-2); text-wrap: pretty; }
.clock-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@keyframes clockPulso { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .clock-kicker::before { animation: none; } }

/* Registro de jornada */
.registro-dialog { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.registro-dialog form { margin-top: 14px; display: grid; gap: 4px; }
.registro-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.registro-quick .btn[aria-pressed="true"] { background: var(--accent); color: var(--paper, #fff); }
.registro-check { margin: 6px 0 2px; }

/* Hoja de un día */
.day-dialog { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-head .dialog-title:focus, .day-head .dialog-title:focus-visible { outline: none; }
.day-holiday { margin-top: 6px; color: var(--stamp); font-weight: 600; }
.day-block { margin-top: 18px; }
.day-block:empty { display: none; }
.day-subtitle { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; padding: 0; }
.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.day-row-actions { display: flex; gap: 6px; font-family: var(--font-ui); }
.day-templates { margin-bottom: 10px; }
.day-templates:empty { display: none; }
.day-plan-form .btn, .day-mark .btn { width: 100%; margin-top: 4px; }
.day-mark { border: 0; padding: 0; min-width: 0; }
.day-mark-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--page);
  border: 1px solid var(--rule-strong);
}
.day-mark-options .mode-option { min-height: 44px; padding: 0 8px; }
.day-mark-options .mode-option[data-mark=""] { grid-column: 1 / -1; }
.day-until { margin-top: 12px; }

/* Finiquito */
.finiquito .pay-lines { margin-top: 16px; }
.fin-total { margin-top: 12px; font-size: 17px; }
.fin-total strong { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.fin-notes { margin: 14px 0 0 1.1em; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

@media (max-width: 399px) {
  .cal-day { min-height: 46px; border-radius: 8px; }
  .cal-info { font-size: 9px; }
  .plan-item { grid-template-columns: 5.5em minmax(0, 1fr) 44px; }
  .plan-hours { display: none; }
}
@media print { .plan-due, .cal, .cal-vac, .plan-list { display: none; } }

/* ==========================================================================
   Selector con píldora deslizante
   ========================================================================== */
.has-pill { position: relative; isolation: isolate; }
.seg-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    height 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}
.seg-pill.no-anim { transition: none; }
.has-pill .mode-option { position: relative; z-index: 1; transition: color 300ms ease; }
.has-pill .mode-option[aria-checked="true"] { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .seg-pill { transition: opacity 150ms ease; }
}

/* ==========================================================================
   TurnoTracker Pro
   ========================================================================== */
.pro-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  text-transform: none;
}
.is-pro [data-pro-badge] { display: none; }
.cover-option[data-pro-cover] { position: relative; }
.cover-option[data-pro-cover]::after {
  content: "Pro";
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  z-index: 2;
  pointer-events: none;
}
.is-pro .cover-option[data-pro-cover]::after { display: none; }
.pro .pro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pro-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.pro-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pro-list li { position: relative; padding-left: 26px; }
.pro-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.4em;
  width: 13px;
  height: 7px;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}
.pro-price { margin-top: 18px; font-family: var(--font-num); font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.pro-price small { display: block; font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.pro-terms { margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.pro-terms a { color: inherit; text-underline-offset: 2px; }
.pro-buy { width: 100%; margin-top: 14px; text-decoration: none; }
.pro-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.pro-key-row { display: flex; gap: 8px; margin-top: 6px; }
.pro-key-row .field { flex: 1; min-width: 0; text-transform: uppercase; }
.pro-form .hint { margin-top: 10px; }
