:root {
  --bg:        #0b0e14;
  --panel:     #11151d;
  --panel-2:   #181d27;
  --border:    #232a36;
  --text:      #e7ecf3;
  --muted:     #8893a4;
  --accent:    #00c2ff;
  --accent-2:  #1bd6a4;
  --warn:      #f0a000;
  --start:     #1bd6a4;
  --end:       #ff5577;
  --portal:    #00c2ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 100%;
}

#sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#sidebar header {
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--border);
}

#sidebar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#sidebar #set-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.lang-switch {
  display: flex;
  gap: 4px;
  padding: 8px 18px 0;
}
.lang-switch button {
  flex: 1;
  font-family: inherit;
  font-size: 11px;
  padding: 5px 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.lang-switch button:hover {
  color: var(--text);
  border-color: var(--muted);
}
.lang-switch button.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 194, 255, 0.08);
}

#sidebar .controls {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

#sidebar button {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

#sidebar button:hover { border-color: var(--accent); color: var(--accent); }

#mission-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}
#mission-list[hidden] { display: none; }

/* Grid view — 6-column thumbnail layout that recreates the Ingress
   in-game mission banner mosaic (6×4 for 24 missions). Cells are small
   and picture-only; name is shown via the native tooltip on hover. */
#mission-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px 12px 16px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}
#mission-grid[hidden] { display: none; }
/* Circular medallion-style tiles, mirroring the Ingress mission-medal
   view inside the in-game scanner. Picture-only, no number badge. */
.mission-grid-cell {
  position: relative;
  display: block;
  padding: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--border);
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}
.mission-grid-cell:hover {
  border-color: var(--accent);
  transform: scale(1.06);
  z-index: 1;
}
.mission-grid-cell:active { transform: scale(0.97); }
.mission-grid-cell.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(0,194,255,0.55);
  z-index: 1;
}
/* Absolute positioning forces the picture to fill the circular cell
   regardless of <button>'s intrinsic line-height quirks. */
.mission-grid-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* View-switch — compact list/grid icon toggle. Lives inside .controls. */
.view-switch {
  display: inline-flex;
  margin-top: 8px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.view-switch button {
  flex: 1;
  background: var(--panel-2);
  color: var(--muted);
  border: none;
  border-radius: 0 !important;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.view-switch button.active {
  background: var(--bg);
  color: var(--accent);
}
.view-switch button:hover { color: var(--accent); }

#mission-list li {
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
}

#mission-list li:hover { background: var(--panel-2); }

#mission-list li.active {
  background: linear-gradient(90deg, rgba(0,194,255,0.12), transparent);
  border-left: 3px solid var(--accent);
  padding-left: 15px;
}

.mission-num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.mission-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-count {
  font-size: 11px;
  color: var(--muted);
}

#sidebar footer {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--border);
}

.note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

#map {
  width: 100%;
  height: 100%;
  background: var(--panel-2);
  touch-action: pan-x pan-y pinch-zoom;
}

#detail {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 320px;
  max-height: calc(100% - 28px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 16px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
/* Stronger than #detail{display:flex} in the mobile media query so the
   [hidden] HTML attribute actually hides the panel on phones too. */
#detail[hidden] { display: none; }

#detail h2 { margin: 0 0 8px; font-size: 15px; padding-right: 24px; }

/* Mission banner image lives next to the title in a flex row so the
   sticky title pinning logic on mobile still works (h2 remains a direct
   child of #detail in the desktop case; the wrapper is purely visual). */
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-title-row h2 { margin: 0; flex: 1 1 auto; min-width: 0; }
#detail-picture {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
#detail-picture[hidden] { display: none; }

.detail-actions {
  margin: 4px 0 12px;
}
.btn-primary {
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: #061015;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: #4dd6ff; }
.btn-primary:active { transform: translateY(1px); }
.hint {
  margin: 6px 2px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
#detail-close {
  position: absolute;
  right: 6px; top: 4px;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
/* Drag handle: hidden on desktop, visible bar at the top of the bottom-sheet
   on mobile. Tap to collapse / expand the detail panel so the map can be
   freely panned and zoomed even while a mission is selected. */
.sheet-handle { display: none; }
#detail-portals { list-style: none; margin: 0; padding: 0; }
#detail-portals li {
  display: grid;
  grid-template-columns: 22px 44px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12.5px;
}
#detail-portals .ix { color: var(--accent); font-weight: 600; }
#detail-portals img {
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--panel-2);
  object-fit: cover;
}
#detail-portals .portal-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#detail-portals .portal-nav {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: background 0.12s ease;
  font-variant-numeric: tabular-nums;
}
#detail-portals .portal-nav--maps {
  color: var(--accent);
  font-size: 16px;
  background: rgba(0,194,255,0.10);
  border-color: rgba(0,194,255,0.25);
}
#detail-portals .portal-nav--maps:hover  { background: rgba(0,194,255,0.22); }
#detail-portals .portal-nav--maps:active { background: rgba(0,194,255,0.35); }
#detail-portals .portal-nav--ingress {
  color: var(--accent-2);
  font-size: 14px;
  background: rgba(27,214,164,0.10);
  border-color: rgba(27,214,164,0.28);
}
#detail-portals .portal-nav--ingress:hover  { background: rgba(27,214,164,0.22); }
#detail-portals .portal-nav--ingress:active { background: rgba(27,214,164,0.35); }

/* Numbered map markers */
.portal-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--portal);
  color: #061015;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #061015;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
  font-variant-numeric: tabular-nums;
}
.portal-pin.start { background: var(--start); }
.portal-pin.end   { background: var(--end); color: #fff; }

.banner-pin {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--accent);
  color: #061015;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid #061015;
}

.blog-pin {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: var(--warn);
  color: #1a1308;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid #1a1308;
  box-shadow: 0 2px 6px rgba(0,0,0,0.55);
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.blog-pin-icon  { font-size: 12px; line-height: 1; }
.blog-pin-orders{ font-size: 11px; line-height: 1; }
.blog-pin:hover { filter: brightness(1.08); }
.blog-pin:active{ transform: translateY(1px); }

/* ---------- Welcome modal ---------- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.modal[hidden] { display: none; }
.modal-inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 24px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
}
.modal-close:hover { color: var(--accent); }
.modal-inner h2 {
  margin: 0 28px 6px 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}
.welcome-lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.banner-figure {
  margin: 0 0 18px;
  padding: 0;
}
.banner-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.banner-figure figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.3px;
}
.welcome-section {
  margin: 14px 0;
}
.welcome-section h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list li { padding: 4px 0; }
.link-list a {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.link-list a:hover { border-color: var(--accent); color: var(--accent); }
#welcome-blogs a {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: baseline;
}
.blog-orders {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}
.blog-title { font-size: 13px; line-height: 1.45; }
.blog-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 999px;
}
@media (max-width: 540px) {
  #welcome-blogs a {
    grid-template-columns: 56px 1fr;
    grid-template-areas: "orders date" "title title";
    row-gap: 4px;
  }
  #welcome-blogs .blog-orders { grid-area: orders; }
  #welcome-blogs .blog-date   { grid-area: date; justify-self: end; }
  #welcome-blogs .blog-title  { grid-area: title; }
}
.blog-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 10px;
}
#welcome-enter {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.disclaimer {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.note-disclaimer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.06);
  font-size: 10.5px;
  opacity: 0.8;
}

/* ---------- About-this-event button in sidebar ---------- */
#sidebar .link-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
#sidebar .link-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Secondary action in detail panel ---------- */
.btn-secondary {
  display: block;
  margin-top: 8px;
  text-align: center;
  text-decoration: none;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary[hidden] { display: none; }

/* ---------- Coordinate-system chooser ---------- */
.coord-chooser-inner { max-width: 460px; }
.coord-chooser-target {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.coord-chooser-note {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text);
  background: rgba(240, 160, 0, 0.08);
  border: 1px solid rgba(240, 160, 0, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  line-height: 1.5;
}
.coord-chooser-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
/* Normalise both buttons so the primary / secondary inheritance
   differences (font-weight, border, default <button> metrics) don't
   leave them at different heights side-by-side. */
.coord-chooser-buttons .btn-primary,
.coord-chooser-buttons .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  border-width: 1px;
  border-style: solid;
}
.coord-chooser-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.coord-chooser-remember input { margin: 0; }
@media (max-width: 480px) {
  .coord-chooser-buttons { grid-template-columns: 1fr; }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: rgba(11, 14, 20, 0.96);
  color: var(--accent-2);
  border: 1px solid rgba(27, 214, 164, 0.35);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 820px) {
  .modal {
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-inner { padding: 18px 16px 20px; border-radius: 10px; }
  .modal-inner h2 { font-size: 18px; }
  .welcome-section h3 { font-size: 12px; }

  body {
    grid-template-columns: 1fr;
    grid-template-rows: 62vh 1fr;
    grid-template-areas: "map" "sidebar";
  }
  #map {
    grid-area: map;
    min-height: 0;
  }
  /* On phones the sidebar is only ~38vh tall; constraining the mission
     list as the only scroll region leaves it ~2 rows visible — unusable.
     Instead, let the whole sidebar scroll as one unit so users can swipe
     through header → controls → all 24 missions → footer naturally. */
  #sidebar {
    grid-area: sidebar;
    min-height: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  #mission-list {
    overflow: visible;
    flex: 0 0 auto;
  }
  #sidebar header { padding: 12px 16px 8px; }
  #sidebar h1 { font-size: 16px; }
  #sidebar .controls { padding: 8px 16px; }
  #sidebar footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  #mission-list li { padding: 10px 16px; }
  #mission-list li.active { padding-left: 13px; }

  /* Detail panel becomes a bottom-sheet on mobile so the map above stays
     visible and pinch-zoom keeps working while a mission is selected.
     Default height is moderate (38vh) and a drag-handle lets users
     collapse the panel to a slim header strip when they need the full map.
     Single scroll container — title, action buttons and portal list all
     scroll together so the user doesn't hit two nested scroll regions. */
  #detail {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 38vh;
    max-height: 70vh;
    border-radius: 14px 14px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 22px 18px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
    box-shadow: 0 -10px 32px rgba(0,0,0,0.5);
    transition: height 0.18s ease;
    display: block;
  }
  #detail-portals {
    /* Plain flow child of the single scroll container. */
    overflow: visible;
    max-height: none;
    min-height: 0;
  }
  /* Pin the mission title + banner image so users always know which
     mission they are looking at, even when they scroll deep into the
     portal list. Sticky must live on the wrapper (direct child of
     #detail, the scroll container), not on the h2 inside it. */
  #detail .detail-title-row {
    position: sticky;
    top: -22px;
    margin: -22px -18px 8px;
    padding: 14px 44px 8px 18px;
    background: var(--panel);
    z-index: 3;
  }
  #detail .detail-title-row h2 { padding-right: 0; }
  #detail.collapsed {
    height: 44px;
    padding-top: 14px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #detail.collapsed #detail-portals,
  #detail.collapsed .detail-actions { display: none; }
  #detail.collapsed h2 {
    font-size: 14px;
    margin: 2px 40px 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Visible swipe-handle bar so users discover the collapse affordance. */
  .sheet-handle {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 18px;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1;
  }
  .sheet-handle::before {
    content: "";
    display: block;
    margin: 6px auto 0;
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.28);
  }
  /* Close sits above the handle AND the sticky title in the top-right
     corner so it remains visible AND tappable in both expanded and
     collapsed (44px) states. Must be a higher z-index than the sticky
     #detail h2 (z:3) or the title's full-width box swallows the tap. */
  #detail-close {
    width: 36px; height: 32px;
    font-size: 22px;
    top: 4px; right: 6px;
    z-index: 5;
  }
  /* font-size only — padding handled by the sticky-title rule above. */
  #detail h2 { font-size: 17px; }
  #detail-portals li { padding: 9px 0; font-size: 14px; gap: 6px; }
  #detail-portals img { width: 48px; height: 48px; }
  #detail-portals .portal-nav { width: 38px; height: 38px; }
  #detail-portals .portal-nav--maps { font-size: 18px; }
  #detail-portals .portal-nav--ingress { font-size: 16px; }
  .btn-primary { padding: 12px 14px; font-size: 14px; }
}

/* Very short landscape phones — keep a usable sidebar */
@media (max-width: 820px) and (max-height: 480px) {
  body { grid-template-rows: 60vh 1fr; }
}

/* Zhuhai routes */
.grid-label { display: block; padding: 6px; color: white; background: #073346; font-size: 12px; }
.mission-description { padding: 0 16px; line-height: 1.7; font-size: 14px; }

#detail-portals .portal-nav--maps { grid-column: 5; }

/* Quiet building detail, matched to the dark Apple basemap. */
.building-controls { position:fixed; top:12px; left:336px; z-index:2; display:grid; gap:4px; max-width:230px; padding:9px 12px; border-radius:13px; background:rgba(31,39,49,.92); color:#e2e8ee; box-shadow:0 3px 14px #0003; backdrop-filter:blur(18px); font-size:13px; }
.building-controls label { display:flex; align-items:center; gap:8px; cursor:pointer; font-weight:600; }
.building-controls input { accent-color:#0a84ff; width:16px; height:16px; margin:0; }
.building-controls a { color:#abb7c4; font-size:9px; text-decoration:none; }
.building-controls small { color:#adb9c6; font-size:11px; }
.building-controls small:empty { display:none; }
#building-dialog { box-sizing:border-box; width:min(460px,calc(100vw - 28px)); max-height:calc(100dvh - 40px); padding:22px; border:1px solid #59657366; border-radius:24px; background:#202b37; color:#eef2f6; box-shadow:0 20px 80px #0008; overflow:auto; }
#building-dialog::backdrop { background:#07111c80; backdrop-filter:blur(5px); }
#building-dialog h2 { margin:6px 36px 10px 0; font-size:24px; letter-spacing:-.5px; }
.building-eyebrow { margin:0; font-size:10px; letter-spacing:1.5px; color:#a3b2c1; font-weight:600; }
.building-close { position:absolute; right:14px; top:14px; width:30px; height:30px; border:0; border-radius:50%; background:#46515e; color:#eef3f8; font-size:22px; cursor:pointer; }
#building-height { display:inline-block; margin:0 0 14px; border-radius:8px; padding:5px 8px; background:#344252; color:#cbd8e5; font-size:12px; }
#building-preview { width:100%; height:280px; display:grid; place-items:center; border-radius:16px; overflow:hidden; background:#19242f; color:#afbdcc; text-align:center; }
#building-preview canvas { width:100%; height:100%; display:block; touch-action:none; }
#building-preview canvas:focus-visible { outline:2px solid #0a84ff; outline-offset:-3px; }
#building-gesture-hint { margin:10px 0; text-align:center; color:#a9b8c7; font-size:11px; }
#building-model-note { color:#a9b8c7; font-size:12px; line-height:1.5; }
#building-source { color:#76b8ff; font-size:11px; text-decoration:none; }
@media(max-width:820px) { .building-controls { left:12px; max-width:210px; } #building-dialog { padding:18px; } #building-preview { height:250px; } }
