/* Site-wide nav, cookie, and narrow-grid guard. Loaded last. */

:root { --wc-nav-offset: 68px; }

html { scroll-padding-top: calc(var(--wc-nav-offset) + 8px); }

body:has(> header.watt-header) {
  --wc-nav-offset: 68px;
  padding-top: var(--wc-nav-offset);
}

body:has(> nav):not(:has(> header.watt-header)) {
  --wc-nav-offset: 64px;
  padding-top: var(--wc-nav-offset);
}

header.watt-header,
body > nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: var(--wc-nav-offset);
  margin: 0;
  background-color: #f7f9fc !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid #dde2eb;
  box-shadow: none;
}

body.watt-v3 > header.watt-header {
  --wc-nav-offset: 68px;
  background-color: #f5f7f2 !important;
  border-bottom-color: #dbe1d8;
}

header.watt-header .watt-nav-v3,
body > nav > div,
body > nav .nav-inner {
  box-sizing: border-box;
  height: var(--wc-nav-offset) !important;
  min-height: 0 !important;
  max-height: var(--wc-nav-offset);
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  justify-content: space-between;
  gap: 8px;
  overflow: visible;
}

body > nav > div > a:first-child,
.nav-inner > a,
.nav-logo,
.watt-logo-v3 {
  flex: 0 0 auto;
  white-space: nowrap;
}

.watt-nav-v3 > nav,
.nav-links,
nav .nav-links,
.nav .nav-links,
body > nav > div > div {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: var(--wc-nav-offset);
  scrollbar-width: none;
}

.watt-nav-v3 > nav::-webkit-scrollbar,
.nav-links::-webkit-scrollbar,
body > nav > div > div::-webkit-scrollbar { display: none; }

.watt-nav-v3 > nav a,
.nav-links a,
body > nav > div > div a {
  flex: 0 0 auto;
  white-space: nowrap;
}

body:has(> nav.nav) .hero { padding-top: 24px; }

.watt-skip:focus { top: calc(var(--wc-nav-offset) + 8px); }

/* Keep every cookie bar in the document flow so it cannot cover the hero. */
#cookie-consent,
.watt-cookie-v3 {
  position: relative !important;
  inset: auto !important;
  z-index: 2 !important;
  box-sizing: border-box;
  max-width: 100%;
}

.wc-nav-toggle {
  display: none;
  margin-left: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c4cbd6;
  border-radius: 6px;
  background: #fff;
  color: #1a1e25;
  font: 700 14px/1 Inter, "Source Sans 3", system-ui, sans-serif;
  cursor: pointer;
}

.watt-v3 .wc-nav-toggle {
  background: #eea20b;
  border-color: #eea20b;
  color: #17231d;
  font-family: "Source Sans 3", system-ui, sans-serif;
}

.wc-nav-toggle-bars {
  width: 16px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}

.wc-nav-toggle[hidden] { display: none !important; }

@media (max-width: 520px) {
  :root,
  body:has(> header.watt-header),
  body:has(> nav):not(:has(> header.watt-header)),
  body.watt-v3 > header.watt-header {
    --wc-nav-offset: 56px;
  }

  .watt-nav-v3 > nav,
  .nav-links,
  nav .nav-links,
  .nav .nav-links,
  body > nav > div > div {
    justify-content: flex-start !important;
  }

  .watt-nav-v3 > nav a,
  .nav-links a,
  body > nav > div > div a {
    padding: 8px 7px !important;
    font-size: 13px !important;
  }

  .wc-collapse .wc-nav-toggle:not([hidden]) { display: inline-flex; }

  .wc-collapse .wc-links { display: none !important; }

  .wc-collapse.wc-nav-open .wc-links {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto !important;
    max-height: calc(100dvh - var(--wc-nav-offset) - 8px) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start;
    overflow: auto !important;
    padding: 8px;
    background: #f7f9fc;
    border-bottom: 1px solid #dde2eb;
    box-shadow: 0 18px 36px rgba(16, 25, 35, 0.16);
    z-index: 90;
  }

  body.watt-v3 .wc-collapse.wc-nav-open .wc-links { background: #f5f7f2; }

  .wc-collapse.wc-nav-open .wc-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 12px !important;
    white-space: normal;
  }
}

@media (min-width: 521px) {
  .wc-nav-toggle { display: none !important; }
}

/* Four-column boards stay readable. One column at phone width. */
@media (max-width: 480px) {
  .watt-state-grid { grid-template-columns: 1fr !important; }
  .table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
  .table-wrap table {
    display: table !important;
    width: max-content !important;
    min-width: 640px;
    table-layout: auto !important;
  }
  .table-wrap th,
  .table-wrap td { white-space: nowrap; }
}
