:root {
  color-scheme: light;
  
  /* Core Apple-like colors */
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.12);
  
  /* Text */
  --text: #1d1d1f;
  --muted: #86868b;
  --muted-light: #a1a1a6;
  
  /* Accents - A tasteful indigo */
  --accent: #5e5ce6;
  --accent-soft: rgba(94, 92, 230, 0.08);
  --accent-hover: rgba(94, 92, 230, 0.15);
  --accent-strong: rgba(94, 92, 230, 0.22);
  
  /* Effects */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.04), 0 4px 10px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.06), 0 6px 14px rgba(0, 0, 0, 0.03);
  --code-bg: #fcfcfd;
  --code-border: rgba(17, 24, 39, 0.08);
  --code-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  /* Typography */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: rgba(17, 23, 32, 0.78);
  --surface-solid: #111722;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f8;
  --muted: #b0b8c6;
  --muted-light: #8792a5;
  --accent: #7c8cff;
  --accent-soft: rgba(124, 140, 255, 0.16);
  --accent-hover: rgba(124, 140, 255, 0.22);
  --accent-strong: rgba(124, 140, 255, 0.35);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.44);
  --code-bg: #0b1020;
  --code-border: rgba(124, 140, 255, 0.18);
  --code-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 0%, rgba(94, 92, 230, 0.03), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(0, 122, 255, 0.03), transparent 40%);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--text); margin: 0; }

h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Base Layout */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar Glassmorphism */
.sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 32px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  
  /* Hide scrollbar for a cleaner look */
  scrollbar-width: none; 
}
.sidebar-sticky::-webkit-scrollbar { display: none; }

.brand {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand-copy {
  margin: 8px 0 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.brand-meta {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted-light);
}

.sidebar-separator {
  height: 1px;
  margin: 0 0 28px;
  background: var(--line);
}

.nav-search {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-search-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.nav-search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.nav-search-input::placeholder {
  color: var(--muted-light);
}

.nav-search-input:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.theme-control {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.api-style-control {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.theme-control-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.api-style-control-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.theme-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.api-style-select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.api-style-select:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.theme-select:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Navigation */
.navigation { display: grid; gap: 28px; }
.nav-group h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.nav-group a {
  display: block;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-group a:hover {
  background: var(--line);
  color: var(--text);
}

.nav-link.is-active,
.nav-group a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-strong);
}

/* Main Content Area */
.content {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-md);
}

.content-header {
  margin-bottom: 40px;
}

.page-meta {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.mt-large { margin-top: 48px; }

/* Prose & Typography */
.prose p, .prose li {
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
  margin-top: 0;
  margin-bottom: 16px;
}
.prose ul { padding-left: 20px; margin-bottom: 16px; }
.prose p:last-child, .prose ul:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;}
.prose a:hover { text-decoration-thickness: 2px; }
.muted { color: var(--muted); }

/* Inline Code styling */
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--line);
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text);
}

/* Markdown overrides for inline code */
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 13px;
}

/* Code Block Wrapper */
.code-block-wrapper {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  box-shadow: var(--code-shadow);
}

.code-block-wrapper pre {
  margin: 0 !important; /* Override prism default */
  padding: 20px !important;
  background: transparent !important;
  overflow-x: auto;
}

:root[data-theme='dark'] code[class*='language-'],
:root[data-theme='dark'] pre[class*='language-'] {
  color: #d7dee9;
  text-shadow: none;
}

:root[data-theme='dark'] .token.comment,
:root[data-theme='dark'] .token.prolog,
:root[data-theme='dark'] .token.doctype,
:root[data-theme='dark'] .token.cdata {
  color: #7f8ea3;
}

:root[data-theme='dark'] .token.keyword,
:root[data-theme='dark'] .token.boolean,
:root[data-theme='dark'] .token.operator {
  color: #9bb1ff;
  background: transparent;
}

:root[data-theme='dark'] .token.string,
:root[data-theme='dark'] .token.char,
:root[data-theme='dark'] .token.attr-value {
  color: #9fe0b0;
}

:root[data-theme='dark'] .token.function,
:root[data-theme='dark'] .token.class-name {
  color: #ffd37b;
}

:root[data-theme='dark'] .token.number,
:root[data-theme='dark'] .token.constant,
:root[data-theme='dark'] .token.symbol {
  color: #ffb38f;
}

/* Cards (Stats & Modules) */
.summary-grid, .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-grid { margin-bottom: 48px; }

.stat-card {
  padding: 24px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card span {
  display: block;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.stat-card p { 
  margin: 4px 0 0; 
  font-size: 14px;
  font-weight: 500;
  color: var(--muted); 
}

/* Module Groups */
.module-group { margin-top: 48px; }
.group-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.badge {
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}

/* Module Cards */
.module-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.module-file {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.module-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.module-style-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.module-entity {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.source-link {
  margin: -24px 0 32px;
  font-size: 14px;
  color: var(--muted);
}
.source-link a {
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* API Cards */
.exports-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.style-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.style-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.style-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.api-card {
  padding: 32px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.class-members {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.class-members-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.member-style-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.member-style-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.members-grid {
  display: grid;
  gap: 16px;
}

.member-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.member-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.member-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
}

.member-signature {
  margin-bottom: 20px;
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.api-kind {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 700;
}

/* Anchor Link styling */
.anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted-light);
  background: transparent;
}

.anchor:hover {
  background: var(--line);
  color: var(--text);
}

.signature-block { margin-top: 0; margin-bottom: 24px; }

.meta-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.meta-block { margin: 0; }
.meta-block h3 { margin-bottom: 12px; }

.doc-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.doc-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.style-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.style-badge-target {
  background: rgba(40, 167, 69, 0.12);
  color: #1f7a36;
}

.style-badge-legacy {
  background: rgba(255, 159, 10, 0.14);
  color: #a85d00;
}

:root[data-theme='dark'] .style-badge-target {
  background: rgba(69, 201, 111, 0.18);
  color: #8ce99a;
}

:root[data-theme='dark'] .style-badge-legacy {
  background: rgba(255, 179, 64, 0.2);
  color: #ffd08a;
}

.style-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.meta-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.meta-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.type-badge {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.empty-state {
  font-style: italic;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .sidebar-sticky {
    position: static;
    height: auto;
    padding: 24px;
  }

  .content {
    padding: 24px;
  }
  
  .api-card {
    padding: 24px;
  }
}