/* ==========================================================================
   The shell: the header both views hang below, and the view switcher.

   External header css also here

   The header used to belong to the retrieval app, and the map drew its own
   near-copy. There is one now, and it is the only element on the page that
   knows there are two views at all.
   ========================================================================== */

/* `height`, not just `min-height`. Both views are fixed-height instruments
   that scroll internally - every `overflow: hidden` and `min-height: 0` below
   assumes the shell is exactly the viewport. With only a floor, a tall child
   raised the shell instead: inspecting a hit with a long GEO record grew the
   page 410 px past the fold, taking the AI panel off screen and stretching the
   network canvas out of the window with it. The floor stays for the map's
   percentage-height chain. */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

/* The view slot has to be a flex container itself, not just a flex child.
   Both views claim the height under the header with `flex: 1`, and a plain
   block wrapper would silently ignore that and collapse to content height -
   which is exactly what it did, leaving a band of bare canvas below the
   retrieval view. `min-height: 0` lets the views' own scroll containers work
   instead of the slot growing to fit them. */
.app-shell > #page-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* --- Header ------------------------------------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 12px var(--space-4);
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-bg);
  color: var(--header-fg);
  flex: none;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  /* The brand is a link home now. Nothing about it should say "link": no
     underline, no color shift - only the pointer and a focus ring. */
  outline-offset: 3px;
}
.app-brand:hover .app-title { color: #ffffff; }

/* NASA insignia in the existing compact brand slot. */
.app-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex: none;
}

.app-brand-text { display: flex; flex-direction: column; gap: 1px; }

.app-title {
  margin: 0;
  font-size: calc(var(--text-xl) * 1.2);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  transition: color 120ms ease;
}

.app-subtitle {
  margin: 0;
  font-size: calc(var(--text-sm) * 1.2);
  color: var(--header-fg-muted);
  line-height: 1.3;
}

/* --- View switcher ------------------------------------------------------ */
/* A segmented control rather than tabs. Tabs imply the page below is a panel
   of one thing; these are two ways of looking at the same corpus, and the
   control should read as a mode switch. */

.app-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 0;
  background: transparent;
  border: 1px solid transparent;
}

.app-nav-item {
  display: block;
  padding: 6px 18px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--header-fg-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.app-nav-item:hover { color: var(--header-fg); background: rgba(255, 255, 255, 0.08); }

.app-nav-item.is-active {
  background: transparent;
  color: var(--header-fg);
  box-shadow: inset 0 -2px var(--hds-color-nasa-red);
}
.app-nav-item.is-active:hover { background: #2e2e32; color: #ffffff; }

.app-nav-item:focus-visible,
.app-brand:focus-visible {
  outline: 2px solid var(--header-fg);
  outline-offset: 2px;
}

/* --- Header statistics -------------------------------------------------- */

.app-header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: none;
}

.header-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.header-stat-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.header-stat-value--accent { color: var(--header-fg); }

.header-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--header-fg-muted);
}

.header-stat-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.16);
}

.header-stat-sub {
  display: block;              
  font-size: 10px;
  line-height: 1.2;
  /*color: var(--text-secondary);*/
  color: var(--header-fg-muted);
  opacity: 0.8;
  white-space: nowrap;
}

/* Below this the two header stats and the switcher cannot share a row without
   the brand losing its subtitle. The stats are context, so they go first. */
@media (max-width: 1100px) {
  .app-header-meta { display: none; }
  .app-nav { margin-left: auto; }
}

@media (max-width: 640px) {
  /* Brand, switcher and the guide button share 343 px on a phone; with the
     desktop's 20 px gutter and gaps the title wrapped to two lines. */
  .app-header { gap: var(--space-3); padding-left: 16px; padding-right: 16px; }
  .app-subtitle { display: none; }
  .app-nav-item { padding: 6px 10px; }
}

.app-brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.app-title { color: var(--header-fg); font-family: var(--font-heading); }

/* --- Skeletons --------------------------------------------------------------
   One placeholder language for the boot shell (app.INDEX_STRING) and the map's
   first figure (manifold.layout.map_skeleton): the shapes of what is coming, in
   the surface's own neutrals, with one slow sweep of light across them. The
   sweep is the only motion and stops under reduced motion; the shapes alone
   still say "the layout is arriving". */
.sk {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--sk-base) 0%, var(--sk-base) 35%,
              var(--sk-sheen) 50%, var(--sk-base) 65%, var(--sk-base) 100%);
  background-size: 300% 100%;
  animation: sk-sweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
:root { --sk-base: var(--hds-color-carbon-10); --sk-sheen: var(--hds-color-carbon-05); }
@keyframes sk-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; background: var(--sk-base); }
}

/* The boot shell: present only while Dash's own loading node is, so it can
   never outlive the app it stands in for. Dash's "Loading..." stays in the
   accessibility tree and leaves the screen. */
.boot-skeleton { display: none; }
body:has(._dash-loading) .boot-skeleton {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-canvas);
}
._dash-loading {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.boot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  padding: 0 20px;
  flex: none;
  background: var(--header-bg);
  --sk-base: var(--hds-color-carbon-80);
  --sk-sheen: var(--hds-color-carbon-70);
}
.boot-header .sk-mark { width: 34px; height: 34px; border-radius: 50%; }
/* The brand block holds the title's measured width (title and subtitle,
   259 px) so the nav and the counts land where the real ones will. */
.boot-brand {
  color: var(--header-fg);
  font: 700 var(--text-xl)/1.15 var(--font-heading);
  letter-spacing: -0.01em;
  width: 259px;
  flex: none;
}
.boot-header .sk-nav { width: 62px; height: 14px; flex: none; margin-left: 20px; }
.boot-header .sk-nav + .sk-nav { margin-left: 28px; }
.boot-header .sk-meta { width: 110px; height: 26px; flex: none; }
.boot-header .sk-meta:first-of-type, .boot-header .sk-nav + .sk-meta { margin-left: auto; }
.boot-header .sk-meta + .sk-meta { margin-left: 30px; }
@media (max-width: 900px) {
  .boot-header .sk-meta { display: none; }
  .boot-brand { width: auto; }
}
.boot-body {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 384px;
  flex: 1 1 auto;
  min-height: 0;
}
.boot-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
}
.boot-rail .sk-label { width: 38%; height: 12px; margin-top: 14px; }
.boot-rail .sk-control { width: 100%; height: 38px; }
.boot-main { display: contents; }
.boot-panel, .boot-inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  align-self: start;
}
.boot-inspector { margin-left: 0; }
.boot-panel .sk-heading, .boot-inspector .sk-heading { width: 30%; height: 22px; }
.boot-panel .sk-line, .boot-inspector .sk-line { width: 70%; height: 12px; }
.boot-panel .sk-row { width: 100%; height: 36px; }
.boot-key { display: none; }
@media (min-width: 1181px) and (max-width: 1480px) {
  .boot-body { grid-template-columns: 288px minmax(0, 1fr) 328px; }
}
@media (max-width: 1180px) {
  .boot-body { grid-template-columns: 1fr; }
  .boot-rail { display: none; }
  .boot-inspector { display: none; }
}

/* The map's boot shape: its own 268 px rail beside the navy canvas, with the
   floating key where the real one will land. */
[data-boot-route="map"] .boot-body { grid-template-columns: 268px minmax(0, 1fr); }
[data-boot-route="map"] .boot-rail { padding: 16px; }
[data-boot-route="map"] .boot-main {
  display: block;
  position: relative;
  background: var(--plot-bg);
  --sk-base: rgba(255, 255, 255, 0.07);
  --sk-sheen: rgba(255, 255, 255, 0.13);
}
[data-boot-route="map"] .boot-panel,
[data-boot-route="map"] .boot-inspector { display: none; }
[data-boot-route="map"] .boot-key {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: absolute;
  top: 46px; right: 14px;
  width: 228px;
  padding: 14px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
}
.boot-key .sk-key-row { height: 12px; width: 100%; }
.boot-key .sk-key-row:nth-child(2n) { width: 82%; }
@media (max-width: 900px) {
  [data-boot-route="map"] .boot-body { grid-template-columns: 1fr; }
  [data-boot-route="map"] .boot-rail { display: none; }
  [data-boot-route="map"] .boot-key { display: none; }
}

/* ===== External OSDR header ===== */
#headers form {
  display: inline;
}
#headers form input {
  padding: 5pt 7pt;
  border: 1px solid #555;
  border-radius: 2pt;
  outline-color: none !important;
}
#headers form input:hover {
  box-shadow: 0pt 0pt 8pt #888;
}
#headers form input:focus {
  outline: 0 none !important;
  border: 1px solid #888;
  box-shadow: 0pt 0pt 8pt #888;
}
#headers form input[type="submit"] {
  display: none;
}


/* Header banners -- global NASA, if any */
#headers .hds-banner-content {
  text-align: center;
  padding: 11.5pt 17pt 10.5pt 11pt;
  border-bottom: 1px solid #000;
}


/* Header menus -- both global NASA and project-specific OSDR; mobile/desktop versions */
#headers .header {
  background: #000;
  color: #FFF;
}
#headers .header a {
  color: #FFF;
  text-decoration: none;
  transition: all .15s linear;
}
#headers .header a:hover {
  color: #FFF;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4pt;
}
#headers .header a.live:hover {
  position: relative;
  background: #333;
}
#headers .header a.live {
  position: relative;
  font-weight: 700;
}
#headers .header td {
  white-space: nowrap;
  padding: 0;
}
#headers .header td.left {
  width: 42.5vw;
  padding-left: 10pt;
}
#headers .header td.middle {
  width: 15vw;
  text-align: center;
}
#headers .header td.right {
  width: 42.5vw;
  text-align: right;
  padding-right: 10pt;
}
#headers .header a.dropdown-header, #headers .header a.live {
  display: inline-block;
  vertical-align: middle;
  color: #FFF !important;
  text-decoration: none !important;
  cursor: pointer;
}
#headers .nasa-logo {
  position: relative;
  height: 3.2em;
  margin-top: .4em;
  font-size: 12.5pt !important;
}


/* NASA header (mobile) */
#headers #touch-nasa-header {
  display: none;
}
#headers .touch-menu svg#hamburger {
  position: relative;
  top: 1pt;
  cursor: pointer;
}
#headers .touch-menu svg#magnifier {
  position: relative;
  top: 2pt;
  cursor: pointer;
  margin-right: 10pt;
}
#headers #touch-dropdown-menu-wrapper, #headers #touch-dropdown-menu-search {
  display: none;
}
#headers .touch-dropdown-menu {
  line-height: 2;
  padding-left: 15pt;
}
#headers #touch-dropdown-menu-search {
  text-align: right;
}
#headers #touch-nasa-search {
  margin: 10pt 15pt 15pt 15pt;
  min-width: 50vw;
  background: #000;
  color: #FFF;
}


/* NASA header (desktop) -- may have to rearrange the lines here to make it make more sense */
#headers #nasa-header .dropdown-wrapper a.dropdown-header {
  font-weight: 700;
}
#headers #nasa-header .dropdown-wrapper.onclick.active a.dropdown-header {
  background: #333 !important;
}
#headers #nasa-header .dropdown-wrapper.onclick:hover a.dropdown-header {
  background: #1F1F1F;
}
#headers #nasa-header .dropdown-wrapper.onhover:hover a.dropdown-header {
  background: #333;
}
#headers #nasa-header a span {
  display: inline-block;
  margin: 22pt 12pt;
  font-size: 13pt;
  vertical-align: middle;
}
#headers #nasa-header .dropdown-menu {
  background: #333;
  min-width: 18em;
  padding: 15pt;
}
#headers #nasa-search {
  position: relative;
  top: 1.2pt;
  margin: 0 15pt;
  background: #000;
  color: #FFF;
}


/* OSDR header (mobile) */
#headers #touch-osdr-header-wrapper {
  display: none;
}
#headers #touch-osdr-header-inner {
  display: none;
}
#headers #touch-osdr-header {
  display: none;
  background: #1B1B1F;
  text-align: center;
}
#headers #touch-osdr-header .touch-dropdown-wrapper {
  display: block;
  text-align: left;
  padding: 0pt;
}
#headers #touch-osdr-header .dropdown-wrapper {
  display: block;
  text-align: left;
  padding: 0pt;
}
#headers #touch-osdr-header .touch-dropdown-wrapper span {
  display: inline-block;
  padding: 10pt;
}
#headers #touch-osdr-header .dropdown-wrapper span {
  display: inline-block;
  padding: 10pt;
}


/* OSDR header (desktop) */
#headers #osdr-header {
  background: #1B1B1F;
  text-align: center;
}
#headers #osdr-header a {
  text-decoration: none;
}
#headers #osdr-header a, #headers #osdr-header a span {
  color: #FFF;
  font-family: "inter", sans-serif;
  font-size: 10pt;
  font-weight: bold;
  letter-spacing: -.35pt;
}
#headers #osdr-header a span {
  display: inline-block;
  margin: 12pt 5pt;
  vertical-align: middle;
}
#headers #osdr-header a svg {
  top: .35pt;
  margin-left: 4pt;
  height: 7pt;
  width: 7pt;
}
#headers #osdr-header a.has-href span {
  padding-right: 2pt;
}
#headers #osdr-header a.has-href:hover span {
  color: #999 !important;
}
#headers #osdr-header .dropdown-wrapper .dropdown-menu {
  background: #27272B;
  padding: 6pt 15pt 9pt 15pt;
  min-width: 11em;
}
#headers #osdr-header .dropdown-wrapper:hover .dropdown-header {
  background: #27272B;
}
#headers #osdr-header .dropdown-wrapper.onclick.active .dropdown-header {
  background: #27272B;
}
#headers #osdr-header .dropdown-wrapper.onhover:hover .dropdown-header {
  background: #27272B;
}
#headers #osdr-header .dropdown-wrapper.left .dropdown-menu {
  border-left: 3pt solid #555;
}
#headers #osdr-header .dropdown-wrapper.left .dropdown-header {
  border-left: 3pt solid transparent;
}
#headers #osdr-header .dropdown-wrapper.left.onclick.active .dropdown-header {
  border-left: 3pt solid #555;
}
#headers #osdr-header .dropdown-wrapper.left.onhover:hover .dropdown-header {
  border-left: 3pt solid #555;
}
#headers #osdr-header .dropdown-wrapper.right .dropdown-menu {
  border-right: 3pt solid #555;
}
#headers #osdr-header .dropdown-wrapper.right .dropdown-header {
  border-right: 3pt solid transparent;
}
#headers #osdr-header .dropdown-wrapper.right.onclick.active .dropdown-header {
  border-right: 3pt solid #555;
}
#headers #osdr-header .dropdown-wrapper.right.onhover:hover .dropdown-header {
  border-right: 3pt solid #555;
}
#headers #osdr-header .dropdown-menu a {
  white-space: nowrap;
}
#headers #osdr-header .dropdown-menu a:hover {
  text-decoration: underline;
}


/* Dropdown menus */
#headers .dropdown-wrapper {
  position: relative;
  display: inline-block;
}
#headers svg.circled-arrow {
  position: relative;
  top: 2pt;
  height: 12pt;
  width: 12pt;
  transition: all .5s ease-out;
}
#headers svg.arrow {
  position: relative;
  top: 0pt;
  height: 8pt;
  width: 8pt;
  transition: all .5s ease-out;
}
#headers .left .dropdown-menu {
  left: 0;
}
#headers td.left .dropdown-menu {
  box-shadow: 4pt 6pt 4pt 2pt #00000088;
}
#headers .right .dropdown-menu {
  right: 0;
}
#headers td.right .dropdown-menu {
  box-shadow: -4pt 6pt 4pt 2pt #00000088;
}
#headers .dropdown-wrapper.onhover:hover svg, #headers .dropdown-wrapper.onclick.active svg {
  transform: rotate(540deg);
}
#headers .dropdown-wrapper .dropdown-menu {
  transition: all .15s linear;
}
#headers .touch .dropdown-menu {
  display: none;
  visibility: hidden;
  line-height: 2;
  text-align: left;
  padding: 6pt 12pt;
  background: #555;
}
#headers .mouse .dropdown-menu {
  position: absolute;
  display: block;
  visibility: hidden;
  opacity: 0;
  line-height: 2;
  text-align: left;
}
#headers .touch .dropdown-wrapper.onhover:hover .dropdown-menu, #headers .dropdown-wrapper.onclick.active .dropdown-menu {
  display: block;
  transition: all .15s linear;
}
#headers .mouse .dropdown-wrapper.onhover:hover .dropdown-menu, #headers .dropdown-wrapper.onclick.active .dropdown-menu {
  visibility: visible;
  opacity: 1;
  transition: all .15s linear;
}

#headers .dropdown-menu {
  z-index: 3;
}

/* ===== External OSDR header ===== */
/* Footer */
#footers .footer-wrapper {width: 100vw !important; padding-top: 40pt !important; background: black}
#footers #footer * {font-size: 10pt;}
#footers #footer table {width: 100%}
#footers #footer h6 {color: white; font-family: Oswald, "Helvetica Neue", Helvetica, sans-serif; font-weight: 500; font-size: 11pt; margin-bottom: 6pt; text-transform: uppercase;}
#footers #footer a {color: #FFF; text-decoration: none;}
#footers #footer a svg {height: 14pt;}
#footers #footer a:hover span {text-decoration: underline; text-decoration-style: dashed;}
#footers .footer-block * {white-space: nowrap; line-height: 1.5;}
#footers .footer-block-img {vertical-align: top; padding-left: 100pt;}
#footers .footer-block-img img {height: 96pt; margin-top: -5pt;}
#footers .footer-block-text {vertical-align: top;}
#footers .footer-paragraph {display: block; float: left; vertical-align: top; min-width: 19em; padding-bottom: 15pt;}
#footers .footer-block-text ul {list-style-type: none;}
#footers .footer-block-text li::before {content: "\203a  "; font-weight: bold;}
#footers .footer-block-text .footer-paragraph:first-of-type ul:first-of-type li::before {content: "" !important;}
#footers .footer-block-text .footer-paragraph:first-of-type ul:first-of-type a {font-weight: bold;}
#footers .footer-block-text svg {width: 10pt; margin-left: 0 !important; margin-right: 2pt; position: relative; top: 3pt;}
#footers .footer-block-text #href-x svg {position: relative; top: 3.75pt;}
#footers .footer-block-text #href-x span {margin-left: -1.5pt;}
#footers .footer-block-text #href-youtube svg {height: 9pt;}
#footers .footer-block-text #href-youtube span {position: relative; top: 2pt;}
#footers .footer-block-text #href-linkedin svg {top: 2.5pt !important;}
#footers #footer-cellar {border-top: 1px solid #555; margin-top: 20pt; padding-top: 32pt; padding-bottom: 20pt; color: #999;}
#footers #footer-cellar a, #footer-cellar span {color: #999; margin-right: 24pt; white-space: nowrap;}
#footers #footer-cellar a:hover {text-decoration: underline; text-decoration-style: dashed;}
