:root {
  --bg: #0c0b09;
  --panel: rgba(18, 15, 12, 0.96);
  --ink: #f7f1e7;
  --muted: #d2c6b4;
  --faint: #b7aa98;
  --gold: #e8c98a;
  --gold-2: #c6a15a;
  --line: rgba(232, 201, 138, 0.28);
  --danger: #e15d4c;
  --sea: #07141c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --card-alpha: 0.948;
  font-family: Manrope, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--sea); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--gold); }

#app {
  --bar: 58px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: var(--bar) minmax(0, 1fr);
}
#topbar { grid-column: 1 / -1; grid-row: 1; }
#sidebar { grid-column: 1; grid-row: 2; }
#map { grid-column: 2; grid-row: 2; }

#topbar {
  z-index: 800;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  padding: 0 14px;
  background:
    linear-gradient(90deg, rgba(232, 201, 138, 0.08), transparent 28%),
    #120f0c;
  border-bottom: 1px solid var(--line);
}
.top-tools { grid-column: 2; display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-side { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.account {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.auth-plaque {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  max-width: 100%;
  padding: 0 6px 0 12px;
  background:
    linear-gradient(180deg, rgba(243, 221, 176, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(232, 201, 138, 0.08), transparent 24%),
    #16130f;
  border: 1px solid rgba(232, 201, 138, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 236, 196, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.28);
}
.auth-plaque::before,
.auth-plaque::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  background: #120f0c;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.auth-plaque::before { left: -5px; }
.auth-plaque::after { right: -5px; }
.auth-crest {
  flex: none;
  width: 14px;
  height: 14px;
  background:
    radial-gradient(circle at 50% 50%, #fff6df 0 1.5px, transparent 2.5px),
    linear-gradient(135deg, #fff1cf, #c6a15a 46%, #6e5224);
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.auth-seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #4a3d2a, #120f0c 70%);
  box-shadow: inset 0 0 0 3px rgba(18, 15, 12, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.55);
  color: #fff6df;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16px;
  line-height: 1;
}
.auth-copy {
  display: grid;
  min-width: 0;
  line-height: 1;
}
.auth-kicker {
  color: var(--gold-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.auth-line {
  overflow: hidden;
  color: #fff6df;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-sub {
  flex: none;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-plaque a,
.auth-plaque button,
.profile > button,
#mark-mode {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(232, 201, 138, 0.4);
  background: rgba(0, 0, 0, 0.28);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.auth-plaque a.tsm-login {
  border-color: #f0d7a2;
  background: linear-gradient(180deg, #fff1cf, #e8c98a 42%, #a07838);
  color: #1a140c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 0 rgba(0, 0, 0, 0.45);
}
.auth-plaque a:hover,
.auth-plaque button:hover,
.profile > button:hover,
#mark-mode:hover { filter: brightness(1.12); }
.auth-plaque a:focus-visible,
.auth-plaque button:focus-visible,
.profile > button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.auth-note {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  margin: 0;
  max-width: min(360px, 80vw);
  padding: 8px 12px;
  border: 1px solid rgba(225, 93, 76, 0.55);
  background: #1a120f;
  box-shadow: var(--shadow);
  color: #ffb1a8;
  font-size: 12px;
}
.auth-note:empty { display: none; }
.profile { position: relative; flex: none; }
.profile > button { height: 42px; padding: 0 16px; }
.profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.profile-panel[hidden] { display: none; }
.profile-panel label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.profile-panel label span { color: var(--gold); font-variant-numeric: tabular-nums; }
.profile-panel input[type="range"] { width: 100%; accent-color: var(--gold); cursor: pointer; }
.profile-panel .hint { margin: 0; }

#sidebar {
  position: relative;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px 16px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(232, 201, 138, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(232, 201, 138, 0.05), transparent 180px),
    var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(232, 201, 138, 0.08);
  overflow: auto;
  backdrop-filter: blur(8px);
}

.brand h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.95;
  background: linear-gradient(180deg, #fff6df, #e8c98a 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.lede { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.search-wrap { position: relative; z-index: 8; width: clamp(150px, 28vw, 340px); }
.search { display: block; }
#topbar .search input { height: 40px; padding: 8px 12px; }
#mark-mode { height: 40px; padding: 0 14px; }
#mark-mode.on { background: var(--gold); color: #1a140c; border-color: var(--gold); filter: none; }
.search input, .jump-box > button, .detail input, #topbar .account input {
  width: 100%;
  border: 1px solid var(--line);
  background: #120f0c;
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
#topbar .account input { width: 148px; padding: 8px 12px; }
.search input::placeholder { color: var(--faint); }
.search input:focus, .jump-box > button:focus, .detail input:focus {
  border-color: var(--gold);
}

.jump { display: grid; gap: 6px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.jump-box { position: relative; }
.jump-box > button {
  text-align: left;
  cursor: pointer;
  padding-right: 36px;
}
.jump-box > button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-70%) rotate(45deg);
}
.jump-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #1a1612;
  border: 1px solid rgba(232, 201, 138, 0.55);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.jump-menu[hidden] { display: none !important; }
.jump-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #f7f1e7;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.jump-menu button:hover, .jump-menu button:focus, .jump-menu button.on {
  background: rgba(232, 201, 138, 0.18);
  color: #fff8e8;
  outline: none;
}

.results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  list-style: none;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(232, 201, 138, 0.45);
  border-radius: 12px;
  background: #1a1612;
  max-height: 280px;
  overflow: auto;
  box-shadow: var(--shadow);
}
.results[hidden] { display: none !important; }
.results button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 8px;
  cursor: pointer;
}
.results button:hover, .results button.active { background: rgba(228, 194, 122, 0.12); }
.results small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.results .empty { padding: 10px; color: var(--faint); font-size: 13px; }

.layers { display: grid; gap: 10px; }
.group {
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(232, 201, 138, 0.08), rgba(0, 0, 0, 0.18));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.08);
}
.group h2 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 14px;
}
.layer input { accent-color: var(--gold-2); }
.pip { width: 9px; height: 9px; border-radius: 99px; box-shadow: 0 0 0 2px rgba(0,0,0,0.25); flex: none; }
.node-key { width: 18px; height: 18px; object-fit: contain; flex: none; }
.leaflet-div-icon.node-pin, .leaflet-div-icon.fish-pin, .leaflet-div-icon.boss-pin { background: transparent; border: 0; overflow: visible; }
.fish-pin img, .boss-pin img { display: block; width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.boss-pin img { width: 40px; height: 40px; object-fit: contain; }
.fish-pin.is-spot img, .boss-pin.is-spot img { transform: scale(1.35); }
.actor-face { display: block; width: 96px; height: 96px; object-fit: contain; margin: 0 0 8px; border-radius: 8px; background: #14110d; }
.yield-list .chance { margin-left: auto; color: var(--faint); font-size: 12px; }
.node-pin img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}
.node-pin.on-route img {
  filter: drop-shadow(0 0 3px rgba(255, 244, 200, 1)) drop-shadow(0 0 8px rgba(232, 201, 138, 0.9));
}
.node-pin.in-region img {
  filter: drop-shadow(0 0 4px rgba(246, 226, 182, 0.95)) drop-shadow(0 0 10px rgba(232, 201, 138, 0.75)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}
.node-name {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  pointer-events: none;
  color: #fff6e4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid rgba(232, 201, 138, 0.28);
  border-radius: 5px;
  padding: 1px 5px;
}
.node-name.place { font-size: 13px; color: #ffe7b0; }
#map.show-places .node-name.place,
#map.region-on .node-pin.in-region .node-name.place,
#map.show-mid .node-name.mid,
#map.show-nodes .node-name { display: block; }
.count { margin-left: auto; color: var(--faint); font-size: 12px; }

.fishbox {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(90, 160, 190, 0.14), rgba(6, 16, 24, 0.55));
  border: 1px solid rgba(150, 200, 220, 0.28);
  box-shadow: inset 0 1px 0 rgba(220, 245, 255, 0.08);
}
.ranks { display: grid; gap: 2px; max-height: 280px; overflow: auto; }
.rank-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rank-list { display: none; grid-template-columns: 1fr 1fr; gap: 1px 8px; padding: 0 0 6px; }
.rank.open .rank-list { display: grid; }
.fish-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 3px 2px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink);
}
.fish-pick img, .fish-ico, .fish-row img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: none;
}
.fish-pick:hover { color: var(--gold); }
.fish-pick.on {
  color: #1a140c;
  background: var(--gold);
  border-radius: 6px;
  font-weight: 700;
}
.fishbox h2 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8eb8c9;
}
.fishbox input,
.fishbox .hint,
.fishbox details { grid-column: 1 / -1; }
.fishbox summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.hotspot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 8px; }
.hotspot-grid label { display: flex; gap: 6px; align-items: center; font-size: 12px; cursor: pointer; }

.hint, .credits { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.45; }
.credits { margin-top: auto; display: grid; gap: 8px; }

#map { height: 100%; background: var(--sea); min-width: 0; min-height: 0; }
.leaflet-container { background: var(--sea); font-family: Manrope, sans-serif; }

.leaflet-tooltip.bdo-tip {
  background: #1a1612;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px 8px;
  font-size: 12px;
}
.leaflet-tooltip.bdo-tip::before { border-top-color: #1a1612; }

.region-label {
  overflow: visible;
  background: transparent;
  border: 0;
  color: rgba(247, 241, 231, 0.82);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  text-align: center;
}
.pin-icon {
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

#sidebar-toggle, .coords, .detail, .loading { position: absolute; z-index: 600; }
#sidebar-toggle {
  top: calc(var(--bar) + 12px);
  left: 354px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
#app.sidebar-closed { grid-template-columns: minmax(0, 1fr); }
#app.sidebar-closed #sidebar { display: none; }
#app.sidebar-closed #map { grid-column: 1 / -1; grid-row: 2; }
#app.sidebar-closed #sidebar-toggle { left: 14px; }

.coords {
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 14, 12, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.detail {
  left: 354px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 390px));
  max-height: min(72vh, 620px);
  overflow: hidden;
  padding: 0 0 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(232, 201, 138, calc(var(--card-alpha) * 0.16)), transparent 72px),
    rgba(18, 15, 12, var(--card-alpha));
  border: 1px solid rgba(232, 201, 138, 0.55);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 236, 196, 0.2);
}
.detail.is-dragging { cursor: grabbing; }
.detail-grip {
  flex: none;
  height: 28px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  display: grid;
  place-items: center;
}
.detail-grip::before {
  content: "";
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(232, 201, 138, 0.85);
  box-shadow: 0 7px 0 rgba(232, 201, 138, 0.35);
}
.detail h2, .detail .kicker, .detail .alt { cursor: grab; }
.detail.is-dragging h2,
.detail.is-dragging .kicker,
.detail.is-dragging .alt,
.detail.is-dragging .detail-grip { cursor: grabbing; }
#detail-body {
  overflow: auto;
  min-height: 0;
  padding: 0 14px;
}
#app.sidebar-closed .detail { left: 16px; width: min(380px, calc(100vw - 32px)); }
.detail .kicker { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.detail h2 { margin: 4px 36px 4px 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; line-height: 1; font-weight: 600; }
.detail .alt { margin: 0 0 6px; color: var(--faint); font-size: 12px; }
.detail p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.detail .row { display: flex; gap: 8px; flex-wrap: wrap; }
.detail a, .detail button.ghost {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}
.detail[hidden] { display: none !important; }
.yield-list {
  list-style: none;
  margin: 2px 0 10px;
  padding: 0;
  display: grid;
  gap: 2px;
}
.yield-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ink);
  font-size: 14px;
}
.yield-list img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: none;
}
.detail .close {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 99px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.detail .danger { color: #ffb1a8; border-color: rgba(225, 93, 76, 0.4); }
.fish-list { display: grid; gap: 2px; }
.fish-list .grade { margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.grade-prize { color: #f2d48a; }
.grade-rare { color: #ffe14a; }
.grade-high { color: #7eb6ff; }
.grade-general { color: #8dce8a; }
.grade-harpoon { color: #d7b4ff; }
.grade-trash { color: #8d97a3; }
.fish-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 5px 6px;
  cursor: pointer;
  font-size: 13px;
}
.fish-row:hover { background: rgba(232, 201, 138, 0.1); }
.fish-row .rate { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.zone-jump { width: 100%; text-align: left; }

.loading {
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 20, 28, 0.82);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
}
.loading.hidden { display: none; }

.leaflet-control-zoom {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  background: #1a1612 !important;
  color: var(--ink) !important;
  border-bottom-color: var(--line) !important;
}

#app.marking, #app.marking .leaflet-container { cursor: crosshair; }

.route-box { display: grid; gap: 8px; }
.route-box h2 {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.route-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-picks button, #route-clear {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #120f0c;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.route-picks button.armed { border-color: var(--gold); color: var(--gold); background: rgba(232, 201, 138, 0.12); }
.route-sum {
  margin: 0;
  color: #fff6df;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  line-height: 0.95;
}
.route-list {
  max-height: 240px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  display: grid;
  gap: 2px;
}
.route-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--ink);
}
.route-list button:hover { color: var(--gold); }
.route-list .cost { color: var(--gold); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #map, #app.sidebar-closed #map { grid-column: 1; grid-row: 2; }
  #sidebar {
    position: absolute;
    top: var(--bar);
    right: auto;
    bottom: 0;
    left: 0;
    width: min(340px, 92vw);
    box-shadow: var(--shadow);
  }
  #app { --bar: 112px; }
  .auth-kicker, .auth-sub, .auth-plaque:not(.signed) .auth-copy { display: none; }
  .auth-line { font-size: 16px; }
  #topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 46px 46px;
    justify-items: center;
    height: var(--bar);
    padding: 8px 10px;
  }
  .top-tools, .top-side { grid-column: 1; justify-self: center; }
  .top-side { grid-row: 2; }
  .search-wrap { width: min(210px, 58vw); }
  .account, .account form { flex: 1 1 auto; min-width: 0; }
  #topbar .account input { width: auto; flex: 1 1 72px; min-width: 0; }
  #sidebar-toggle { left: 14px; top: calc(var(--bar) + 12px); }
  #app:not(.sidebar-closed) #sidebar-toggle { left: min(354px, calc(92vw + 8px)); }
  .detail { left: auto; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); }
}
