/* The shared topbar sits flush to the top of every page — cancel any per-page
   body top padding (style-modern.css's `body { padding: var(--space-md) }`,
   model-status, aiforecast). `html body` outranks those plain `body` rules. */
html body {
  padding-top: 0;
}

.site-topbar {
  position: relative;
  z-index: 2100;
  width: min(100%, 980px);
  height: 40px;
  min-height: 0;
  margin: 0 auto 16px;
  padding: 2px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #757575;
  background: #111922;
  border-bottom: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  --site-nav-panel-bg: #0f1419;
  --site-nav-link: rgba(226, 232, 240, 0.88);
  --site-nav-link-hover: #ffffff;
  --site-nav-control-text: rgba(226, 232, 240, 0.82);
  --site-nav-accent: #38bdf8;
  --site-nav-switch-bg: #1a2332;
  --site-nav-switch-border: rgba(148, 163, 184, 0.24);
  --site-nav-switch-knob: #64748b;
}

body.sandbox-page {
  padding-top: 0;
}

.site-nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
  line-height: 0;
  gap: 10px;
}

.site-menu-button {
  width: 26px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #5b6470;
  cursor: pointer;
  flex: 0 0 auto;
}

.site-menu-button span {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.site-menu-button:hover,
.site-menu-button:focus-visible {
  color: #7a8491;
}

.site-menu-button:focus-visible,
.site-topbar-title:focus-visible {
  outline: 2px solid var(--site-nav-accent);
  outline-offset: 2px;
}

.site-topbar-title {
  color: rgba(226, 232, 240, 0.84);
  font: 700 0.84rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.site-topbar-title:hover,
.site-topbar-title:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

.site-menu-panel {
  position: absolute;
  z-index: 2200;
  top: calc(100% + 8px);
  left: 0;
  width: min(318px, calc(100vw - 28px));
  padding: 10px;
  border-radius: 10px;
  background: var(--site-nav-panel-bg);
  border: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  pointer-events: none;
  transition: transform 180ms ease, opacity 160ms ease, visibility 160ms ease;
}

.site-menu-panel.is-open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.site-menu-panel[hidden] {
  display: none;
}

.site-menu-section {
  display: grid;
  gap: 4px;
}

.site-menu-section + .site-menu-section,
.site-menu-controls {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.site-menu-section a {
  min-height: 34px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  color: var(--site-nav-link);
  text-decoration: none;
  font: 700 0.86rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.site-menu-section a:hover,
.site-menu-section a:focus-visible {
  background: rgba(79, 195, 247, 0.12);
  color: var(--site-nav-link-hover);
}

.site-menu-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.site-menu-control {
  min-width: 0;
  margin: 0;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-menu-control-label {
  color: var(--site-nav-control-text);
  font: 700 0.68rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-menu-control .theme-toggle {
  width: 38px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
  position: relative;
  display: inline-block;
}

.site-menu-control .theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.site-menu-control .theme-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--site-nav-switch-border);
  background: var(--site-nav-switch-bg);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.site-menu-control .theme-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  border-radius: 50%;
  background: var(--site-nav-switch-knob);
  transition: transform 0.18s ease, background 0.18s ease;
}

.site-menu-control .theme-toggle input:checked + .theme-toggle-slider::before {
  transform: translateX(16px);
  background: var(--site-nav-accent);
}

.site-menu-control .theme-toggle input:focus-visible + .theme-toggle-slider {
  outline: 2px solid var(--site-nav-accent);
  outline-offset: 2px;
}

html.theme-light .site-topbar {
  --site-nav-panel-bg: #f8fafc;
  --site-nav-link: #334155;
  --site-nav-link-hover: #0f172a;
  --site-nav-control-text: #475569;
  --site-nav-switch-bg: #e2e8f0;
  --site-nav-switch-border: rgba(15, 23, 42, 0.14);
  --site-nav-switch-knob: #94a3b8;
  background: #e8eef5;
  color: #475569;
}

html.theme-light .site-topbar-title {
  color: #0f172a;
}

html.theme-light .site-menu-button {
  color: #64748b;
}

html.theme-light .site-menu-section a:hover,
html.theme-light .site-menu-section a:focus-visible {
  background: rgba(3, 105, 161, 0.08);
}

@media (max-width: 560px) {
  body.sandbox-page {
    padding: 0;
  }

  .sandbox-page #wx-page-content {
    padding: 0 var(--space-md) var(--space-md);
  }

  .site-topbar {
    width: 100%;
    height: 40px;
    margin-bottom: 16px;
    padding: 2px 18px;
  }

  .site-menu-panel {
    position: fixed;
    z-index: 2200;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: min(320px, 86vw);
    padding: 62px 14px 18px;
    border-radius: 0;
    opacity: 0;
    transform: translateX(-104%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 240ms ease, opacity 180ms ease, visibility 180ms ease;
    overflow-y: auto;
  }

  .site-menu-panel.is-open {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .site-menu-panel[hidden] {
    display: block;
  }

  body.sandbox-menu-open {
    overflow: hidden;
  }
}

/* ===== Shared site footer: Help & Info link, theme-responsive ===== */
.site-footer {
  width: min(100%, 980px);
  margin: 28px auto 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  color: #6b7480;
  font: 600 0.8rem/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.site-footer-link {
  color: rgba(226, 232, 240, 0.86);
  text-decoration: none;
  font-weight: 700;
}

.site-footer-link:hover,
.site-footer-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

html.theme-light .site-footer {
  border-top-color: rgba(15, 23, 42, 0.1);
  color: #64748b;
}

html.theme-light .site-footer-link {
  color: #0369a1;
}

html.theme-light .site-footer-link:hover,
html.theme-light .site-footer-link:focus-visible {
  color: #0c4a6e;
}
