:root {
  --theme-browser: #f5f2e9;
  --theme-control-bg: #fffdf8;
  --theme-control-fg: #171719;
  --theme-control-line: #cdc9bd;
  --theme-focus: #4b174f;
}

html[data-theme="dark"] {
  --ink: #eef1eb;
  --paper: #0b0e0f;
  --lime: #c8f642;
  --aub: #b681bb;
  --muted: #a7aeaa;
  --line: #353c3e;
  --theme-browser: #0b0e0f;
  --theme-control-bg: #151a1c;
  --theme-control-fg: #eef1eb;
  --theme-control-line: #3a4245;
  --theme-focus: #c8f642;
}

.nav-tools,
.topline-tools,
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.systems-link {
  padding: 8px 10px;
  border: 1px solid var(--theme-control-line);
  color: var(--theme-control-fg);
  font: 700 10px/1 ui-monospace, monospace;
  letter-spacing: .05em;
  text-decoration: none;
  white-space: nowrap;
}

.systems-link:hover {
  border-color: var(--theme-control-fg);
}

.theme-toggle {
  width: 40px !important;
  height: 40px;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--theme-control-line) !important;
  border-radius: 50% !important;
  background: var(--theme-control-bg) !important;
  color: var(--theme-control-fg) !important;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--theme-control-fg) !important;
  background: var(--theme-control-bg) !important;
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 3px;
}

.theme-icon {
  font: 700 19px/1 Georgia, serif;
}

html[data-theme="light"] .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

.brand-unit:not(.aixcel) img {
  padding: 4px;
  background: #171719;
}

html[data-theme="dark"] .lede,
html[data-theme="dark"] .creator span,
html[data-theme="dark"] .trace p {
  color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select {
  color: var(--ink);
  background: #14191b;
}

html[data-theme="dark"] form button {
  color: #10120e;
  background: var(--lime);
}

html[data-theme="dark"] .creator,
html[data-theme="dark"] .ops-grid article,
html[data-theme="dark"] .trace-tags code {
  background: #151a1c;
}

html[data-theme="dark"] .evidence-grid,
html[data-theme="dark"] .decision-block {
  color: var(--ink);
  background: #151a1c;
}

html[data-theme="dark"] .approval {
  color: #171719;
}

html[data-theme="dark"] .approval button {
  color: #ffffff;
  background: #171719;
}

@media (max-width: 800px) {
  .systems-link:first-of-type {
    display: none;
  }

  .theme-toggle {
    width: 36px !important;
    height: 36px;
  }
}
