:root {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: rgba(255, 255, 255, 0.92);
  --sidebar: rgba(255, 255, 255, 0.72);
  --text: #172033;
  --muted: #5a6476;
  --accent: #1f6feb;
  --accent-2: #0f766e;
  --border: rgba(23, 32, 51, 0.12);
  --code-bg: rgba(23, 32, 51, 0.06);
  --shadow: 0 24px 80px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(31, 111, 235, 0.14),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 20%,
      rgba(15, 118, 110, 0.12),
      transparent 25%
    ),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  backdrop-filter: blur(16px);
}

.brand {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.sidebar h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.1;
}

.home-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.92rem;
  text-decoration: none;
}

.search-wrap {
  margin-bottom: 18px;
}

.search-wrap label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

#search-input:focus {
  outline: 2px solid rgba(31, 111, 235, 0.25);
  border-color: rgba(31, 111, 235, 0.45);
}

.nav-section-title {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-nav,
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-nav li + li,
.search-results li + li {
  margin-top: 4px;
}

.doc-nav button,
.search-results button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.doc-nav button:hover,
.search-results button:hover,
.doc-nav button.active {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.doc-nav button.active {
  border-color: rgba(31, 111, 235, 0.25);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.08);
}

.search-results button .result-title {
  display: block;
  font-weight: 600;
}

.search-results button .result-snippet {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.search-results mark,
.doc-body mark {
  background: rgba(255, 214, 102, 0.65);
  padding: 0 2px;
  border-radius: 3px;
}

.empty-state {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.content {
  padding: 32px clamp(20px, 4vw, 56px) 64px;
}

.content-panel {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 36px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.doc-meta {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-body {
  line-height: 1.65;
  font-size: 1rem;
}

.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  scroll-margin-top: 24px;
}

.doc-body h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.doc-body h2 {
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.doc-body h3 {
  margin-top: 1.5rem;
}

.doc-body p,
.doc-body ul,
.doc-body ol,
.doc-body pre,
.doc-body table {
  margin: 0.85rem 0;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.4rem;
}

.doc-body code {
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.92em;
}

.doc-body pre {
  overflow: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: #111827;
  color: #f3f4f6;
}

.doc-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc-body th,
.doc-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  background: rgba(23, 32, 51, 0.04);
}

.status-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.hidden {
  display: none !important;
}

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

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

  .content-panel {
    padding: 24px 20px;
  }
}
