/* Translucent Frosted Neutral-Grey Dynamic Island Design System
 * Pure neutral charcoal/graphite/silver palette everywhere (zero blue, zero yellow, zero all-caps).
 * Typography: Bundled Inter Variable & Helvetica Neue / Helvetica (16px root, 14–16px UI & body).
 * Signature link & editorial text accent: rgb(160, 70, 70) / #a04646.
 */

@font-face {
  font-family: 'Inter';
  src: url('../vendor/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-canvas: #080809;
  --glass-bg: rgba(12, 12, 14, 0.78);
  --glass-bg-deep: rgba(11, 11, 13, 0.88);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-surface: rgb(160, 70, 70);
  --accent-link: rgb(208, 110, 110);
  --accent-link-hover: rgb(228, 138, 138);
  --accent-link-soft: rgba(160, 70, 70, 0.20);
  --accent-link-border: rgba(196, 98, 98, 0.45);
  --card-w: clamp(318px, 27vw, 368px);
  --island-bottom: calc(76px + env(safe-area-inset-top, 0px));
}

* {
  box-sizing: border-box;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible,
#search-input:focus,
#search-input:focus-visible {
  outline: none;
}

html {
  font-size: 16px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.55;
  overscroll-behavior: none;
}

/* Signature editorial link & accent text (WCAG AA on #0b0b0d) */
.accent-text {
  color: var(--accent-link);
}
.accent-link {
  color: var(--accent-link);
  text-decoration: none;
  transition: color 0.16s ease;
}
.accent-link:hover {
  color: var(--accent-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.accent-chip {
  background: var(--accent-link-soft);
  border: 1px solid var(--accent-link-border);
  color: #f0cece;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.accent-chip:hover {
  background: rgba(160, 70, 70, 0.34);
  border-color: rgba(208, 110, 110, 0.65);
  color: #ffffff;
}

#space-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, #101012 0%, #070708 56%, #030304 100%);
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
}

#space-frontier-view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  background: radial-gradient(ellipse at 14% 50%, #121214 0%, #070708 56%, #030304 100%);
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#space-frontier-view.space-hidden {
  opacity: 0;
  pointer-events: none;
}

.maplibregl-ctrl-bottom-right {
  z-index: 3 !important;
}
.maplibregl-ctrl-attrib {
  box-sizing: border-box !important;
  background: rgba(12, 12, 14, 0.76) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.60) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 999px !important;
  padding: 2px 11px !important;
  margin: 0 20px 12px 0 !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  max-width: none !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  padding: 4px 30px 4px 12px !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) {
  padding: 0 !important;
  min-height: 26px !important;
  width: 26px !important;
  height: 26px !important;
}
.maplibregl-ctrl-attrib-button {
  filter: invert(1) opacity(0.72);
  top: 0 !important;
  right: 0 !important;
  width: 24px !important;
  height: 24px !important;
}
.maplibregl-ctrl-attrib a { color: var(--accent-link) !important; }

/* True Translucent Frosted Neutral-Grey Glass (GPU-composited) */
.liquid-glass {
  background: var(--glass-bg-deep);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 var(--glass-highlight);
  isolation: isolate;
}

.liquid-pill {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 var(--glass-highlight);
  isolation: isolate;
}

/* Symmetrical 3-Zone Dynamic Island */
#dynamic-island {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  z-index: 42;
  height: 52px;
  padding: 6px;
  border-radius: 999px;
  max-width: calc(100vw - 24px);
  transition: box-shadow 0.25s ease;
}

.island-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
}

.island-zone {
  display: flex;
  align-items: center;
  gap: 6px;
}
.island-left { justify-content: flex-start; }
.island-center { justify-content: center; }
.island-right { justify-content: flex-end; }

.island-btn {
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-shrink: 0;
}

.island-rabbit-btn {
  background: rgba(160, 70, 70, 0.14);
  border-color: rgba(160, 70, 70, 0.34);
}
.island-rabbit-btn:hover {
  background: rgba(160, 70, 70, 0.24);
  border-color: rgba(160, 70, 70, 0.52);
}

.island-btn-open {
  background: rgba(160, 70, 70, 0.22) !important;
  border-color: rgba(160, 70, 70, 0.58) !important;
  color: #ffffff !important;
}

.island-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: #a1a1aa;
  line-height: 1.1;
}

.island-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-surface);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}
.island-count-badge.hidden { display: none !important; }

.island-bm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e4e4e7;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.island-bm-badge.hidden { display: none !important; }

.island-mode-track {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 38px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.island-mode-btn {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.island-mode-btn.glass-btn {
  background: transparent;
  border-color: transparent;
  color: rgba(228, 228, 231, 0.82);
}
.island-mode-btn.glass-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

/* Non-Blocking Floating Popovers (Rabbit Hole & Precision Filters) */
.atlas-popover {
  position: fixed;
  top: var(--island-bottom);
  left: 50%;
  transform: translateX(-50%);
  z-index: 52;
  max-height: calc(100dvh - 172px);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.atlas-popover.hidden {
  display: none !important;
}
.atlas-popover-rabbit {
  width: min(464px, calc(100vw - 24px));
  overflow: hidden;
}
.atlas-popover-filter {
  width: min(540px, calc(100vw - 24px));
}

.filter-branch-rail {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.filter-branch-rail .filter-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

.popover-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.popover-toggle-row:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}

.popover-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-surface);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-select,
select.glass-input {
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0 34px 0 12px;
  font-size: 13.5px;
  color: #f4f4f5;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.filter-select {
  height: 42px;
}
.filter-select:hover,
select.glass-input:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}
.filter-select:focus,
select.glass-input:focus {
  border-color: rgba(208, 110, 110, 0.62);
}
select option,
.filter-select option {
  background: #141416;
  color: #f4f4f5;
}
select optgroup,
.filter-select optgroup {
  background: #0d0d10;
  color: #a1a1aa;
  font-style: normal;
  font-weight: 600;
}

/* Bespoke Liquid-Glass Custom Select & Mobile Bottom-Sheet Picker */
.cselect-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}
.cselect-native-hidden {
  position: absolute !important;
  inset: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.cselect-trigger {
  width: 100%;
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cselect-compact .cselect-trigger {
  height: 38px;
  border-radius: 12px;
}
.cselect-trigger:hover {
  background: rgba(255, 255, 255, 0.095);
  border-color: rgba(255, 255, 255, 0.22);
}
.cselect-wrap.is-open .cselect-trigger,
.cselect-trigger:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(208, 110, 110, 0.65);
  box-shadow: 0 0 0 3px rgba(160, 70, 70, 0.18);
}
.cselect-trigger-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 450;
}
.cselect-trigger-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cselect-trigger-cnt {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #a1a1aa;
}
.cselect-chevron {
  width: 15px;
  height: 15px;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), color 0.15s ease;
}
.cselect-wrap.is-open .cselect-chevron {
  transform: rotate(180deg);
  color: #f4f4f5;
}
.cselect-chevron svg {
  width: 15px;
  height: 15px;
}

/* Portal Container (always above modals & popovers) */
.cselect-portal {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.cselect-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: auto;
}
.cselect-backdrop.is-desktop {
  background: transparent;
}
.cselect-backdrop.is-mobile {
  background: rgba(3, 3, 5, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cselectFadeIn 0.18s ease-out;
}
.cselect-panel {
  position: fixed;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(13, 13, 16, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.cselect-popover {
  border-radius: 18px;
  animation: cselectPopIn 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}
.cselect-sheet {
  left: 8px;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  max-height: min(76dvh, 620px);
  border-radius: 26px;
  animation: cselectSheetUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.cselect-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 10px auto 2px;
  flex-shrink: 0;
}
.cselect-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.cselect-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cselect-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.cselect-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  flex-shrink: 0;
}
.cselect-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.cselect-search-ico {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: #71717a;
  pointer-events: none;
}
.cselect-search {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #f4f4f5;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cselect-search::placeholder {
  color: #71717a;
}
.cselect-search:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(208, 110, 110, 0.62);
}
.cselect-search-clear {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 0;
  color: #d4d4d8;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cselect-search-clear.hidden {
  display: none !important;
}
.cselect-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cselect-group-hdr {
  position: sticky;
  top: -8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 6px;
  margin-top: 4px;
  background: rgba(14, 14, 17, 0.96);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #a1a1aa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cselect-group-hdr:first-child {
  margin-top: 0;
}
.cselect-group-cnt {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: #71717a;
}
.cselect-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(244, 244, 245, 0.92);
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.cselect-sheet .cselect-opt {
  padding: 12px 13px;
  font-size: 14.5px;
}
.cselect-opt:hover,
.cselect-opt.is-focused {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}
.cselect-opt.is-selected {
  background: rgba(160, 70, 70, 0.22);
  border-color: rgba(208, 110, 110, 0.48);
  color: #ffffff;
  font-weight: 500;
}
.cselect-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.cselect-opt-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cselect-opt-cnt {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #a1a1aa;
}
.cselect-opt.is-selected .cselect-opt-cnt {
  background: rgba(208, 110, 110, 0.22);
  color: #f4f4f5;
}
.cselect-check {
  width: 16px;
  height: 16px;
  color: var(--accent-link);
  flex-shrink: 0;
}
.cselect-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13.5px;
  color: #71717a;
}
@keyframes cselectFadeIn {
  from { opacity: 0.6; }
  to { opacity: 1; }
}
@keyframes cselectPopIn {
  from { opacity: 0.96; transform: translateY(-4px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cselectSheetUp {
  from { opacity: 0.96; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(244, 244, 245, 0.90);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.filter-chip:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
}
.filter-chip-active {
  background: rgba(160, 70, 70, 0.24) !important;
  border-color: rgba(160, 70, 70, 0.62) !important;
  color: #ffffff !important;
  font-weight: 500;
}
.filter-chip-count {
  font-size: 11.5px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}
.filter-chip-active .filter-chip-count {
  color: #e6bdbd;
}

.spotlight-item-active {
  background: rgba(255, 255, 255, 0.13) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(244, 244, 245, 0.92);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, color 0.16s ease;
  cursor: pointer;
}
.glass-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.22);
}
.glass-btn:active {
  transform: scale(0.97);
}

.glass-btn-active {
  background: rgba(244, 244, 245, 0.96) !important;
  color: #09090b !important;
  border: 1px solid rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.26);
  font-weight: 500;
}
.glass-btn-active:hover {
  background: #ffffff !important;
  color: #09090b !important;
}
.glass-btn-active svg {
  color: #09090b !important;
}

.glass-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 244, 245, 0.94);
  transition: background 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}
.glass-row:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
}
.glass-row-active {
  background: rgba(244, 244, 245, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  color: #09090b;
}

.glass-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 10px 14px;
  color: #f4f4f5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.glass-input::placeholder {
  color: rgba(161, 161, 170, 0.65);
}
.glass-input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.09);
}

/* Precision Architectural Timeline Ruler */
.timeline-ruler {
  position: relative;
  height: 32px;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}
.timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(161, 161, 170, 0.28) 0%, rgba(212, 212, 216, 0.55) 75%, rgba(244, 244, 245, 0.72) 100%);
  border-radius: 999px;
}
.timeline-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: #f4f4f5;
  border-radius: 999px;
  pointer-events: none;
}
.timeline-needle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #111113;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 2px 10px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}
.timeline-dot {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.48);
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.15s ease;
}
.timeline-dot:hover,
.timeline-dot.active {
  background: var(--accent-surface);
  transform: translate(-50%, -50%) scale(1.65);
}

/* Cinematic Timeline Tour Progress Hairline & Documentary Story Spotlight */
.time-tour-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
#time-bar.is-playing .time-tour-progress-track {
  opacity: 1;
}
.time-tour-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(160, 70, 70, 0.85) 0%, #e5a3a3 60%, #ffffff 100%);
  border-radius: 0 999px 999px 0;
  will-change: width;
}
#time-bar.is-hover-paused .time-tour-progress-bar {
  opacity: 0.45;
}
.time-story-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.085);
}
.time-story-card p {
  margin: 0;
}
.timeline-hover-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 14, 17, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  font-size: 11.5px;
  font-weight: 500;
  color: #f4f4f5;
  white-space: nowrap;
  max-width: min(320px, 78vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-hover-tip .tl-tip-year {
  color: var(--accent-link);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
  font-weight: 600;
}
.time-disc-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(212, 212, 216, 0.88);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.time-disc-chip:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}
.time-disc-chip.is-active {
  background: rgba(160, 70, 70, 0.24);
  border-color: rgba(208, 110, 110, 0.55);
  color: #ffffff;
}
.sheet-swiping {
  transition: none !important;
  will-change: transform, opacity;
}
.sheet-snap-back {
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease !important;
}

.section-label {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(161, 161, 170, 0.88);
}

/* Single-row equal-height action bar inside Overview Card (never wraps/overflows) */
.card-actions {
  padding: 10px 14px;
  gap: 6px;
}
.card-action {
  flex: 1 1 0%;
  min-width: 0;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 5px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}
.card-action.hidden {
  display: none !important;
}

/* Mobile bottom-sheet grab handle (hidden on desktop) */
.card-sheet-handle {
  display: none;
}

/* Symmetrical Two-Half Bottom Floating Dock (Desktop >=768px) */
#bottom-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  border-radius: 999px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 28px);
}

.dock-type-group,
.dock-explore-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 4px;
  flex-shrink: 0;
}

.dock-mobile-only {
  display: none !important;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.dock-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.dock-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dock-filter-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-surface);
  box-shadow: 0 0 0 2px rgba(18, 18, 20, 0.9);
}
.dock-filter-dot.hidden {
  display: none !important;
}

.zoom-divider {
  width: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin: 1px 0;
}

/* Bottom-left Earth globe controls (visible across all laptops & desktops >=1024px) */
#earth-only-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
}

/* Base Editorial Overview Card, Stack Sheet, Photo Scrim & Close Button */
#place-card,
#cluster-sheet {
  width: var(--card-w);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 178px);
}
#card-photo-wrap {
  height: 136px;
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}
#card-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 54px;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.64), rgba(8, 8, 10, 0));
  pointer-events: none;
  z-index: 1;
}
#card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#btn-close-card {
  width: 32px;
  height: 32px;
  background: rgba(11, 11, 13, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.60);
}
#btn-close-card:hover {
  background: rgba(11, 11, 13, 0.94);
  border-color: rgba(255, 255, 255, 0.48);
  color: #ffffff;
}
#card-badge,
#card-title {
  padding-right: 36px;
}
#card-extra-chips:empty {
  display: none;
}

/* Clean Floating Rabbit Hole Trail Card (viewport-centered above dock on desktop) */
#rabbit-trail-bar {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 37;
  width: min(580px, calc(100vw - 32px));
  border-radius: 20px;
  padding: 11px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#rabbit-trail-bar.hidden {
  display: none !important;
}
.trail-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.trail-bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}
.trail-bar-meta:hover #trail-bar-title {
  color: #ffffff;
}
.trail-bar-bridge {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
  color: #ededed;
  white-space: normal;
  word-wrap: break-word;
}
.trail-expand-icon {
  transition: transform 180ms ease;
  opacity: 0.78;
}
#rabbit-trail-bar.is-expanded .trail-expand-icon {
  transform: rotate(180deg);
}
.trail-bar-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 9px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.trail-bar-stops.hidden {
  display: none !important;
}
.trail-stop-chip {
  font-size: 11.5px;
  color: #d4d4d4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.trail-stop-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.trail-stop-chip.is-current {
  background: rgba(160, 70, 70, 0.22);
  border-color: rgba(208, 110, 110, 0.5);
  color: #ffffff;
  font-weight: 500;
}

.trail-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-link-soft);
  border: 1px solid var(--accent-link-border);
  color: #f0cece;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.impact-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.impact-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(160, 70, 70, 0.85), rgba(244, 244, 245, 0.9));
  transition: width 0.25s ease;
}

.offline-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
  margin-top: 8px;
}
.offline-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgb(160, 70, 70), #e4e4e7);
  transition: width 0.16s ease;
}

.agent-node-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 13px 15px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.agent-node-card:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Space Frontier Mode Overrides */
body.space-mode #place-card {
  top: 152px;
  max-height: calc(100dvh - 244px);
}
body.space-mode #earth-only-controls,
body.space-mode #active-filter-pill,
body.space-mode #bottom-dock .dock-type-group,
body.space-mode #bottom-dock .dock-divider {
  display: none !important;
}
body.space-mode #zoom-controls {
  bottom: 20px;
  left: 20px;
  right: auto;
}
body.space-mode #zoom-controls .zoom-btn,
body.space-mode #zoom-controls .zoom-divider {
  display: none !important;
}

/* Modal backdrop overlay — soft dim so globe remains softly visible behind frosted centered windows */
.modal-backdrop {
  background: rgba(6, 6, 8, 0.46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Password strength segments */
.strength-seg {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}
.strength-weak { background: var(--accent-surface); }
.strength-mid  { background: #a1a1aa; }
.strength-strong { background: #f4f4f5; }

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar { display: none; }

.scroll-clean {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.scroll-clean::-webkit-scrollbar { width: 5px; }
.scroll-clean::-webkit-scrollbar-track { background: transparent; }
.scroll-clean::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 999px; }

#toast {
  position: fixed;
  top: var(--island-bottom);
  left: 50%;
  max-width: calc(100vw - 24px);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS (Desktop >=1200px · Laptop 1024-1199px · Tablet 768-1023px · Mobile <768px)
   ========================================================================= */

@media (min-width: 1024px) {
  #earth-only-controls {
    display: flex;
  }
  body.card-open.time-open #time-bar {
    left: calc(var(--card-w) + 36px) !important;
    right: 84px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: auto !important;
    max-width: 820px !important;
  }
}

/* Wide desktop (>=1200px): true centered #rabbit-trail-bar clear of #place-card on the left */
@media (min-width: 1200px) {
  body.card-open #rabbit-trail-bar {
    left: 50%;
    transform: translateX(-50%);
    width: min(580px, calc(100vw - 2 * (var(--card-w) + 36px)));
  }
}

/* Compact desktop & laptop (768px–1280px): streamlined dock sizing for clean horizontal clearance */
@media (max-width: 1280px) and (min-width: 768px) {
  .dock-btn {
    padding: 0 11px;
    gap: 5px;
    font-size: 13px;
  }
  .dock-icon {
    width: 14px;
    height: 14px;
  }
}

/* Laptop (1024px–1279px): compact bottom-left Arcs/Labels/3D capsule */
@media (max-width: 1279px) and (min-width: 1024px) {
  #earth-only-controls {
    left: 16px;
    padding: 4px;
    gap: 3px;
  }
  #earth-only-controls button {
    padding: 5px 9px;
    font-size: 12.5px;
    line-height: 1.2;
  }
}

/* Narrow Laptop (1024px–1140px): keep full "Universities" dock label cleanly clear of #earth-only-controls */
@media (max-width: 1140px) and (min-width: 1024px) {
  #bottom-dock {
    padding: 5px 6px;
    gap: 4px;
  }
  .dock-type-group,
  .dock-explore-group {
    gap: 2px;
  }
  .dock-btn {
    padding: 0 8.5px;
    gap: 4px;
    font-size: 12.25px;
  }
  #earth-only-controls {
    left: 12px;
    padding: 3px;
    gap: 2px;
  }
  #earth-only-controls button {
    padding: 5px 7.5px;
    font-size: 12px;
  }
}

/* Laptop / Tablet corridor centering for #rabbit-trail-bar (768px–1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
  #rabbit-trail-bar {
    bottom: 94px;
  }
  body.card-open #rabbit-trail-bar {
    left: calc(var(--card-w) + 36px);
    right: 78px;
    transform: none;
    margin-inline: auto;
    width: min(560px, calc(100vw - var(--card-w) - 114px));
  }
}

/* Elevated dock & non-overlapping zoom / attribution (768px–1180px) */
@media (max-width: 1180px) and (min-width: 768px) {
  #bottom-dock {
    bottom: 34px !important;
  }
  #earth-only-controls {
    bottom: 34px;
  }
  #zoom-controls {
    bottom: 94px !important;
    right: 16px !important;
    left: auto !important;
  }
  body.space-mode #zoom-controls {
    bottom: 34px !important;
    left: 16px !important;
    right: auto !important;
  }
  .maplibregl-ctrl-attrib {
    margin: 0 14px 6px 0 !important;
    padding: 2px 9px !important;
  }
}

/* Tablet & smaller (<1024px): prevent panel collisions */
@media (max-width: 1023px) {
  body.card-open.time-open #time-bar,
  body.time-open #zoom-controls,
  body.card-open #active-filter-pill {
    display: none !important;
  }
  .island-kbd {
    display: none !important;
  }
  .island-btn {
    padding: 0 11px;
    gap: 6px;
  }
}

/* Tablet portrait (768px–1023px): slightly tighter card width so map & trail corridor breathe */
@media (max-width: 1023px) and (min-width: 768px) {
  :root {
    --card-w: 300px;
  }
}

/* Narrow tablet / split-pane (640px–860px): compact icon mode switcher keeps true island symmetry */
@media (max-width: 860px) and (min-width: 640px) {
  .island-mode-label {
    display: none !important;
  }
  .island-mode-btn {
    width: 34px;
    padding: 0;
  }
  .island-inner {
    gap: 6px;
  }
}

/* Mobile Dynamic Island (<640px): true symmetrical 6-icon fit for 360-430px screens */
@media (max-width: 639px) {
  :root {
    --island-bottom: calc(64px + env(safe-area-inset-top, 0px));
  }
  #dynamic-island {
    top: calc(10px + env(safe-area-inset-top, 0px));
    width: auto;
    max-width: calc(100vw - 20px);
    height: 48px;
    padding: 5px 6px;
  }
  .island-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .island-zone {
    gap: 5px;
  }
  .island-label-sm,
  .island-label-md,
  .island-mode-label,
  .island-kbd,
  .island-bm-badge {
    display: none !important;
  }
  .island-btn {
    position: relative;
    height: 36px;
    width: 36px;
    min-width: 36px;
    padding: 0;
    gap: 0;
  }
  .island-count-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border: 1.5px solid #0b0b0d;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    pointer-events: none;
  }
  .island-mode-track {
    height: 36px;
    padding: 1px;
    gap: 2px;
  }
  .island-mode-btn {
    height: 32px;
    width: 32px;
    padding: 0;
  }
  #active-filter-pill {
    top: var(--island-bottom) !important;
  }
  .filter-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Bottom Nav Bar & Bottom-Sheet Place Card (<768px) */
@media (max-width: 767px) {
  .atlas-popover {
    top: var(--island-bottom);
    max-height: calc(100dvh - 154px);
    padding: 14px;
  }
  #space-zone-bar {
    top: var(--island-bottom) !important;
  }
  #space-zone-pills .szone-btn {
    padding: 5px 11px !important;
    font-size: 13px !important;
  }
  #spotlight-backdrop {
    padding: var(--island-bottom) 10px 16px !important;
  }
  #spotlight-modal {
    max-height: calc(100dvh - 96px) !important;
    border-radius: 22px !important;
  }
  #spotlight-modal > div:first-child {
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  #search-input {
    font-size: 15px !important;
  }
  #btn-spotlight-agent {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
  }
  #drawer-backdrop {
    padding: 10px !important;
  }
  #drawer-modal {
    max-height: calc(100dvh - 36px) !important;
    border-radius: 24px !important;
  }
  .card-sheet-handle {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    pointer-events: none;
  }
  #btn-close-card {
    width: 36px;
    height: 36px;
  }
  #place-card,
  #cluster-sheet {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    top: auto !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 54dvh !important;
    border-radius: 24px !important;
  }
  #cluster-sheet > div:nth-child(2) {
    padding-top: 20px;
  }
  #bottom-dock {
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 999px !important;
    padding: 5px 6px !important;
    overflow: visible !important;
  }
  .dock-type-group,
  .dock-divider {
    display: none !important;
  }
  .dock-explore-group {
    width: 100%;
    gap: 4px;
  }
  .dock-mobile-only {
    display: inline-flex !important;
  }
  .dock-btn {
    flex: 1 1 0%;
    min-width: 0;
    height: auto;
    flex-direction: column;
    gap: 2px;
    padding: 7px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
  }
  .dock-btn:not(.glass-btn-active) {
    background: transparent;
    border-color: transparent;
  }
  .dock-icon {
    width: 17px;
    height: 17px;
  }
  #zoom-controls {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    left: auto !important;
    padding: 4px !important;
  }
  #zoom-controls .zoom-btn,
  #zoom-controls .zoom-divider {
    display: none !important;
  }
  body.card-open #zoom-controls,
  body.time-open #zoom-controls {
    display: none !important;
  }
  .maplibregl-ctrl-attrib {
    display: none !important;
  }
  #time-bar {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    padding: 14px !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #rabbit-trail-bar {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    transform: none !important;
    top: var(--island-bottom) !important;
    bottom: auto !important;
    border-radius: 18px !important;
    padding: 10px 12px !important;
    gap: 6px !important;
  }
  #rabbit-trail-bar.is-expanded {
    z-index: 46 !important;
    max-height: calc(100vh - var(--island-bottom) - 104px);
    overflow-y: auto;
  }
  #rabbit-trail-bar .trail-bar-bridge {
    font-size: 12.5px;
    line-height: 1.42;
  }
  body.trail-open #active-filter-pill {
    display: none !important;
  }
  body.trail-open #place-card {
    max-height: 46dvh !important;
  }
  #card-photo-wrap {
    height: 112px !important;
  }
}

/* Compact phone (<420px): keep Filter popover header & Spotlight search clean on 1 row */
@media (max-width: 420px) {
  #btn-filter-offline {
    padding: 5px 9px !important;
    font-size: 12px !important;
  }
  #btn-filter-reset {
    padding: 5px 9px !important;
    font-size: 12px !important;
  }
  #btn-spotlight-agent span {
    display: none;
  }
  #btn-spotlight-agent {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    justify-content: center;
  }
  #btn-spotlight-deep-research {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
}

/* =========================================================================
   DEEP RESEARCH STUDIO (arXiv · alphaXiv · ROR · Gemini Search & Deep Research)
   ========================================================================= */

.dr-mode-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dr-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  min-width: 0;
}

.dr-mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dr-mode-btn.is-active {
  background: rgba(160, 70, 70, 0.2) !important;
  border-color: rgba(208, 110, 110, 0.5) !important;
}

.dr-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: #d4d4d4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dr-badge-accent {
  color: #f3c4c4;
  background: rgba(160, 70, 70, 0.22);
  border-color: rgba(208, 110, 110, 0.45);
}

.dr-mode-title {
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f5;
  line-height: 1.2;
}

.dr-mode-sub {
  font-size: 11px;
  color: #a3a3a3;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dr-mode-btn.is-active .dr-mode-sub {
  color: #d6b6b6;
}

.dr-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.095);
}

.dr-context-pill {
  border-radius: 15px;
  padding: 10px 13px;
  background: rgba(160, 70, 70, 0.1);
  border: 1px solid rgba(190, 82, 82, 0.3);
}

.dr-hub-item,
.dr-paper-item {
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(12, 12, 15, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.085);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dr-suggest-chip {
  font-size: 12px;
  color: #d4d4d4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dr-suggest-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.dr-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #e5e5e5;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.dr-source-chip:hover {
  background: rgba(160, 70, 70, 0.18);
  border-color: rgba(190, 82, 82, 0.45);
}

.dr-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgb(208, 110, 110);
  box-shadow: 0 0 10px rgba(208, 110, 110, 0.8);
  animation: drPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes drPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.65; }
  50% { transform: scale(1.18); opacity: 1; }
}

@media (max-width: 639px) {
  .dr-mode-bar {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .dr-mode-btn {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
  }
}
