:root {
  /* COLOR TEST — sunset. Original teal values are in the comment at the bottom of this block.
     Revert: restore the commented tokens and remove palette-sunset.css from the platform. */
  --bg: #fefdf6;
  --on-bg: #1a232b;
  --surface: #ffffff;
  --surface-low: #f8f6ee;
  --surface-high: #ecece1;
  --outline: #a8b7c5;
  --outline-strong: #5f7990;
  --muted: #476076;
  --primary: #577590;
  --primary-mid: #3d5265;
  --primary-soft: #cdd6de;
  --brand-paws: #f3ca40;
  --on-primary: #ffffff;
  --secondary: #6b4518;
  --secondary-container: #f7c484;
  --tertiary: #1f532c;
  --error: #8c5a4d;
  --error-bg: #f3dcd6;
  --sidebar: #1a232b;
  --sidebar-hover: #577590;
  --sidebar-text: #e1e6eb;
  --sidebar-muted: #a8b7c5;
  --shadow: 0 4px 20px color-mix(in srgb, var(--primary) 14%, transparent);
  /* Original teal:
     --bg: #fbf9f5; --on-bg: #1b1c1a; --surface: #ffffff; --surface-low: #f5f3ef;
     --surface-high: #eae8e4; --outline: #bfc8c8; --outline-strong: #707978; --muted: #3f4848;
     --primary: #0c5252; --primary-mid: #2d6a6a; --primary-soft: #b1eeed; --brand-paws: #2bb8b8; --on-primary: #ffffff;
     --secondary: #765a05; --secondary-container: #ffd87c; --tertiary: #1f532c;
     --error: #ba1a1a; --error-bg: #ffdad6; --sidebar: #072f2f; --sidebar-hover: #0c5252;
     --sidebar-text: #d7efee; --sidebar-muted: #8fb8b8; --shadow: 0 4px 20px rgba(42, 103, 103, 0.08); */
  --radius: 12px;
  --font-head: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --sidebar-w: 280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--on-bg);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.8125rem;
}

.wiki-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.wiki-sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0 2rem;
}

.wiki-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(177, 238, 237, 0.12);
  color: inherit;
  text-decoration: none;
}

.wiki-brand:hover {
  text-decoration: none;
}

.ph, .ph-fill {
  line-height: 1;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 1;
}

.text-primary {
  color: var(--primary);
}

.wiki-brand .ph,
.wiki-topbar .ph {
  flex-shrink: 0;
  color: var(--primary-soft);
}

.wiki-brand-mark {
  flex-shrink: 0;
  display: inline-block;
  width: 2.25rem;
  height: 2.45rem;
  background-color: var(--primary);
  -webkit-mask-image: url("./brand/iso-mask.png");
  mask-image: url("./brand/iso-mask.png");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  transform: translateZ(0);
}

.wiki-brand strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wiki-brand-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
}

.wiki-search {
  margin: 1rem 1rem 0.5rem;
}

.wiki-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(177, 238, 237, 0.2);
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
}

.wiki-search input::placeholder {
  color: var(--sidebar-muted);
}

.wiki-search input:focus {
  outline: 2px solid var(--primary-soft);
  outline-offset: 1px;
}

.wiki-nav {
  padding: 0.5rem 0.75rem;
  flex: 1;
}

.wiki-nav-group {
  margin-top: 1rem;
}

.wiki-nav-group > span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 0.35rem 0.6rem;
}

.wiki-nav a {
  display: block;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.wiki-nav a:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
}

.wiki-nav a.is-active {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.wiki-nav-footer {
  padding: 1rem 1.25rem 0;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
  border-top: 1px solid rgba(177, 238, 237, 0.12);
  margin-top: 1rem;
}

.wiki-nav-footer a {
  color: var(--primary-soft);
}

.wiki-main {
  min-width: 0;
}

.wiki-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--sidebar);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  z-index: 20;
}

.wiki-menu-btn {
  background: transparent;
  border: 1px solid rgba(177, 238, 237, 0.3);
  color: inherit;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  cursor: pointer;
}

.wiki-article {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 4rem;
}

.wiki-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-mid);
  margin: 0 0 0.5rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--on-bg);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 650;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--outline);
}

h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 1.5rem 0 0.5rem;
}

p,
ul,
ol {
  color: var(--muted);
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.3rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--muted);
}

.badge-shipped {
  background: #d7f0d9;
  color: var(--tertiary);
}

.badge-next {
  background: var(--secondary-container);
  color: var(--secondary);
}

.badge-later {
  background: #e4e2de;
  color: var(--muted);
}

.badge-intended {
  background: #d7ecec;
  color: var(--primary);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  box-shadow: var(--shadow);
}

.callout.warn {
  border-left-color: var(--secondary);
}

.callout.danger {
  border-left-color: var(--error);
  background: #fff8f7;
}

.callout strong {
  display: block;
  color: var(--on-bg);
  margin-bottom: 0.25rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 1.75rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  display: block;
}

a.card:hover {
  text-decoration: none;
  border-color: var(--primary-mid);
  transform: translateY(-2px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--outline);
  vertical-align: top;
}

th {
  background: var(--surface-low);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.tree {
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.timeline {
  border-left: 2px solid var(--outline);
  margin: 1rem 0 1.5rem 0.5rem;
  padding-left: 1.25rem;
}

.timeline-item {
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-item time {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-mid);
}

.toc {
  background: var(--surface-low);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 0 0 1.75rem;
}

.toc strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.toc a {
  display: block;
  padding: 0.15rem 0;
  font-size: 0.9rem;
}

.search-results {
  display: none;
  margin: 0 0.75rem 0.5rem;
  background: #0a3a3a;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.search-results.is-open {
  display: block;
}

.search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  text-decoration: none;
}

.search-results a:hover,
.search-results a.is-focused {
  background: var(--sidebar-hover);
}

.search-results em {
  display: block;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 47, 47, 0.4);
  z-index: 15;
}

.overlay.is-open {
  display: block;
}

@media (max-width: 900px) {
  .wiki-shell {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(var(--sidebar-w), 86vw);
  }

  .wiki-sidebar.is-open {
    transform: none;
  }

  .wiki-topbar {
    display: flex;
  }

  .wiki-article {
    padding: 1.5rem 1.1rem 3rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
