:root {
  --bg: #060b14;
  --surface: #0d1520;
  --surface2: #111c2e;
  --border: rgba(5, 150, 87, .14);
  --border2: rgba(5, 150, 87, .34);
  --green: #059657;
  --orange: #ff7800;
  --text: #e2eef0;
  --muted: #6f879f;
  --radius: 16px;
  --font-sans: Inter, Arial, sans-serif;
  --color-bg: var(--bg);
  --color-bg-soft: var(--surface);
  --color-surface: var(--surface);
  --color-surface-soft: var(--surface2);
  --color-surface-elevated: var(--surface2);
  --color-surface-inset: var(--bg);
  --color-border: var(--border2);
  --color-border-soft: var(--border);
  --color-border-strong: var(--green);
  --color-text: var(--text);
  --color-text-soft: #a7bbce;
  --color-text-muted: var(--muted);
  --color-accent: var(--green);
  --color-accent-hover: #07ad65;
  --color-brand: var(--green);
  --color-brand-alt: var(--orange);
  --color-float: var(--surface);
  --chart-bg: var(--bg);
  --chart-grid: var(--bg);
  --chart-label-bg: var(--surface2);
}
html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f3f5f7;
  --border: rgba(5, 150, 87, .2);
  --border2: rgba(5, 150, 87, .45);
  --text: #101820;
  --muted: #5a6b7a;
  --color-bg: var(--bg);
  --color-bg-soft: var(--surface);
  --color-surface: var(--surface);
  --color-surface-soft: var(--surface2);
  --color-surface-elevated: var(--surface);
  --color-surface-inset: var(--surface2);
  --color-border: var(--border2);
  --color-border-soft: var(--border);
  --color-border-strong: var(--green);
  --color-text: var(--text);
  --color-text-soft: #3d4d5c;
  --color-text-muted: var(--muted);
  --color-accent: var(--green);
  --color-float: var(--surface);
  --chart-bg: #ffffff;
  --chart-grid: #ffffff;
  --chart-label-bg: var(--surface2);
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}
.q4-masthead { background: var(--surface); }
.q4-masthead .q4-shell {
  width: min(1440px, calc(100% - 40px));
  max-width: none;
}
.q4-masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}
.q4-wordmark {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0;
}
.q4-wordmark .q4-mark { width: 34px; height: 34px; }
.q4-brand-name { font-size: 17px; font-weight: 700; letter-spacing: .05em; color: var(--green); white-space: nowrap; }
.q4-brand-orange { color: var(--orange); }
.q4-navigation { min-width: 0; justify-self: center; }
.q4-crumb { width: min(var(--read, 880px), calc(100% - 40px)); margin-inline: auto; text-align: center; }
.q4-crumb ol { justify-content: center; }
.q4-crumb li { min-width: 0; overflow-wrap: anywhere; }
.q4-journey {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px;
  list-style: none;
}
.q4-journey li { display: flex; align-items: center; flex: 0 0 auto; margin: 0; padding: 0; }
.q4-journey a { display: inline-flex; align-items: center; min-height: 38px; white-space: nowrap; letter-spacing: .07em; }
.q4-arrow { display: none; }
.q4-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.q4-back, .q4-theme, .q4-language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  color: var(--text);
  font: 700 12px var(--font-sans);
  line-height: 1.4;
  white-space: nowrap;
}
.q4-back { color: var(--green); }
.q4-theme { width: 40px; padding: 0; font-size: 18px; cursor: pointer; }
.q4-language { cursor: pointer; }
.q4-back:hover, .q4-theme:hover, .q4-language:hover { background: var(--surface); border-color: var(--green); text-decoration: none; }
.q4-masthead :focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.q4-logotype { display: inline-flex; gap: 0; letter-spacing: -.06em; }
.q4-logotype span { color: var(--orange); }
.q4-logotype b { color: var(--green); font-weight: inherit; }
.q4-footer { background: var(--surface); }
.q4-map { max-width: none; margin: 0; padding: 0; }
.q4-map-content { width: min(880px, calc(100% - 40px)); margin: 32px auto; }
.q4-map-content h1, .q4-map-content h2, .q4-map-content h3 { color: var(--text); }
.q4-map-content a { color: var(--green); }
.q4-map-content table, .q4-map-content th, .q4-map-content td { border-color: var(--border2); background: var(--surface); color: var(--text); }
.q4-map-content code { background: var(--surface2); color: var(--text); }
.control, .theme-toggle, .language-selector { font-family: var(--font-sans); }
html[data-theme="light"] .navigation a,
html[data-theme="light"] .hero-lead,
html[data-theme="light"] .card strong,
html[data-theme="light"] .reading-item,
html[data-theme="light"] .transparency-copy { color: #3d4d5c; }
@media (max-width: 1360px) {
  .q4-masthead-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .q4-navigation { grid-column: 1 / -1; grid-row: 2; width: 100%; }
}
@media (max-width: 620px) {
  .q4-masthead .q4-shell { width: calc(100% - 28px); }
  .q4-masthead-inner { gap: 12px; }
  .q4-actions { gap: 6px; }
  .q4-back { padding-inline: 9px; }
  .q4-journey a { min-height: 40px; }
  .q4-wordmark { grid-column: 1 / -1; justify-self: center; }
  .q4-navigation { grid-row: 2; }
  .q4-actions { grid-column: 1 / -1; grid-row: 3; justify-self: center; margin-left: 0; }
}
@media print {
  .q4-masthead, .q4-actions { display: none; }
}

:has(> #mainNavigation) > #menuToggle { order: -1; flex: none; }
#siteAccount[hidden] { display: none; }
#siteAccount { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 6px 10px; border: 1px solid rgba(255, 120, 0, .4); border-radius: 13px; background: var(--surface2); }
#siteAccount .site-account-avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border: 1px solid var(--border2); border-radius: 50%; color: var(--orange); }
#siteAccount .site-account-user { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
#siteAccount .site-account-name { max-width: 22ch; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#siteAccount .site-account-plan { padding: 1px 8px; border: 1px solid rgba(255, 120, 0, .45); border-radius: 5px; background: rgba(255, 120, 0, .08); color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
#siteAccount .site-account-plan:empty { display: none; }
#siteAccount .site-account-logout { flex: none; padding: 4px 9px; border: 1px solid var(--border2); border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
#siteAccount .site-account-logout:hover { color: #ff7800; border-color: rgba(255, 120, 0, .45); background: rgba(255, 120, 0, .08); }
#siteAccount .site-account-logout:disabled { opacity: .6; cursor: wait; }

@media (min-width: 921px) {
  :has(> #mainNavigation) > #mainNavigation { margin-left: 0; margin-right: auto; }
}

@media (max-width: 920px) {
  :has(> #mainNavigation) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    height: auto;
    row-gap: 10px;
  }
  :has(> #mainNavigation) > #menuToggle + a { margin-right: auto; min-width: 0; }
  :has(> #mainNavigation) > #mainNavigation { order: 10; flex-basis: 100%; margin: 0; }
  :has(> #mainNavigation) > #mainNavigation + :is(nav, div) { display: contents; }
  body:has(> .header #mainNavigation) > .header { position: sticky; top: 0; }
  body:has(> .header #mainNavigation) .hero { padding-top: 40px; }
}

:has(> #mainNavigation) > #menuToggle + a :is(.brand-text, .site-brand-text) { display: flex; flex-direction: column; min-width: 0; line-height: 1; }
:has(> #mainNavigation) > #menuToggle + a :is(.brand-mark, .site-brand-mark) { width: 32px; height: 32px; flex: none; }
:has(> #mainNavigation) > #menuToggle + a :is(.brand-name, .site-brand-name) { font-size: 17px; font-weight: 700; letter-spacing: .05em; white-space: nowrap; }
:has(> #mainNavigation) > #menuToggle + a :is(.brand-sub, .site-brand-sub) { display: block; margin-top: 3px; font-size: 7px; font-weight: 600; letter-spacing: .2em; white-space: nowrap; }
@media (max-width: 560px) {
  :has(> #mainNavigation) > #menuToggle + a :is(.brand-sub, .site-brand-sub) { font-size: 6px; }
}
