/* NRUTA — estilos del prototipo
   Lenguaje visual: negro y blanco, grises neutros, tipografía grande y directa.
   Un solo acento de color para foco (azul) y colores de estado (vigente, por vencer, vencido). */

:root {
  --black: #000;
  --white: #fff;
  --g50: #F6F6F6;
  --g100: #EEEEEE;
  --g200: #E2E2E2;
  --g300: #CBCBCB;
  --g400: #AFAFAF;
  --g500: #6B6B6B;
  --g600: #545454;
  --g700: #333333;
  --blue: #276EF1;
  --ok: #03703C;
  --ok-bg: #E6F2ED;
  --bad: #C41A0C;
  --bad-dot: #E11900;
  --bad-bg: #FFEFED;
  --warn: #7A5800;
  --warn-bg: #FFF2D9;
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --pad: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: #fff; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .3; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.ic { width: 24px; height: 24px; flex: none; }
.muted { color: var(--g500); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic.inline { width: 16px; height: 16px; vertical-align: -2px; color: var(--g500); }
.mt-l { margin-top: 26px; }
.mt-s { margin-top: 8px; }
.sub-h { font-size: 14px; font-weight: 600; color: var(--g500); margin-top: 18px; }
.small { font-size: 13px; }
.mt { margin-top: 16px; }

/* ---------- Estructura ---------- */
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: #fff; position: relative; }
#view { padding: 4px var(--pad) calc(104px + env(safe-area-inset-bottom)); }

h1 { font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 18px; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 56px; margin: 0 -10px; }
.page-title { margin-top: 4px; }
.lead { font-size: 16px; color: var(--g600); margin-top: 8px; max-width: 34em; }

.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--g100); font-weight: 700; font-size: 15px; flex: none; }
.avatar.lg { width: 68px; height: 68px; font-size: 24px; }

/* ---------- Barra de registro (inicio) ---------- */
.where {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 58px;
  padding: 0 20px; border-radius: 999px; background: var(--g100);
  font-size: 18px; font-weight: 600; letter-spacing: -.01em;
}
.where-txt { flex: 1; text-align: left; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; font-stretch: 88%; text-align: center; min-width: 0; }
.tile-ic { display: grid; place-items: center; width: 100%; aspect-ratio: 5 / 4; border-radius: 12px; background: var(--g100); }
.tile-ic .ic { width: 30px; height: 30px; stroke-width: 1.8; }
.tile:active .tile-ic { background: var(--g200); }

/* ---------- Resumen del mes ---------- */
.hero { margin-top: 26px; background: #000; color: #fff; border-radius: 16px; padding: 20px 20px 18px; }
.hero-lbl { font-size: 15px; color: var(--g300); font-weight: 500; }
.hero-num { font-size: 46px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 15px; color: var(--g300); margin-top: 6px; }
.meter { height: 6px; border-radius: 3px; background: var(--g700); margin: 18px 0 14px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #fff; border-radius: 3px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-grid dt { font-size: 13px; color: var(--g400); }
.hero-grid dd { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- Secciones ---------- */
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pill-link {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--g100); font-size: 14px; font-weight: 600; flex: none;
}
.text-link { font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.text-link.danger { color: var(--bad); }

.big { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure { margin-top: 20px; }
.figure .big { margin-top: 2px; }
.note { font-size: 13px; color: var(--g500); margin-top: 22px; line-height: 1.45; }

/* ---------- Filas ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 66px;
  padding: 10px 0; text-align: left;
}
.list > .row + .row, .menu > .row + .row { border-top: 1px solid var(--g100); }
.row-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--g100); flex: none; }
.row-ic .ic { width: 22px; height: 22px; }
.row-ic.sq { border-radius: 10px; background: #000; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.row-ic.sq.lg { width: 68px; height: 68px; border-radius: 16px; font-size: 24px; }
.row-ic.plain { background: none; width: 28px; justify-items: start; }
.row-ic.done { background: #000; color: #fff; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.row-sub { font-size: 14px; color: var(--g500); line-height: 1.3; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; text-align: right; }
.row > .ic.muted { color: var(--g400); }
.row.danger, .row.danger .row-ic { color: var(--bad); }
.amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { font-size: 12px; color: var(--g500); }

.datebox {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 48px; height: 52px; border-radius: 10px; background: var(--g100); flex: none; line-height: 1;
}
.datebox b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.datebox small { font-size: 12px; margin-top: 4px; color: var(--g600); }
.datebox.bad { background: var(--bad-bg); color: var(--bad); }
.datebox.warn { background: var(--warn-bg); color: var(--warn); }
.datebox.bad small, .datebox.warn small { color: inherit; }
.datebox.ok { background: var(--ok-bg); color: var(--ok); }
.datebox.ok small { color: inherit; }

.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--g100); color: var(--g600);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: var(--g50); border-radius: 12px; padding: 12px 10px; min-width: 0; }
.stat span { display: block; font-size: 13px; color: var(--g500); }
.stat b { display: block; font-size: 17px; font-weight: 700; font-stretch: 80%; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { padding: 26px 20px; text-align: center; background: var(--g50); border-radius: 16px; margin-top: 10px; }
.empty p { color: var(--g600); max-width: 28em; margin: 0 auto; }
.empty .btn { margin-top: 14px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 10px; font-size: 17px; font-weight: 600;
}
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: #000; color: #fff; }
.btn-primary:active { background: var(--g700); }
.btn-secondary { background: var(--g100); }
.btn-secondary:active { background: var(--g200); }
.btn-danger { background: var(--bad-dot); color: #fff; }
.btn-text { background: none; }
.btn-text-danger { background: none; color: var(--bad); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 999px; }
.btn-round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #000; color: #fff; flex: none; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.icon-btn:active { background: var(--g100); }
.text-btn { height: 44px; padding: 0 12px; font-weight: 600; font-size: 16px; border-radius: 999px; }
.text-btn:active { background: var(--g100); }

/* ---------- Segmentos y filtros ---------- */
.seg, .chips-row {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad);
}
.seg::-webkit-scrollbar, .chips-row::-webkit-scrollbar { display: none; }
.seg button, .chip-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 16px;
  border-radius: 999px; background: var(--g100); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.chip-btn .ic { width: 18px; height: 18px; }
.seg button.on, .chip-btn.on { background: #000; color: #fff; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px -10px 0; }
.month-nav b { font-size: 17px; }

/* ---------- Gastos por categoría ---------- */
.cbars { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.cbar { display: flex; align-items: center; gap: 12px; }
.cbar-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--g100); flex: none; }
.cbar-ic .ic { width: 20px; height: 20px; }
.cbar-ic.sq { border-radius: 10px; background: #000; color: #fff; font-weight: 700; font-size: 13px; }
.cbar-main { flex: 1; min-width: 0; }
.cbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.cbar-top b { font-variant-numeric: tabular-nums; }
.cbar-track { display: block; height: 6px; background: var(--g100); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.cbar-track i { display: block; height: 100%; background: #000; border-radius: 3px; }
.day-head { font-size: 14px; font-weight: 600; color: var(--g500); margin: 20px 0 0; }

/* ---------- Patente chilena ---------- */
.plate {
  display: inline-flex; flex-direction: column; align-items: center; flex: none;
  background: #fff; color: #000; border: 2px solid #000; border-radius: 6px;
  padding: 2px 10px 3px; line-height: 1;
}
.plate small { font-size: 7px; font-weight: 700; letter-spacing: .38em; margin: 1px 0 1px .38em; }
.plate b { font-size: 23px; font-weight: 800; font-stretch: 70%; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.plate.lg { border-width: 3px; border-radius: 10px; padding: 5px 20px 7px; }
.plate.lg small { font-size: 11px; margin-bottom: 2px; }
.plate.lg b { font-size: 50px; }

/* ---------- Flota ---------- */
.veh-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.veh-card { display: block; border: 1px solid var(--g200); border-radius: 16px; padding: 16px; }
.veh-card:active { background: var(--g50); }
.veh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.veh-name { display: block; font-size: 20px; font-weight: 700; margin-top: 14px; letter-spacing: -.01em; }
.veh-sub { display: block; color: var(--g500); margin-top: 2px; font-size: 15px; }
.veh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 14px; color: var(--g600); }
.veh-meta span { display: inline-flex; align-items: center; gap: 6px; }
.veh-meta .ic { width: 18px; height: 18px; }
.veh-hero, .emp-hero { text-align: center; padding: 6px 0 4px; }
.veh-foto { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; margin-bottom: 18px; }
.veh-hero h1, .emp-hero h1 { font-size: 30px; margin-top: 16px; }
.veh-hero p, .emp-hero p { margin-top: 6px; }
.emp-hero .row-ic { margin: 0 auto; }
.tabs-gap { margin-top: 24px; }
.missing { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--warn-bg); }
.missing p { color: var(--warn); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.missing .chip-btn { background: #fff; }
.bill { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--g50); border: 1px solid var(--g200); }
.bill b { font-size: 16px; }
.bill p { color: var(--g600); font-size: 14px; margin-top: 2px; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.btn-pair .btn { padding: 0 10px; font-size: 16px; }
.emp-hero .avatar { margin: 0 auto; }

/* ---------- Agenda ---------- */
.cal { margin-top: 18px; border: 1px solid var(--g200); border-radius: 16px; padding: 6px 8px 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; margin-top: 2px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--g500); padding: 4px 0; }
.cal-day { position: relative; display: grid; place-items: center; height: 46px; }
.cal-day span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-day.today span { box-shadow: inset 0 0 0 2px #000; font-weight: 700; }
.cal-day.sel span { background: #000; color: #fff; }
.cal-day .dot { position: absolute; bottom: 0; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #000; }
.cal-day .dot.late { background: var(--bad-dot); }
.cal-day .dot.done { background: var(--g300); }

/* ---------- Cuenta ---------- */
.acct { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 20px; }
.acct h1 { font-size: 30px; }
.acct p { margin-top: 4px; }
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile3 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 94px; border-radius: 12px; background: var(--g100); font-size: 15px; font-weight: 600; }
.tile3:active { background: var(--g200); }
.promo { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 20px; padding: 18px; border-radius: 16px; background: var(--g50); border: 1px solid var(--g200); }
.promo b { font-size: 17px; }
.promo p { color: var(--g600); font-size: 15px; margin-top: 4px; }
.menu { margin-top: 18px; display: flex; flex-direction: column; }
.menu .row { min-height: 60px; }

/* ---------- Hoja inferior ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 92dvh; background: #fff;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet:focus { outline: none; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--g300); margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 6px 16px; flex: none; }
.sheet-head h2 { font-size: 24px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 0; }
.sheet-actions {
  position: sticky; bottom: 0; display: grid; gap: 6px; width: 100%;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: #fff; margin-top: 6px;
}

.ev-date { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.ev .muted { margin-top: 2px; }
.ev .pill { margin-top: 12px; }
.kv { margin-top: 14px; border-top: 1px solid var(--g100); }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--g100); font-size: 15px; }
.kv dt { color: var(--g600); }
.kv dd { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.kv .total dt { color: #000; font-weight: 700; }
.kv .total dd { font-weight: 700; font-size: 18px; }
.done-line { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; margin-bottom: 6px; }
.done-line .ic { width: 20px; height: 20px; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-wrap: wrap; column-gap: 12px; }
.field { width: 100%; margin-bottom: 18px; min-width: 0; }
.field.half { width: calc(50% - 6px); }
.field.third { width: calc((100% - 24px) / 3); }
.out { margin-top: -4px; }
.vol { font-size: 15px; }
.vol b { font-size: 22px; letter-spacing: -.01em; }
.lbl { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.input {
  display: block; width: 100%; height: 52px; padding: 0 14px; border-radius: 8px;
  border: 2px solid transparent; background: var(--g100); font-size: 17px;
  -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: #000; background: #fff; }
.input::placeholder, .money input::placeholder { color: var(--g400); }
select.input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
input[type=date].input { line-height: 48px; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
input[type=date].input::-webkit-date-and-time-value { text-align: left; }
.money { display: flex; align-items: center; height: 52px; border-radius: 8px; border: 2px solid transparent; background: var(--g100); }
.money:focus-within { border-color: #000; background: #fff; }
.money span { padding-left: 14px; font-size: 17px; font-weight: 600; }
.money input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; padding: 0 14px 0 4px; font-size: 17px; outline: none; font-variant-numeric: tabular-nums; }
.money.xl { height: 74px; }
.money.xl span, .money.xl input { font-size: 38px; font-weight: 700; letter-spacing: -.02em; }
.hint { display: block; font-size: 13px; color: var(--g500); margin-top: 6px; line-height: 1.4; }
.hint:empty, .err:empty { display: none; }
.err { display: block; font-size: 13px; color: var(--bad); margin-top: 6px; font-weight: 600; }
.field.has-err .input, .field.has-err .money { border-color: var(--bad-dot); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--g100); font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip span .ic { width: 18px; height: 18px; }
.chip input:checked + span { background: #000; color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.segf { display: flex; background: var(--g100); border-radius: 10px; padding: 4px; gap: 4px; }
.segf .chip { flex: 1; }
.segf .chip span { width: 100%; justify-content: center; background: none; border-radius: 8px; height: 40px; padding: 0 8px; }
.segf .chip input:checked + span { background: #000; color: #fff; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; padding: 2px 0; }
.toggle b { display: block; font-size: 16px; font-weight: 600; }
.toggle small { display: block; font-size: 13px; color: var(--g500); margin-top: 2px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--g300); transition: background .15s; }
.toggle i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.toggle input:checked + i { background: #000; }
.toggle input:checked + i::after { transform: translateX(20px); }
.toggle input:focus-visible + i { outline: 3px solid var(--blue); outline-offset: 2px; }

.file-box { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px dashed var(--g300); border-radius: 12px; cursor: pointer; }
.file-box input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-box:focus-within { border-color: #000; }
.file-prev img { display: block; max-width: 100%; max-height: 240px; margin-top: 10px; border-radius: 8px; border: 1px solid var(--g200); }
.file-actions { display: flex; gap: 18px; margin-top: 8px; }
.file-actions:empty { display: none; }

/* ---------- Barra de pestañas ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--g100);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
#tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 11.5px; font-weight: 600; color: var(--g500); }
#tabbar a.on { color: #000; }
#tabbar a.on .ic { stroke-width: 2.4; }
.badge { position: absolute; top: 2px; left: calc(50% + 7px); width: 10px; height: 10px; border-radius: 50%; background: var(--bad-dot); border: 2px solid #fff; }

/* ---------- Aviso breve ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 16px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: #000; color: #fff; font-size: 15px; font-weight: 600; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Escritorio: la app se muestra como teléfono ---------- */
@media (min-width: 560px) {
  html, body { background: var(--g100); }
  #app { box-shadow: 0 0 0 1px var(--g200); }
}

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

/* ---------- Resumen de rutas ---------- */
.doc-head { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; font-size: 14px; color: var(--g600); }
.doc-head b { font-size: 16px; color: #000; }
.doc-title { margin-top: 14px; font-size: 30px; }
.res-list { display: flex; flex-direction: column; }
.res-item { padding: 12px 0; border-top: 1px solid var(--g100); }
.res-item p { margin-top: 2px; }
.res-top { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.res-table { display: none; }
.share-bar {
  position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; background: #fff;
}
.share-bar .btn { padding: 0 8px; font-size: 15px; }

/* ---------- Plan ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.plan { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border: 1px solid var(--g200); border-radius: 16px; }
.plan.best { border: 2px solid #000; }
.plan .pill { align-self: flex-start; margin-bottom: 4px; }
.plan .big { font-size: 28px; margin-top: 6px; }
.plan .btn { margin-top: 12px; height: 46px; font-size: 15px; }

/* ---------- Ayuda ---------- */
.faq details { border-top: 1px solid var(--g100); }
.faq details:last-child { border-bottom: 1px solid var(--g100); }
.faq summary { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--g500); }
.faq details[open] summary::after { content: "−"; }
.faq p { padding: 0 0 16px; color: var(--g600); line-height: 1.5; max-width: 60ch; }

/* ---------- Impresión (PDF del resumen) ---------- */
@media print {
  html, body { background: #fff; }
  #tabbar, #toast, #sheet-root, .no-print { display: none !important; }
  #app { max-width: none; box-shadow: none; }
  #view { padding: 0; }
  .doc { font-size: 11px; }
  .doc .stats { display: none; }
  .res-list { display: none; }
  .res-table { display: table; width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 10px; }
  .res-table th, .res-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid #ccc; vertical-align: top; }
  .res-table th { font-weight: 700; border-bottom: 2px solid #000; }
  .kv div { padding: 6px 0; }
  @page { margin: 14mm; }
}
