/* pSTABLES system atlas. Workspace chrome only: diagram colours carry meaning. */
html:has(body.ps-geography) {
  --bg: #070f1d;
  --panel: #0d1a2c;
  --line: #294052;
  --text: #e3edf5;
  --muted: #9db2c5;
  --cyan: #56d8e8;
  --green: #6ee7bd;
  --scroll-thumb: #3b6279;
  --scroll-track: #0a1524;
  --ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page-width: 1720px;
  scroll-padding-top: calc(var(--ps-header-height, 72px) + 18px);
}
body.ps-geography {
  color: #e3edf5;
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.6;
  background: #070f1d;
}
body.ps-geography::before {
  background: linear-gradient(#070f1dd9, #070f1df2), url('../geography/geobg.png') center / cover no-repeat;
  opacity: 1;
}
body.ps-mkr-map::before {
  background-image: linear-gradient(#070f1dd9, #070f1df2), url('../geography/geovault-bg.png');
}
.ps-geography > .top {
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) minmax(220px, 1fr);
  background: #0a1625ed;
  border-color: #294052;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
}
.ps-geography .site-label { color: #9bb7cb; letter-spacing: .08em; }
.ps-geography .build-tag { color: #7f9aaf; }
.ps-geography .brand { color: #e3f4f8; font: 650 20px/1.3 var(--ui); }
.ps-geography .brand small { color: #95b2c4; font: 11px/1.5 var(--ui); letter-spacing: .04em; }
.ps-geography .pin { color: #a5bfce; }
.ps-geography .pin b { color: #8ba7bd; }
.ps-geography .workspace { padding: 18px 22px 0; gap: 18px; grid-template-columns: 204px minmax(0, 1fr); }
.ps-geography .workspace-actions {
  top: calc(var(--ps-header-height, 72px) + 16px);
  max-height: calc(100vh - var(--ps-header-height, 72px) - 32px);max-height: calc(100dvh - var(--ps-header-height, 72px) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0d1a2cf5;
  border-color: #29465a;
  box-shadow: 0 10px 30px #0002;
}
.ps-geography .workspace-actions > .sidebar-title { color: #bed2df; font-size: 10px; }
.ps-geography .workspace-actions .workspace-research > a,
.ps-geography .workspace-actions .workspace-research > button,
.ps-geography .workspace-actions .files-menu > summary {
  background: #122439;
  border-color: #2c465b;
  color: #c7dce8;
}
.ps-geography .workspace-actions .workspace-research > a:hover,
.ps-geography .workspace-actions .workspace-research > button:hover,
.ps-geography .workspace-actions .files-menu > summary:hover {
  background: #173348;
  border-color: #4c9db4;
  color: #ecfaff;
}
.ps-geography .workspace-actions .companion-link {
  background: linear-gradient(145deg, #153d38, #102737);
  border-color: #437d74;
  box-shadow: inset 0 1px 0 #a5ffdb12, 0 5px 18px #0002;
}
.ps-geography .workspace-actions #pitfalls { color: #e8d3ac; background: #25291f; border-color: #686144; }
.ps-geography .workspace-actions .files-menu > div { background: #0a1626; border-color: #29465a; }
.ps-geography .workspace-actions .files-menu a,
.ps-geography .workspace-actions .files-menu button { background: #112438; border-color: #29465a; color: #c1d7e5; }
.ps-geography .workspace-content { min-width: 0; }
.ps-geography .navshell { background: #0d1a2cf5; border-color: #294052; padding: 12px; }
.ps-geography .route-intro { color: #a8c0d2; font-size: 10px; }
.ps-geography #routeNav { gap: 8px; }
.ps-geography #routeNav button {
  background: linear-gradient(135deg, #142a3e, #0e2031);
  min-height: 62px;
  border-color: #34556b;
  color: #dfeef5;
  box-shadow: inset 0 1px 0 #d6f5ff08;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.ps-geography #routeNav button:hover { background: #19394d; border-color: var(--tab-accent, #56d8e8); }
.ps-geography #routeNav button.active {
  background: linear-gradient(rgba(var(--accent-rgb), .15), rgba(var(--accent-rgb), .08)), #102437;
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.ps-geography .nav-label { font-size: 13px; font-weight: 600; }
.ps-geography .maphead { background: #0d1a2cf5; border-color: #294052; padding: 14px 16px; }
.ps-geography .maphead h1 { color: #edf6fc; font-size: 21px; }
.ps-geography .maphead p { color: #a9bfce; font-size: 13px; }
.ps-geography .controls { padding: 11px 0; gap: 10px; }
.ps-geography .controls button,
.ps-geography .controls .view-options > summary,
.ps-geography .controls .legend-menu > summary,
.ps-geography .bottom button {
  background: #122439;
  border-color: #2c465b;
  color: #c5dce9;
  min-height: 36px;
  font-size: 12px;
}
.ps-geography .controls button:hover,
.ps-geography .controls .view-options > summary:hover,
.ps-geography .controls .legend-menu > summary:hover,
.ps-geography .bottom button:hover { background: #1a354b; border-color: #4c9db4; color: #f0fbff; }
.ps-geography #trace { color: #91e6ee; background: #11323d; border-color: #367b87; }
.ps-geography #resetTrace { color: #a8becf; }
.ps-geography #dataJump { color: #bdebd8; background: #12382f; border-color: #3c7964; }
.ps-geography .controls label { color: #bcd0df; }
.ps-geography .controls input[type=checkbox] { accent-color: #56d8e8; }
.ps-geography .zoom-caption { color: #8eaabd; }
.ps-geography #zoomOut, .ps-geography #zoomIn { color: #cbe8f5; }
.ps-geography #zoomValue { color: #bedbea; }
.ps-geography #fit { color: #7fdde9; border-color: #3f8095; }
.ps-geography .view-options > div, .ps-geography .legend-panel { background: #0d1a2cfc; border-color: #3c617a; box-shadow: 0 16px 40px #0006; }
.ps-geography .view-options > summary::after, .ps-geography .legend-menu > summary::after { color: #83b7ca; }
.ps-geography .legend { color: #c1d4e2; }
.ps-geography .legend-label, .ps-geography .domain-label, .ps-geography .legend-panel p { color: #9db6c8; }
.ps-geography #domainLegend > span { background: #152c40; border-color: #35536b; }
.ps-geography .mapviewport {
  background: #071422b3;
  border-color: #345064;
  border-radius: 8px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-margin-top: calc(var(--ps-header-height, 72px) + 16px);
}
.ps-geography .tracebar { background: #0d1a2cf5; border-color: #294052; }
.ps-geography #traceLabel, .ps-geography .bottom .summary { color: #adc3d2; }
.ps-geography .route-data { background: #0d1a2cf7; border-color: #29465a; scroll-margin-top: calc(var(--ps-header-height, 72px) + 16px); }
.ps-geography > footer { color: #90aabe; }
.ps-geography #sheet { background: #0d1a2cfc; border-color: #3c617a; }
.ps-geography .sheet-header { background: #112438fc; border-color: #2f4b60; }
.ps-geography .detail-tabs { background: #0d1a2cfc; }
.ps-geography .detail-tabs button { background: #142c40; }
.ps-geography .detail-tabs button[aria-selected=true] { background: #194258; border-color: #62bbce; box-shadow: inset 0 -2px 0 #62bbce; }
.ps-geography #addressSearch { background: #0a1728; border-color: #3c617a; }
.ps-geography .directory-item { background: #13283c; border-color: #34536b; }
.ps-geography .directory-item:hover { background: #1a374d; border-color: #62bbce; }
.ps-geography .maphead { scroll-margin-top: calc(var(--ps-header-height, 72px) + 16px); }
.ps-geography .ps-map-status { color: #e4c78f; font-size: 12px; flex-basis: 100%; }
.ps-geography .ps-map-status:empty { display: none; }
.ps-geography .ps-address-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ps-geography .ps-address-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; border: 1px solid #38627b; border-radius: 6px; background: #153147; color: #b4e5f0; font-size: 12px; }
.ps-geography .ps-address-links a:hover { text-decoration: none; background: #1a4258; border-color: #60bdce; }
.ps-geography .ps-map-lookup-status { border: 1px solid #3b627b; background: #10273a; border-radius: 7px; padding: 12px 14px; margin: 12px 0; color: #bad2df; font-size: 13px; }
.ps-geography .ps-map-lookup-status p { margin: 0; }
.ps-geography.ps-geo-report::before { display: none; }
.ps-geography.ps-geo-report .report-head,
.ps-geography.ps-geo-report .report-main { max-width: 1192px; padding: 26px 24px; }
.ps-geography.ps-geo-report .report-head { border-color: #294052; }
.ps-geography.ps-geo-report .report-head h1 { font-size: clamp(25px, 3vw, 35px); letter-spacing: -.035em; color: #e5f5f7; }
.ps-geography.ps-geo-report .report-head p { color: #abc2d1; font-size: 14px; }
.ps-geography.ps-geo-report .report-meta { color: #87aec2; font-size: 10px; }
.ps-geography.ps-geo-report .report-nav { gap: 7px; margin: 18px 0; }
.ps-geography.ps-geo-report .report-nav a { padding: 8px 11px; border-color: #2d4b62; color: #b7deeb; background: #11263a; border-radius: 7px; font-size: 12px; }
.ps-geography.ps-geo-report .report-nav a:hover { border-color: #56b6c8; background: #17394a; }
.ps-geography.ps-geo-report .report-main > section { scroll-margin-top: calc(var(--ps-header-height, 72px) + 18px); border-color: #294052; }
.ps-geography .review-prose { --rv-line: #355369; font-size: 14px; line-height: 1.75; }
.ps-geography .review-prose .rv-box { background: #0e1e30; border-color: #2d4b60; }
.ps-geography .review-prose .rv-verdict { background: linear-gradient(120deg, #163544, #102a30); border-color: #356076; border-left-color: #56d8e8; }
.ps-geography .review-prose .rv-verdict h3 { font-size: 20px; }
.ps-geography .review-prose .rv-sectionhead > p { font-size: 14px; }
.ps-geography .review-prose .rv-tablewrap { background: #0b1828; }
.ps-geography .review-prose details { background: #102236; border-color: #2d4b60; }
.ps-geography .review-prose th { background: #142c40; }
.ps-geography .review-prose .rv-node { background: #102336; }
.ps-geography .review-prose .rv-source { scroll-margin-top: calc(var(--ps-header-height, 72px) + 18px); }
@media (max-width: 1199px) {
  .ps-geography > .top { grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr); gap: 5px 18px; }
  .ps-geography .workspace { grid-template-columns: 188px minmax(0, 1fr); gap: 14px; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 760px) {
  .ps-geography > .top { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 4px; }
  .ps-geography .brand { font-size: 19px; text-align: left; }
  .ps-geography .brand small { display: inline; margin-left: 8px; font-size: 10px; }
  .ps-geography .pin { text-align: left; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 9px; }
  .ps-geography .workspace { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; }
  .ps-geography .workspace-actions { position: relative; top: auto; max-height: none; padding: 8px 12px; overflow: visible; }
  .ps-geography .workspace-actions > .sidebar-title { min-height: 34px; font-size: 11px; }
  .ps-geography .workspace-actions .companion-link { min-height: 88px; }
  .ps-geography .navshell { padding: 10px; }
  .ps-geography #routeNav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 1px 9px;
    scrollbar-width: thin;
  }
  .ps-geography #routeNav button { flex: 0 0 142px; min-height: 66px; padding: 10px; scroll-snap-align: start; }
  .ps-geography .nav-label { font-size: 13px; }
  .ps-geography .route-intro { font-size: 9px; gap: 8px; }
  .ps-geography .maphead { padding: 12px; }
  .ps-geography .maphead h1 { font-size: 19px; }
  .ps-geography .maphead p { font-size: 12px; }
  .ps-geography .controls { gap: 8px; }
  .ps-geography .controls-left { gap: 6px; }
  .ps-geography .controls-right { width: 100%; gap: 6px; }
  .ps-geography .zoom-caption { display: none; }
  .ps-geography .controls button,
  .ps-geography .controls .view-options > summary,
  .ps-geography .controls .legend-menu > summary { min-height: 42px; }
  .ps-geography #zoomOut, .ps-geography #zoomIn { width: 42px; }
  .ps-geography .mapviewport { min-height: 260px; max-height: 67vh;max-height: 67dvh; }
  .ps-geography.ps-geo-report .report-head,
  .ps-geography.ps-geo-report .report-main { padding: 20px 14px; }
  .ps-geography .review-prose { font-size: 13px; }
  .ps-geography.ps-geo-report .report-nav a { min-height: 40px; display: inline-flex; align-items: center; }
}
@media (pointer: coarse) {
  .ps-geography .controls button,
  .ps-geography .controls summary,
  .ps-geography .bottom button { min-height: 44px; }
}
html:fullscreen body.ps-geo-map { overflow-y: auto; }
html:fullscreen .ps-geo-map > #ps-shell,
html:fullscreen .ps-geo-map > .top,
html:fullscreen .ps-geo-map .workspace-actions,
html:fullscreen .ps-geo-map > footer { display: none !important; }
html:fullscreen .ps-geo-map .workspace { grid-template-columns: minmax(0, 1fr); max-width: none; padding: 10px 14px; }
html:fullscreen .ps-geo-map #routeNav { display: flex; overflow-x: auto; gap: 7px; padding-bottom: 6px; }
html:fullscreen .ps-geo-map #routeNav button { flex: 0 0 140px; min-height: 54px; }
html:fullscreen .ps-geo-map .mapviewport { max-height: 65vh;max-height: 65dvh; }
@media print {
  body.ps-geography { background: #fff; color: #111; }
  .ps-geography > #ps-shell { display: none !important; }
  .ps-geography.ps-geo-report .report-head, .ps-geography.ps-geo-report .report-main { max-width: none; padding: 12px; }
}
