:root {
  font: 14px/1.5 "Aptos", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--shell);
  color-scheme: light;
  --shell: #f6f8fb;
  --paper: var(--worldscape-surface);
  --panel: var(--shell);
  --ink: #18243a;
  --muted: #4e5e73;
  --faint: #f1f5fa;
  --line: #d9e3ee;
  --accent: #244d80;
  --accent-hover: #1b3d67;
  --accent-soft: #eaf1fa;
  --blue: var(--accent);
  --blue-soft: var(--accent-soft);
  --control-border: #c1d1e3;
  --shadow: 0 5px 16px #18243a16, 0 1px 4px #18243a0d;
  --atlas-preview: url("/atlas/atlas-amsterdam.webp?v=canal-inset");
  --pad: 22px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { height: 100dvh; }
body { display: flex; flex-direction: column; overscroll-behavior: none; background: var(--paper); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ui-icon { display: block; width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: 3px; }

#main-nav { flex: none; display: flex; align-items: center; gap: 4px; margin: 11px var(--pad) 0; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--shell); }
#main-nav button { display: inline-flex; flex: 1 1 0; min-width: 0; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 3px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
#main-nav .ui-icon { width: 15px; height: 15px; }
#main-nav button:hover { background: var(--paper); color: var(--ink); }
#main-nav button[aria-current="page"] { border-color: var(--control-border); background: var(--accent-soft); color: var(--accent); font-weight: 700; }

#workspace { position: relative; width: 100%; min-height: 0; flex: 1; display: grid; grid-template-columns: clamp(302px, 23.4vw, 360px) minmax(0, 1fr); gap: 12px; padding: 11px clamp(12px, 1.65vw, 24px) 8px; background: var(--shell); }
#workspace.panel-folded, #workspace.in-scene { grid-template-columns: minmax(0, 1fr); }
#workspace.panel-folded > #sidebar, #workspace.in-scene > #sidebar, #workspace.in-scene #rail-fold { display: none; }
#map-pane { position: relative; overflow: hidden; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); box-shadow: 0 3px 15px #18243a0b; }
#sidebar { position: relative; z-index: 7; display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 3px 13px #18243a0a; }
#workspace-intro { position: relative; isolation: isolate; flex: none; padding: 20px var(--pad) 0; }
#workspace-intro::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 -8px auto;
  width: 55%;
  border-radius: 0 13px 0 0;
  background: linear-gradient(90deg, var(--paper), #fff0 53%), linear-gradient(0deg, var(--paper), #fff0 50%), var(--atlas-preview) 60% 50% / cover;
  content: "";
  pointer-events: none;
}
#workspace-heading { margin: 0; color: var(--ink); font-size: clamp(25px, 2.1vw, 32px); font-weight: 720; line-height: 1.25; letter-spacing: -.038em; text-shadow: 0 1px 6px var(--paper), 0 0 16px var(--paper); }
#workspace-heading[data-published-place] { overflow-wrap: anywhere; }

#search-card { position: relative; flex: none; margin: 13px var(--pad) 17px; }
#search-form { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 47px; padding: 4px 8px; background: var(--shell); border: 1px solid var(--control-border); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
#search-form:focus-within { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 2px #244d8026; }
#search-go, #clear { display: grid; place-items: center; flex: none; width: 29px; height: 31px; padding: 0; border: 0; border-radius: 6px; background: transparent; }
#search-go { color: var(--accent); }
#search-go:hover, #clear:hover { background: var(--accent-soft); }
.lens { position: relative; width: 13px; height: 13px; margin: -2px 1px 0 0; border: 1.6px solid var(--accent); border-radius: 50%; }
.lens::after { content: ""; position: absolute; width: 6px; height: 1.6px; right: -4px; bottom: -2px; background: var(--accent); transform: rotate(46deg); }
#query { flex: 1; min-width: 0; height: 32px; border: 0; outline: 0; background: transparent; font-size: 13px; }
#query::placeholder { color: var(--muted); }
#clear { color: var(--muted); font: 22px/1 system-ui; }
#shortcut { display: grid; place-items: center; width: 20px; height: 22px; flex: none; margin: 0 1px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--muted); font: 12px/1 ui-monospace, monospace; }
#panel { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 9; max-height: min(53dvh, 430px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
#panel .content { padding: 15px 16px; }
#panel p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#panel p + p { margin-top: 6px; }
#panel h2 { margin: 0 0 4px; font-size: 16px; }
.choices { padding: 4px 0; }
.choice-caption { padding: 8px 15px 5px; font-size: 12px !important; }
.result { display: flex; gap: 9px; align-items: start; width: 100%; padding: 10px 15px; border: 0; background: var(--paper); text-align: left; }
.result:hover, .result:focus-visible { background: var(--faint); }
.result[aria-current="true"] { background: var(--accent-soft); }
.result.saved { align-items: center; }
.result.saved .place-glyph { align-self: center; }
.result.city-browse { color: var(--accent); }
.result b, .result small { display: block; }
.result small, .coordinate { color: var(--muted); font: 12px/1.5 ui-monospace, monospace; }
.dot-icon { width: 7px; height: 7px; flex: none; margin-top: 7px; border-radius: 50%; background: var(--blue); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--accent); font-size: 13px; font-weight: 620; }
.action:hover:enabled { background: var(--faint); border-color: var(--control-border); }
.action.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.action.primary:hover:enabled { border-color: var(--accent-hover); background: var(--accent-hover); }
.loading { display: flex; align-items: center; gap: 8px; }
.loading::before { content: ""; width: 13px; height: 13px; flex: none; border: 2px solid #e0e8f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#directory-toggle { display: none; }
#directory { min-height: 0; display: flex; flex-direction: column; flex: 1; padding-top: 13px; border-top: 1px solid var(--line); }
#directory > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 var(--pad) 10px; }
.directory-head-controls { display: flex; align-items: center; gap: 7px; }
#directory-shuffle { min-height: 30px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--accent); font-size: 11px; font-weight: 650; white-space: nowrap; }
#directory-shuffle:hover:enabled { border-color: var(--control-border); background: var(--faint); }
#directory h2, #coverage-heading { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
#directory h2 { font-size: 16px; letter-spacing: -.012em; }
#directory-close { display: none; }
#directory nav { display: flex; gap: 4px; flex: none; align-items: center; margin: 0 var(--pad) 10px; max-width: calc(100% - 2 * var(--pad)); padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--shell); }
#directory nav button, .directory-pages button { min-height: 27px; padding: 3px 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
#directory nav button { flex: 1 1 0; min-height: 30px; }
#directory nav button:hover, #directory nav button[aria-pressed="true"] { border-color: var(--control-border); background: var(--accent-soft); color: var(--accent); font-weight: 660; }
#directory-body { min-height: 0; overflow: auto; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--panel); }
#directory-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 10px var(--pad) 14px; }
#directory-list li { display: flex; align-items: center; gap: 1px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); transition: border-color .17s, background .17s, box-shadow .17s; }
#directory-list li:hover, #directory-list li:focus-within { border-color: var(--control-border); box-shadow: 0 3px 9px #233d6116; }
#directory-list li.is-selected { border-color: #a4c0e8; background: var(--accent-soft); }
.directory-place { display: flex; flex: 1; align-items: center; gap: 11px; min-width: 0; min-height: 74px; padding: 7px 3px 7px 7px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.place-label { display: block; min-width: 0; }
.place-label strong, .place-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-label strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; margin-block: 1px; color: var(--ink); font-size: 14px; font-weight: 690; line-height: 1.35; }
.place-label small { color: var(--muted); font-size: 11px; line-height: 1.33; }
.place-label .place-hierarchy { color: var(--muted); }
.place-label .directory-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 3px; white-space: normal; overflow-wrap: anywhere; }
.place-label .directory-activity { margin-top: 3px; color: var(--accent); white-space: normal; overflow-wrap: anywhere; }
.map-coordinate span:last-child, dd.map-coordinate { font: 10px/1.35 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.place-glyph { position: relative; display: grid; place-items: center; flex: none; width: 78px; height: 49px; overflow: hidden; border-radius: 6px; background: var(--faint); color: var(--accent); }
.place-glyph img, #place-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.place-glyph .ui-icon { width: 21px; height: 21px; }
.rank { position: absolute; inset: 4px auto auto 4px; display: grid; place-items: center; min-width: 18px; height: 18px; padding-inline: 3px; border-radius: 3px; background: #172d39e8; color: #fff; font: 670 10px/1 ui-monospace, monospace; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.vote-actions { display: flex; align-items: center; gap: 1px; flex: none; margin-right: 5px; }
.like, .undo-like { display: flex; align-items: center; gap: 3px; min-width: 19px; min-height: 32px; padding: 3px; border: 0; border-radius: 5px; background: transparent; color: #667990; }
.like:hover, .undo-like:hover { background: var(--blue-soft); }
.heart { display: flex; color: #456782; }
.heart .ui-icon, .undo-like .ui-icon { width: 16px; height: 16px; }
.like.has-vote .heart { color: #a43e46; }
.like.has-vote .heart svg { fill: currentColor; }
.votes { font: 11px/1 system-ui; }
#directory-status { color: var(--muted); font-size: 12px; margin: 8px var(--pad); }
.directory-pages { display: grid; flex: none; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 4px; padding: 6px var(--pad) 9px; border-top: 1px solid var(--line); background: var(--paper); }
.directory-pages button { min-height: 32px; border-color: var(--line); color: var(--accent); }
#directory-prev { justify-self: start; }
#directory-next { justify-self: end; }
.directory-pages button[aria-disabled="false"]:hover { border-color: var(--control-border); background: var(--accent-soft); }
.directory-pages button[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: default; }
#directory-page { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

#coverage-footer { display: flex; flex: none; align-items: center; gap: 22px; min-height: 37px; padding: 4px clamp(12px, 1.65vw, 24px); border-top: 1px solid var(--line); background: var(--paper); }
.coverage-heading { display: flex; flex: none; align-items: center; gap: 7px; }
.coverage-heading i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
#coverage-heading { font-size: 12px; white-space: nowrap; }
.coverage-stats { display: flex; align-items: center; gap: 15px; }
.coverage-stats > div { display: flex; align-items: baseline; gap: 6px; padding-inline-start: 13px; border-inline-start: 1px solid var(--line); }
.coverage-stats strong { font-size: 16px; line-height: 1.15; font-weight: 680; font-variant-numeric: tabular-nums; }
.coverage-stats span { color: var(--muted); font-size: 11px; }

#atlas, #world-view { width: 100%; height: 100%; overflow: hidden; }
#atlas { position: relative; isolation: isolate; background: var(--accent-soft); }
#map { display: block; position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; outline: 0; }
#map:focus-visible { outline: 2px solid #7695cb; outline-offset: -2px; }
#map.is-point { cursor: pointer; }
#map.dragging { cursor: grabbing; }
#discover-map-pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.discover-map-pin { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #23516b; pointer-events: auto; touch-action: manipulation; }
.discover-map-pin .ui-icon { width: 24px; height: 24px; filter: drop-shadow(0 2px 2px #102c49a6); }
.discover-map-pin:is(:hover, :focus-visible, [aria-pressed="true"]) { z-index: 1; color: #125eb2; }
.discover-map-pin[aria-pressed="true"] .ui-icon { width: 32px; height: 32px; }
.discover-map-embed :is(#site-header, #sidebar, #coverage-footer, #rail-fold, #map-share, #selected-place, .worldscape-skip, .map-places-button, .map-places-panel) { display: none; }
.discover-map-embed #workspace { display: block; min-height: 0; padding: 0; }
.discover-map-embed #map-pane { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.discover-map-embed #map-toolbar { top: 10px; right: 10px; left: 10px; }
.discover-map-embed #map-controls { right: 10px; bottom: 36px; }
.discover-map-embed #map-legend { left: 10px; bottom: 18px; }
.discover-map-embed #map-scale { left: 12px; bottom: 23px; }
.discover-map-embed #atlas:has(#map-legend:not([hidden])) #map-scale { bottom: 55px; }
#map-toolbar { position: absolute; top: 19px; left: 20px; right: 20px; z-index: 3; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.map-toolbar-start, .map-toolbar-end { display: flex; align-items: center; gap: 6px; min-width: 0; }
#rail-fold { flex: none; justify-content: center; pointer-events: auto; }
#map-share { flex: none; pointer-events: auto; }
.map-context { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--accent); box-shadow: var(--shadow); font-size: 12px; font-weight: 640; white-space: nowrap; }
.map-context .ui-icon { width: 16px; height: 16px; }
button.map-context { pointer-events: auto; }
button.map-context:is(:hover, [aria-pressed="true"]) { border-color: var(--control-border); background: var(--accent-soft); }
#map-controls { position: absolute; right: 20px; bottom: 50px; z-index: 3; display: grid; justify-items: center; gap: 7px; }
.icon-button, #map-zoom button { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--accent); box-shadow: var(--shadow); }
.icon-button:hover, #map-zoom button:hover { background: var(--accent-soft); }
#map-zoom { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
#map-zoom button { width: 35px; height: 35px; border: 0; border-radius: 0; box-shadow: none; font: 22px/1 system-ui; }
#map-zoom button + button { border-top: 1px solid var(--line); }
#map-legend { position: absolute; left: 20px; bottom: 20px; z-index: 2; display: flex; gap: 12px; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #53657b; box-shadow: var(--shadow); pointer-events: none; font-size: 11px; white-space: nowrap; }
#map-legend span { display: flex; align-items: center; gap: 6px; }
#map-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
#map-legend #legend-current i { border: 1px solid #2458db; background: #dbe6ff; }
#map-legend #legend-pending i { border: 1px solid #a67b2e; background: #f6deb1; }
#map-scale { position: absolute; left: 23px; bottom: 60px; display: grid; gap: 1px; color: #405972; pointer-events: none; font: 10px/1.2 system-ui; text-shadow: 0 0 3px white; }
#map-scale i { display: block; height: 5px; border: solid #536a81; border-width: 0 1px 1px; }
#credit { position: absolute; z-index: 2; right: 10px; bottom: 7px; max-width: calc(100% - 22px); border-radius: 4px; background: #ffffffe8; padding: 2px 5px; color: #4f6375; font: 10px/1.3 system-ui; }
#credit a { color: inherit; text-decoration: none; }
#credit a:hover { text-decoration: underline; }
#coverage-hint { position: absolute; z-index: 5; top: 0; left: 0; pointer-events: none; max-width: min(240px, 76vw); padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); }
#coverage-hint small, #coverage-hint strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#coverage-hint small { color: var(--muted); font-size: 10px; }
#coverage-hint strong { font-size: 12px; }
#selection { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 2; pointer-events: none; }
#marker { position: absolute; left: -18px; top: -37px; width: 36px; height: 40px; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 7px; border: 0; border-radius: 40%; background: transparent; touch-action: none; cursor: grab; pointer-events: auto; }
#marker:active { cursor: grabbing; }
#marker i { display: block; width: 21px; height: 21px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: var(--blue); transform: rotate(-45deg); box-shadow: -2px 2px 5px #223b6955; }
#marker i::after { content: ""; position: absolute; width: 6px; height: 6px; top: 5.5px; left: 5.5px; border-radius: 50%; background: white; }
.marker-action { position: absolute; left: 15px; top: -31px; min-height: 30px; padding: 4px 9px; border: 1px solid #c9d7ee; border-radius: 7px; background: #fff; color: #264e94; pointer-events: auto; box-shadow: var(--shadow); font-size: 12px; font-weight: 620; white-space: nowrap; }
.marker-action:hover:enabled { background: #edf3ff; }
#workspace:not([data-page="explore"]) .marker-action { display: none; }

#selected-place { position: absolute; z-index: 4; right: 21px; top: 72px; width: min(332px, calc(100% - 43px)); max-height: calc(100% - 246px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.detail-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 7px 16px; color: var(--muted); font-size: 11px; font-weight: 650; }
.detail-header .icon-button { width: 29px; height: 29px; border: 0; box-shadow: none; font-size: 20px; font-weight: 400; }
#selected-place:not([hidden]) { animation: show-place .19s ease-out; }
@keyframes show-place { from { translate: 0 5px; } to { translate: 0 0; } }
#selected-place .detail-header { position: absolute; z-index: 2; top: 9px; right: 9px; padding: 0; }
#selected-place .detail-header > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#selected-place .detail-header .icon-button { border: 1px solid var(--line); background: #fffffff2; box-shadow: 0 1px 4px #233d6120; }
#coverage-pins { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.coverage-pin { position: absolute; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: auto; transform: translate(-50%,-50%); }
.coverage-pin.cluster { width: 36px; height: 36px; }
.coverage-pin:focus-visible { outline-offset: 0; }
#place-photo { position: relative; height: 148px; background-color: var(--faint); }
#place-photo span { position: absolute; right: 7px; bottom: 6px; padding: 2px 5px; border-radius: 4px; background: #233446cc; color: white; font-size: 10px; }
#place-intro { display: flex; flex-direction: column; margin: 13px 17px 11px; }
#place-photo[hidden] + #place-intro { padding-inline-end: 27px; }
#selected-name { margin: 0; font-size: 24px; font-weight: 720; letter-spacing: -.035em; line-height: 1.27; overflow-wrap: anywhere; text-wrap: balance; }
#selected-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
#selected-subtitle:empty { display: none; }
#selected-description { margin: 7px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; }
.selected-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; width: fit-content; margin: 5px 0 0; color: #345eae; font-size: 11px; font-weight: 650; }
.selected-caption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #5684ec; }
#selected-revision { color: var(--muted); font-weight: 550; }
#place-geography { margin: 1px 16px 12px; border-top: 1px solid var(--line); }
#place-geography summary, .workspace-geography summary { padding: 8px 0 2px; font-size: 12px; color: var(--accent); cursor: pointer; }
#place-geography :is(#nearby-links, #business-facts, .place-facts, .scene-metrics) { margin-inline: 0; }
.workspace-geography { margin-top: 9px; padding: 0 3px 3px; }
.workspace-preview { display: block; width: 100%; max-height: 124px; border-radius: 8px; object-fit: cover; }
.selected-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin: 0 16px 11px; }
.selected-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 42px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--accent); font-size: 12px; font-weight: 640; }
.selected-actions button:hover { background: var(--faint); }
.selected-actions .ui-icon { width: 14px; height: 14px; }
#side-action { border-color: var(--accent); background: var(--accent); color: #fff; }
#side-action:hover:enabled { background: var(--accent-hover); }
#side-action:enabled .ui-icon { transition: transform .16s; }
#side-action:hover:enabled .ui-icon { transform: translateX(2px); }
#nearby-links { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 16px 10px; }
#nearby-links :is(a, button) { display: inline-flex; align-items: center; min-height: 34px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--accent-hover); font-size: 12px; font-weight: 600; text-decoration: none; }
#nearby-links :is(a, button):hover { background: var(--accent-soft); text-decoration: underline; }
#nearby-links #nearby-facilities { border-color: #c6daf8; background: var(--accent-soft); }
.place-facts, #business-facts { margin: 9px 16px 12px; padding: 4px 0 0; border-top: 1px solid var(--line); }
.place-facts > div, #business-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; font-size: 11px; }
.place-facts dt, #business-facts dt { color: var(--muted); white-space: nowrap; }
.place-facts dt .ui-icon { width: 15px; height: 15px; }
.place-facts dd, #business-facts dd { margin: 0; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.place-facts dd.map-coordinate { font-size: 11px; }
.scene-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0 16px 9px; padding: 8px 0; border-top: 1px solid var(--line); }
.scene-metrics strong, .scene-metrics span { display: block; }
.scene-metrics strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.scene-metrics span { color: var(--muted); font-size: 11px; }

.workflow-panel { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 var(--pad) 19px; }
.workflow-panel h2 { margin: 14px 0 7px; font-size: 14px; color: var(--ink); }
.workflow-panel p { margin: 7px 0 9px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.workflow-panel .action { text-decoration: none; }
.workflow-steps { display: flex; align-items: center; padding: 0 0 13px; gap: 7px; border-bottom: 1px solid var(--line); }
.workflow-steps span { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.workflow-steps b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--faint); font: 600 10px/1 system-ui; }
.workflow-steps .current { color: var(--accent-hover); font-weight: 650; }
.workflow-steps .current b { background: var(--accent); color: white; }
.workflow-steps i { flex: 1; height: 1px; background: var(--line); }
.workflow-location, .workflow-option, .workflow-callout, .task-row { display: block; width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-align: left; }
.workflow-location strong, .workflow-option strong, .task-row strong, .task-row small { display: block; }
.workflow-location small, .workflow-option small, .task-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.workflow-option { border-color: var(--line); background: var(--faint); color: var(--accent); }
.workflow-option select { display:block; width:100%; color:inherit; font:inherit; font-weight:650; padding:5px 6px; border:1px solid var(--line); border-radius:6px; background:var(--paper); }
.workflow-callout { margin-top: 12px; }
.workflow-full { display: flex; width: 100%; margin-top: 11px; }
.workflow-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.workflow-tabs button { flex: 1; min-width: max-content; padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; }
.workflow-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 630; }
.task-row { margin-top: 7px; background: var(--paper); }
.task-row:hover, .task-row[aria-pressed="true"] { background: var(--faint); border-color: var(--control-border); }
.task-status { display: inline-flex; gap: 6px; align-items: center; color: #8b5e20; font-size: 11px; }
.task-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b9832e; }
.workflow-form { display: grid; gap: 7px; }
.workflow-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.workflow-form input, .workflow-form select, .workflow-form textarea, .review-key input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 12px; }
.error-message { color: #96343c !important; }

#world-view { display: flex; flex-direction: column; background: var(--panel); }
#world-frame { border: 0; flex: 1; min-height: 0; width: 100%; }

dialog { width: min(440px, calc(100% - 32px)); max-height: 86dvh; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 45px #233d6133; overscroll-behavior: contain; }
dialog::backdrop { background: #17243b57; }
dialog header { display: flex; justify-content: space-between; align-items: center; }
dialog h2 { margin: 0; font-size: 19px; }
dialog h3 { margin: 16px 0 6px; font-size: 14px; }
dialog p { margin: 7px 0; font-size: 13px; }
dialog header button { padding: 0 6px; border: 0; background: transparent; font-size: 23px; }
dialog label { display: block; margin: 11px 0; color: var(--muted); font-size: 13px; }
dialog input, dialog textarea, dialog select { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--shell); font: inherit; }
dialog textarea { resize: vertical; }
#map-share-close { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; }
#map-share-close:hover { background: var(--faint); }
#map-share-help { color: var(--muted); }
#report-feed article { padding: 8px 0; border-top: 1px solid var(--line); }
#report-feed a { display: block; overflow-wrap: anywhere; font-size: 12px; }
#preferences-dialog { width: min(360px, calc(100% - 30px)); }
#preferences-dialog form > button { display: block; margin: 18px 0 0 auto; padding: 7px 15px; border: 0; border-radius: 7px; background: var(--accent); color: white; }

.map-places-button, .map-detail-status, .map-places-panel { position: absolute; z-index: 5; border: 1px solid #dde5ed; background: white; color: #445d77; box-shadow: var(--shadow); }
.map-places-button, .map-detail-status { top: 20px; min-height: 34px; padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.map-places-button { top: 63px; left: 20px; }
.map-detail-status { top: 64px; left: 20px; }
.map-places-button:not([hidden]) + .map-detail-status { top: 106px; }
.map-places-button:hover, .map-detail-status:hover { background: #f1f6ff; }
.map-places-panel { top: 106px; right: 20px; display: flex; flex-direction: column; gap: 7px; width: min(355px, calc(100% - 39px)); max-height: calc(100% - 135px); padding: 12px; border-radius: 10px; }
.map-places-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-places-head strong { font-size: 14px; }
.map-places-head button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; font: 21px/1 system-ui; color: #5c7692; }
.map-places-scope, .map-places-notice { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.map-places-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.map-places-filters button { min-height: 31px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 11px; }
.map-places-filters button:hover, .map-places-filters button[aria-pressed="true"] { border-color: #c6daf8; background: var(--accent-soft); color: var(--accent-hover); }
.map-places-panel input { width: 100%; padding: 7px 8px; border: 1px solid #d7e1ee; border-radius: 6px; background: #f8fbff; font-size: 12px; }
.map-places-list { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; min-height: 44px; font-size: 12px; }
.map-place-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: center; border-bottom: 1px solid #eceff4; }
.map-place-row { display: block; width: 100%; min-height: 44px; padding: 8px 4px; border: 0; background: transparent; text-align: left; }
.map-place-row strong, .map-place-row small { display: block; overflow-wrap: anywhere; }
.map-place-row strong { font-size: 13px; font-weight: 620; }
.map-place-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.map-place-row:hover, .map-place-guide:hover, .map-places-head button:hover { background: #f1f6ff; }
.map-place-guide { min-height: 42px; padding: 4px 5px; border: 0; border-radius: 5px; background: var(--paper); color: var(--accent-hover); font-size: 11px; font-weight: 650; }
.map-list-more { padding: 6px; border: 0; border-radius: 6px; background: var(--blue-soft); color: #2b57ab; font-size: 12px; }

@media (max-height: 800px) {
  #workspace-intro { padding-top: 15px; }
  .directory-place { min-height: 53px; }
  .place-glyph { width: 59px; height: 36px; }
  #place-photo { height: 114px; }
}
@media (max-width: 830px) {
  :root { --pad: 16px; }
  #workspace { grid-template-columns: 271px minmax(0, 1fr); }
  #selected-place { right: 14px; }
  #map-toolbar { left: 13px; right: 13px; }
  .map-places-button { left: 13px; }
}
@media (max-width: 600px) {
  #main-nav { flex-basis: 100%; gap: 3px; margin: 0; }
  #main-nav button { min-height: 32px; padding: 0 5px; }
  #main-nav .ui-icon { width: 13px; height: 13px; }
  #workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px; padding: 6px 7px 4px; }
  #workspace.panel-folded, #workspace.in-scene { grid-template-rows: minmax(0, 1fr); }
  #sidebar { position: static; flex-flow: row wrap; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 10px; }
  #workspace-intro { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #workspace-intro:has([data-published-place]) { position: relative; width: 100%; height: auto; padding: 5px 3px 0; clip-path: none; white-space: normal; }
  #workspace-intro:has([data-published-place])::before { display: none; }
  #workspace-heading[data-published-place] { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 17px; letter-spacing: normal; }
  #search-card { flex: 1; min-width: 0; margin: 0; }
  #search-form { min-height: 39px; padding-block: 1px; }
  #query { font-size: 16px; }
  #shortcut { display: none; }
  #directory-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; min-height: 39px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--accent); font-size: 11px; font-weight: 620; white-space: nowrap; }
  #directory-toggle i { display: flex; }
  #directory-toggle .ui-icon { width: 14px; height: 14px; }
  #directory { position: absolute; inset: 0; z-index: 10; border: 0; background: var(--paper); padding-top: 15px; }
  #directory > header { margin-bottom: 4px; }
  #directory-shuffle { min-height: 32px; }
  #directory-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: var(--faint); color: var(--accent); }
  .workflow-panel { flex: 0 0 100%; max-height: 30dvh; padding: 5px 3px 2px; }
  #map-toolbar { top: 10px; left: 10px; right: 10px; }
  #rail-fold { width: 34px; height: 34px; }
  .map-context { min-width: 0; min-height: 34px; padding: 0 7px; gap: 4px; font-size: 11px; }
  .map-context span { overflow: hidden; text-overflow: ellipsis; }
  :root:not(.discover-map-embed) #workspace[data-page="explore"] #atlas:not(.has-selection) .map-toolbar-start .map-context { padding-inline-start: 4px; }
  :root:not(.discover-map-embed) #workspace[data-page="explore"] #atlas:not(.has-selection) .map-toolbar-start .map-context::before {
    width: 33px;
    height: 24px;
    flex: none;
    border-radius: 5px;
    background: var(--atlas-preview) 38% 57% / cover;
    content: "";
  }
  :root:not(.discover-map-embed) #workspace[data-page="explore"] #atlas:not(.has-selection) .map-toolbar-start .map-context > .ui-icon { display: none; }
  #map-share { width: 38px; height: 38px; }
  .map-context .ui-icon { width: 14px; height: 14px; }
  #map-controls { bottom: 48px; right: 10px; }
  #map-legend { left: 10px; bottom: 21px; min-height: 27px; }
  #map-scale { left: 12px; bottom: 54px; }
  #selected-place { top: auto; right: auto; left: 10px; bottom: 56px; max-height: calc(100% - 101px); width: min(298px, calc(100% - 62px)); }
  #place-photo { height: 86px; }
  #selected-place { bottom: 35px; width: calc(100% - 20px); max-height: min(52%, 350px); }
  #atlas.has-selection #map-controls { top: 55px; bottom: auto; }
  #atlas.has-selection #map-scale, #atlas.has-selection #map-legend { visibility: hidden; }
  #selected-place .selected-actions { position: sticky; top: 0; z-index: 1; margin-inline: 0; padding: 3px 12px; background: var(--paper); }
  #place-intro { margin: 7px 12px 8px; }
  #selected-name { font-size: 19px; }
  .detail-header { padding-block: 4px; }
  .selected-actions { margin: 0 12px 8px; }
  #nearby-links { margin-inline: 12px; }
  #nearby-links :is(a, button) { min-height: 38px; }
  .map-places-button { top: 50px; right: 10px; left: auto; min-height: 31px; padding: 4px 7px; font-size: 10px; }
  .map-places-panel { top: 85px; right: 10px; width: calc(100% - 20px); max-height: calc(100% - 105px); }
  .map-places-panel[data-origin] { top: auto; bottom: 28px; max-height: min(400px, calc(100% - 89px)); }
  .map-places-filters button { min-height: 34px; }
  #atlas .map-detail-status { top: 50px; left: 10px; }
  #atlas.has-selection:has(.map-places-button:not([hidden])) #map-controls { top: 86px; }
  #credit { bottom: 4px; font-size: 8px; }
  #coverage-footer { display: block; min-height: auto; padding: 4px 10px 6px; }
  #coverage-heading { font-size: 10px; }
  .coverage-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; margin-top: 2px; }
  .coverage-stats > div { display: grid; gap: 0; padding-inline-start: 7px; }
  .coverage-stats > div:first-child { padding-inline-start: 0; border-inline-start: 0; }
  .coverage-stats strong { font-size: 14px; }
  .coverage-stats span { min-width: 0; font-size: 10px; line-height: 1.2; }
}
@media (max-width: 350px) {
  #directory-toggle i { display: none; }
  :root:not(.discover-map-embed) #map-toolbar { inset-inline: 8px; gap: 4px; }
  :root:not(.discover-map-embed) #map-toolbar > div { gap: 4px; }
  :root:not(.discover-map-embed) #map-toolbar .map-context { padding-inline: 4px; gap: 3px; font-size: 10.5px; }
  :root:not(.discover-map-embed) #workspace[data-page="explore"] #atlas:not(.has-selection) .map-toolbar-start .map-context::before { width: 18px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

