:root {
  --paper: #f6f8f9;
  --ink: #203345;
  --muted: #566975;
  --line: #cdd6dc;
  --accent: #206965;
  color: var(--ink);
  background: var(--paper);
  font:
    15px/1.5 'Helvetica Neue',
    'PingFang SC',
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button,
select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  padding: 6px 12px;
}
button:hover,
select:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.55;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
:focus-visible {
  outline: 2px solid #278f84;
  outline-offset: 3px;
}
.mast,
footer,
.workspace,
#empty-library {
  width: min(1440px, 93%);
  margin-inline: auto;
}
.mast {
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.identity {
  display: flex;
  align-items: baseline;
  gap: 15px;
}
.identity strong {
  font:
    normal 34px/0.95 Georgia,
    serif;
  letter-spacing: -0.065em;
}
.identity span,
.mast a,
footer {
  font-size: 13px;
  color: var(--muted);
}
.mast a,
footer a {
  text-decoration: none;
}
.mast a:hover,
footer a:hover {
  text-decoration: underline;
}
.workspace {
  display: grid;
  grid-template-columns: clamp(205px, 18vw, 270px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 65px);
  padding: 30px 0;
}
.sidebar,
.viewer {
  min-width: 0;
}
.library-heading,
.route-heading,
.profile-head,
.dialog-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.library-heading h1,
.profile h3 {
  font-size: 17px;
  font-weight: 550;
  margin: 0;
}
.library-heading span,
.route-meta,
.route-item small,
.profile-head span,
.empty,
.workspace-details,
.dialog-caption {
  font-size: 13px;
  color: var(--muted);
}
.search {
  margin: 18px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 40px;
}
.filter-panel summary,
.workspace-details summary,
.layers summary {
  width: fit-content;
  min-height: 40px;
  padding: 9px 0;
  font-size: 13px;
  cursor: pointer;
}
.more-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.filter-panel :is(input, select) {
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}
.route-list {
  margin-top: 8px;
  max-height: 62vh;
  overflow: auto;
}
.route-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 8px;
  background: transparent;
}
.route-item[aria-current='true'] {
  background: #e3eeec;
  box-shadow: inset 3px 0 var(--accent);
}
.route-item strong,
.route-item small {
  display: block;
  overflow-wrap: anywhere;
}
.thumb {
  width: 38px;
  height: 38px;
  flex: none;
}
.sidebar-foot button {
  margin-top: 15px;
  color: var(--muted);
  padding-left: 0;
  border: 0;
  background: none;
  font-size: 13px;
}
.route-heading {
  margin-bottom: 16px;
}
.route-heading h2 {
  margin: 0;
  font-weight: 550;
  line-height: 1.2;
  font-size: clamp(24px, 2.7vw, 42px);
  overflow-wrap: anywhere;
  letter-spacing: -0.04em;
}
.route-meta {
  margin: 0 0 3px;
}
.views {
  display: flex;
  flex-shrink: 0;
  background: #e4e9ec;
  padding: 3px;
  border-radius: 7px;
}
.views button {
  background: transparent;
  border: 0;
  min-height: 38px;
  padding: 5px 17px;
}
.views [aria-pressed='true'] {
  background: var(--ink);
  color: white;
}
.metrics,
.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}
.metrics {
  margin-bottom: 16px;
}
.metric dt,
.metric small,
.metric p {
  font-size: 12px;
  color: var(--muted);
}
.metric dd {
  margin: 0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.map-panel {
  position: relative;
  height: clamp(290px, 48vh, 620px);
  background: #e3ebe8;
  overflow: hidden;
}
.map-panel canvas#map-fallback,
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-toolbar,
.flight {
  position: absolute;
  left: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.map-toolbar {
  top: 12px;
}
.map-toolbar > * {
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  border-radius: 4px;
}
.map-toolbar span {
  padding: 5px;
}
.flight {
  bottom: 32px;
  right: 12px;
  background: white;
  padding: 4px;
}
.flight input {
  flex: 1;
  min-width: 0;
}
.profile {
  padding: 16px 0 2px;
}
.profile-head span {
  font-variant-numeric: tabular-nums;
}
#profile {
  width: 100%;
  height: 95px;
  display: block;
  cursor: crosshair;
}
.workspace-details {
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.notes {
  white-space: pre-wrap;
}
.workspace-sky {
  background: #0e1b2b;
  color: #eef4fb;
  padding: 14px;
}
.workspace-sky button {
  background: #1d3044;
  border-color: #456078;
  color: inherit;
}
.sky-timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
}
.sky-timeline output {
  font-variant-numeric: tabular-nums;
}
#sky-time {
  grid-column: 1/-1;
  width: 100%;
  accent-color: #8bc7be;
}
.sky-start,
.sky-end {
  font-size: 11px;
  color: #bbcad6;
}
.sky-end {
  grid-column: 3;
  justify-self: end;
}
.sky-panorama-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 0;
}
.sky-panorama-toolbar button {
  font-size: 13px;
}
.layers {
  position: relative;
  margin-left: auto;
}
.layers > div {
  position: absolute;
  right: 0;
  z-index: 3;
  width: 160px;
  display: grid;
  background: #203144;
  padding: 10px;
}
.layers label {
  padding: 5px;
}
.sky-panorama-stage {
  height: clamp(350px, 52vh, 640px);
  cursor: grab;
}
.sky-panorama-view,
.sky-panorama-readout,
.sky-panorama-credit {
  display: block;
  color: #c5d2df;
  font-size: 12px;
  padding-top: 7px;
}
.sky-panorama-stage[data-dragging='true'] {
  cursor: grabbing;
}
footer {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
#empty-library {
  position: relative;
  background: #101927 url('vendor/milky-way-galactic.jpg') center / cover;
  color: white;
  min-height: clamp(345px, 60svh, 690px);
  margin-block: 24px;
  display: grid;
  align-content: end;
  padding: clamp(24px, 5vw, 80px);
  isolation: isolate;
}
#empty-library::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #07131de8, transparent 85%);
}
#empty-library h1 {
  font:
    normal clamp(32px, 4vw, 62px) / 1.25 Georgia,
    'Songti SC',
    serif;
  margin: 0;
}
#empty-library p {
  margin: 8px 0 18px;
  color: #e0e5e9;
}
#empty-library button {
  background: #e9f1ef;
  color: #192e39;
  border: 0;
  min-height: 42px;
}
.image-credit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 10px;
  color: #d1dae0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  width: min(430px, 92vw);
  color: var(--ink);
}
dialog::backdrop {
  background: #16263877;
}
.dialog-body h2 {
  margin: 0;
  font-size: 21px;
}
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.summary-grid .metric p {
  margin: 2px 0;
}
#notification {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
  padding: 10px 16px;
  background: var(--ink);
  color: white;
}
@media (max-width: 760px) {
  .mast {
    height: 56px;
  }
  .identity strong {
    font-size: 28px;
  }
  .identity {
    gap: 9px;
  }
  .workspace {
    display: block;
    padding-top: 16px;
  }
  .sidebar {
    margin-bottom: 22px;
  }
  .route-list {
    max-height: 152px;
  }
  .route-item {
    padding: 8px;
  }
  .library-heading h1 {
    font-size: 16px;
  }
  .search {
    margin-top: 8px;
  }
  .sidebar-foot button {
    margin-top: 5px;
  }
  .views button {
    padding: 4px 12px;
  }
  .route-heading {
    align-items: flex-end;
  }
  .metrics {
    justify-content: space-between;
    gap: 6px;
  }
  .metric dd {
    font-size: 16px;
  }
  .map-panel {
    height: 40svh;
    min-height: 260px;
  }
  .sky-timeline {
    grid-template-columns: 1fr auto;
  }
  .sky-timeline output {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .sky-timeline button,
  .sky-end {
    grid-column: 2;
  }
  .sky-timeline button {
    grid-row: 1;
  }
  .workspace-sky {
    padding: 10px;
  }
  .map-toolbar {
    max-width: calc(100% - 53px);
    flex-wrap: wrap;
  }
  .image-credit {
    font-size: 9px;
  }
}
.mast-actions { display:flex; align-items:center; gap:clamp(8px,2vw,24px); }
#open-local { font-size:14px; }
#local-form { display:grid; gap:12px; }
#local-form h2,#local-form p { margin:0; }
#local-form label { display:grid; gap:5px; }
#local-form input { min-width:0; width:100%; }
#local-form small { color:var(--muted); }
#local-status { white-space:pre-line; overflow-wrap:anywhere; }
@media(max-width:430px){.identity span{display:none}}
