@font-face { font-family: 'Barlow'; src: url('fonts/barlow-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('fonts/barlow-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('fonts/barlow-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('fonts/barlow-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #EEF1F0;
  --surface: #FFFFFF;
  --ink: #17202B;
  --ink-2: #566170;
  --ink-3: #8A94A1;
  --rule: #D8DEE3;
  --torii: #D23F2A;
  --torii-ink: #FFFFFF;
  --jade: #16855A;
  --indigo: #4654B0;
  --sky: #2B6CB0;
  --warn: #B4581A;
  --kanto: #16855A;
  --kansai: #4654B0;
  --airport: #2B6CB0;
  --shadow: 0 1px 0 rgba(23, 32, 43, .06), 0 8px 24px -12px rgba(23, 32, 43, .25);
  --sans: 'Barlow', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', system-ui, -apple-system, sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', 'Hiragino Sans', system-ui, sans-serif;
  --jp: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --tab-h: 64px;
  --top-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1318;
    --surface: #171E26;
    --ink: #E8ECF0;
    --ink-2: #A3AEBB;
    --ink-3: #6E7A88;
    --rule: #28323D;
    --torii: #E5553E;
    --jade: #2FA874;
    --indigo: #7783DA;
    --sky: #5B98DA;
    --warn: #E08A4C;
    --kanto: #2FA874;
    --kansai: #7783DA;
    --airport: #5B98DA;
    --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sky); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }
.jp { font-family: var(--jp); }
.num { font-family: var(--cond); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--paper);
}
.topbar-in {
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-family: var(--cond); font-size: 24px; font-weight: 700; letter-spacing: .01em; }
.brand span { font-family: var(--jp); font-size: 13px; color: var(--ink-2); }
@media (max-width: 370px) { .brand span { display: none; } }
.sync {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2);
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 999px; padding: 5px 11px;
}
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.sync.ok i { background: var(--jade); }
.sync.off i { background: var(--warn); }
.sync.busy i { background: var(--sky); animation: pulse 1s infinite alternate; }
.sync.err i { background: var(--torii); }
@keyframes pulse { to { opacity: .3; } }

main { padding: 4px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); max-width: 680px; margin: 0 auto; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--rule);
}
.tabbar-in { height: var(--tab-h); max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab {
  background: none; border: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-3);
}
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); }
.tab-add { position: relative; }
.tab-add .plus {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--torii); color: var(--torii-ink);
  display: grid; place-items: center; margin-top: -22px;
  box-shadow: 0 6px 18px -6px rgba(210, 63, 42, .7);
}
.tab-add .plus svg { width: 26px; height: 26px; stroke-width: 2.4; }
.tab-add span { color: var(--ink-2); }

/* ---------- route strip (días como estaciones) ---------- */
.route { margin: 8px -4px 16px; overflow-x: auto; scrollbar-width: none; }
.route::-webkit-scrollbar { display: none; }
.route-in { display: grid; grid-template-columns: repeat(7, minmax(46px, 1fr)); position: relative; padding: 0 4px; }
.route-line { position: absolute; top: 15px; left: calc(4px + 100% / 14); right: calc(4px + 100% / 14); height: 6px; display: flex; border-radius: 3px; overflow: hidden; }
.route-line b { flex: 1; }
.stop-btn {
  position: relative; background: none; border: 0; padding: 4px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.stop-btn .dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--c);
  transition: transform .15s;
}
.stop-btn .lbl { font-size: 12px; line-height: 1.15; color: var(--ink-2); text-align: center; }
.stop-btn .lbl b { display: block; font-family: var(--cond); font-size: 18px; font-weight: 600; color: var(--ink); }
.stop-btn[aria-pressed="true"] .dot { background: var(--c); transform: scale(1.12); }
.stop-btn.today .dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--torii); }
.stop-btn.past .lbl { color: var(--ink-3); }

/* ---------- letrero de estación ---------- */
.eki {
  background: var(--surface); border-radius: 6px; overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.eki-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 14px 0; }
.eki-badge {
  border: 3px solid var(--line); border-radius: 6px; min-width: 46px; text-align: center;
  font-family: var(--cond); line-height: 1; padding: 3px 4px 4px; background: var(--surface);
}
.eki-badge small { display: block; font-size: 11px; font-weight: 600; color: var(--line); letter-spacing: .02em; }
.eki-badge b { font-size: 24px; font-weight: 700; }
.eki-when { text-align: right; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.eki-when b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.eki-name { font-family: var(--jp); font-weight: 700; font-size: 46px; line-height: 1.05; text-align: center; letter-spacing: .12em; margin: 2px 0 2px; }
.eki-romaji { font-family: var(--cond); font-weight: 600; font-size: 22px; text-align: center; letter-spacing: .04em; margin-bottom: 12px; }
.eki-band {
  background: var(--line); color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font-size: 13.5px; font-weight: 600; min-height: 40px;
}
.eki-band button { background: none; border: 0; color: inherit; padding: 9px 12px; display: flex; align-items: center; gap: 6px; min-height: 40px; }
.eki-band .prev { justify-content: flex-start; }
.eki-band .next { justify-content: flex-end; }
.eki-band .mid { font-family: var(--cond); font-size: 15px; padding: 0 6px; opacity: .9; }
.eki-band .jpn { font-family: var(--jp); font-weight: 600; }
.eki-band [disabled] { opacity: .35; }

.countdown { background: var(--ink); color: var(--paper); border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.countdown .num { font-size: 40px; font-weight: 700; line-height: 1; }

.day-meta { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 8px; font-size: 14px; color: var(--ink-2); }
.day-meta button { background: none; border: 0; color: var(--sky); font-weight: 600; padding: 6px 0; }

/* ---------- timeline ---------- */
.tl { list-style: none; padding: 0; margin: 0 0 12px; }
.tl li { display: grid; grid-template-columns: 52px 18px 1fr; column-gap: 8px; position: relative; }
.tl .t { font-family: var(--cond); font-weight: 600; font-size: 18px; padding-top: 1px; text-align: right; color: var(--ink); }
.tl .t.none { color: var(--ink-3); font-size: 15px; }
.tl .rail { position: relative; display: flex; justify-content: center; }
.tl .rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.tl li:first-child .rail::before { top: 9px; }
.tl li:last-child .rail::before { bottom: calc(100% - 12px); }
.tl .rail i { position: relative; margin-top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--k); border: 3px solid var(--paper); box-sizing: content-box; }
.tl li.idea .rail i { background: var(--paper); border: 2px dashed var(--k); width: 12px; height: 12px; }
.tl li.done .rail i { background: var(--ink-3); }
.tl .body { padding-bottom: 18px; min-width: 0; }
.tl .title { font-weight: 600; font-size: 17px; line-height: 1.25; }
.tl li.done .title { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-2); }
.tl .place { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.tl .notes { font-size: 14.5px; margin-top: 6px; color: var(--ink); }
.tl li.done .notes { display: none; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--rule); color: var(--ink-2); vertical-align: 2px; margin-left: 6px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.act {
  border: 1px solid var(--rule); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 34px;
}
.act svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act.go { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.act.icon { padding: 6px 9px; }

/* ---------- secciones ---------- */
.sec { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec h2 { font-family: var(--cond); font-weight: 700; font-size: 24px; margin: 0; letter-spacing: .005em; }
.sec .aside { font-size: 14px; color: var(--ink-2); }
.sec button { background: none; border: 0; color: var(--sky); font-weight: 600; font-size: 14.5px; padding: 4px 0; }
.panel { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }
.pad { padding: 14px; }

/* ---------- gastos ---------- */
.total { padding: 16px 16px 14px; }
.total .big { font-family: var(--cond); font-weight: 700; font-size: 52px; line-height: .95; letter-spacing: -.005em; }
.total .big small { font-size: 28px; font-weight: 600; margin-right: 2px; }
.total .mxn { font-size: 17px; color: var(--ink-2); margin-top: 4px; }
.budget { margin-top: 14px; }
.budget .track { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.budget .fill { height: 100%; background: var(--jade); border-radius: 4px; }
.budget .fill.warn { background: var(--warn); }
.budget .fill.over { background: var(--torii); }
.budget .row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.wallets { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.wallet { padding: 12px 10px 12px 14px; border-left: 1px solid var(--rule); min-width: 0; }
.wallet:first-child { border-left: 0; }
.wallet .lab { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.wallet .lab i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.wallet .amt { font-family: var(--cond); font-weight: 600; font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet .amt.neg { color: var(--torii); }
.wallet .sub { font-size: 12px; color: var(--ink-3); }
.wallet-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.wallet-actions .act { flex: 1; justify-content: center; }

.seg { display: inline-flex; background: var(--rule); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.bars { list-style: none; margin: 0; padding: 4px 14px 10px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.bars li:last-child { border-bottom: 0; }
.bars .name { font-size: 15px; font-weight: 500; }
.bars .val { font-family: var(--cond); font-weight: 600; font-size: 17px; text-align: right; }
.bars .val small { font-family: var(--sans); font-weight: 400; font-size: 12.5px; color: var(--ink-2); margin-left: 6px; }
.bars .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.bars .track b { display: block; height: 100%; background: var(--c); border-radius: 3px; }

.list { list-style: none; margin: 0; padding: 0; }
.dayhead { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); padding: 14px 2px 6px; font-weight: 600; }
.row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; background: var(--surface); border: 0; width: 100%; text-align: left;
  border-bottom: 1px solid var(--rule);
}
.list .row:first-of-type { border-radius: 10px 10px 0 0; }
.list .row:last-of-type { border-radius: 0 0 10px 10px; border-bottom: 0; }
.list .row:only-of-type { border-radius: 10px; }
.row .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 19px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.row .what { min-width: 0; }
.row .what b { display: block; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .what span { font-size: 13px; color: var(--ink-2); }
.row .how { text-align: right; }
.row .how b { display: block; font-family: var(--cond); font-weight: 600; font-size: 19px; }
.row .how span { font-size: 12.5px; color: var(--ink-2); }
.row.move .how b { color: var(--jade); }
.empty { text-align: center; padding: 26px 18px; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; font-size: 14.5px; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
}
.chip[aria-pressed="true"] { border-color: var(--c, var(--ink)); background: var(--c, var(--ink)); color: #fff; }
.chip .e { font-size: 16px; }

/* ---------- recomendaciones ---------- */
.rec { padding: 14px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.rec:first-child { border-radius: 10px 10px 0 0; }
.rec:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; }
.rec:only-child { border-radius: 10px; }
.rec-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.rec-head h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; }
.rec-head .ja { font-family: var(--jp); font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.price { text-align: right; flex: none; }
.price b { display: inline-block; font-family: var(--cond); font-weight: 600; font-size: 17px; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 7px; }
.price.free b { border-color: var(--jade); color: var(--jade); }
.price span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.rec .meta { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.rec p { margin: 6px 0 0; font-size: 14.5px; }

/* ---------- info ---------- */
.call { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.call:last-child { border-bottom: 0; }
.call b { display: block; font-weight: 600; }
.call span { font-size: 13px; color: var(--ink-2); }
.call .n { font-family: var(--cond); font-weight: 700; font-size: 22px; color: var(--torii); white-space: nowrap; }
.call.small-n .n { font-size: 18px; }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--rule); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.phrase:last-child { border-bottom: 0; }
.phrase .es { font-weight: 600; font-size: 15px; }
.phrase .jp { font-size: 17px; margin-top: 2px; }
.phrase .ro { font-size: 13px; color: var(--ink-2); }
.phrase .zoom { color: var(--ink-3); align-self: center; }
.taxi { padding: 14px; border-bottom: 1px solid var(--rule); }
.taxi:last-child { border-bottom: 0; }
.taxi b { font-weight: 600; display: block; }
.taxi .jp { font-size: 16px; white-space: pre-line; margin: 6px 0 10px; }
.taxi .missing { color: var(--warn); font-size: 14px; margin: 6px 0 10px; }
.guide { padding: 14px; border-bottom: 1px solid var(--rule); }
.guide:last-child { border-bottom: 0; }
.guide h3 { margin: 0 0 6px; font-size: 16.5px; }
.guide ul { margin: 0; padding-left: 18px; }
.guide li { font-size: 14.5px; margin: 5px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--rule); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font-size: 15px; }
.check:last-child { border-bottom: 0; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink-3); flex: none; display: grid; place-items: center; margin-top: 1px; }
.check.on .box { background: var(--jade); border-color: var(--jade); }
.check.on .box::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.on span { color: var(--ink-2); text-decoration: line-through; }

/* ---------- formularios ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; border: 1.5px solid var(--rule); background: var(--surface); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; color: var(--ink);
}
.input:focus { border-color: var(--sky); outline: none; }
textarea.input { min-height: 72px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amount { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; border-bottom: 2px solid var(--ink); padding: 4px 0 6px; margin-bottom: 6px; }
.amount .cur { font-family: var(--cond); font-weight: 700; font-size: 36px; }
.amount input { border: 0; background: none; font-family: var(--cond); font-weight: 700; font-size: 48px; width: 100%; padding: 0; outline: none; color: var(--ink); }
.amount .swap { border: 1.5px solid var(--rule); background: var(--surface); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 14px; }
.conv { font-size: 14.5px; color: var(--ink-2); min-height: 21px; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; font-size: 16.5px;
  background: var(--torii); color: var(--torii-ink); width: 100%; min-height: 52px;
}
.btn.secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--rule); }
.btn.danger { background: none; color: var(--torii); border: 1.5px solid var(--rule); }
.btn:disabled { opacity: .5; }
.btns { display: grid; gap: 10px; margin-top: 6px; }
.btns.two { grid-template-columns: 1fr 1fr; }
.hint { font-size: 13.5px; color: var(--ink-2); margin: -6px 0 14px; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 60; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--paper); border-radius: 18px 18px 0 0;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  max-width: 680px; margin: 0 auto;
}
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 26px; }
.sheet-head button { background: none; border: 0; font-weight: 600; color: var(--ink-2); padding: 8px 0 8px 12px; }
@media (prefers-reduced-motion: reduce) { .sheet, .backdrop, .stop-btn .dot { transition: none; } .sync.busy i { animation: none; } }

.bigtext { position: fixed; inset: 0; z-index: 80; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.bigtext .jp { font-size: clamp(30px, 9vw, 52px); font-weight: 700; line-height: 1.35; white-space: pre-line; word-break: keep-all; }
.bigtext .sub { margin-top: 18px; color: var(--ink-2); font-size: 16px; }
.bigtext .close { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 16px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 70;
  max-width: 520px; margin: 0 auto;
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px 14px; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--paper); font-weight: 700; text-decoration: underline; padding: 4px; }

.banner { border: 1.5px dashed var(--warn); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; font-size: 14.5px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner button { background: none; border: 0; color: var(--sky); font-weight: 700; white-space: nowrap; }

/* ---------- top actions ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.gear { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.gear svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- documentos ---------- */
.lockcard { text-align: left; }
.lockcard .lock-ico { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.lockcard h2 { font-family: var(--cond); font-weight: 700; font-size: 24px; margin: 0 0 6px; }
.lockcard p { margin: 0 0 14px; font-size: 14.5px; }
.remember { display: flex; gap: 10px; align-items: center; font-size: 15px; margin: -2px 0 6px; }
.remember input { width: 20px; height: 20px; accent-color: var(--jade); }
.linkbtn { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--ink-2); font-size: 14px; text-decoration: underline; padding: 6px; text-align: center; }

.doclist { background: var(--surface); border-radius: 10px; overflow: hidden; }
.doc { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding-right: 10px; border-bottom: 1px solid var(--rule); }
.doc:last-child { border-bottom: 0; }
.doc-main { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; background: none; border: 0; text-align: left; padding: 10px 0 10px 12px; min-width: 0; }
.doc-main .what { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.doc-main .what b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-main .what > span { font-size: 13px; color: var(--ink-2); }
.doc-main .dnote { color: var(--ink) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dstat { font-size: 12px !important; color: var(--sky) !important; }
.dstat.warn { color: var(--warn) !important; }
.dthumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid var(--rule); flex: none; }
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dthumb.icon { font-size: 26px; }
.docpick { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; margin-bottom: 16px; }
.docpick.picker { border: 2px dashed var(--rule); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); }
.docpick.picker b { font-size: 16px; }
.daydocs { margin: -4px 0 12px; }
.daydocs.chips.scroll { margin: -4px -16px 12px; }
.daydocs .chip { background: var(--surface); }

.viewer { position: fixed; inset: 0; z-index: 90; background: var(--surface); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
.vbar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.vbar b { text-align: center; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vnotes { padding: 12px 16px; font-size: 17px; font-weight: 600; white-space: pre-line; border-bottom: 1px solid var(--rule); user-select: text; -webkit-user-select: text; }
.vbody { padding: 10px 0 24px; max-width: 900px; margin: 0 auto; background: var(--paper); min-height: 60vh; }
.vbody img, .vbody canvas { display: block; width: 100%; height: auto; margin: 0 auto 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }

/* ---------- mapa ---------- */
#mapWrap { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + var(--top-h)); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 10; }
#map { position: absolute; inset: 0; background: var(--paper); }
.map-ui { position: absolute; left: 0; right: 0; top: 8px; z-index: 500; pointer-events: none; }
.map-ui .chips { pointer-events: auto; }
.map-ui .chip { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.map-day { margin-top: 8px; padding: 0 16px; pointer-events: auto; }
.map-day select { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14.5px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.locate { position: absolute; right: 14px; bottom: 18px; z-index: 500; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.25); display: grid; place-items: center; }
.locate svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.map-note { position: absolute; left: 14px; bottom: 18px; right: 74px; z-index: 500; background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 8px 11px; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; }
.pin span { transform: rotate(45deg); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 15px; }
.rdot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--c); display: grid; place-items: center; font-size: 13px; box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.me { width: 18px; height: 18px; border-radius: 50%; background: #2B7BF0; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(43,123,240,.25); }
.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--surface); color: var(--ink); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--sans); font-size: 14.5px; line-height: 1.4; min-width: 200px; }
.leaflet-popup-content h4 { margin: 0; font-size: 16px; }
.leaflet-popup-content .ja { font-family: var(--jp); color: var(--ink-2); font-size: 13px; }
.leaflet-popup-content .acts { margin-top: 10px; }
.leaflet-container a.act.go { color: var(--paper); }
.leaflet-container a.act { color: var(--ink); }
.leaflet-container { font-family: var(--sans); }
@media (prefers-color-scheme: dark) { .leaflet-tile-pane { filter: brightness(.82) contrast(1.05) saturate(.85); } }

/* ---------- escáner ---------- */
.scanner { position: fixed; inset: 0; z-index: 95; background: #0B0F14; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); user-select: none; -webkit-user-select: none; }
.sc-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px; min-height: 52px; }
.sc-top > :first-child { justify-self: start; }
.sc-top > :last-child { justify-self: end; }
.sc-top b { font-size: 16px; font-weight: 600; text-align: center; }
.sc-pg { font-family: var(--cond); font-size: 16px; color: #B8C2CC; }
.sc-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.sc-wait { color: #B8C2CC; font-size: 16px; }
.sc-box { position: relative; }
.sc-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-poly { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sc-poly polygon { fill: rgba(43, 156, 255, .16); stroke: #2B9CFF; stroke-width: 2.5; stroke-linejoin: round; }
.sc-h { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 0; padding: 0; background: transparent; touch-action: none; cursor: grab; }
.sc-h::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: rgba(255,255,255,.9); border: 3px solid #2B9CFF; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.sc-h.on::after { inset: 6px; background: rgba(43,156,255,.35); }
.sc-loupe { position: absolute; width: 116px; height: 116px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.6); pointer-events: none; z-index: 3; }
.sc-result { display: grid; place-items: center; }
.sc-result canvas { box-shadow: 0 4px 24px rgba(0,0,0,.6); background: #fff; }
.sc-filters { display: flex; gap: 8px; justify-content: center; padding: 10px 12px 4px; flex-wrap: wrap; }
.sc-chip { border: 1.5px solid #3A4552; background: #18202A; color: #E8ECF0; border-radius: 999px; padding: 8px 14px; font-size: 14.5px; font-weight: 600; min-height: 38px; }
.sc-chip[aria-pressed="true"] { background: #fff; color: #0B0F14; border-color: #fff; }
.sc-bar { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding: 10px 12px 12px; }
.sc-btn { border: 1.5px solid #3A4552; background: #18202A; color: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 15px; min-height: 46px; }
.sc-top .sc-btn { min-height: 38px; padding: 6px 12px; border-radius: 999px; }
.sc-btn.sc-main { background: var(--torii); border-color: var(--torii); }
.docpick-acts { display: flex; gap: 8px; margin: -6px 0 16px; flex-wrap: wrap; }
