@font-face { font-family: 'Outfit'; src: url('outfit.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #ebe8e1;
  --ink: #1b1a17;
  --ink-2: #5f5c55;
  --ink-3: #9a968d;
  --line: #e2ded5;
  --accent: #1f3552;
  --accent-ink: #ffffff;
  --ok: #2f6b4f;
  --ok-bg: #e4efe8;
  --warn: #8a5a1c;
  --warn-bg: #f4ead7;
  --bad: #a83f2a;
  --bad-bg: #f6e1dc;
  --info-bg: #e3e8ef;
  --radius: 18px;
  --radius-s: 11px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --nav-h: 64px;
  --shadow: 0 10px 30px rgba(20, 18, 12, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1d1c1a;
    --surface-2: #26241f;
    --ink: #f1eee7;
    --ink-2: #b3ada2;
    --ink-3: #78736a;
    --line: #2e2c27;
    --accent: #c9d6e6;
    --accent-ink: #131211;
    --ok: #8fd0ad;
    --ok-bg: #1d2f26;
    --warn: #e2b877;
    --warn-bg: #33291a;
    --bad: #f0a08c;
    --bad-bg: #3a221c;
    --info-bg: #23293a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* ─── Base ───────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.hidden { display: none !important; }

/* ─── Header ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 600px; margin: 0 auto;
}
.top .logo { height: 34px; width: auto; display: block; }
.top .clock .sim { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); vertical-align: 2px; }
.top .clock { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--ink-2); letter-spacing: -0.01em; }

main { max-width: 600px; margin: 0 auto; padding: 4px 18px 24px; }
section.screen { display: none; }
section.screen.active { display: block; }

/* ─── Nav ────────────────────────────────────────────────── */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: center;
}
nav.tabs .inner { display: flex; width: 100%; max-width: 600px; padding: 0 6px; }
nav.tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-h); color: var(--ink-3); position: relative;
}
nav.tabs .ico { position: relative; width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
nav.tabs svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs .lbl { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
nav.tabs button.on { color: var(--ink); }
nav.tabs button.on .ico { background: var(--surface-2); }
nav.tabs button.on svg { stroke-width: 2.1; }
nav.tabs .cnt { position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-style: normal; }
nav.tabs button:active .ico { background: var(--line); }

/* ─── Guía de inicio ─────────────────────────────────────── */
.guia { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 8px; margin: 10px 0; }
.guia h3 { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin-bottom: 4px; letter-spacing: -0.02em; }
.guia p.sub { color: var(--ink-2); font-size: 14.5px; margin-bottom: 8px; }
.paso { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.paso .n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.paso.ok .n { background: var(--ok-bg); color: var(--ok); }
.paso .t { font-size: 15px; }
.paso .d { font-size: 12.5px; color: var(--ink-3); }

/* ─── Chips / segmented ──────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 14px; font-family: var(--font-display); font-weight: 500; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; color: var(--ink-2); white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin: 6px 0 12px; }
.seg button { padding: 6px 14px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* ─── Cards & lists ──────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin: 10px 0; border: 1px solid var(--line); }
.card.flat { border: 0; }
.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0 14px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left;
}
.row:first-child { border-top: 0; }
.row .t { font-size: 15.5px; line-height: 1.3; }
.row .m { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.row .hour { font-family: var(--font-display); font-weight: 600; font-size: 17px; width: 50px; color: var(--ink-2); letter-spacing: -0.01em; }
.row.done .t { color: var(--ink-3); text-decoration: line-through; }
.row.done .hour { color: var(--ink-3); }
.row.skipped { opacity: 0.45; }
.row.walk { grid-template-columns: 48px 1fr; padding: 4px 16px; border-top: 0; color: var(--ink-3); font-size: 12px; background: var(--bg); }
.row.walk .hour { font-size: 12px; font-family: var(--font-ui); }
.zone-h { padding: 14px 2px 6px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; vertical-align: 1px; letter-spacing: 0.02em; }
.badge.anchor { background: var(--info-bg); color: var(--accent); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.adulto { background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 10px; padding: 3px 8px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dot.p1 { background: var(--ink); } .dot.p2 { background: var(--ink-3); } .dot.p3 { background: var(--line); border: 1px solid var(--ink-3); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; font-family: var(--font-display); background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); background: var(--bad-bg); }
.btn.wide { width: 100%; }
.btn.big { padding: 16px 20px; font-size: 17px; }
.btn.sm { padding: 8px 13px; font-size: 13.5px; border-radius: 11px; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); background: var(--surface-2); font-size: 18px; }
.icon-btn.on { background: var(--ink); color: var(--bg); }

/* ─── Ahora ──────────────────────────────────────────────── */
.banner { border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.banner .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.banner .v { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
.banner.bien { background: var(--ok-bg); color: var(--ok); }
.banner.adelanto { background: var(--info-bg); color: var(--accent); }
.banner.tarde { background: var(--bad-bg); color: var(--bad); }
.banner.libre, .banner.fin { background: var(--surface-2); color: var(--ink-2); }
.now-card { background: var(--surface); border-radius: var(--radius); padding: 20px 20px 18px; border: 1px solid var(--line); margin: 0 0 12px; }
.now-card .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.now-card .when { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; margin: 6px 0 10px; letter-spacing: -0.03em; }
.now-card .when small { font-size: 18px; font-weight: 500; color: var(--ink-3); margin-left: 8px; letter-spacing: 0; }
.now-card h2 { font-size: 28px; line-height: 1.1; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.now-card .where { color: var(--ink-2); margin-top: 4px; }
.now-card .note { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; }
.now-card .live { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.next { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 12px 4px; }
.next .hour { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink-2); }
.next .t { font-size: 16px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; font-family: var(--font-display); font-size: 22px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }

/* ─── Forms ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field label { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px;
}
.field textarea { min-height: 72px; resize: vertical; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.field { min-width: 0; }
.field input[type="time"], .field input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 46px; min-width: 0; width: 100%; max-width: 100%; text-align: left; }
.field input[type="time"]::-webkit-date-and-time-value, .field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.tg { position: relative; width: 46px; height: 28px; flex: 0 0 auto; display: inline-block; }
.tg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; left: 0; top: 0; }
.tg i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.tg input:checked + i { background: var(--ink); }
.tg input:checked + i::after { transform: translateX(18px); }
.search { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; margin: 6px 0 4px; }

/* ─── Sheet ──────────────────────────────────────────────── */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 14, 10, 0.45); z-index: 20; display: none; }
.sheet-bg.open { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform .22s ease-out; display: none;
}
.sheet.open { display: block; transform: translateY(0); }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet .sheet-x { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 14px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.sheet > div:not(.grab) > h2:first-child { padding-right: 44px; }
.top .logo { cursor: pointer; }
.sheet h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin-bottom: 4px; letter-spacing: -0.02em; }
.sheet .sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 10px; }
.sheet .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ─── Quién / mapa / historial ───────────────────────────── */
.mapa-wrap #mapa { height: 62vh; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.mk { background: var(--ink); color: var(--bg); border-radius: 50%; font: 700 12px/26px var(--font-display); text-align: center; border: 2px solid var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mk.done { background: var(--ink-3); }
.mk.adult { background: #000; color: #fff; }
.hist { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.hist span { font-size: 11px; color: var(--ink-3); display: inline-flex; flex-direction: column; align-items: center; }
.hist b { font-size: 14px; color: var(--ink); font-weight: 500; }

.checkline { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); color: var(--ink-2); font-size: 14px; margin: 0 0 8px; }
.hist b { font-family: var(--font-display); }

.fase { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; margin: -2px 2px 10px; }
.cta-plan { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 600; font-size: 14px; margin: 4px 0 10px; }

.resumen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.resumen-grid div { background: var(--bg); border-radius: 12px; padding: 10px 8px; text-align: center; }
.resumen-grid b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.resumen-grid span { font-size: 11.5px; color: var(--ink-3); }
.vq { padding: 12px 16px; margin: 0 0 10px; }
.vq-open { color: var(--ok); font-weight: 600; }
.fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.foto { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--ink-3); border: 1px dashed var(--line); cursor: pointer; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto.add { border-style: dashed; }
.visor { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; }
.visor img { max-width: 100%; max-height: 80vh; border-radius: 10px; }
.visor .btn { color: #fff; background: rgba(255,255,255,.15); }

.pa-hint { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--info-bg); color: var(--accent); font-size: 13.5px; }
.pa-hint b { font-family: var(--font-display); }

.recorte { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.recorte:first-of-type { border-top: 0; }
.recorte .num { white-space: nowrap; }
.vq .stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.vq .stat > span:last-child { text-align: right; white-space: nowrap; }

/* ─── Misc ───────────────────────────────────────────────── */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 6px; }
.section-title h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.stat:first-child { border-top: 0; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.prio { display: inline-flex; gap: 6px; }
.prio button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.prio button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wait { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-align: right; min-width: 44px; letter-spacing: -0.02em; }
.wait.closed { color: var(--ink-3); font-size: 13px; font-family: var(--font-ui); }
.order-btns { display: inline-flex; gap: 4px; }
.order-btns button { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
kbd { font-family: inherit; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
