/* =====================================================================
   Up to 40% — mismo lenguaje visual que OmT Finance (líneas finas,
   tipografía ligera, tarjetas translúcidas) en tonos azules y blancos.
   ===================================================================== */
:root {
  --bg: #07101f;
  --surface: rgba(12, 24, 48, 0.42);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-solid: #0e1a33;
  --text: #f1f6ff;
  --muted: #8ea0bf;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #6cb6ff;
  --grad: linear-gradient(135deg, #a5dcff, #5aa9ff 55%, #3b7bff);
  --grad-strong: linear-gradient(135deg, #4c9dff, #2f6fe4);
  --danger: #ff7a7a;
  --shadow: rgba(0, 0, 0, 0.45);
  --bar-bg: rgba(7, 16, 31, 0.55);
  --tele: #6cb6ff;
  --tele-bg: rgba(90, 169, 255, 0.28);
  --off: #5fe0b0;
  --off-bg: rgba(52, 211, 153, 0.22);
  --holiday: #f7a6cf;
  --holiday-bg: rgba(244, 114, 182, 0.24);
  --other: #fbbf6a;
  --other-bg: rgba(251, 191, 36, 0.22);
  --vacation: #c4b5fd;
  --vacation-bg: rgba(167, 139, 250, 0.26);
  --vacprev: #f0abfc;
  --vacprev-bg: rgba(232, 121, 249, 0.2);
  --hours: #67e8f9;
  --hours-bg: rgba(34, 211, 238, 0.2);
  --nonexp: #bef264;
  --nonexp-bg: rgba(163, 230, 53, 0.18);
  --weekend: rgba(255, 255, 255, 0.025);
  /* Fondo: intensidad de las manchas y de las ondas */
  --wall-a: 0.30;
  --ripple: 255 255 255;
  --ripple-a: 0.025;
  --radius: 18px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef4fc;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-2: rgba(20, 60, 140, 0.06);
  --surface-solid: #ffffff;
  --text: #0d1b36;
  --muted: #5c6f8f;
  --line: rgba(20, 60, 140, 0.12);
  --accent: #2f6fe4;
  --grad: linear-gradient(135deg, #5cc2ff, #2f7cf6 55%, #1e4fd8);
  --danger: #d23b3b;
  --shadow: rgba(20, 50, 120, 0.16);
  --bar-bg: rgba(245, 249, 255, 0.6);
  --tele: #2f6fe4;
  --tele-bg: rgba(59, 130, 246, 0.18);
  --off: #0f9b6c;
  --off-bg: rgba(16, 185, 129, 0.16);
  --holiday: #cc2f7c;
  --holiday-bg: rgba(236, 72, 153, 0.14);
  --other: #b76e00;
  --other-bg: rgba(245, 158, 11, 0.18);
  --vacation: #7c4ddb;
  --vacation-bg: rgba(139, 92, 246, 0.15);
  --vacprev: #b0279f;
  --vacprev-bg: rgba(217, 70, 239, 0.13);
  --hours: #0e7490;
  --hours-bg: rgba(6, 182, 212, 0.15);
  --nonexp: #4d7c0f;
  --nonexp-bg: rgba(101, 163, 13, 0.15);
  --weekend: rgba(20, 60, 140, 0.03);
  --wall-a: 0.34;
  --ripple: 20 50 120;
  --ripple-a: 0.04;
  color-scheme: light;
}

/* Fondos (4 gamas): colores de las manchas en RGB */
:root, :root[data-wall="glaciar"] { --c1: 96 165 250; --c2: 186 230 253; --c3: 56 189 248; --c4: 37 99 235; }
:root[data-wall="coral"] { --c1: 248 113 113; --c2: 253 164 175; --c3: 251 146 60; --c4: 244 63 94; }
:root[data-wall="menta"] { --c1: 52 211 153;  --c2: 134 239 172; --c3: 45 212 191; --c4: 22 163 74; }
:root[data-wall="ambar"] { --c1: 251 191 36;  --c2: 253 224 71;  --c3: 251 146 60; --c4: 217 119 6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  touch-action: manipulation; /* sin zoom por doble toque */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  height: 100%;
  min-height: 100lvh;
}

html, body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100%; min-height: 100lvh; background: transparent; }

/* Fondo: manchas de color difuminadas y ondas casi imperceptibles (solo CSS, estático) */
body::before {
  content: '';
  position: fixed;
  inset: -120px 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 28% 38%, rgb(var(--ripple) / var(--ripple-a)) 0 1px, transparent 1px 26px),
    repeating-radial-gradient(circle at 78% 72%, rgb(var(--ripple) / calc(var(--ripple-a) * 0.75)) 0 1px, transparent 1px 34px),
    radial-gradient(55% 45% at 12% 8%, rgb(var(--c1) / calc(var(--wall-a) * 1.15)), transparent 70%),
    radial-gradient(45% 40% at 92% 22%, rgb(var(--c2) / calc(var(--wall-a) * 0.9)), transparent 72%),
    radial-gradient(60% 50% at 75% 92%, rgb(var(--c3) / calc(var(--wall-a) * 0.85)), transparent 70%),
    radial-gradient(50% 45% at 6% 78%, rgb(var(--c4) / calc(var(--wall-a) * 0.8)), transparent 72%),
    conic-gradient(from 200deg at 55% 45%, rgb(var(--c1) / calc(var(--wall-a) * 0.5)), rgb(var(--c3) / calc(var(--wall-a) * 0.4)), rgb(var(--c4) / calc(var(--wall-a) * 0.45)), rgb(var(--c2) / calc(var(--wall-a) * 0.4)), rgb(var(--c1) / calc(var(--wall-a) * 0.5))),
    var(--bg);
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }

/* Texto con el degradado del logo */
.brand b, .wm-name b {
  font-weight: inherit;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Pantalla de inicio ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: 1fr 1fr;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.sp-top, .sp-bottom { display: flex; flex-direction: column; align-items: center; }
.sp-top { justify-content: flex-end; gap: 22px; padding-bottom: 6vh; }
.sp-bottom { justify-content: flex-start; gap: 14px; padding-top: 8vh; }
.logo-slot { display: inline-flex; }
.logo-mark { filter: drop-shadow(0 0 18px rgba(90, 169, 255, .3)); }
.wordmark { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wm-name {
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: 54px;
  font-weight: 200;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
}
.wm-by {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .32em;
  margin-right: -.32em;
  color: var(--muted);
}
.sp-enter {
  width: 104px; height: 104px;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 8%, transparent), 0 10px 30px var(--shadow);
  transition: transform .15s ease;
}
.sp-enter:active { transform: scale(.94); }
.sp-label { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

/* Mientras se ve la pantalla de inicio, la app espera oculta debajo */
body.booting { overflow: hidden; }
body.booting .app { opacity: 0; visibility: hidden; }

/* Transición al entrar: la pantalla de inicio se vuelve cristal translúcido
   (se ven los calendarios difuminados detrás) y se desvanece. */
body.entering .app { visibility: visible; animation: app-in .75s ease forwards; }
body.entering .splash { animation: splash-glass .8s ease forwards; pointer-events: none; }
body.entering .sp-top, body.entering .sp-bottom { animation: splash-content .35s ease forwards; }

@keyframes app-in {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes splash-glass {
  0% { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); background: transparent; }
  35% { -webkit-backdrop-filter: blur(22px) saturate(130%); backdrop-filter: blur(22px) saturate(130%); background: color-mix(in srgb, var(--bg) 35%, transparent); opacity: 1; }
  100% { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); background: transparent; opacity: 0; }
}
@keyframes splash-content {
  to { opacity: 0; transform: scale(1.04); filter: blur(6px); }
}

/* ---------- App ---------- */
.app {
  --top-h: calc(58px + env(safe-area-inset-top));
  --bottom-h: calc(68px + env(safe-area-inset-bottom));
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: calc(var(--bottom-h) + 16px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { font-size: 22px; font-weight: 300; letter-spacing: .01em; white-space: nowrap; }

.icon-btn {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}
.icon-btn:active { background: var(--surface-2); }

main {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
}

/* Resumen */
.big-stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-number { font-size: 60px; font-weight: 200; line-height: 1; letter-spacing: -.01em; }
.big-label { font-size: 16px; font-weight: 300; color: var(--muted); }
.summary.over .big-number { color: var(--danger); }
.summary.over .progress-fill { background: var(--danger); }

.progress {
  margin-top: 16px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 999px; background: var(--grad); transition: width .3s ease; }
.progress-text { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.tiles, .mini-stats { display: grid; margin: 0; }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.tiles div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}
.tiles dt, .mini-stats dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tiles dd { margin: 4px 0 0; font-size: 24px; font-weight: 300; }
.mini-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.mini-stats dt { font-size: 9px; letter-spacing: .03em; }
.mini-stats dd { margin: 3px 0 0; font-size: 16px; font-weight: 400; }

/* Tipos de día */
.brushes { position: sticky; top: calc(var(--top-h) + 8px); z-index: 10; padding: 10px; }
.hint { margin: 0 2px 8px; font-size: 11px; color: var(--muted); }
.brush-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
}
.brush {
  --c: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.brush-icon { flex: 0 0 auto; display: grid; place-items: center; color: var(--c); }
.brush-label { min-width: 0; font-size: 12px; font-weight: 500; line-height: 1.15; -webkit-hyphens: auto; hyphens: auto; }
.brush.tele, .brush.half { --c: var(--tele); }
.brush.off { --c: var(--off); }
.brush.vacation { --c: var(--vacation); }
.brush.holiday { --c: var(--holiday); }
.brush.other { --c: var(--other); }
.brush.active {
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c) inset;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}
.brush.active .brush-label { font-weight: 600; }

/* Calendario */
.months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}
.month h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 300;
  text-transform: capitalize;
}
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wd { text-align: center; font-size: 10px; letter-spacing: .12em; color: var(--muted); padding-bottom: 4px; }

.day {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.day .num { font-size: 15px; font-weight: 400; }
.day .icon { display: grid; place-items: center; line-height: 0; }
.day.weekend { background: var(--weekend); color: var(--muted); border-color: transparent; cursor: default; opacity: .6; }
.day.tele { background: var(--tele-bg); border-color: color-mix(in srgb, var(--tele) 60%, transparent); }
.day.half { background: linear-gradient(135deg, var(--tele-bg) 50%, transparent 50%); border-color: color-mix(in srgb, var(--tele) 60%, transparent); }
.day.tele .icon, .day.half .icon { color: var(--tele); }
.day.off .icon { color: var(--off); }
.day.vacation .icon { color: var(--vacation); }
.day.holiday .icon { color: var(--holiday); }
.day.other .icon { color: var(--other); }
.day.off { background: var(--off-bg); border-color: color-mix(in srgb, var(--off) 60%, transparent); }
.day.holiday { background: var(--holiday-bg); border-color: color-mix(in srgb, var(--holiday) 60%, transparent); }
.day.other { background: var(--other-bg); border-color: color-mix(in srgb, var(--other) 60%, transparent); }
.day.vacation { background: var(--vacation-bg); border-color: color-mix(in srgb, var(--vacation) 60%, transparent); }
.day.national::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--holiday);
}
.day.today { box-shadow: 0 0 0 2px var(--accent); }
.day:not(:disabled):active { transform: scale(.93); }

/* Festivos */
.holiday-list ul { margin: 0; padding-left: 18px; }
.holiday-list li { margin: 5px 0; font-size: 14px; font-weight: 300; }
.holiday-list strong { font-weight: 500; }
.muted, .note { color: var(--muted); }
.note { font-size: 12px; margin: 12px 0 0; }

/* ---------- Barra inferior: cambio de trimestre ---------- */
.quarterbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  height: var(--bottom-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px env(safe-area-inset-bottom);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line);
}
.quarter-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
}
.quarter-title span { font-size: 20px; font-weight: 300; letter-spacing: .02em; }
.quarter-title small { font-size: 11px; color: var(--muted); letter-spacing: .08em; }

/* ---------- Menú ⋯ ---------- */
.menu {
  position: fixed;
  z-index: 50;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: 0 12px 32px var(--shadow);
  animation: pop-in .15s ease;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 16px;
  text-align: left;
}
.menu-item svg { color: var(--accent); }
.menu-item:active { background: var(--surface-2); }

/* ---------- Opciones de visualización ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 4, 16, .5);
  animation: fade-in .18s ease;
}
:root[data-theme="light"] .sheet-backdrop { background: rgba(10, 30, 80, .3); }
.sheet {
  width: 100%;
  max-width: 520px;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sheet-up .2s ease;
}
.sheet p { margin: 0; }
.sheet-title { margin: 0 0 4px; font-size: 22px; font-weight: 300; }
.opt-label {
  margin: 6px 0 0 !important;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted);
}
.small { font-size: 13px; }
.seg {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.seg button.on { background: var(--grad-strong); color: #fff; }
.walls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wall {
  position: relative;
  height: 104px;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 4px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.wall.on { border-color: var(--accent); }
:root[data-theme="light"] .wall { color: var(--text); text-shadow: 0 1px 2px rgba(255, 255, 255, .8); }
.wall.on::after { content: '✓'; position: absolute; top: 6px; right: 8px; font-size: 14px; }
.body-actions { display: flex; justify-content: flex-end; }
.done-btn {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--grad-strong);
  color: #fff;
  font-weight: 600;
}

/* Aviso breve */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-h, 80px) + 16px);
  z-index: 70;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  box-shadow: 0 8px 24px var(--shadow);
  font-size: 14px;
  animation: fade-in .2s ease;
}

@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } }

@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); }
}

@media (max-width: 380px) {
  .wm-name { font-size: 46px; }
  .big-number { font-size: 52px; }
  .brush { gap: 4px; padding: 4px 5px; }
  .brush-label { font-size: 10.5px; }
  main { padding: 12px; gap: 12px; }
  .card { padding: 14px 12px; }
  .grid { gap: 3px; }
  .day .num { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  body.entering .app, body.entering .splash, body.entering .sp-top, body.entering .sp-bottom { animation-duration: .01s; }
}

/* ---------- Siempre en vertical: aviso al girar un móvil ---------- */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg);
    color: var(--text);
    text-align: center;
  }
  .rotate-hint svg { color: var(--accent); transform: rotate(-90deg); }
  .rotate-hint p { margin: 0; font-size: 16px; font-weight: 300; letter-spacing: .02em; }
  body { overflow: hidden; }
}

/* ---------- Aviso emergente: añadir a la pantalla de inicio ---------- */
.sheet-backdrop.center {
  align-items: center;
  padding: 16px;
  background: rgba(0, 4, 16, .35);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
}
:root[data-theme="light"] .sheet-backdrop.center { background: rgba(225, 235, 250, .4); }
.install-sheet {
  max-width: 400px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 22px;
  border-bottom: 1px solid var(--line);
  padding: 22px 18px 16px;
  align-items: center;
  text-align: center;
  animation: pop-in .22s ease;
}
.install-logo { display: inline-flex; }
.install-sheet .sheet-title { font-size: 21px; line-height: 1.25; }
.install-steps {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: left;
}
.install-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.35;
}
.install-steps b { font-weight: 600; }
.step-icon {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
}
.install-footer {
  width: 100%;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.no-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.no-more input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* Versión de la app, discreta, en la parte de abajo de la pantalla de inicio */
.sp-version {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  opacity: .7;
}

/* ---------- 1.1.0: nuevos tipos de día ---------- */
.brush.halfoff { --c: var(--off); }
.brush.vacprev { --c: var(--vacprev); }
.brush.hours { --c: var(--hours); }
.day.halfoff { background: linear-gradient(135deg, var(--off-bg) 50%, transparent 50%); border-color: color-mix(in srgb, var(--off) 60%, transparent); }
.day.mix { background: linear-gradient(135deg, var(--tele-bg) 50%, var(--off-bg) 50%); border-color: color-mix(in srgb, var(--off) 45%, var(--tele) 45%); }
.day.vacprev { background: var(--vacprev-bg); border-color: color-mix(in srgb, var(--vacprev) 60%, transparent); }
.day.hours { background: var(--hours-bg); border-color: color-mix(in srgb, var(--hours) 60%, transparent); }
.day.halfoff .icon { color: var(--off); }
.day.vacprev .icon { color: var(--vacprev); }
.day.hours .icon { color: var(--hours); }

/* Días pendientes (última fila del resumen) */
.pending-title {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.mini-stats.pending { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 6px; padding-top: 0; border-top: 0; }
.mini-stats.pending dd { font-size: 17px; font-weight: 300; }
.mini-stats.pending dd.neg { color: var(--danger); }

/* Días de vacaciones y libre por año */
.alw-sheet { max-height: 88dvh; overflow-y: auto; }
.alw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alw-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.alw-field span { font-size: 11px; color: var(--muted); }
.alw-field input, .alw-add input {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 300;
}
.alw-years { display: grid; gap: 8px; }
.alw-year { display: grid; grid-template-columns: 52px 1fr 1fr 36px; gap: 8px; align-items: center; }
.alw-y { font-size: 17px; font-weight: 400; text-align: center; }
.alw-del {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
}
.alw-add { display: flex; gap: 8px; align-items: center; }
.alw-add input { width: 80px; flex: 0 0 80px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.alw-add .text-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; }

/* ---------- Aviso de novedades ---------- */
.whatsnew-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(0, 4, 16, .45);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  animation: fade-in .25s ease;
}
:root[data-theme="light"] .whatsnew-backdrop { background: rgba(225, 235, 250, .45); }
.whatsnew-backdrop.closing { animation: fade-out .22s ease forwards; }
.whatsnew {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-solid);
  box-shadow: 0 24px 60px var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: wn-in .45s cubic-bezier(.2, .9, .3, 1.2);
}
.wn-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 20px 22px;
  background: var(--grad-strong);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.wn-hero::before, .wn-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.wn-hero::before { width: 180px; height: 180px; top: -90px; right: -50px; }
.wn-hero::after { width: 120px; height: 120px; bottom: -70px; left: -30px; }
.wn-spark { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: rgba(255, 255, 255, .18); animation: wn-glow 2.4s ease-in-out infinite; }
.wn-hero h2 { margin: 4px 0 0; font-size: 28px; font-weight: 300; letter-spacing: .01em; }
.wn-pill { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.wn-list { list-style: none; margin: 0; padding: 14px 16px 4px; display: grid; gap: 10px; }
.wn-list li { display: flex; gap: 12px; align-items: flex-start; }
.wn-list li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; font-weight: 300; line-height: 1.35; color: var(--muted); }
.wn-list b { font-size: 15px; font-weight: 500; color: var(--text); }
.wn-icon {
  --c: var(--accent);
  flex: 0 0 36px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.wn-list .halfoff .wn-icon, .wn-list .off .wn-icon { --c: var(--off); }
.wn-list .vacprev .wn-icon { --c: var(--vacprev); }
.wn-list .hours .wn-icon { --c: var(--hours); }
.wn-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 16px; }
@keyframes wn-in { from { opacity: 0; transform: translateY(24px) scale(.94); } }
@keyframes wn-glow { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .08); transform: scale(1.06); } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .whatsnew, .wn-spark { animation: none; } }

/* ---------- Grupo «Otros»: días que no caducan, médico y bajas ---------- */
.brush.nonexp { --c: var(--nonexp); }
.brush.medical, .brush.sick { --c: var(--other); }
.day.nonexp { background: var(--nonexp-bg); border-color: color-mix(in srgb, var(--nonexp) 60%, transparent); }
.day.medical, .day.sick { background: var(--other-bg); border-color: color-mix(in srgb, var(--other) 60%, transparent); }
.day.nonexp .icon { color: var(--nonexp); }
.day.medical .icon, .day.sick .icon { color: var(--other); }
.group-btn { position: relative; }
.brush-more { position: absolute; top: 3px; right: 4px; display: grid; color: var(--muted); opacity: .8; }
.group-menu { z-index: 60; min-width: 220px; max-width: calc(100vw - 16px); }
.group-menu .menu-item { white-space: nowrap; -webkit-appearance: none; appearance: none; color: var(--text); font-size: 16px; }
.group-menu .menu-item span { overflow: hidden; text-overflow: ellipsis; }
.group-menu .menu-item.nonexp svg { color: var(--nonexp); }
.group-menu .menu-item.medical svg, .group-menu .menu-item.sick svg, .group-menu .menu-item.other svg { color: var(--other); }
.group-menu .menu-item.on { background: var(--surface-2); font-weight: 600; }
.wn-list .nonexp .wn-icon { --c: var(--nonexp); }
.wn-list .other .wn-icon { --c: var(--other); }

/* Ventana de días que no caducan */
.nx-counter { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 6px 0; }
.nx-btn {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--nonexp) 55%, transparent);
  border-radius: 50%;
  background: var(--nonexp-bg);
  color: var(--text);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
.nx-btn:active:not(:disabled) { transform: scale(.94); }
.nx-btn:disabled { opacity: .35; }
.nx-value { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.nx-num { font-size: 48px; font-weight: 200; line-height: 1; }
.nx-cap { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nx-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 0; }
.nx-stats div { padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.nx-stats dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nx-stats dd { margin: 4px 0 0; font-size: 22px; font-weight: 300; }
.nx-stats dd.neg { color: var(--danger); }

/* Menús emergentes de los grupos: color de cada opción */
.group-menu .menu-item.tele svg, .group-menu .menu-item.half svg { color: var(--tele); }
.group-menu .menu-item.off svg, .group-menu .menu-item.halfoff svg { color: var(--off); }
.group-menu .menu-item.vacation svg { color: var(--vacation); }
.group-menu .menu-item.vacprev svg { color: var(--vacprev); }
.wn-list .half .wn-icon { --c: var(--tele); }

/* iPhone (pantalla completa): iOS difumina una franja justo debajo de la barra de estado (hora,
   batería). Se baja la barra superior para que el título y los iconos queden fuera. */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .app { --top-h: calc(72px + env(safe-area-inset-top)); } /* la barra crece lo mismo: el botón no toca la línea */
}
