/* Visitas — layout: barra azul de placa de rua no topo, fila de cartões numerados,
   barra de rota fixa embaixo; no tablet a fila fica à esquerda e o mapa à direita. */
:root {
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #131B26;
  --muted: #586376;
  --line: #D6DCE4;
  --bar: #1B4F9C;
  --bar-ink: #FFFFFF;
  --bar-muted: #C9D8EF;
  --accent: #1B4F9C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EBF7;
  --ok: #0E7C66;
  --ok-ink: #FFFFFF;
  --ok-soft: #DCF1EA;
  --warn: #A84A08;
  --warn-soft: #FBE9DA;
  --danger: #B42318;
  --pin: #1B4F9C;
  --pin-ok: #0E7C66;
  --pin-ring: #FFFFFF;
  --shadow: 0 1px 2px rgba(19, 27, 38, .07), 0 4px 14px rgba(19, 27, 38, .06);
  --shadow-up: 0 -2px 10px rgba(19, 27, 38, .07);
  --f-display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  --topbar-h: 64px;
  --chrome-top: 108px;
  --routebar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1218; --surface: #151C26; --surface-2: #1A2330; --ink: #E8EDF3; --muted: #9CA7B6; --line: #283345;
    --bar: #123B76; --bar-ink: #FFFFFF; --bar-muted: #B9CBE6;
    --accent: #8AB2EE; --accent-ink: #0B1018; --accent-soft: #1B2B44;
    --ok: #3CC3A2; --ok-ink: #062019; --ok-soft: #10302A;
    --warn: #F29A5C; --warn-soft: #3A2412; --danger: #F2837A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .3);
    --shadow-up: 0 -2px 12px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 var(--f-body);
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: .9em; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.app { min-height: 100dvh; padding-bottom: calc(var(--routebar-h) + 12px); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bar); color: var(--bar-ink);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  min-height: var(--topbar-h);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding-block: 8px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--bar-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8a8 8 0 0 0-8 8c0 5.8 8 12.4 8 12.4s8-6.6 8-12.4a8 8 0 0 0-8-8zm-1.1 11.6-3.2-3.1 1.4-1.4 1.8 1.7 4.4-4.4 1.4 1.4z'/%3E%3C/svg%3E") center / 26px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8a8 8 0 0 0-8 8c0 5.8 8 12.4 8 12.4s8-6.6 8-12.4a8 8 0 0 0-8-8zm-1.1 11.6-3.2-3.1 1.4-1.4 1.8 1.7 4.4-4.4 1.4 1.4z'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.brand-text h1 { font: 700 26px/1 var(--f-display); letter-spacing: .02em; margin: 0; }
.cycle { margin: 3px 0 0; font-size: 13px; color: var(--bar-muted); display: flex; gap: 6px; white-space: nowrap; }
.cycle b { color: var(--bar-ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--bar-ink); border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { fill: currentColor; stroke: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.sync {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08);
  color: var(--bar-ink); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #7BE0B8; }
.sync[data-state="salvando"] .sync-dot { background: #FFFFFF; animation: pulse 1s ease-in-out infinite; }
.sync[data-state="offline"] .sync-dot, .sync[data-state="offline-pend"] .sync-dot { background: #FFC27A; }
.sync[data-state="erro"] .sync-dot { background: #FF8A80; }
@keyframes pulse { 50% { opacity: .35; } }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); }
.progress span { display: block; height: 100%; width: 0; background: #7BE0B8; transition: width .3s ease; }

/* ---------- tabs ---------- */
.tabs {
  position: sticky; top: var(--topbar-h); z-index: 25;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabs button {
  height: 46px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted);
  border-bottom: 3px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.count { font: 600 12px/1 var(--f-body); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); padding: 3px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] .count { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* ---------- lists ---------- */
.main { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); padding-block: 12px 0; }
.panel { max-width: 760px; margin: 0 auto; }
.progress-text { margin: 2px 2px 12px; color: var(--muted); font-size: 14px; }
.progress-text b { color: var(--ink); font-weight: 600; }
.progress-text small { display: block; font-size: 12.5px; margin-top: 1px; }
.fila-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 12px; }
.fila-topo .progress-text { margin: 0; min-width: 0; }
.btn.compact { height: 40px; padding: 0 12px; font-size: 14.5px; gap: 6px; border-radius: 10px; flex: none; }
.btn.compact svg { width: 18px; height: 18px; }
.org-dica {
  margin: 2px 2px 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); font-size: 14.5px; line-height: 1.4;
}
.org-dica b { display: block; color: var(--accent); font-size: 16px; margin-bottom: 2px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 52px; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 8px 4px;
  box-shadow: var(--shadow); transition: opacity .18s ease, transform .18s ease;
}
.item.saindo { opacity: 0; transform: translateX(24px); }
.grip {
  align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 10px;
}
.grip:active { cursor: grabbing; }
.pos {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font: 700 18px/1 var(--f-display); display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.dots { width: 14px; height: 8px; background-image: radial-gradient(var(--muted) 1.3px, transparent 1.6px); background-size: 5px 4px; opacity: .7; }
.item .body {
  min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px;
}
.title { font: 600 16.5px/1.25 var(--f-body); display: flex; align-items: center; gap: 6px; }
.aprox { font: 600 12px/1 var(--f-body); color: var(--warn); background: var(--warn-soft); padding: 2px 5px; border-radius: 6px; }
.addr { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tem-nota { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; }
.check {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ok); color: var(--ok); background: transparent;
  display: grid; place-items: center; cursor: pointer; justify-self: center;
}
.check:hover, .check:active { background: var(--ok); color: var(--ok-ink); }
.item.feito { grid-template-columns: 40px minmax(0, 1fr) auto; padding-left: 10px; box-shadow: none; }
.ok-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.ok-badge svg { width: 18px; height: 18px; stroke-width: 2.6; }
.quando { color: var(--ok); font-weight: 600; }
.desfazer { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 9px 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty b { color: var(--ink); }
.is-ghost { opacity: .35; }
.is-chosen { box-shadow: 0 10px 30px rgba(19, 27, 38, .22); }
.is-drag { box-shadow: 0 14px 34px rgba(19, 27, 38, .3); }
body.dragging { user-select: none; -webkit-user-select: none; }

/* modo "Mudar ordem": tocar nos PDVs na ordem desejada */
.item.escolha { display: block; padding: 0; }
.escolher {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px 10px 4px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius);
}
.escolher .txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sel {
  justify-self: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font: 700 18px/1 var(--f-display); color: var(--accent-ink); font-variant-numeric: tabular-nums;
}
.item.escolha.marcado { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.item.escolha.marcado .sel { background: var(--accent); border-color: var(--accent); }
body.organizando .tabs button[aria-selected="false"] { opacity: .4; pointer-events: none; }
.orgbar .btn { flex: 1; min-width: 0; }
.orgbar .btn.ghost { flex: 0 0 auto; padding: 0 18px; }

/* ---------- map ---------- */
.mapwrap { display: none; height: calc(100dvh - var(--chrome-top) - var(--routebar-h)); }
body[data-tab="mapa"] .mapwrap { display: block; }
body[data-tab="mapa"] .main { display: none; }
body[data-tab="mapa"] .app { padding-bottom: 0; }
#map { width: 100%; height: 100%; background: var(--surface-2); }
.leaflet-container { font-family: var(--f-body); font-size: 13px; }
.pin-wrap { background: none; border: 0; }
.pin {
  width: 30px; height: 30px; border-radius: 50%; box-sizing: border-box; display: grid; place-items: center;
  background: var(--pin); color: #FFFFFF; border: 2.5px solid var(--pin-ring);
  font: 700 15px/1 var(--f-display); box-shadow: 0 1px 4px rgba(10, 16, 24, .45);
}
.pin.aprox { outline: 2px dashed var(--pin); outline-offset: 2px; }
.pin.feito { width: 24px; height: 24px; background: var(--pin-ok); }
.pin.feito svg { width: 14px; height: 14px; stroke: #FFFFFF; stroke-width: 3; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; min-width: 210px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.pop-k { font: 600 11.5px/1.2 var(--f-body); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.pop-t { font: 700 19px/1.15 var(--f-display); margin: 2px 0; }
.pop-a { font-size: 13.5px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pop-actions .btn { height: 38px; padding: 0 11px; font-size: 13.5px; }
.map-ctl { display: flex; flex-direction: column; gap: 6px; }
.map-ctl button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px;
  padding: 8px 11px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow); cursor: pointer;
}
.leaflet-bar a, .leaflet-bar a:hover { background-color: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2F80ED; border: 3px solid #FFFFFF; box-shadow: 0 0 0 6px rgba(47, 128, 237, .25); }

/* ---------- route bar ---------- */
.routebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 28;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-up);
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); flex: none; }
.stepper button { width: 40px; height: 46px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); }
.stepper output { min-width: 26px; text-align: center; font: 700 20px/1 var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font: 600 15.5px/1 var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: var(--ok-ink); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); color: #FFFFFF; }
.btn.link { background: none; border: 0; height: auto; padding: 8px 0; text-decoration: underline; }
.btn.link.danger { color: var(--danger); background: none; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.route-btn { flex: 1; min-width: 0; }
.route-btn span { overflow: hidden; text-overflow: ellipsis; }
.route-btn svg { fill: currentColor; stroke: none; width: 20px; height: 20px; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 18, .45); opacity: 0; transition: opacity .2s ease; }
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  transform: translateY(100%); transition: transform .22s ease;
}
.sheet.open { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sh-head h2 { font: 700 26px/1.05 var(--f-display); margin: 2px 0 0; }
.sheet-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.kicker { margin: 0; font: 600 12px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.kicker.ok { color: var(--ok); }
.addr-block p { margin: 0; }
.addr-l1 { font-size: 18px; font-weight: 600; }
.addr-l2 { color: var(--muted); font-size: 14.5px; margin-top: 2px !important; }
.hint { color: var(--warn); font-size: 13.5px; margin-top: 6px !important; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }
.actions.small .btn { height: 42px; font-size: 14.5px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field input, .field textarea {
  font: 16px/1.4 var(--f-body); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; }
.field small { color: var(--muted); min-height: 1.2em; }
.dados { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.dados div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; }
.dados dt { color: var(--muted); font-size: 13.5px; }
.dados dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 4px; }
.danger-zone p { margin: 8px 0; color: var(--muted); font-size: 14.5px; }
.menu { display: flex; flex-direction: column; }
.menu button {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 13px 4px; border: 0;
  border-bottom: 1px solid var(--line); background: none; cursor: pointer;
}
.menu button:last-child { border-bottom: 0; }
.menu button svg { color: var(--accent); }
.menu b { display: block; font-weight: 600; font-size: 16px; }
.menu small { display: block; color: var(--muted); font-size: 13.5px; }
.msg { margin: 0; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.msg:empty { display: none; }
.msg.erro { background: transparent; border-color: var(--danger); color: var(--danger); }
.msg.aviso { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.msg.okmsg { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.msg.carregando::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.add-form { display: flex; gap: 8px; align-items: flex-end; }
.add-form .field { flex: 1; }
.add-form input { font-family: var(--f-mono); letter-spacing: .02em; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.preview p { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.sheet h3 { font: 700 19px/1.1 var(--f-display); margin: 6px 0 0; }
.arq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.arq-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.arq-list small { display: block; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--routebar-h) + 14px); z-index: 50; transform: translate(-50%, 20px);
  width: max-content; max-width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px;
  background: #1D2633; color: #FFFFFF; box-shadow: 0 8px 26px rgba(0, 0, 0, .3); font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
body.painel-aberto .toast { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 12px); }
.toast button { border: 0; background: none; color: #9CC3FF; font-weight: 700; cursor: pointer; padding: 4px 2px; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; background: var(--bar); display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top, 0px)) 16px 20px; overflow-y: auto; }
.gate-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.gate-card h1 { font: 700 34px/1 var(--f-display); margin: 0; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card form { display: flex; flex-direction: column; gap: 10px; }
.brand-mark.big { width: 46px; height: 46px; border-radius: 12px; background: var(--bar); -webkit-mask-size: 40px; mask-size: 40px; }

/* ---------- loading skeleton ---------- */
.skel { height: 74px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* ---------- sheet as dialog on larger screens ---------- */
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, calc(100vw - 48px)); max-height: 86dvh; border-radius: 18px; transform: translate(-50%, -46%); opacity: 0; transition: opacity .18s ease, transform .18s ease; padding-bottom: 22px; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-handle { display: none; }
}

/* ---------- tablet: fila à esquerda, mapa à direita ---------- */
@media (min-width: 900px) {
  .app {
    height: 100dvh; min-height: 0; padding-bottom: 0;
    display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top top" "tabs map" "main map" "route map";
  }
  .topbar { grid-area: top; position: relative; }
  .tabs { grid-area: tabs; position: static; grid-template-columns: repeat(2, 1fr); border-right: 1px solid var(--line); }
  .tabs .tab-mapa { display: none; }
  .main { grid-area: main; overflow-y: auto; border-right: 1px solid var(--line); padding-bottom: 12px; }
  .mapwrap, body[data-tab="mapa"] .mapwrap { grid-area: map; display: block; height: auto; min-height: 0; }
  body[data-tab="mapa"] .main { display: block; }
  .routebar { grid-area: route; position: static; border-right: 1px solid var(--line); box-shadow: none; }
  .toast { left: 220px; bottom: 90px; }
}
