:root { color-scheme: light dark; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; color: #292218; background: #fff8ee; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: linear-gradient(160deg, #fff8ee 0%, #fdf4e7 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
.app { max-width: 540px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px calc(34px + env(safe-area-inset-bottom)); }
header { padding: 4px 4px 24px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.eyebrow, .label { color: #9b6c3f; font-size: .7rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 6px; }
h1, h2, p { margin-top: 0; }
h1 { font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(1.9rem, 7.5vw, 2.55rem); font-weight: 800; line-height: 1.06; letter-spacing: -.045em; margin-bottom: 8px; }
h2 { font-size: 1.2rem; letter-spacing: -.025em; margin-bottom: 0; }
.subtitle { color: #75695e; margin-bottom: 0; }
.today-card, .summary-card, .history { margin-bottom: 18px; }
.today-card, .summary-card { background: rgba(255,255,255,.78); border: 1px solid #f0dfca; border-radius: 22px; padding: 20px; box-shadow: 0 8px 30px rgba(92,57,20,.06); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.text-button { border: 0; background: none; color: #9b5d22; font-weight: 700; padding: 4px 0; }
.danger { color: #a84838; font-size: .85rem; }
.date-picker { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; background: #fff8ee; border-radius: 12px; padding: 12px; color: #67594d; font-size: .85rem; }
input[type="date"], input[type="month"] { border: 0; background: transparent; color: #3a2d20; font-weight: 700; min-width: 0; }
.meal-options { display: grid; gap: 10px; }
.meal-button { display: grid; grid-template-columns: 32px 1fr 30px; align-items: center; gap: 10px; text-align: left; border: 1.5px solid #eadac6; background: #fff; border-radius: 15px; padding: 14px; color: #382b1e; transition: transform .15s, background .15s, border-color .15s; }
.meal-button:active { transform: scale(.98); }
.meal-button.selected { background: #e9f4e5; border-color: #86b47e; }
.meal-button:disabled { cursor: not-allowed; opacity: .48; background: #f7f1e9; }
.meal-icon { font-size: 1.35rem; }
.meal-button strong, .meal-button small { display: block; }
.meal-button small { color: #87776a; font-size: .78rem; margin-top: 2px; }
.check { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; border: 1.5px solid #d9c9b8; color: transparent; font-weight: 900; }
.selected .check { background: #4b9449; border-color: #4b9449; color: #fff; }
.schedule-note, .save-message { min-height: 1.2em; font-size: .82rem; font-weight: 600; margin: 12px 0 0; }
.schedule-note { color: #796c60; }
.save-message { color: #468145; }
.summary-card { background: #3f633d; border-color: #3f633d; color: #fff; }
.summary-card .label { color: #cde1c7; }
.summary-card input { color: #fff; text-align: right; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 12px; }
.totals div { background: rgba(255,255,255,.12); border-radius: 14px; padding: 13px; }
.totals span, .totals small { display: block; }
.totals span { font-size: 1.45rem; font-weight: 800; letter-spacing: -.04em; }
.totals small, .monthly-detail { color: #d7e5d2; font-size: .78rem; }
.monthly-detail { margin-bottom: 14px; }
.share-button { width: 100%; border: 0; padding: 13px; border-radius: 12px; background: #fff; color: #345c33; font-weight: 800; }
.history { padding: 8px 4px; }
.history-list { list-style: none; padding: 0; margin: 14px 0 0; }
.history-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid #eadfce; }
.history-list li:last-child { border-bottom: 0; }
.history-date { font-weight: 700; }
.history-meals { color: #796c60; font-size: .83rem; margin-top: 3px; }
.history-meals.no-meal { color: #9a8371; }
.history-total { font-weight: 800; white-space: nowrap; }
.empty { display: block !important; color: #796c60; font-size: .9rem; padding: 16px 0 !important; }
.aviso {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(41, 34, 24, 0.62);
  color: #fff8ee;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transform: translateX(-50%);
  pointer-events: none;
}
.app.is-locked {
  filter: blur(14px) saturate(1.05);
  pointer-events: none;
  user-select: none;
}
.login {
  width: min(340px, calc(100vw - 40px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.38);
  color: #292218;
  box-shadow: 0 18px 50px rgba(41, 34, 24, 0.12);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}
.login::backdrop {
  background: rgba(255, 248, 238, 0.18);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.login form { display: grid; gap: 12px; padding: 22px; }
.campo { display: grid; gap: 8px; font-size: 12px; letter-spacing: .04em; color: #67594d; }
.campo input, .clave-fila { width: 100%; min-width: 0; border: 1px solid rgba(234, 218, 198, 0.7); border-radius: 12px; background: rgba(255, 248, 238, 0.45); }
.campo input { height: 46px; padding: 0 14px; color: #292218; font-size: 16px; -webkit-appearance: none; appearance: none; }
.clave-fila { display: flex; align-items: center; }
.clave-fila input { flex: 1; border: 0; background: transparent; height: 46px; font-size: 16px; }
.campo input:focus, .clave-fila:focus-within { outline: none; border-color: #9b5d22; }
.clave-fila button { flex: 0 0 auto; margin: 0; padding: 11px; border: 0; background: none; color: inherit; line-height: 0; opacity: .55; }
.clave-fila button[aria-pressed="true"] { opacity: 1; }
.entrar { height: 46px; margin-top: 4px; border: 0; border-radius: 12px; background: #3f633d; color: #fff; font-weight: 800; }
.login form.error .campo input, .login form.error .clave-fila { border-color: #a84838; }
@media (min-width: 600px) { .app { padding-top: 48px; } }
@media (prefers-color-scheme: dark) {
  :root { color: #f4eee6; background: #171914; }
  body { background: linear-gradient(160deg, #171914 0%, #20231c 100%); }
  .eyebrow, .label { color: #d5ad75; }
  .subtitle { color: #b9b3a9; }
  .today-card { background: #262922; border-color: #3d4135; box-shadow: 0 8px 30px rgba(0,0,0,.22); }
  .date-picker { background: #1d201a; color: #c9c3ba; }
  input[type="date"], input[type="month"] { color: #f4eee6; color-scheme: dark; }
  .meal-button { background: #2c3028; border-color: #484d40; color: #f5efe7; }
  .meal-button small { color: #c2b9ae; }
  .meal-button.selected { background: #244126; border-color: #75ae70; }
  .meal-button:disabled { background: #21241e; }
  .check { border-color: #666d5e; }
  .schedule-note { color: #c3b9ad; }
  .history-list li { border-color: #3a3d35; }
  .history-meals { color: #bdb5aa; }
  .history-meals.no-meal { color: #9e9589; }
  .text-button { color: #e1a75f; }
  .danger { color: #e48272; }
  .login {
    background: rgba(38, 41, 34, 0.42);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f4eee6;
  }
  .login::backdrop { background: rgba(23, 25, 20, 0.22); }
  .campo { color: #c2b9ae; }
  .campo input, .clave-fila { background: rgba(29, 32, 26, 0.45); border-color: rgba(72, 77, 64, 0.7); color: #f4eee6; }
  .entrar { background: #75ae70; color: #171914; }
}
