/* Achromatic ledger: la interfaz queda en tinta y gris; el color va solo en los datos
   (pins y puntos de estado) y en la única acción principal (near-black). Suelo "baldosa" #f4f3f1. */
:root {
  --ground: #f4f3f1;
  --surface: #ffffff;
  --raised: #eeeeee;
  --active: #e9e9e9;
  --border: #e6e6e6;
  --rule: #f0f0f0;
  --control: #d4d4d4;
  --text: #0a0a0a;
  --muted: #5f5f5f;
  --faint: #6b6b6b;
  --primary: #141414;
  --negative: #c4242a;
  --focus: #1d5fbf;

  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 12px;
  --pad: 24px;
  --control-height: 36px;
  --row-pad: 12px;
  --list-w: clamp(360px, 27vw, 500px);
  --drawer-w: 440px;

  --fs-title: 24px;
  --fs-section: 16px;
  --fs-body: 14px;
  --fs-small: 12px;
  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 20px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); }
body { overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.error { color: var(--negative); font-size: var(--fs-small); min-height: 16px; margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Controles ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; min-height: var(--control-height); padding: 7px 10px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; line-height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface); color: var(--text);
  font-weight: 500; white-space: nowrap; cursor: pointer; touch-action: manipulation;
  transition: background-color .12s, border-color .12s, transform .08s;
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.small { height: 28px; padding: 0 10px; font-size: var(--fs-small); }
.btn.icon { width: var(--control-height); padding: 0; border-color: transparent; background: transparent; }
.btn.icon:hover { background: var(--raised); }
.btn.danger-text { border-color: transparent; background: transparent; color: var(--negative); padding: 0 8px; }
.btn.danger-text:hover { background: #ffedea; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Input + botón unidos */
.joined { display: flex; }
.joined > :first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.joined > :last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.joined > input { flex: 1; min-width: 0; }
.joined select.cur { width: 76px; flex: none; }

/* ---------- Layout ---------- */
.layout {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: var(--list-w) 1fr;
  grid-template-areas: "list map";
}
body.drawer-open .layout { grid-template-columns: var(--list-w) 1fr var(--drawer-w); grid-template-areas: "list map drawer"; }
.sidebar { grid-area: list; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--ground); }
.map-wrap { grid-area: map; position: relative; min-width: 0; margin: 8px 8px 8px 0; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border); background: #e8e6e1; }
#map { position: absolute; inset: 0; }
.mobile-bar, .bottom-bar { display: none; }

/* ---------- Sidebar ---------- */
.sidebar-head { padding: 20px var(--pad) 12px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--fs-section); }
.wordmark img { border-radius: 5px; }
.summary { text-wrap: balance; font-size: var(--fs-title); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; margin: 0; font-variant-numeric: tabular-nums; }
.subline { margin: 4px 0 0; min-height: 20px; }
.subline button { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.toolbar { display: flex; gap: 8px; padding: 0 var(--pad); }
.toolbar input { flex: 1; min-width: 0; }
.toolbar select { width: auto; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px var(--pad) 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-small); font-weight: 500; color: var(--text); cursor: pointer; flex: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.chip .n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--control); }
.chip[aria-pressed="false"] { background: transparent; color: var(--muted); border-style: dashed; }
.chip[aria-pressed="false"] .dot { opacity: .35; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, #8a8a8a); }

/* ---------- Lista ---------- */
.list { list-style: none; margin: 0; padding: 0 12px 16px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.card {
  position: relative; display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; align-items: start;
  padding: var(--row-pad); border-radius: var(--radius-card); cursor: pointer; background: var(--surface);
  border: 1px solid transparent; margin-bottom: 6px;
  transition: border-color .12s, background-color .12s;
}
.card:hover { border-color: var(--control); }
.card[aria-current="true"] { border-color: var(--text); }
.card.discarded { opacity: .6; }
.thumb { position: relative; width: 88px; height: 66px; border-radius: 6px; background: var(--raised); display: grid; place-items: center; color: var(--faint); font-size: var(--fs-small); overflow: hidden; padding: 0; border: 0; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .count, .popup-photo .count {
  position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px; line-height: 16px;
  background: rgba(10,10,10,.72); color: #fff; font-size: 11px; font-weight: 500;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.card-tags span { font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: var(--raised); color: #3d3d3d; white-space: nowrap; }
.card-tags .more { background: none; color: var(--muted); }
.card-body { min-width: 0; display: grid; gap: 2px; }
.card-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-price { font-variant-numeric: tabular-nums; }
.card-price strong { font-weight: 700; }
.card-price span { color: var(--muted); }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: var(--fs-small); color: var(--muted); min-width: 0; flex-wrap: wrap; line-height: 16px; margin-top: 2px; }
.card-meta .status { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 500; flex: none; }
.card-meta .warn { color: #92400e; }
.card-notes { display: none; font-size: var(--fs-small); color: var(--muted); line-height: 16px; margin-top: 4px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-actions { display: flex; flex-direction: column; gap: 2px; margin: -4px -4px 0 0; }
.card-actions a, .card-actions button {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-control);
  color: var(--muted); border: 0; background: none; cursor: pointer; text-decoration: none;
}
.card-actions a:hover, .card-actions button:hover { background: var(--raised); color: var(--text); }
.empty { padding: 20px; border: 1px dashed var(--control); border-radius: var(--radius-card); color: var(--muted); text-align: left; margin: 4px 0; }
.empty strong { color: var(--text); font-weight: 500; display: block; margin-bottom: 4px; }
.skeleton { height: 92px; border-radius: var(--radius-card); background: var(--surface); margin-bottom: 6px; }

/* ---------- Mapa ---------- */
.pin { cursor: pointer; transition: transform .12s; transform-origin: 50% 100%; line-height: 0; }
.pin:hover { transform: scale(1.12); }
.pin svg { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.pin.faded { opacity: .55; }
.popup { display: grid; gap: 4px; font-family: var(--font); font-size: 13px; line-height: 18px; color: var(--text); width: 240px; }
.popup-photo { position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; margin-bottom: 4px; }
.popup img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: var(--raised); display: block; }
.popup strong { font-size: var(--fs-body); font-weight: 500; }
.popup .price { font-variant-numeric: tabular-nums; }
.popup .price b { font-weight: 700; }
.popup .status { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.popup-actions { display: flex; gap: 14px; margin-top: 6px; }
.popup-actions a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.gm-style .gm-style-iw-c { border-radius: var(--radius-card); padding: 12px !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; }
.gm-style .gm-style-iw-chr { position: absolute; right: 0; top: 0; z-index: 1; }

.map-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); background: var(--ground); }

body.picking #map { cursor: crosshair; }
.pick-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 12px; align-items: center; padding: 6px 6px 6px 14px;
  background: var(--primary); color: #fff; border-radius: 999px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.pick-banner .btn { border-color: transparent; }

/* ---------- Panel de alta / edición ---------- */
.drawer { grid-area: drawer; min-height: 0; overflow-y: auto; scroll-padding-bottom: 80px; background: var(--ground); overscroll-behavior: contain; }
.drawer-card { padding: 20px var(--pad) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.drawer-head h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 500; }
.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { font-weight: 500; font-size: var(--fs-body); padding: 0; margin-bottom: 0; }
fieldset.field legend { margin-bottom: 8px; }
.hint { margin: 0; font-size: var(--fs-small); line-height: 16px; color: var(--muted); }
#fetch-msg:empty { display: none; }
.loc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.loc-row .hint.ok { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--gap); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.gallery > .hint { grid-column: 1 / -1; padding: 14px; border: 1px dashed var(--control); border-radius: var(--radius-card); }
.g-item { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--raised); }
.g-item.cover { grid-column: span 2; grid-row: span 2; }
.g-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in; background: none; }
.g-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-badge { position: absolute; left: 6px; bottom: 6px; padding: 0 6px; border-radius: 4px; background: rgba(10,10,10,.72); color: #fff; font-size: 11px; line-height: 18px; font-weight: 500; }
.g-act {
  position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 4px; border: 0; padding: 0;
  background: rgba(10,10,10,.6); color: #fff; font-size: 14px; line-height: 24px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.g-act[data-cover] { left: 4px; }
.g-del { right: 4px; }
.g-item:hover .g-act, .g-act:focus-visible { opacity: 1; }
@media (hover: none) { .g-act { opacity: 1; } }
.add-photo input { font-size: 13px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.tag button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.tag button:hover { background: var(--raised); color: var(--text); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius-control); background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: var(--fs-small); line-height: 16px; }
.notice .btn { flex: none; }
details.description summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; }
details.description summary::before { content: "›"; display: inline-block; transition: transform .12s; color: var(--muted); }
details.description[open] summary::before { transform: rotate(90deg); }
details.description textarea { margin-top: 8px; font-size: 13px; line-height: 18px; }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sidebar-foot { padding: 8px var(--pad) 12px; border-top: 1px solid var(--border); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: var(--fs-small); color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hint .link-btn { font-size: inherit; font-weight: 500; }

/* Visor de fotos */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0a0a0a; color: #fff; overflow: hidden; }
.lightbox::backdrop { background: #0a0a0a; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 20px; padding-top: max(10px, env(safe-area-inset-top)); }
.lb-top .num { font-weight: 500; }
.lb-link { white-space: nowrap; flex: none; margin-left: auto; color: #fff; font-size: 13px; text-underline-offset: 2px; }
.lb-close { color: #fff; }
.lb-close:hover { background: rgba(255,255,255,.12); }
.lb-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-track figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; padding: 56px 64px; }
.lb-track img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; transition: background-color .12s; }
.lb-nav:hover { background: rgba(255,255,255,.24); }
.lb-nav[disabled] { opacity: .25; cursor: default; }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

/* Street View */
.sv { display: none; }
.sv[open] { display: flex; flex-direction: column; }
.sv-top { position: static; background: #0a0a0a; flex: none; }
.sv-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sv-pano { flex: 1; min-height: 0; }
.sv-msg { margin: auto; padding: 24px; text-align: center; color: #d4d4d4; }
.sv-msg a { color: #fff; }
.loc-actions { display: inline-flex; gap: 6px; flex: none; }

/* Diálogo del bookmarklet */
.sheet { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.sheet::backdrop { background: rgba(10,10,10,.35); }
.sheet-card { padding: 20px 24px 24px; }
.sheet-card p, .sheet-card ol { margin: 0 0 12px; color: #2b2b2b; }
.sheet-card h3 { font-size: var(--fs-body); font-weight: 600; margin: 20px 0 6px; }
.sheet-card ol { padding-left: 20px; }
.bm-link { cursor: grab; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .12s;
}
.segmented label:hover { border-color: var(--control); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented input:checked + label { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }

.drawer-actions {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center;
  margin: 4px calc(-1 * var(--pad)) 0; padding: 12px var(--pad); padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--ground); border-top: 1px solid var(--border);
}

/* ---------- Login / toast ---------- */
.login { position: fixed; inset: 0; z-index: 50; background: var(--ground); display: grid; place-items: center; padding: 16px; }
.login-card { width: min(340px, 100%); display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px; }
.login-card h2 { margin: 0; font-size: var(--fs-title); line-height: 30px; font-weight: 500; }
.login-card p.muted { margin: 0 0 8px; }
.login-card label { font-weight: 500; }
.login-card .btn { margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-control);
  font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100vw - 32px);
}

/* ---------- Pantallas grandes ---------- */
@media (min-width: 1600px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  :root { --pad: 28px; --drawer-w: 480px; }
  .card { grid-template-columns: 112px 1fr auto; }
  .thumb { width: 112px; height: 84px; }
  .card-notes { display: -webkit-box; }
}

/* ---------- Laptop chica / tablet horizontal: el panel flota sobre el mapa ---------- */
@media (max-width: 1279px) and (min-width: 900px) {
  body.drawer-open .layout { grid-template-columns: var(--list-w) 1fr; grid-template-areas: "list map"; }
  .drawer {
    position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(var(--drawer-w), 50vw); z-index: 20;
    border-radius: var(--radius-card); border: 1px solid var(--border); box-shadow: -6px 0 24px rgba(0,0,0,.12);
  }
  .drawer-actions { border-radius: 0 0 var(--radius-card) var(--radius-card); }
}

/* ---------- Celular y tablet vertical: una vista por vez ---------- */
@media (max-width: 899px) {
  :root { --pad: 16px; --control-height: 40px; }
  body { overflow: hidden; }
  .layout {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "bar" "main" "nav";
  }
  body.drawer-open .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "main" "nav"; }
  .desk-only { display: none !important; }

  .mobile-bar {
    grid-area: bar; display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 var(--pad); padding-top: env(safe-area-inset-top); box-sizing: content-box;
    background: var(--ground); border-bottom: 1px solid var(--border);
  }
  .sidebar, .map-wrap { grid-area: main; }
  .map-wrap { margin: 0; border: 0; border-radius: 0; }
  body[data-view="map"] .sidebar { display: none; }
  body[data-view="list"] .map-wrap { visibility: hidden; }
  .sidebar-head { padding-top: 16px; }
  .title-row { display: none; }
  .summary { font-size: 20px; line-height: 28px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .list { padding: 0 8px 16px; }
  .card { grid-template-columns: 72px 1fr auto; padding: 10px; }
  .thumb { width: 72px; height: 56px; }
  .lb-track figure { padding: 56px 0; }
  .lb-nav { display: none; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .bottom-bar {
    grid-area: nav; display: grid; grid-template-columns: 1fr 1fr;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-bar button {
    height: 52px; border: 0; background: none; font-weight: 500; color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .bottom-bar button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 2px 0 var(--text); }
  .bottom-bar .num { color: var(--muted); font-weight: 400; }

  .drawer { position: fixed; inset: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
  body.picking .drawer { display: none; }
  body.picking .sidebar { display: none; }
  body.picking .map-wrap { visibility: visible; }
  .pick-banner { top: auto; bottom: 16px; }
  .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.bm-link { text-decoration: none; }

/* ---------- Lugares frecuentes, tiempos de viaje y comercios cerca ---------- */
.sidebar-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.insights { gap: 10px; padding-top: 4px; border-top: 1px solid var(--rule); }
.insights .label-row { align-items: center; }
.insights .label-row + .label-row, #commutes + .label-row { margin-top: 6px; }
.commute { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.commute:first-child { padding-top: 0; }
.commute-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.commute-head strong { font-weight: 500; }
.commute-head .muted { font-size: var(--fs-small); }
.commute-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: 16px; }
.commute-table th, .commute-table td { padding: 3px 0; text-align: right; font-weight: 400; white-space: nowrap; }
.commute-table thead th { color: var(--muted); }
.commute-table th[scope="row"] { text-align: left; color: var(--muted); }
.commute-table td.avg { font-weight: 600; color: var(--text); }
.nearby { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 12px; margin: 0; font-size: var(--fs-small); line-height: 18px; }
.nearby dt { font-weight: 500; }
.nearby dt .n { color: var(--muted); font-weight: 400; margin-left: 2px; }
.nearby dd { margin: 0; min-width: 0; }
.nearby a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.popup-commutes { display: grid; gap: 1px; margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--rule); }
.popup-commute { display: flex; justify-content: space-between; gap: 8px; }
.popup-commute span:first-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-pin { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 999px; background: var(--primary); color: #fff; font: 500 12px/16px var(--font); box-shadow: 0 1px 4px rgba(0,0,0,.25); white-space: nowrap; transform: translateY(50%); }
.places-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--rule); }
.places-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.places-list li div { display: grid; min-width: 0; }
.places-list li .muted { font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places-list li.empty { display: block; font-size: var(--fs-small); }
.place-form { display: grid; gap: 12px; }
.place-form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
