:root {
  --fondo: #17130F;
  --fondo-2: #241E18;
  --fondo-3: #342B22;
  --crema: #F4ECDB;
  --crema-2: #E9DCC2;
  --papel: #FBF6EC;
  --naranja: #C2541B;
  --naranja-hondo: #9E3F10;
  --naranja-claro: #F6C9A2;
  --tinta: #17130F;
  --suave: #6E5D4C;
  --linea: #DCCDB0;
  --claro-suave: #B9AC98;
  --radio-hoja: 32px;
  --radio: 20px;
  --margen: clamp(16px, 5vw, 24px);
  --titulo: 'Bricolage Grotesque', system-ui, sans-serif;
  --texto: 'Hanken Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fondo);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, p { margin: 0; }

.arranque { min-height: 100dvh; display: grid; place-items: center; }
.arranque::after {
  content: ''; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--fondo-3); border-top-color: var(--naranja);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Estructura ---------- */
.pantalla { min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }

.cabecera {
  color: var(--crema);
  padding: calc(env(safe-area-inset-top) + 18px) var(--margen) 22px;
  display: grid; gap: 14px;
}
.cabecera-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { color: var(--naranja); display: grid; }
.fecha-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--fondo-2); border: 1px solid var(--fondo-3);
  padding: 8px 8px 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--crema);
}
.fecha-chip i {
  font-style: normal; background: var(--naranja); color: var(--papel);
  min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; padding: 0 7px;
}
.fecha-chip:not(:has(i)) { padding-right: 16px; }
.saludo { font-family: var(--titulo); font-weight: 800; font-size: clamp(34px, 10vw, 44px); line-height: 1.02; letter-spacing: -0.02em; }
.boton-icono {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--fondo-2); border: 1px solid var(--fondo-3); color: var(--crema);
}
.sub { color: var(--claro-suave); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: -6px; }
.vivo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--claro-suave); }
.vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--claro-suave); }
.vivo.on { color: #9FD3A0; }
.vivo.on i { background: #6FCB74; box-shadow: 0 0 0 0 rgba(111, 203, 116, .6); animation: latido 2s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 7px rgba(111, 203, 116, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 203, 116, 0); } }

.pestanas {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--fondo-2); border: 1px solid var(--fondo-3); border-radius: 999px; padding: 4px;
}
.pestanas button {
  padding: 11px 4px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--claro-suave);
  transition: background .2s, color .2s;
}
.pestanas button.activa { background: var(--crema); color: var(--tinta); }

.hoja {
  flex: 1; background: var(--crema); border-radius: var(--radio-hoja) var(--radio-hoja) 0 0;
  padding: 24px var(--margen) calc(env(safe-area-inset-bottom) + 28px);
  display: grid; align-content: start; gap: 22px;
}
.bloque { display: grid; gap: 14px; }
.bloque-titulo { font-family: var(--titulo); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.vacio { color: var(--suave); background: var(--papel); border-radius: var(--radio); padding: 18px; }
.pie { text-align: center; color: var(--suave); font-size: 13px; margin-top: 6px; }

/* ---------- Colgador (estado de hoy) ---------- */
.colgador {
  position: relative; background: var(--fondo); color: var(--crema);
  border-radius: var(--radio-hoja); padding: 30px 22px 22px; text-align: left;
  display: grid; gap: 4px; overflow: hidden;
}
.colgador::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: var(--naranja); opacity: .9;
}
.colgador > * { position: relative; z-index: 1; }
.colgador-ojal {
  position: absolute; right: 26px; top: 26px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--crema); z-index: 2;
}
.colgador-hoy { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--naranja-claro); }
.colgador-titulo { font-family: var(--titulo); font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; margin-top: 4px; max-width: 75%; }
.colgador-linea { font-size: 17px; font-weight: 500; margin-top: 6px; }
.colgador-pie {
  justify-self: start; margin-top: 12px; font-size: 14px; font-weight: 600;
  background: var(--fondo-3); color: var(--crema); padding: 7px 14px; border-radius: 999px;
}
.tono-libre::after { background: #6E8F6A; }
.tono-sale::after { background: var(--naranja-claro); }
.tono-cambio::after { background: var(--naranja); }
.tono-llega .colgador-pie, .tono-cambio .colgador-pie { background: var(--naranja); color: var(--papel); }
.colgador.mini { width: 150px; height: 150px; border-radius: 40px; padding: 0; display: grid; place-items: end start; }
.colgador.mini .colgador-titulo { font-size: 22px; padding: 18px; max-width: none; }
.colgador.mini .colgador-ojal { right: 20px; top: 20px; width: 26px; height: 26px; }

/* ---------- Lo que viene ---------- */
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agenda-fila {
  display: flex; align-items: center; gap: 14px; background: var(--papel); border-radius: var(--radio); padding: 12px 16px 12px 12px;
}
.agenda-fecha {
  width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-content: center; text-align: center; line-height: 1;
  background: var(--fondo); color: var(--crema);
}
.agenda-fecha b { font-family: var(--titulo); font-size: 22px; font-weight: 800; }
.agenda-fecha small { font-size: 12px; font-weight: 600; text-transform: uppercase; margin-top: 3px; color: var(--claro-suave); }
.agenda-fila.entra .agenda-fecha { background: var(--naranja); }
.agenda-fila.entra .agenda-fecha small { color: var(--naranja-claro); }
.agenda-info { min-width: 0; }
.agenda-titulo { font-weight: 700; font-size: 17px; }
.agenda-titulo span { font-weight: 500; color: var(--suave); }
.agenda-detalle { color: var(--suave); font-size: 15px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ---------- Calendario estilo Airbnb ---------- */
.mes-nav { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 8px; }
.mes-lado { font-size: 13px; color: var(--suave); text-transform: capitalize; font-weight: 600; display: grid; line-height: 1.1; }
.mes-lado:first-child { justify-self: start; }
.mes-lado:last-child { justify-self: end; text-align: right; }
.mes-lado small { font-weight: 500; opacity: .7; }
.mes-actual { font-family: var(--titulo); font-weight: 800; font-size: 24px; text-align: center; min-width: 128px; display: grid; line-height: 1.05; }
.mes-actual small { font-family: var(--texto); font-size: 13px; font-weight: 600; color: var(--suave); }
.boton-redondo {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--fondo); color: var(--crema);
}
.boton-redondo:active { transform: scale(.94); }

.cal { background: var(--papel); border-radius: var(--radio); padding: 10px 6px 8px; }
.cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; font-weight: 700; color: var(--suave); padding-bottom: 6px; border-bottom: 1px solid var(--linea); }
.cal-grilla { touch-action: pan-y; }
.cal-semana {
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); height: 64px;
  border-bottom: 1px solid var(--linea);
}
.cal-semana:last-child { border-bottom: 0; }
.cal-dia { display: flex; justify-content: center; padding-top: 7px; font-size: 15px; font-weight: 600; }
.cal-dia b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-weight: inherit; }
.cal-dia.fuera { color: transparent; }
.cal-dia.pasado { color: #A7988A; text-decoration: line-through; text-decoration-color: rgba(167, 152, 138, .5); }
.cal-dia.hoy b { background: var(--tinta); color: var(--papel); text-decoration: none; }

.cal-estadia {
  --ancho: calc(100% / 7);
  position: absolute; bottom: 8px; height: 22px;
  left: calc(var(--ancho) * var(--desde) + 2px);
  width: calc(var(--ancho) * (var(--hasta) - var(--desde)) - 4px);
  background: var(--naranja); color: var(--papel);
  display: flex; align-items: center; gap: 3px; padding: 0 8px; overflow: hidden;
  font-size: 12px; font-weight: 700;
}
.cal-estadia.inicio { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal-estadia.final { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.cal-estadia:not(.inicio) { left: calc(var(--ancho) * var(--desde)); width: calc(var(--ancho) * (var(--hasta) - var(--desde)) - 2px); }
.cal-estadia:not(.final) { width: calc(var(--ancho) * (var(--hasta) - var(--desde)) - 2px); }
.cal-estadia:not(.inicio):not(.final) { width: calc(var(--ancho) * (var(--hasta) - var(--desde))); }
.cal-estadia em { font-style: normal; }
.cal-estadia.pasada { background: #CDBEA6; color: var(--tinta); }

/* ---------- Resumen del mes ---------- */
.resumen { background: var(--fondo); color: var(--crema); border-radius: var(--radio); padding: 18px; display: grid; gap: 16px; }
.resumen-barra { height: 10px; background: var(--fondo-3); border-radius: 999px; overflow: hidden; }
.resumen-barra span { display: block; height: 100%; background: var(--naranja); border-radius: 999px; }
.resumen dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.resumen dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--claro-suave); }
.resumen dd { margin: 2px 0 0; font-family: var(--titulo); font-size: 28px; font-weight: 800; line-height: 1.1; }
.resumen small { font-size: 12px; color: var(--claro-suave); }

/* ---------- Reseñas ---------- */
.estrellas { display: inline-flex; gap: 1px; color: #D9C9AE; }
.estrellas .on { color: var(--naranja); }
.nota { background: var(--fondo); color: var(--crema); border-radius: var(--radio); padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.nota-grande { display: grid; gap: 4px; justify-items: start; }
.nota-grande b { font-family: var(--titulo); font-size: 52px; font-weight: 800; line-height: .95; letter-spacing: -0.03em; }
.nota-grande small { font-size: 13px; color: var(--claro-suave); }
.nota-grande .estrellas { color: var(--fondo-3); }
.nota-dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.nota-dist li { display: grid; grid-template-columns: 12px 1fr 20px; align-items: center; gap: 8px; font-size: 13px; color: var(--claro-suave); }
.nota-dist li span:last-child { text-align: right; }
.nota-dist i { height: 7px; background: var(--fondo-3); border-radius: 999px; overflow: hidden; }
.nota-dist em { display: block; height: 100%; background: var(--naranja); border-radius: 999px; }

.resenas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.resena { background: var(--papel); border-radius: var(--radio); padding: 16px; display: grid; gap: 10px; }
.resena header { display: flex; align-items: center; gap: 12px; }
.resena header > div { flex: 1; min-width: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--naranja-claro); color: var(--naranja-hondo); font-family: var(--titulo); font-weight: 800; font-size: 18px;
}
.resena:nth-child(3n+2) .avatar { background: var(--fondo); color: var(--crema); }
.resena:nth-child(3n) .avatar { background: var(--crema-2); color: var(--tinta); }
.resena-autor { font-weight: 700; font-size: 16px; }
.resena-fecha { font-size: 13px; color: var(--suave); }
.resena-texto { font-size: 16px; line-height: 1.5; }

/* ---------- Ajustes ---------- */
.ajustes {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--crema);
  padding: calc(env(safe-area-inset-top) + 18px) var(--margen) calc(env(safe-area-inset-bottom) + 24px);
  display: grid; align-content: start; gap: 14px; max-width: 560px; margin: 0 auto;
  animation: subir .25s ease-out;
}
@keyframes subir { from { transform: translateY(24px); opacity: 0; } }
.ajustes-cabecera { display: flex; justify-content: space-between; align-items: center; }
.ajustes-cabecera h2 { font-family: var(--titulo); font-weight: 800; font-size: 32px; }
.ajustes .boton-icono { background: var(--fondo); border-color: var(--fondo); }
.ajuste { background: var(--papel); border-radius: var(--radio); padding: 18px; display: grid; gap: 10px; }
.ajuste h3 { font-size: 17px; }
.ajuste p { color: var(--suave); font-size: 15px; }

/* ---------- Formularios y botones ---------- */
.campo { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.campo input {
  font: inherit; font-size: 17px; font-weight: 500; padding: 15px 16px; border-radius: 16px;
  border: 1.5px solid var(--linea); background: var(--papel); color: var(--tinta);
}
.campo input:focus { outline: none; border-color: var(--naranja); box-shadow: 0 0 0 4px rgba(194, 84, 27, .15); }
.boton { width: 100%; padding: 16px; border-radius: 999px; font-weight: 700; font-size: 17px; }
.boton-naranja { background: var(--naranja); color: var(--papel); }
.boton-naranja:active { background: var(--naranja-hondo); }
.boton-naranja:disabled { opacity: .6; }
.boton-claro { background: var(--fondo); color: var(--crema); }
.error { color: #A3260B; font-size: 15px; font-weight: 500; }
.ok { color: #2F6B34; font-size: 15px; font-weight: 600; }

/* ---------- Ingreso ---------- */
.ingreso {
  min-height: 100dvh; max-width: 480px; margin: 0 auto; color: var(--crema);
  padding: calc(env(safe-area-inset-top) + 48px) var(--margen) 32px;
  display: grid; align-content: center; gap: 14px;
}
.ingreso-arte { margin-bottom: 14px; }
.ingreso h1 { font-family: var(--titulo); font-weight: 800; font-size: clamp(34px, 10vw, 44px); line-height: 1.02; letter-spacing: -0.02em; }
.ingreso .ayuda { color: var(--claro-suave); font-size: 17px; }
.formulario { background: var(--crema); color: var(--tinta); border-radius: var(--radio-hoja); padding: 22px; display: grid; gap: 14px; margin-top: 10px; }
.ingreso-pie { color: var(--claro-suave); font-size: 14px; text-align: center; }
.ingreso > .boton { margin-top: 8px; }

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