/* Shared top navigation — overlay, setup, help, test */
:root {
  --site-nav-height: 44px;
  --accent: #f3ce13;
  --panel: rgba(0, 0, 0, 0.92);
}

.site-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--panel);
  border-bottom: 1px solid rgba(243, 206, 19, 0.35);
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  pointer-events: auto;
}

body.site-nav-visible .site-nav {
  display: block;
}

/* Setup / help / test: nav always on */
body.page-site .site-nav {
  display: block;
  position: relative;
  flex-shrink: 0;
}

.site-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 12px;
  min-height: var(--site-nav-height);
  box-sizing: border-box;
}

.site-nav-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  text-decoration: none;
  margin-right: 6px;
  max-width: min(12rem, 38vw);
}

.site-nav-brand:hover .site-nav-brand-name {
  text-decoration: underline;
}

.site-nav-brand-name {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.site-nav-brand-tagline {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-lede {
  margin: -6px 0 18px;
  font-size: 0.95rem;
  color: var(--muted, #9a9aa8);
}

.nav-preview-badge {
  color: #e85d5d;
  font-size: 1rem;
  line-height: 1;
  cursor: help;
  user-select: none;
  flex-shrink: 0;
}

.nav-preview-badge[hidden] {
  display: none !important;
}

.site-nav-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.site-nav-views {
  display: flex;
  gap: 4px;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-left: auto;
}

.site-nav-btn,
.site-nav-links a {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(243, 206, 19, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.site-nav-btn:hover,
.site-nav-links a:hover {
  background: rgba(243, 206, 19, 0.15);
}

.site-nav-btn.is-active,
.site-nav-links a.is-current {
  background: rgba(243, 206, 19, 0.28);
  color: var(--accent);
  border-color: rgba(243, 206, 19, 0.65);
}

.layout-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 4px;
}

.layout-pos-cell {
  padding: 4px;
  font-size: 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(243, 206, 19, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.layout-pos-cell:hover {
  background: rgba(243, 206, 19, 0.2);
}

.layout-pos-cell.is-active {
  background: rgba(243, 206, 19, 0.35);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.layout-pos-cell.is-disabled,
.layout-pos-cell:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

body.page-overlay.site-nav-visible #wheel-main.pos-tc,
body.page-overlay.site-nav-visible #wheel-main.pos-tl,
body.page-overlay.site-nav-visible #wheel-main.pos-tr,
body.page-overlay.site-nav-visible #onscreen-status.pos-tc,
body.page-overlay.site-nav-visible #onscreen-status.pos-tl,
body.page-overlay.site-nav-visible #onscreen-status.pos-tr,
body.page-overlay.site-nav-visible #deck-card.pos-tc,
body.page-overlay.site-nav-visible #deck-card.pos-tl,
body.page-overlay.site-nav-visible #deck-card.pos-tr {
  top: calc(var(--site-nav-height) + 12px);
}

/* Site pages: header + scrollable main + footer (see site-footer.css) */
html.page-site-root,
body.page-site {
  height: 100%;
}

body.page-site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
}

body.page-site main,
body.page-site .site-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 0;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-site main::-webkit-scrollbar,
body.page-site .site-main::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Content stays centered; scrollport is full width so bars sit on the viewport edge if shown */
body.page-site main > *,
body.page-site .site-main > * {
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Thin bar at the far right when scrollbars cannot be hidden (some OS/browser settings) */
@supports not (scrollbar-width: none) {
  body.page-site main,
  body.page-site .site-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(243, 206, 19, 0.45) transparent;
  }
}

/* Overlay with chrome: wheel area fills space between nav and footer */
body.page-overlay.site-nav-visible {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
}

body.page-overlay.site-nav-visible .site-nav {
  position: relative;
  flex-shrink: 0;
}

body.page-overlay.site-nav-visible #app-overlay-region {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  inset: auto;
  width: 100%;
  z-index: 1;
}

body.page-overlay.site-nav-visible #wheel-stage {
  min-height: 100%;
  height: 100%;
}

body.page-overlay.site-nav-visible .side-drawer {
  height: calc(100dvh - var(--site-nav-height) - var(--site-footer-height, 40px));
  height: calc(100vh - var(--site-nav-height) - var(--site-footer-height, 40px));
}
