:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #eef3f7;
  --border: #d8e1e8;
  --border-dark: #c3ced8;
  --text: #17202c;
  --muted: #647184;
  --link: #2277b3;
  --link-hover: #145985;
  --navy: #071b2f;
  --navy-2: #0f2f4d;
  --yellow: #ffcc24;
  --blue-soft: #e6f0f7;
  --warning-bg: #fff7d9;
  --warning-border: #ead27a;
  --table-head: #edf3f8;
  --radius: 6px;
  --shadow: 0 12px 32px rgba(7, 27, 47, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: 0;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

code {
  padding: 2px 5px;
  border: 1px solid #d7e2ec;
  border-radius: 4px;
  background: #eef4f9;
  color: #233244;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
}

.topbar > *,
.layout > *,
.content-grid > * {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 285px;
  color: var(--navy);
  font-weight: 800;
}

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

.brand img {
  width: auto;
  height: 38px;
  max-width: 160px;
  object-fit: contain;
}

.brand span {
  display: inline-flex;
  min-height: 24px;
  padding: 2px 7px;
  align-items: center;
  border-radius: 4px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.search {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.search input {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

.search input:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(34, 119, 179, 0.14);
}

.toplinks {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.sidebar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  padding: 20px 16px;
  overflow-y: auto;
  background: #eef2f6;
  border-right: 1px solid var(--border);
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  margin: 0 0 8px;
  color: #788494;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav li {
  margin: 2px 0;
}

.sidebar-nav a {
  display: block;
  min-height: 31px;
  padding: 5px 8px;
  border-radius: var(--radius);
  color: #2d3642;
  font-weight: 650;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #dce6ee;
  color: #123f67;
  text-decoration: none;
}

.mini-status {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.mini-status strong {
  color: var(--navy);
}

.mini-status span {
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  width: 100%;
  max-width: 1180px;
  padding: 26px 38px 64px;
  min-width: 0;
}

.breadcrumb {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb span {
  margin: 0 6px;
  color: #9aa5b2;
}

.article-header {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--link);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.18;
}

h3 {
  margin: 0 0 6px;
  color: #223047;
  font-size: 1rem;
  line-height: 1.25;
}

p {
  margin: 0 0 12px;
}

.subtitle {
  max-width: 860px;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  background: #fff;
  color: #425063;
  font-size: 0.84rem;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 30px;
  align-items: start;
}

section,
.intro-panel {
  scroll-margin-top: 72px;
  margin-bottom: 30px;
}

.intro-panel,
.term-card,
.category-card,
.practice-card,
.toc,
.note,
.timeline article,
.fleet-strip article,
.article-footer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.intro-panel {
  padding: 16px;
  box-shadow: var(--shadow);
}

.note {
  padding: 12px 14px;
  margin-top: 14px;
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #4e421d;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.term-card {
  display: grid;
  align-content: start;
  min-height: 128px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.term-card:hover,
.category-card:hover,
.practice-card:hover {
  border-color: #a9cce4;
  background: #f7fbff;
  text-decoration: none;
}

.term-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty-state {
  padding: 14px;
  margin-top: 12px;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.json-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.json-results a {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
}

.json-results a:hover {
  border-color: #a9cce4;
  background: #f7fbff;
  text-decoration: none;
}

.json-results small {
  color: var(--muted);
}

.category-grid,
.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.category-card,
.practice-card {
  display: grid;
  align-content: start;
  min-height: 118px;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.category-card span,
.practice-card span {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.timeline article > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 850;
}

table {
  width: 100%;
  max-width: 100%;
  margin: 14px 0 20px;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: #fff;
}

th,
td {
  padding: 9px 11px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: #313944;
}

.fleet-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.fleet-strip article {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.fleet-strip strong {
  color: var(--navy);
}

.fleet-strip span {
  color: var(--muted);
}

.idea-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.article-footer {
  padding: 14px;
  color: var(--muted);
  background: #fdfefe;
}

.article-footer p {
  margin: 0;
}

.wiki-article {
  max-width: 880px;
}

.wiki-article section {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.toc {
  position: sticky;
  top: 82px;
  padding: 14px 16px;
  font-size: 0.92rem;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  color: #3c4653;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.toc ol {
  padding-left: 19px;
  margin: 0;
}

.toc li {
  margin: 5px 0;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.search-hit {
  border-color: #a9cce4;
  background: #f7fbff;
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-section {
    margin-bottom: 16px;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  main {
    max-width: none;
    padding: 24px 22px 56px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    order: -1;
  }

  .brand {
    min-width: auto;
  }

  .brand img {
    width: auto;
    height: 34px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .search {
    max-width: none;
  }

  .toplinks {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .fleet-strip {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .practice-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 13.5px;
  }

  main {
    padding: 20px 14px 48px;
  }

  .sidebar {
    padding: 16px 12px;
  }

  .brand img {
    width: auto;
    height: 32px;
  }

  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }
}
