:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f3f5f9;
  --line: #d6dced;
  --text: #1b2330;
  --muted: #5b6675;
  --accent: #2f6bff;
  --accent-2: #6b46ff;
  --danger: #e5484d;
  --ok: #159a5b;
  --shadow: 0 1px 2px rgba(20, 30, 55, .06), 0 4px 16px rgba(20, 30, 55, .06);
  font-size: 14px;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must win over components that set `display` (toolbars, #selBar). */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .04s, box-shadow .12s;
}
button:hover { background: var(--panel-2); border-color: #c2cadd; }
button:active { transform: translateY(1px); }
button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #2a60e6; }
button.danger { color: var(--danger); }
button:disabled { opacity: .8; cursor: default; }
/* While a button is mid-task its label counts percentages; a fixed width keeps it from stuttering
   on every tick. Wide enough for the longest label ("Uploading… 100%"). */
button.btn-busy {
  min-width: 11.5rem; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
}

/* Track is a neutral gray so it reads on both light and colored buttons; the moving arc takes the
   button's own text color, which is why it stays visible on "Load" and on Publish. */
.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 5px;
  border: 2px solid rgba(120,130,150,.35); border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

input[type="text"], input[type="number"], select {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
}
input::placeholder { color: #9aa4b4; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Top bar ---------- */
#topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 500;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: .2px; }
.brand .sub { color: var(--muted); font-weight: 400; }
.brand .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: url("/icon.svg") center/contain no-repeat;
}
.mode-switch { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.mode-switch button { border: none; background: transparent; border-radius: 6px; }
.mode-switch button:hover { background: #e7ebf3; }
.mode-switch button.active { background: var(--accent); color: #fff; }
.mode-switch button.active:hover { background: var(--accent); }

.topbar-config { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.map-name { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 3px; }
.map-name input { width: 180px; }
.albumart-pick {
  display: flex; align-items: center; gap: 8px;
  border: 1px dashed #c2cadd; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  color: var(--muted); background: #fff;
}
.albumart-pick:hover { border-color: var(--accent); color: var(--text); }
#albumArtThumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.io-buttons { display: flex; gap: 8px; margin-left: auto; align-items: center; }
/* Toolbar dropdown menu */
.menu-wrap { position: relative; }
#menuBtn { min-width: 140px; text-align: center; }   /* fixed so "Exporting NN%" doesn't resize it */
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 600; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(20, 30, 55, .18);
}
.menu button { text-align: left; border: none; background: transparent; border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--text); }
.menu button:hover { background: var(--panel-2); }
.menu .menu-publish { color: var(--accent-2); font-weight: 650; }
.speed-select { font-size: 13px; }

/* Vertex / centre / radius editing handles on the map */
.edit-handle { cursor: grab; }
.edit-handle:active { cursor: grabbing; }
.edit-handle i {
  display: block; width: 15px; height: 15px; box-sizing: border-box;
  border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(20, 30, 55, .35);
}
.edit-handle.vertex i { border-radius: 4px; }
.edit-handle.center i { border-radius: 50%; }
.edit-handle.radius i { border-radius: 50%; }

/* ---------- Main split ---------- */
main { flex: 1; display: flex; min-height: 0; }
#mapPane { position: relative; flex: 1 1 62%; min-width: 0; display: flex; flex-direction: column; }
#map { flex: 1; }
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
/* The hint shares its row with the tool buttons. It is the only thing allowed to shrink, and it
   truncates rather than wrapping — so however long the text gets, the buttons keep their size. */
.toolbar > button { flex: 0 0 auto; }
.toolbar .hint {
  color: var(--muted); font-size: 12px;
  flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.listener-readout { color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
#stopListen { margin-left: auto; }

#sidePane {
  flex: 0 0 38%; max-width: 460px; min-width: 320px;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
/* Listen mode is a preview of what a listener sees, so the authoring pane goes away entirely and
   the map takes the whole width. The top bars stay: mode switch, menu and the listen toolbar are
   how you drive the preview. Leaflet has to be told the container resized — see setMode. */
body.listening #sidePane { display: none; }
.count { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; font-size: 12px; color: var(--muted); }

/* Side-panel tabs */
.side-tabs { display: flex; border-bottom: 1px solid var(--line); }
.side-tab {
  flex: 1; border: none; background: transparent; border-radius: 0; padding: 13px 10px;
  color: var(--muted); font-weight: 650; font-size: 14px; border-bottom: 2px solid transparent;
}
.side-tab:hover { background: var(--panel-2); }
.side-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.side-tab .count { margin-left: 6px; }

.tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#tabDetails { overflow-y: auto; padding: 18px; }
#shapeList { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.empty { color: var(--muted); text-align: center; padding: 30px 24px; line-height: 1.6; font-size: 13px; }

#selBar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
#selCount { font-size: 12px; color: var(--accent); font-weight: 600; margin-right: auto; }
#selBar button { padding: 4px 10px; font-size: 12px; }
.shape-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shape-actions .edit-btn { font-size: 12px; padding: 5px 10px; border-color: var(--accent); color: var(--accent); }
.shape-actions .edit-btn:hover { background: rgba(47, 107, 255, .08); }
.redraw-btn { align-self: flex-start; font-size: 12px; padding: 5px 10px; }
.loopprev-btn { align-self: flex-start; font-size: 12px; padding: 5px 10px; }

/* Details form */
.details-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.field-hint { font-weight: 400; }
.field input[type="text"], .field textarea { width: 100%; font: inherit; }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field-count { font-size: 11px; color: var(--muted); align-self: flex-end; }
.details-form .albumart-pick { align-self: flex-start; }

/* ---------- Shape cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
}
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.card.sounding { box-shadow: 0 0 0 1px var(--ok), var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; }
.swatch { width: 20px; height: 20px; border-radius: 6px; border: 2px solid rgba(0,0,0,.15); cursor: pointer; flex: 0 0 auto; padding: 0; }
.swatch-static { cursor: default; }

/* Details tab: per-walk dialogue state colors */
.dialogue-colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dcolor { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dcolor input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; flex: 0 0 auto; }

/* Details tab: intro / exit clip pickers */
.clip-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-choose { border: 1.5px dashed #c2cadd; border-radius: 8px; padding: 6px 12px; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.clip-choose:hover { border-color: var(--accent); color: var(--text); }
.clip-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.clip-play, .clip-clear, .clip-dl { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.clip-gain { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.clip-gain input { width: 58px; font: inherit; }

/* Listen toolbar: intro / outro trigger buttons */
.listen-action { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.listen-action:hover:not(:disabled) { border-color: var(--accent); }
.listen-action:disabled { opacity: .45; cursor: not-allowed; }

/* Loop card: crossfade checkbox */
.checkbox-field { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.checkbox-field input { cursor: pointer; }
.card-head input.name { flex: 1; background: transparent; border: none; border-bottom: 1px solid transparent; border-radius: 0; padding: 3px 2px; font-weight: 600; }
.card-head input.name:hover { border-bottom-color: var(--line); }
.card-head input.name:focus { border-bottom-color: var(--accent); outline: none; }
.card-head .type-badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.card-head .del { border: none; background: transparent; color: var(--muted); padding: 2px 6px; }
.card-head .del:hover { color: var(--danger); background: transparent; }

.dropzone {
  border: 1.5px dashed #c2cadd; border-radius: 9px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px;
  cursor: pointer; transition: border-color .12s, background .12s; background: var(--panel-2);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: rgba(47,107,255,.10); color: var(--text); }
.dropzone.has-audio { border-style: solid; color: var(--text); background: #fff; }
.dropzone .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-warning { margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--danger); }
.dropzone .preview-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; }

.mode-row { display: flex; gap: 6px; }
.mode-row button { flex: 1; font-size: 12px; padding: 6px 4px; }
.mode-row button.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.params { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.params label { display: flex; align-items: center; gap: 6px; }
.params input[type="number"] { width: 58px; }
.params input[type="range"] { width: 90px; }
.check-inline { cursor: pointer; user-select: none; }
.check-inline input { margin: 0; }

/* ---------- Color picker popover ---------- */
.color-popover {
  position: fixed; z-index: 10000;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; box-shadow: 0 8px 30px rgba(20, 30, 55, .18);
}
.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.color-opt {
  width: 28px; height: 28px; border-radius: 6px; padding: 0;
  border: 2px solid rgba(0,0,0,.12); cursor: pointer; transition: transform .06s;
}
.color-opt:hover { transform: scale(1.1); background-clip: padding-box; }
.color-opt.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.color-section { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 8px 2px 4px; }
.color-custom { margin-top: 8px; width: 100%; font-size: 12px; padding: 6px; }

/* ---------- Auth / publish ---------- */
.account-email { align-self: center; font-size: 12px; color: var(--muted); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.publish { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
button.publish:hover { background: #5c3fe0; }
#loginGate {
  position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center;
  background: rgba(20, 30, 55, .55); backdrop-filter: blur(4px);
}
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px 34px 30px;
  width: min(420px, 90vw); text-align: center; box-shadow: 0 20px 60px rgba(20, 30, 55, .3);
}
.login-card h2 { margin: 4px 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-dot { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 14px;
  background: url("/icon.svg") center/contain no-repeat; }
#gbtn { display: flex; justify-content: center; }
.gate-error { margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  color: #7a2130; background: #fdecef; border: 1px solid #f6c9d1; }
.gate-error a { color: var(--accent); }

/* ---------- Modals (publish / success) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center;
  background: rgba(20, 30, 55, .55); backdrop-filter: blur(4px); padding: 20px;
}
.modal {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  width: min(520px, 94vw); max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(20, 30, 55, .3);
}
.modal-sm { width: min(360px, 92vw); text-align: center; padding: 28px 26px 24px; position: relative; }
.modal-head { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-x { border: none; background: transparent; font-size: 16px; color: var(--muted); padding: 4px 8px; }
.modal-x:hover { color: var(--ink); background: transparent; }
.modal-body { padding: 18px 20px; }
.modal-intro { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.pub-summary { display: flex; gap: 16px; }
.pub-art { width: 84px; height: 84px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.pub-art img { width: 100%; height: 100%; object-fit: cover; }
.pub-art-empty { font-size: 11px; color: var(--muted); }
.pub-fields { flex: 1; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-row { display: flex; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.pub-row dt { color: var(--muted); width: 90px; flex: 0 0 auto; }
.pub-row dd { margin: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pub-row.missing { background: #fdecef; }
.pub-row.missing dt { color: var(--danger); font-weight: 650; }
.pub-row.missing dd::after { content: "— required"; color: var(--danger); }

.pub-confirm { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.pub-confirm input { margin-top: 2px; flex: 0 0 auto; }
.pub-error { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  color: #7a2130; background: #fdecef; border: 1px solid #f6c9d1; }

.success-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: grid;
  place-items: center; color: #fff; font-size: 28px; background: var(--ok); }
.success-msg { color: var(--muted); margin: 0 0 16px; }
.modal-sm .modal-x { position: absolute; top: 12px; left: 12px; }
.success-qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.success-qrcap { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.success-link { display: block; font-size: 12px; word-break: break-all; margin-top: 10px; }
/* Buttons sit below the link with real breathing room, and wrap on narrow screens. */
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* My-walks list */
.walks-list { display: flex; flex-direction: column; gap: 10px; }
.walks-empty { color: var(--muted); text-align: center; padding: 26px; }
.walks-section { margin: 14px 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.walk-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.walk-item .info { flex: 1; min-width: 0; }
.walk-item .info h4 { margin: 0 0 2px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.walk-item .info .meta { font-size: 12px; color: var(--muted); }
.walk-item .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.walk-item .actions button { font-size: 12px; padding: 5px 9px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; box-shadow: 0 8px 30px rgba(20,30,55,.18); z-index: 9999; max-width: 80vw;
}
#toast.err { border-color: var(--danger); }
#toast.ok { border-color: var(--ok); }

/* Leaflet light tweaks */
.leaflet-container { background: #e6e6e6; }   /* grey twin of the old #dfe6ef, shown while tiles load */
/* Tiles live in their own Leaflet pane, so this greys the basemap and nothing else: the shapes,
   routes and drag handles sit in the overlay/marker panes and keep their colour. */
.leaflet-tile-pane { filter: grayscale(1); }
.leaflet-tooltip.shape-tip { background: #fff; border: 1px solid var(--line); color: var(--text); }
.listener-marker {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(47,107,255,.28);
}

/* ---- Artist details modal: name + colour + side-by-side markdown editor/preview ---- */
.modal-wide { width: min(960px, 96vw); }
.modal-wide .modal-body { display: flex; flex-direction: column; gap: 16px; }

.field-note { font-weight: 400; color: var(--muted); }
.linkish { border: none; background: transparent; padding: 0; font: inherit;
  color: var(--accent); text-decoration: underline; cursor: pointer; }
.linkish:hover { background: transparent; }

.color-row { display: flex; align-items: center; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.check-row input { margin: 0; }
input[type="color"]:disabled { opacity: .4; cursor: default; }
.color-row input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: none; }
.color-row .hex { width: 92px; font: inherit; text-transform: lowercase; }

/* Source and preview share a row and scroll independently; they stack on narrow screens. */
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
@media (max-width: 720px) { .md-split { grid-template-columns: 1fr; } }
.md-source, .md-preview { height: 46vh; min-height: 260px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; }
.md-source { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  line-height: 1.55; padding: 12px; resize: none; }
.md-preview { padding: 12px 14px; background: var(--panel-2); font-size: 14px; line-height: 1.6; }
.md-preview > :first-child { margin-top: 0; }
.md-preview > :last-child { margin-bottom: 0; }
.md-preview h1 { font-size: 20px; margin: 18px 0 8px; }
.md-preview h2 { font-size: 17px; margin: 16px 0 8px; }
.md-preview h3 { font-size: 15px; margin: 14px 0 6px; }
.md-preview p, .md-preview ul, .md-preview ol { margin: 0 0 10px; }
.md-preview ul, .md-preview ol { padding-left: 22px; }
.md-preview a { color: var(--accent); }
.md-preview code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: #e8ecf5; padding: 1px 5px; border-radius: 5px; }
.md-preview pre { background: #e8ecf5; padding: 10px 12px; border-radius: 8px; overflow: auto; }
.md-preview pre code { background: none; padding: 0; }
.md-preview blockquote { margin: 0 0 10px; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line); color: var(--muted); }
.md-preview img { max-width: 100%; border-radius: 8px; }
.md-preview-empty { color: var(--muted); font-style: italic; }
/* The bio preview wears the artist's own page colour, so it previews the page, not just the text. */
.md-preview.on-dark { color: #fff; }
.md-preview.on-dark a { color: #8ab4ff; }
.md-preview.on-dark code, .md-preview.on-dark pre { background: rgba(255,255,255,.14); }
.md-preview.on-dark blockquote { border-left-color: rgba(255,255,255,.3); color: rgba(255,255,255,.75); }
.md-preview.on-dark .md-preview-empty { color: rgba(255,255,255,.6); }
/* The Details sidebar is narrow, so its About preview grows with the text instead of filling a pane. */
.md-preview-inline { height: auto; min-height: 0; max-height: 220px; font-size: 13px; }

/* Start-anchor pin: where a transportable walk begins, and which way it faces. */
.anchor-pin { background: none; border: 0; }
.anchor-arrow { width: 30px; height: 30px; display: grid; place-items: center;
  filter: drop-shadow(0 1px 3px rgba(20,30,55,.45)); transform-origin: 50% 50%; }
#anchorHeadingRow input[type="range"] { flex: 1; }

/* ---- suggested routes ------------------------------------------------- */
/* Endpoint markers: just the dot. iconSize is null so the div sizes itself; iconAnchor keeps the
   dot on the point. Captions at an endpoint are Labels now. */
.route-end { display: flex; align-items: center; height: 20px; pointer-events: none; }
.route-end i { display: block; border-radius: 50%; flex: 0 0 auto; }
.route-label-input { width: 108px; }

/* Pan tool: the map is the only thing you can grab, so show the hand closing on drag. */
#map.pan-mode:active { cursor: grabbing; }

/* ---- map labels (free-standing markings) --------------------------------
   The divIcon wrapper is collapsed to a point and its single child is centred on it, so a label
   sits on its coordinate whatever size the text or image turns out to be — Leaflet can't compute
   an anchor for content it doesn't measure. Fixed screen size at every zoom, by design. */
.map-label { width: 0 !important; height: 0 !important; background: none; border: 0; }
.map-label > * {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: block; max-width: none; pointer-events: none;
}
/* The wrapper is collapsed to a point, so the content is the only thing with any area: it has to
   take the pointer while authoring or a label could never be selected or dragged. Leaflet adds
   .leaflet-interactive only when the marker was built interactive, which is edit mode only. */
.map-label.leaflet-interactive > * { pointer-events: auto; cursor: move; }
.map-label span {
  padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-weight: 600; line-height: 1.25;
}
.map-label img { image-rendering: auto; }
.map-label.selected > * { outline: 2px solid var(--accent, #2f6bff); outline-offset: 2px; }

.marking-head {
  margin: 14px 4px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
}
.marking-note { margin-top: 14px; }
.label-thumb {
  width: 34px; height: 34px; object-fit: contain; border-radius: 4px;
  background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 10px 10px;   /* show alpha */
  border: 1px solid var(--line);
}
