:root {
  --bg: #0b0f17;
  --panel: #101827;
  --text: #e6eefc;
  --muted: #a7b4cc;
  --link: #7db4ff;
  --border: rgba(255, 255, 255, 0.08);
  --code: rgba(125, 180, 255, 0.12);
  --danger: #ff8fa3;
  --ok: #8fffb6;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background:
    radial-gradient(1200px 900px at 20% 10%, rgba(125, 180, 255, 0.12), transparent 60%),
    radial-gradient(900px 700px at 80% 40%, rgba(143, 255, 182, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(16, 24, 39, 0.85), rgba(16, 24, 39, 0.65));
  backdrop-filter: blur(10px);
}

main {
  padding: 28px 26px 56px;
  max-width: 1280px;
}

.brand {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 14px;
}

.brand h1 {
  font-size: 16px;
  margin: 0;
  letter-spacing: 0.01em;
}

.brand .tag {
  font-size: 12px;
  color: rgba(167, 180, 204, 0.95);
  margin-top: 2px;
}

.nav-section {
  margin-top: 14px;
}

.nav-section h2 {
  font-size: 11px;
  margin: 18px 10px 8px;
  color: rgba(167, 180, 204, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: rgba(167, 180, 204, 0.95);
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
}

.nav-section h2::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  flex: 1;
}

.nav-section a {
  display: block;
  padding: 7px 10px;
  margin: 2px 6px;
  border-radius: 8px;
  color: var(--text);
  opacity: 0.9;
  font-size: 14px;
  position: relative;
  border-left: 2px solid transparent;
}

.nav-section a:hover {
  background: rgba(125, 180, 255, 0.09);
  text-decoration: none;
  opacity: 1;
  border-left-color: rgba(125, 180, 255, 0.45);
}

.nav-section a.active {
  background: rgba(125, 180, 255, 0.16);
  border-left-color: rgba(125, 180, 255, 0.95);
  opacity: 1;
}

.nav-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.last-updated {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
  text-align: center;
  padding: 4px 8px;
}

.last-updated span {
  color: var(--text);
  opacity: 0.85;
}

.section-note {
  font-size: 14px;
  color: var(--muted);
  margin: -8px 0 12px 0;
  font-style: italic;
}

.section-note a {
  color: var(--link);
}

.callout {
  border: 1px solid var(--border);
  background: rgba(16, 24, 39, 0.6);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0;
}

.callout strong {
  display: inline-block;
  margin-bottom: 6px;
}

.callout.warn {
  border-color: rgba(255, 143, 163, 0.22);
  background: rgba(255, 143, 163, 0.06);
}

.callout.ok {
  border-color: rgba(143, 255, 182, 0.18);
  background: rgba(143, 255, 182, 0.06);
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  font-size: 32px;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

h2 {
  margin: 34px 0 12px;
  font-size: 22px;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  color: rgba(230, 238, 252, 0.95);
}

p {
  margin: 0 0 12px;
  color: rgba(230, 238, 252, 0.96);
}

main > p,
main > ul,
main > ol,
main > pre,
main > .callout,
main > table:not(.data-table) {
  max-width: 78ch;
}

ul {
  padding-left: 18px;
}

li {
  margin: 4px 0;
}

hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  margin: 28px 0;
}

pre {
  background: rgba(16, 24, 39, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  overflow: auto;
  margin: 12px 0 16px;
  max-width: 100%;
}

/* Let code blocks use the full content width (don’t constrain to 78ch). */
main > pre {
  max-width: none;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  table-layout: fixed;
  max-width: 100%;
}

table.data-table th {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(167, 180, 204, 0.95);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

table.data-table td {
  vertical-align: top;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow-wrap: anywhere;
  word-break: break-word;
}

table.data-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

table.data-table tbody tr:hover td {
  background: rgba(125, 180, 255, 0.06);
}

table.data-table td:first-child code.inline {
  white-space: nowrap;
}

table.data-table td:first-child .meta {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 13px;
  margin-top: 4px;
}

table.data-table td a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Ensure generated tables inside containers still use full width. */
main .data-table {
  width: 100%;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(167, 180, 204, 0.95);
  white-space: nowrap;
}

.profile-desc {
  margin-top: 6px;
  color: rgba(230, 238, 252, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kv {
  margin-top: 8px;
}

.kv:first-child {
  margin-top: 0;
}

.kv-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(167, 180, 204, 0.92);
  margin-bottom: 6px;
}

.kv-value {
  color: rgba(230, 238, 252, 0.96);
}

.kv-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.meta {
  color: rgba(167, 180, 204, 0.9);
  font-size: 12px;
  margin-top: 4px;
}

.truncate2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(125, 180, 255, 0.18);
  background: rgba(125, 180, 255, 0.08);
  color: rgba(230, 238, 252, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

details {
  margin-top: 6px;
}

.details-summary {
  cursor: pointer;
  color: rgba(125, 180, 255, 0.95);
  font-size: 12px;
  list-style: none;
}

.details-summary::-webkit-details-marker {
  display: none;
}

.details-summary::before {
  content: "▸ ";
  color: rgba(125, 180, 255, 0.95);
}

details[open] .details-summary::before {
  content: "▾ ";
}

.glossary-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(16, 24, 39, 0.55);
  border-radius: 12px;
  margin: 16px 0 22px;
}

.glossary-jump-label {
  color: rgba(167, 180, 204, 0.95);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glossary-jump a {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(125, 180, 255, 0.18);
  background: rgba(125, 180, 255, 0.08);
  color: rgba(230, 238, 252, 0.95);
  font-size: 13px;
  text-decoration: none;
}

.glossary-jump a:hover {
  background: rgba(125, 180, 255, 0.14);
  text-decoration: none;
}

.glossary-section {
  margin-top: 26px;
}

.glossary-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
  max-width: 92ch;
}

.glossary-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 24, 39, 0.46);
  border-radius: 12px;
  padding: 12px 14px;
}

.glossary-term {
  font-weight: 850;
  letter-spacing: -0.01em;
  font-size: 16px;
  margin: 0;
}

.glossary-def {
  margin-top: 6px;
  color: rgba(230, 238, 252, 0.94);
}

code.inline {
  background: var(--code);
  border: 1px solid rgba(125, 180, 255, 0.16);
  padding: 1px 6px;
  border-radius: 8px;
}

.callout {
  line-height: 1.6;
}

.callout > div {
  color: rgba(230, 238, 252, 0.92);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 940px) {
  .layout {
    grid-template-columns: 1fr;
  }
  nav {
    height: auto;
    position: relative;
  }
  main {
    padding: 22px 16px 46px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
}
