/**
 * App UI type — system interface fonts first (SF Compact / Segoe), then clean fallbacks.
 * Display / brand headings still use Changa One where set explicitly.
 */
:root {
  --font-ui:
    "SF Compact Text",
    "SF Pro Text",
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    "Helvetica Neue",
    sans-serif;
  --font-display: "Changa One", var(--font-ui);
}

/* App shell + RN web root — prefer system UI faces over RN’s default stack. */
html[data-zwar-app-shell],
html[data-zwar-app-shell] body,
#root,
.app-tool-shell {
  font-family: var(--font-ui);
}


/**
 * Geeky dark tokens shared by site chrome + portal — aligned with theme.js.
 */

@font-face {
  font-family: "Changa One";
  src: url("/assets/fonts/ChangaOne-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --zw-bg: #2f2f31;
  --zw-surface: #18181b;
  --zw-elevated: #44444b;
  --zw-border: rgba(124, 124, 131, 0.72);
  --zw-gold: #f4c067;
  --zw-primary: #f65a1a;
  --zw-gilt: #ffffff;
  --zw-ash: rgba(200, 200, 204, 0.82);
  --zw-text: #ffffff;
  --zw-muted: rgba(200, 200, 204, 0.72);
  --app-header-h: 48px;
  --app-header-title-size: 26px;
  --app-header-title-tracking: 0.8px;
  --app-header-tagline-size: 13px;
  --app-header-title-block-h: 43px;
}



@font-face {
  font-family: "Changa One";
  src: url("/assets/fonts/ChangaOne-Regular.ttf") format("truetype");
  font-display: swap;
}

/* Sync with App.js layout.topBar + components/appChromeLayout.js */
.app-header-bar {
  flex: 0 0 var(--app-header-h, 48px);
  min-height: var(--app-header-h, 48px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #18181b;
  border-bottom: 1px solid rgba(124, 124, 131, 0.72);
}

.app-header-logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.app-header-logo {
  flex-shrink: 0;
  width: var(--app-header-title-block-h, 43px);
  height: var(--app-header-title-block-h, 43px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header-logo-wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--zw-gold, #f4c067);
  white-space: nowrap;
}

.app-header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.app-header-shield {
  width: 100%;
  height: 100%;
}

.app-header-titles {
  flex: 1;
  min-width: 0;
}

.app-header-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--app-header-title-size, 26px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--app-header-title-tracking, 0.8px);
  color: var(--zw-gold, #f4c067);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-tagline {
  margin: 2px 0 0;
  font-family: var(--font-ui);
  font-size: var(--app-header-tagline-size, 13px);
  font-weight: 600;
  line-height: 1.15;
  color: rgba(200, 200, 204, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-header-lang {
  position: relative;
  display: inline-flex;
  width: 24px;
  height: 24px;
  min-width: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 200, 204, 0.24);
  border-radius: 5px;
  background: #44444b;
  overflow: hidden;
}

.app-header-lang-flag {
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
}

.app-header-lang-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}



/* ── Site shell ── */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--zw-bg);
  color: var(--zw-text);
  font-family: var(--font-ui);
}

.site-chrome {
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--zw-bg) 92%, transparent);
  border-bottom: 1px solid var(--zw-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-navbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 1280px;
  min-height: 72px;
  margin: 0 auto;
  padding: 8px 32px;
}

.site-chrome .app-header-logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.site-chrome .app-header-logo {
  display: inline-flex;
}

.site-chrome .app-header-logo-img {
  display: block;
  width: 43px;
  height: 43px;
  object-fit: contain;
}

.site-chrome .app-header-logo-wordmark,
.site-footer-logo span {
  color: var(--zw-gold);
  font-family: "Changa One", Impact, sans-serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.site-nav-menu {
  display: contents;
}

.site-nav-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-nav-toggle {
  display: none;
}

.site-nav-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
  margin-left: auto;
}

.site-nav-list,
.site-footer-nav,
.site-footer-social {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-link {
  display: inline-block;
  padding: 10px 9px;
  color: var(--zw-text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.site-nav-link:hover,
.site-nav-link[aria-current="page"] {
  color: var(--zw-gold);
}

.site-nav-link:focus-visible,
.site-social-link:focus-visible,
.site-nav-search:focus-visible,
.site-footer a:focus-visible,
.site-footer-logo:focus-visible,
.app-header-logo-mark:focus-visible {
  outline: 2px solid var(--zw-gold);
  outline-offset: 3px;
}

.site-nav-session {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--zw-ash);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-social-link:hover {
  color: var(--zw-gold);
}

.site-nav-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--zw-primary);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}

.site-session-slot {
  flex: 0 0 auto;
}

.site-session-badge {
  display: block;
  max-width: 8.5rem;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid var(--zw-border);
  border-radius: 999px;
  background: var(--zw-elevated);
  color: var(--zw-ash);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-main {
  flex: 1;
  min-height: 0;
}

.site-footer {
  position: relative;
  margin-top: 48px;
  padding: 68px 20px 48px;
  overflow: hidden;
  border-top: 1px solid var(--zw-border);
  text-align: center;
  color: var(--zw-text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(244, 192, 103, 0.11), transparent 52%),
    var(--zw-surface);
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 980px);
  margin: 0 auto;
}

.site-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: inherit;
  text-decoration: none;
}

.site-footer-logo img {
  width: 43px;
  height: 43px;
  object-fit: contain;
}

.site-footer-disclaimer {
  max-width: 640px;
  margin: 0 auto;
  color: var(--zw-ash);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.site-footer-nav {
  justify-content: center;
  gap: 4px 10px;
  margin: 22px 0 28px;
}

.site-footer-nav a,
.site-footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px;
  color: var(--zw-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.site-social-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.site-footer-nav a:hover,
.site-footer-social a:hover {
  color: var(--zw-primary);
}

.site-footer-social {
  justify-content: center;
  margin-bottom: 28px;
}

.site-footer-social a {
  color: var(--zw-gold);
}

.site-footer-copyright {
  margin: 0;
  color: var(--zw-muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1360px) {
  .site-navbar {
    min-height: 64px;
    padding: 8px 16px;
  }

  .site-nav-menu {
    position: static;
    display: block;
    margin-left: auto;
  }

  .site-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--zw-primary);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .site-nav-checkbox:focus-visible + .site-nav-toggle {
    outline: 2px solid #fff;
    outline-offset: 3px;
  }

  .site-nav-toggle-icon,
  .site-nav-toggle-icon::before,
  .site-nav-toggle-icon::after {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .site-nav-toggle-icon {
    position: relative;
  }

  .site-nav-toggle-icon::before,
  .site-nav-toggle-icon::after {
    position: absolute;
    left: 0;
    content: "";
  }

  .site-nav-toggle-icon::before {
    top: -5px;
  }

  .site-nav-toggle-icon::after {
    top: 5px;
  }

  .site-nav-panel {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    padding: 18px 20px 22px;
    border-bottom: 1px solid var(--zw-border);
    background: var(--zw-surface);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  }

  .site-nav-checkbox:checked ~ .site-nav-panel {
    display: flex;
    flex-direction: column;
  }

  .site-nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav-link {
    display: block;
    padding: 11px 8px;
    font-size: 16px;
  }

  .site-nav-session {
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--zw-border);
  }

  .site-session-slot {
    display: none;
  }

  .site-footer {
    margin-top: 32px;
    padding: 48px 16px 36px;
  }
}

.page-account .site-session-badge {
  display: none !important;
}

body:has(.site-shell) {
  background: var(--zw-bg);
  color: var(--zw-text);
  font-family: var(--font-ui);
}

/* Intel formatter ships its own app-header — hide duplicate under site shell */
.site-shell .app-header.sticky-header {
  display: none;
}
