/* ==========================================================================
   Trucks To Go — sistema de diseño de la app (2.0)
   Tipografía: Geist + Geist Mono (locales). Iconos: Phosphor (core).
   Un solo acento (verde «go»), superficies neutras, claro y oscuro.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --bg: #f3f4f2;
  --surface: #ffffff;
  --surface-2: #f6f7f5;
  --surface-3: #eceeeb;
  --line: #e4e7e2;
  --line-strong: #d3d8d1;

  --text: #0d1512;
  --text-2: #56605b;
  --text-3: #8a938e;

  --brand: #0a8757;
  --brand-press: #08724a;
  --on-brand: #ffffff;
  --brand-tint: #e3f4ec;
  --brand-ink: #076541;

  --ink: #0d1512;
  --on-ink: #ffffff;

  --amber-tint: #fdf1d7;
  --amber-ink: #8a5300;
  --red: #c7321d;
  --red-tint: #fce9e5;
  --red-ink: #a52413;
  --blue-tint: #e6effd;
  --blue-ink: #1a4fb0;
  --violet-tint: #eeeafc;
  --violet-ink: #5437b8;
  --gray-tint: #eceeeb;
  --gray-ink: #56605b;
  --star: #e2a100;

  --bar: rgba(255, 255, 255, 0.94);
  --scrim: rgba(9, 14, 12, 0.48);
  --shadow-sheet: 0 -12px 40px rgba(9, 14, 12, 0.16);
  --shadow-float: 0 6px 24px rgba(9, 14, 12, 0.12), 0 1px 3px rgba(9, 14, 12, 0.08);
  --map-bg: #e9ece7;
  --map-road: #ffffff;
  --map-block: #dfe4dd;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e0c;
    --surface: #141917;
    --surface-2: #1a201d;
    --surface-3: #222926;
    --line: #232a27;
    --line-strong: #323b37;

    --text: #f0f4f1;
    --text-2: #a4aea8;
    --text-3: #6f7a74;

    --brand: #2fd08c;
    --brand-press: #27b87b;
    --on-brand: #04130c;
    --brand-tint: #11281e;
    --brand-ink: #5fe0a8;

    --ink: #f0f4f1;
    --on-ink: #0a0e0c;

    --amber-tint: #2c2210;
    --amber-ink: #f2bd5b;
    --red: #ff6b55;
    --red-tint: #2e1612;
    --red-ink: #ff8f7d;
    --blue-tint: #121f36;
    --blue-ink: #8db4ff;
    --violet-tint: #1e1a35;
    --violet-ink: #b7a4ff;
    --gray-tint: #222926;
    --gray-ink: #a4aea8;
    --star: #f2bd5b;

    --bar: rgba(16, 21, 19, 0.94);
    --scrim: rgba(0, 0, 0, 0.62);
    --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --map-bg: #111614;
    --map-road: #1d2421;
    --map-block: #161c19;
  }
}
@media (prefers-color-scheme: dark) {
  .brand-mark {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  }
}

/* ---------- Base (comportamiento de app, no de página) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
input,
textarea,
select,
[contenteditable],
.selectable {
  -webkit-user-select: text;
  user-select: text;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
}
img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ph,
.ph-fill {
  flex-shrink: 0;
  line-height: 1;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

/* ---------- Carcasa ---------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--app-h, 100dvh);
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
}
@media (min-width: 560px) {
  body {
    background: var(--surface-3);
  }
  .app {
    box-shadow: 0 0 0 1px var(--line);
  }
}

/* Barra superior */
.topbar {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding-top: var(--safe-t);
  background: var(--bg);
  view-transition-name: topbar;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  padding: 0 8px 0 var(--gutter);
}
.topbar.has-back .topbar-row {
  padding-left: 4px;
}
.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar.has-back .topbar-title {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.015em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.topbar-extra {
  padding: 2px var(--gutter) 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0b1411;
  color: #2fd08c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 19px;
  height: 19px;
}
.brand-name {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-name b {
  font-weight: 680;
  color: var(--brand);
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text);
  font-size: 22px;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.icon-btn:active {
  background: var(--surface-3);
  transform: scale(0.92);
}
.icon-btn.is-tonal {
  background: var(--surface-3);
}
.icon-btn.is-on {
  color: var(--brand);
}
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--bg);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin: 0 6px 0 4px;
  transition: transform 0.15s var(--ease);
}
.avatar:active {
  transform: scale(0.92);
}
.avatar.lg {
  width: 60px;
  height: 60px;
  font-size: 21px;
  margin: 0;
}
.avatar.tint {
  background: var(--brand-tint);
  color: var(--brand-ink);
}

/* Pantalla (zona con scroll) */
.screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px var(--gutter) calc(var(--tab-h) + var(--safe-b) + 24px);
}
.screen::-webkit-scrollbar {
  display: none;
}
.screen.flush {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}
.screen.has-action-bar {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 104px);
}
html:not(.vt) .screen > * {
  animation: rise 0.34s var(--ease-out) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Barra de pestañas */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 4px var(--safe-b);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  view-transition-name: tabbar;
  transition: transform 0.25s var(--ease);
}
.kb-open .tabbar {
  transform: translateY(110%);
}
.tab-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 560;
  transition: color 0.18s;
}
.tab-item span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-icon {
  position: relative;
  width: 56px;
  height: 30px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 23px;
  transition: background 0.22s, transform 0.3s var(--ease);
}
.tab-icon .ph-fill {
  display: none;
}
.tab-item:active .tab-icon {
  transform: scale(0.88);
}
.tab-item.active {
  color: var(--text);
}
.tab-item.active .tab-icon {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.tab-item.active .tab-icon .ph {
  display: none;
}
.tab-item.active .tab-icon .ph-fill {
  display: block;
}

/* ---------- Tipografía de contenido ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.section-title:first-child {
  margin-top: 4px;
}
.lead {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.45;
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.012em;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text);
  transition: transform 0.18s var(--ease), background 0.15s, opacity 0.15s;
}
.btn .ph,
.btn .ph-fill {
  font-size: 20px;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}
.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}
.btn-primary:active {
  background: var(--brand-press);
}
.btn-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.btn-tonal {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:active {
  background: var(--surface-3);
}
.btn-outline {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-danger {
  background: var(--red-tint);
  color: var(--red-ink);
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
}
.btn-sm .ph,
.btn-sm .ph-fill {
  font-size: 17px;
}
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.4px solid var(--on-brand);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row > * {
  flex: 1;
}
.btn-row > .grow-2 {
  flex: 2;
}
.link {
  color: var(--brand-ink);
  font-weight: 600;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Chips / etiquetas ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--gray-tint);
  color: var(--gray-ink);
}
.chip .ph,
.chip .ph-fill {
  font-size: 14px;
}
.chip.green {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.chip.orange {
  background: var(--amber-tint);
  color: var(--amber-ink);
}
.chip.red {
  background: var(--red-tint);
  color: var(--red-ink);
}
.chip.blue {
  background: var(--blue-tint);
  color: var(--blue-ink);
}
.chip.purple {
  background: var(--violet-tint);
  color: var(--violet-ink);
}
.chip.has-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Filtros horizontales (tipos de equipo) */
.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--gutter) 12px;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
  background: var(--bg);
  flex-shrink: 0;
}
.pills::-webkit-scrollbar {
  display: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.pill .ph {
  font-size: 17px;
}
.pill:active {
  transform: scale(0.95);
}
.pill.active {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: none;
}
.pill-count {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* ---------- Búsqueda ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text-3);
  transition: box-shadow 0.2s, background 0.2s;
}
.search-field .ph {
  font-size: 19px;
}
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
}
.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::placeholder {
  color: var(--text-3);
}
.search-field:focus-within {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.search-filter {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 21px;
  transition: transform 0.18s var(--ease);
}
.search-filter:active {
  transform: scale(0.93);
}
.search-filter .count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Línea de resultados + orden */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 2px 10px;
  font-size: 13px;
  color: var(--text-2);
}
.list-head strong {
  color: var(--text);
  font-weight: 620;
}
.sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 4px 0 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sort .ph {
  font-size: 15px;
  color: var(--text-2);
}
.sort select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px;
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--line);
  padding: 16px;
}
.card + .card {
  margin-top: 10px;
}
.stack > * + * {
  margin-top: 10px;
}

/* Tarjeta de carga */
.load-card {
  display: block;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 16px;
  margin-bottom: 10px;
  transition: transform 0.22s var(--ease), background 0.15s;
  will-change: transform;
}
.load-card.is-tappable:active {
  transform: scale(0.98);
  background: var(--surface-2);
}
.lc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.lc-tags .chip {
  height: 24px;
  font-size: 12px;
}
.lc-time {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--text-3);
}
.lc-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.route {
  flex: 1;
  min-width: 0;
  position: relative;
  padding-left: 22px;
}
.route-stop:not(.is-dest)::after {
  content: "";
  position: absolute;
  left: -17.75px;
  top: 20px;
  bottom: -12px;
  border-left: 1.5px dashed var(--line-strong);
}
.route-stop {
  position: relative;
}
.route-stop + .route-stop {
  margin-top: 10px;
}
.route-stop::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--brand);
}
.route-stop.is-dest::before {
  border-radius: 3px;
  background: var(--text);
  box-shadow: none;
}
.route-city {
  font-size: 16.5px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-sub {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  text-align: right;
  flex-shrink: 0;
}
.price-amount {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.price-amount.is-open {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-2);
}
.price-sub {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}
.lc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
}
.lc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.lc-meta .ph {
  font-size: 16px;
  color: var(--text-3);
}
.lc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 32px;
}
.lc-broker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-2);
}
.lc-broker-name {
  font-weight: 560;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rating .ph-fill {
  color: var(--star);
  font-size: 13px;
}
.lc-save {
  width: 36px;
  height: 36px;
  margin: -2px -6px -2px 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--text-3);
  transition: transform 0.25s var(--ease), color 0.15s;
}
.lc-save:active {
  transform: scale(0.8);
}
.lc-save.is-on {
  color: var(--brand);
}
.lc-save.pop {
  animation: pop 0.38s var(--ease);
}
@keyframes pop {
  40% {
    transform: scale(1.3);
  }
}
.lc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.lc-actions .btn {
  flex: 1;
}
.lc-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
}
.lc-note.is-action {
  width: 100%;
  text-align: left;
  background: var(--blue-tint);
  color: var(--blue-ink);
  transition: transform 0.2s var(--ease);
}
.lc-note.is-action strong {
  color: inherit;
}
.lc-note.is-action:active {
  transform: scale(0.98);
}
.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.offline {
  position: absolute;
  top: calc(var(--safe-t) + 8px);
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
  box-shadow: var(--shadow-float);
  transform: translate(-50%, -80px);
  transition: transform 0.4s var(--ease);
}
.offline.show {
  transform: translate(-50%, 0);
}
.bid {
  padding: 14px 0;
}
.bid + .bid {
  border-top: 1px solid var(--line);
}
.bid-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bid-amount {
  margin-left: auto;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.bid-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.4;
}
.bid .btn-row {
  margin-top: 12px;
}
.contact-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.contact-row .btn {
  flex: 1;
}
.lc-note strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Estados vacíos / carga ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 28px 24px;
}
.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: var(--surface-3);
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 32px;
  margin-bottom: 18px;
}
.empty h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.empty p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.45;
  max-width: 280px;
}
.empty .btn {
  margin-top: 20px;
}

.skel-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 16px;
  margin-bottom: 10px;
}
.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Tirar para actualizar */
.ptr {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 15;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: var(--brand);
  opacity: 0;
  transform: translateY(-48px);
  pointer-events: none;
}
.ptr.is-settling {
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.ptr.is-loading .ph {
  animation: spin 0.7s linear infinite;
}

/* ---------- Avisos ---------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.4;
  margin-bottom: 12px;
  background: var(--surface-3);
}
.banner .ph-fill {
  font-size: 19px;
  margin-top: 1px;
}
.banner.success {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.banner.error {
  background: var(--red-tint);
  color: var(--red-ink);
}
.banner ul {
  list-style: none;
}

.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  z-index: 300;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.kb-open .toast-wrap {
  bottom: 14px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14.5px;
  font-weight: 540;
  line-height: 1.35;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.36s var(--ease), opacity 0.25s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast .ph-fill {
  font-size: 19px;
}
.toast.success .ph-fill {
  color: #2fd08c;
}
.toast.error .ph-fill {
  color: #ff7a66;
}
@media (prefers-color-scheme: dark) {
  .toast.success .ph-fill {
    color: #0a8757;
  }
  .toast.error .ph-fill {
    color: #c7321d;
  }
}

/* ---------- Formularios ---------- */
.field {
  display: block;
  margin-bottom: 12px;
}
.field > label,
.field-label {
  display: block;
  margin: 0 2px 6px;
  font-size: 13px;
  font-weight: 560;
  color: var(--text-2);
}
.input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 0.18s, background 0.18s;
}
.field textarea {
  padding: 13px 14px;
  min-height: 92px;
  line-height: 1.4;
  resize: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-3);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: inset 0 0 0 1.8px var(--brand);
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='none' stroke='%238a938e' stroke-width='22' stroke-linecap='round' stroke-linejoin='round' d='M208 96l-80 80-80-80'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field input.is-locked,
.field input[readonly] {
  background-color: var(--surface-3);
  box-shadow: none;
  color: var(--text-2);
}
.field input[type="date"],
.field input[type="datetime-local"] {
  min-width: 0;
}
.field-hint {
  margin: 6px 2px 0;
  font-size: 12.5px;
  color: var(--text-3);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field-row.three {
  grid-template-columns: 1.7fr 0.8fr 1fr;
}
.field-row > .field {
  min-width: 0;
}
.with-icon {
  position: relative;
}
.with-icon > .ph {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: var(--text-3);
  pointer-events: none;
}
.with-icon > input {
  padding-left: 44px !important;
}
.with-icon > .reveal {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--text-3);
}
.with-icon > .reveal ~ input,
.with-icon.has-reveal > input {
  padding-right: 50px !important;
}

/* Grupo de formulario (sección) */
.group {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 16px 16px 6px;
  margin-bottom: 12px;
}
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 640;
  letter-spacing: -0.02em;
}
.group-title .ph {
  font-size: 19px;
  color: var(--text-3);
}
.group .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.group .field select,
.group .field textarea,
.sheet .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.sheet .field select,
.sheet .field textarea {
  background-color: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.group .field input:focus,
.group .field select:focus,
.group .field textarea:focus,
.sheet .field input:focus,
.sheet .field select:focus,
.sheet .field textarea:focus {
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1.8px var(--brand);
}
.group .field input.is-locked,
.group .field input[readonly] {
  background-color: var(--surface-3);
  box-shadow: none;
}

/* Interruptor */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 10px;
  font-size: 15.5px;
  font-weight: 520;
}
.switch-row small {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-3);
}
.switch {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 30px;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: var(--line-strong);
  transition: background 0.22s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.26s var(--ease);
}
.switch input:checked + i {
  background: var(--brand);
}
.switch input:checked + i::after {
  transform: translateX(20px);
}

/* Opciones seleccionables (rol, equipos) */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  position: relative;
  display: block;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-body {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 540;
  line-height: 1.2;
  transition: box-shadow 0.18s, background 0.18s, transform 0.18s var(--ease);
}
.choice-body .ph {
  font-size: 19px;
  color: var(--text-3);
  transition: color 0.18s;
}
.choice:active .choice-body {
  transform: scale(0.97);
}
.choice input:checked + .choice-body {
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 1.8px var(--brand);
  color: var(--brand-ink);
}
.choice input:checked + .choice-body .ph {
  color: var(--brand-ink);
}
.choice.is-big .choice-body {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px;
}
.choice.is-big .ph {
  font-size: 24px;
  margin-bottom: 8px;
}
.choice.is-big strong {
  font-size: 15.5px;
  font-weight: 640;
  color: var(--text);
}
.choice.is-big small {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.3;
}

.rpm-out {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stop-row {
  padding: 12px 12px 2px;
  margin-bottom: 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.stop-row .btn {
  margin-bottom: 10px;
}

.picked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--r-sm);
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 13.5px;
  font-weight: 520;
  line-height: 1.35;
}
.picked .ph-fill {
  font-size: 18px;
}

/* Barra de acción fija sobre la barra de pestañas */
.action-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--gutter);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  transition: bottom 0.25s var(--ease);
}
.kb-open .action-bar {
  bottom: 0;
}
.action-bar .btn {
  flex: 1;
}
.fare {
  flex-shrink: 0;
  min-width: 96px;
}
.fare-label {
  font-size: 12px;
  color: var(--text-2);
}
.fare-value {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* ---------- Listas tipo ajustes ---------- */
.list {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}
.list + .list {
  margin-top: 12px;
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  text-align: left;
  transition: background 0.15s;
}
.row + .row::before,
.accordion + .accordion::before,
.row + .accordion::before,
.accordion + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 0;
  border-top: 1px solid var(--line);
}
a.row:active,
button.row:active,
summary.row:active {
  background: var(--surface-2);
}
.row-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.row-icon.green {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.row-icon.red {
  background: var(--red-tint);
  color: var(--red-ink);
}
.row-icon.blue {
  background: var(--blue-tint);
  color: var(--blue-ink);
}
.row-icon.orange {
  background: var(--amber-tint);
  color: var(--amber-ink);
}
.row-icon.purple {
  background: var(--violet-tint);
  color: var(--violet-ink);
}
.row-body {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 15.5px;
  font-weight: 560;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.35;
}
.row-sub.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-end {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 14px;
}
.row-end .ph {
  font-size: 16px;
}
.row-amount {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.row.is-danger .row-title {
  color: var(--red-ink);
}
.row.unread .row-title {
  font-weight: 650;
}
.unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* Acordeón (formularios del perfil) */
.accordion {
  position: relative;
}
.accordion summary {
  list-style: none;
  cursor: pointer;
}
.accordion summary::-webkit-details-marker {
  display: none;
}
.accordion summary .ph-caret-down {
  transition: transform 0.3s var(--ease);
}
.accordion[open] summary .ph-caret-down {
  transform: rotate(180deg);
}
.accordion-body {
  padding: 6px 14px 16px;
  animation: rise 0.3s var(--ease-out) both;
}
.accordion-body .field input:not([type="checkbox"]):not([type="radio"]),
.accordion-body .field select {
  background-color: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.accordion-body .field input:focus,
.accordion-body .field select:focus {
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1.8px var(--brand);
}

/* Cabecera de perfil */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 18px;
}
.profile-head h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.profile-head p {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 1px 0 8px;
  overflow-wrap: anywhere;
}

/* ---------- Indicadores ---------- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  padding: 14px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  min-width: 0;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.stat-value.lg {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.04em;
}
.stat-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-3);
}
.stat.is-ink {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: none;
}
.stat.is-ink .stat-label,
.stat.is-ink .stat-sub {
  color: inherit;
  opacity: 0.62;
}

/* ---------- Detalle de carga ---------- */
.detail-hero {
  padding: 2px 2px 4px;
}
.detail-hero .price-amount {
  font-size: 38px;
  letter-spacing: -0.045em;
  text-align: left;
}
.detail-hero .price-amount.is-open {
  font-size: 24px;
  color: var(--text);
}
.detail-hero .price-sub {
  font-size: 14.5px;
  margin-top: 4px;
}
.detail-hero .chip-row {
  margin-top: 14px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  font-size: 14.5px;
  color: var(--text-2);
}
.kv + .kv {
  border-top: 1px solid var(--line);
}
.kv strong {
  color: var(--text);
  font-weight: 580;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timeline {
  position: relative;
  padding-left: 30px;
}
.tl-stop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: -21.75px;
  top: 25px;
  bottom: 1px;
  border-left: 1.5px dashed var(--line-strong);
}
.tl-stop {
  position: relative;
  padding-bottom: 18px;
}
.tl-stop:last-child {
  padding-bottom: 0;
}
.tl-stop::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 4.5px var(--brand);
}
.tl-stop.stop::before {
  box-shadow: inset 0 0 0 4.5px var(--text-3);
}
.tl-stop.delivery::before {
  border-radius: 5px;
  background: var(--text);
  box-shadow: none;
}
.tl-kind {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 1px;
}
.tl-city {
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.02em;
}
.tl-address {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.35;
}
.tl-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 540;
  color: var(--text-2);
}
.tl-time .ph {
  font-size: 15px;
  color: var(--text-3);
}

.note-box {
  padding: 13px 14px;
  border-radius: var(--r-sm);
  background: var(--amber-tint);
  color: var(--amber-ink);
  font-size: 14px;
  line-height: 1.45;
}

.party {
  display: flex;
  align-items: center;
  gap: 12px;
}
.party-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 680;
  flex-shrink: 0;
}
.party-logo.lg {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 20px;
}
.party-name {
  font-size: 16px;
  font-weight: 630;
  letter-spacing: -0.02em;
}
.party-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
}

.review {
  padding: 14px;
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.review p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.45;
}

/* ---------- Hoja inferior ---------- */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s;
}
.scrim.show {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - var(--safe-t) - 28px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  transform: translateY(105%);
  transition: transform 0.44s var(--ease);
  will-change: transform;
  visibility: hidden;
}
.sheet.show {
  transform: none;
  visibility: visible;
}
.sheet.is-closing {
  visibility: visible;
}
.sheet.is-dragging {
  transition: none;
}
.sheet-grab {
  flex-shrink: 0;
  padding: 9px 0 5px;
  touch-action: none;
}
.sheet-grab::before {
  content: "";
  display: block;
  width: 38px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--line-strong);
}
.sheet-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 8px 20px;
  touch-action: none;
}
.sheet-title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px 20px 20px;
}
.sheet-body::-webkit-scrollbar {
  display: none;
}
.sheet-foot {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 12px 20px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-body:has(+ .sheet-foot:empty) {
  padding-bottom: calc(22px + var(--safe-b));
}
.sheet-foot:empty {
  display: none;
}
.sheet-foot .btn {
  flex: 1;
}
.sheet-foot .btn.is-square {
  flex: 0 0 52px;
  padding: 0;
}
.sheet .section-title:first-child {
  margin-top: 8px;
}
.sheet-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--text-3);
  font-size: 26px;
}
.sheet-loading .ph {
  animation: spin 0.8s linear infinite;
}

/* Estado central dentro de una hoja (procesando / éxito) */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 8px 8px;
}
.state h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.state p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.45;
  max-width: 300px;
}
.state .btn {
  margin-top: 10px;
}
.state .btn:first-of-type {
  margin-top: 22px;
}
.pulse {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 6px 0 22px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--brand-ink);
}
.pulse::before,
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand-tint);
  animation: pulse 1.8s var(--ease-out) infinite;
}
.pulse::after {
  animation-delay: 0.9s;
}
.pulse .ph {
  position: relative;
  z-index: 1;
}
@keyframes pulse {
  from {
    transform: scale(0.5);
    opacity: 1;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}
.done-mark {
  width: 76px;
  height: 76px;
  margin: 6px 0 20px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  animation: done-in 0.5s var(--ease) both;
}
.done-mark svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 0.45s 0.25s var(--ease-out) forwards;
}
@keyframes done-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.ref-pill {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--surface-3);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- Solicitud rápida (inicio del broker) ---------- */
.qr-hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 148px;
  overflow: hidden;
  background: var(--map-bg);
}
.qr-hero svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.qr-hero .road {
  fill: none;
  stroke: var(--map-road);
  stroke-linecap: round;
}
.qr-hero .block {
  fill: var(--map-block);
}
.qr-hero .route-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4;
  stroke-linecap: round;
}
.qr-hero .route-origin {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 4;
}
.qr-hero .route-dest {
  fill: var(--text);
}
.qr-truck {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--shadow-float);
  will-change: transform;
}
.qr-body {
  position: relative;
  z-index: 1;
  margin-top: -24px;
  padding: 22px var(--gutter) 8px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--bg);
  min-height: 100%;
}
.qr-title {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.035em;
  margin: 0 2px 16px;
}
.qr-route {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 0 6px 0 16px;
  margin-bottom: 12px;
}
.qr-route-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  width: 100%;
  text-align: left;
}
.qr-route-row + .qr-route-row {
  border-top: 1px solid var(--line);
}
.qr-route-row + .qr-route-row::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: -18px;
  height: 36px;
  border-left: 1.5px dashed var(--line-strong);
}
.qr-dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--brand), 0 0 0 4px var(--surface);
  flex-shrink: 0;
}
.qr-dot.dest {
  border-radius: 3px;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--surface);
}
.qr-route-row input {
  flex: 1;
  min-width: 0;
  height: 58px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-weight: 520;
  color: var(--text);
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: none;
}
.qr-route-row input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}
.qr-route-row .ph {
  width: 42px;
  text-align: center;
  font-size: 20px;
  color: var(--text-3);
}
.qr-route-row:active {
  opacity: 0.6;
}

.qr-weight {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 14px 16px 16px;
}
.qr-weight-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-2);
}
.qr-weight-head output {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
input[type="range"].range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
  --fill: 4%;
}
input[type="range"].range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--brand) var(--fill), var(--surface-3) var(--fill));
}
input[type="range"].range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s var(--ease);
}
input[type="range"].range:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
input[type="range"].range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--brand) var(--fill), var(--surface-3) var(--fill));
}
input[type="range"].range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.vehicles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vehicle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 12px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: box-shadow 0.2s, background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}
.vehicle:active {
  transform: scale(0.98);
}
.vehicle-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.vehicle-body {
  flex: 1;
  min-width: 0;
}
.vehicle-body > span,
.vehicle-price > span {
  display: block;
}
.vehicle-name {
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.015em;
}
.vehicle-desc {
  font-size: 13px;
  color: var(--text-2);
}
.vehicle-warn {
  font-size: 12.5px;
  font-weight: 560;
  color: var(--red-ink);
}
.vehicle-price {
  text-align: right;
  flex-shrink: 0;
}
.vehicle-price .amount {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.vehicle-price .eta {
  font-size: 12.5px;
  color: var(--text-3);
}
.vehicle.selected {
  background: var(--brand-tint);
  box-shadow: inset 0 0 0 1.8px var(--brand);
}
.vehicle.selected .vehicle-icon {
  background: var(--brand);
  color: var(--on-brand);
}
.vehicle.disabled {
  opacity: 0.45;
}

/* ---------- Selector en mapa (pantalla completa) ---------- */
.map-modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.42s var(--ease), visibility 0s 0.42s;
}
.map-modal.open {
  transform: none;
  visibility: visible;
  transition: transform 0.42s var(--ease);
}
.map-modal-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  padding: var(--safe-t) 8px 0 4px;
  flex-shrink: 0;
}
.map-modal-head h2 {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.015em;
}
.map-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
.map-canvas {
  position: absolute;
  inset: 0;
  background: var(--map-bg);
}
.map-address {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-3);
}
.map-address .ph {
  font-size: 19px;
  color: var(--brand);
}
.map-address.is-set {
  color: var(--text);
  font-weight: 520;
}
.map-address.is-error {
  color: var(--red-ink);
}
.map-modal-foot {
  display: flex;
  gap: 10px;
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.map-modal-foot .btn {
  flex: 1;
}

/* Pantalla Mapa */
.map-screen {
  position: relative;
  flex: 1;
  min-height: 0;
}
.map-screen .map-canvas {
  bottom: calc(var(--tab-h) + var(--safe-b));
}
.map-count {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  font-size: 13.5px;
  font-weight: 580;
}
.map-count .ph {
  font-size: 17px;
  color: var(--brand);
}
.map-fallback {
  position: absolute;
  inset: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  overflow-y: auto;
  background: var(--bg);
  padding: 0 var(--gutter) 24px;
}

/* ---------- Acceso (login / registro) ---------- */
.auth {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: var(--bg);
}
.auth::-webkit-scrollbar {
  display: none;
}
.auth-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 16px) 24px calc(var(--safe-b) + 24px);
}
.auth-nav {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0 -10px 4px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 36px;
  animation: rise 0.5s var(--ease-out) both;
}
.auth-brand .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
}
.auth-brand .brand-mark svg {
  width: 29px;
  height: 29px;
}
.auth-brand .brand-name {
  font-size: 23px;
}
.auth h1 {
  font-size: 30px;
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin-bottom: 8px;
  animation: rise 0.5s 0.05s var(--ease-out) both;
}
.auth .lead {
  margin-bottom: 26px;
  animation: rise 0.5s 0.09s var(--ease-out) both;
}
.auth form,
.auth .auth-block {
  animation: rise 0.5s 0.13s var(--ease-out) both;
}
.auth .field {
  margin-bottom: 14px;
}
.auth-aside {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 2px 20px;
  font-size: 14px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-2);
}
.check input {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  display: grid;
  place-items: center;
  transition: background 0.18s, box-shadow 0.18s;
}
.check input::after {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2.2px solid var(--on-brand);
  border-bottom: 2.2px solid var(--on-brand);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.22s var(--ease);
}
.check input:checked {
  background: var(--brand);
  box-shadow: none;
}
.check input:checked::after {
  transform: rotate(-45deg) scale(1);
}
.auth-foot {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-2);
}

/* ---------- Botón «Instalar app» ---------- */
.pwa-install-btn {
  position: absolute;
  right: 14px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  z-index: 26;
  display: none;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 21px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  transition: transform 0.2s var(--ease);
}
.pwa-install-btn .ph {
  font-size: 18px;
}
.pwa-install-btn.is-visible {
  display: inline-flex;
}
.pwa-install-btn:active {
  transform: scale(0.95);
}
.has-action-bar ~ .pwa-install-btn {
  display: none;
}

/* ---------- Transiciones entre pantallas ---------- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: vt-out 0.14s ease-out both;
}
::view-transition-new(root) {
  animation: vt-in 0.26s var(--ease-out) both;
}
::view-transition-group(tabbar),
::view-transition-group(topbar) {
  animation-duration: 0.2s;
}
::view-transition-group(tabbar) {
  z-index: 3;
}
::view-transition-group(topbar) {
  z-index: 2;
}
@keyframes vt-out {
  to {
    opacity: 0;
  }
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes vt-push-in {
  from {
    transform: translateX(100%);
  }
}
@keyframes vt-push-out {
  to {
    transform: translateX(-24%);
    opacity: 0.4;
  }
}
@keyframes vt-pop-in {
  from {
    transform: translateX(-24%);
    opacity: 0.4;
  }
}
@keyframes vt-pop-out {
  to {
    transform: translateX(100%);
  }
}
html.vt-push::view-transition-old(root) {
  animation: vt-push-out 0.4s var(--ease) both;
}
html.vt-push::view-transition-new(root) {
  animation: vt-push-in 0.4s var(--ease) both;
  z-index: 1;
}
html.vt-pop::view-transition-old(root) {
  animation: vt-pop-out 0.4s var(--ease) both;
  z-index: 1;
}
html.vt-pop::view-transition-new(root) {
  animation: vt-pop-in 0.4s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
