:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --sidebar: #f7f7f5;
  --paper: #ffffff;
  --paper-soft: #f6f6f4;
  --text: #202124;
  --muted: #6f6f68;
  --line: #e6e4df;
  --accent: #0f766e;
  --code-bg: #f4f4f2;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.notion-app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

.notion-app.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 18px 14px;
  overflow: auto;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
}

.notion-app.is-sidebar-collapsed .sidebar {
  opacity: 0;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
}

.sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-close:hover {
  background: #eeeeeb;
}

.sidebar-toggle[aria-expanded="true"] {
  display: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-head .brand {
  flex: 1;
  min-width: 0;
}

.sidebar-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.sidebar-scrim {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 8px;
  border-radius: 10px;
}

.brand:hover,
.nav-item:hover {
  background: #eeeeeb;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 1px;
}

.nav-label {
  margin: 24px 8px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 14px;
}

.nav-label-inline {
  margin-top: 18px;
}

.nav-list {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
}

.nav-item.is-active {
  background: #e9e8e4;
  color: var(--text);
  font-weight: 650;
}

.quick-links {
  margin-top: 18px;
}

.nav-pill {
  display: block;
  margin: 6px 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-pill:hover {
  border-color: #d2d0ca;
  background: #eeeeeb;
}

.sidebar-note {
  margin: 28px 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.5;
}

.page {
  min-width: 0;
  padding: clamp(40px, 7vw, 88px) 24px 80px;
}

.doc-root {
  width: min(980px, 100%);
  margin: 0 auto;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
  font-weight: 800;
}

.doc-lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.doc-callout {
  margin: 28px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--muted);
  line-height: 1.65;
}

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

.doc-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.doc-card:hover {
  border-color: #d2d0ca;
  transform: translateY(-1px);
}

.doc-card-type {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-card h2 {
  margin: 8px 0 6px;
  font-size: 1.15rem;
}

.doc-card p,
.doc-card small {
  color: var(--muted);
  line-height: 1.55;
}

.doc-article {
  font-size: 1rem;
  line-height: 1.75;
}

.doc-article h1,
.doc-article h2,
.doc-article h3 {
  letter-spacing: -0.025em;
}

.doc-article h2 {
  margin-top: 42px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.doc-article p,
.doc-article li,
.doc-article td {
  color: #37352f;
}

.doc-article blockquote {
  margin: 18px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  background: var(--paper-soft);
}

.task {
  list-style: none;
  margin-left: -1.3em;
}

.task input {
  margin-right: 8px;
}

pre {
  overflow: auto;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #1f2933;
  border-radius: 12px;
  background: #0d1117;
  color: #e6edf3;
  font-size: 0.85rem;
  line-height: 1.6;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

pre code,
pre code.hljs {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1em;
  line-height: inherit;
  white-space: pre;
}

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

:not(pre) > code,
p code,
li code,
td code,
th code,
.doc-callout code,
.sidebar-note code {
  padding: 0.12em 0.42em;
  border-radius: 5px;
  background: var(--code-bg);
  color: #9a3412;
  border: 1px solid #ecebe7;
}

.doc-table-wrap {
  max-width: 100%;
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.doc-article table,
.doc-table-wrap table,
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.92rem;
  background: var(--paper);
}

.doc-article th,
.doc-article td,
th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.doc-article th:last-child,
.doc-article td:last-child,
th:last-child,
td:last-child {
  border-right: 0;
}

.doc-article tbody tr:last-child td,
tbody tr:last-child td {
  border-bottom: 0;
}

.doc-article th,
th {
  background: var(--paper-soft);
  font-weight: 700;
  color: var(--text);
  width: auto;
}

.doc-article tbody tr:nth-child(2n),
tbody tr:nth-child(2n) {
  background: #fafaf8;
}

.doc-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.mermaid,
.mermaid-error {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

.mermaid.is-zoomable {
  position: relative;
  cursor: zoom-in;
}

.mermaid.is-zoomable::after {
  content: "Click to expand";
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.mermaid.is-zoomable:hover::after,
.mermaid.is-zoomable:focus-visible::after {
  opacity: 1;
}

.mermaid.is-zoomable:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 3px;
}

.mermaid-error {
  background: #fff5f5;
  color: #991b1b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

.has-modal {
  overflow: hidden;
}

.has-sidebar-open {
  overflow: hidden;
}

.mermaid-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(4px);
}

.mermaid-lightbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 96vw);
  max-height: 92vh;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.mermaid-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.mermaid-lightbox-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.mermaid-lightbox-close:hover {
  background: #eeeeeb;
}

.mermaid-lightbox-figure {
  overflow: auto;
  padding: 18px;
  background: #fff;
}

.mermaid-lightbox-figure svg {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  height: auto;
}

@media (max-width: 820px) {
  .notion-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: min(86vw, 320px);
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }

  .notion-app.is-sidebar-open .sidebar {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .notion-app.is-sidebar-collapsed .sidebar {
    opacity: 0;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar-toggle {
    top: 10px;
    left: 10px;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    border: 0;
    background: rgba(17, 24, 39, 0.32);
    cursor: pointer;
  }

  .sidebar-scrim[hidden] {
    display: none;
  }

  .page {
    padding: 72px 16px 64px;
  }

  .sidebar-note {
    display: none;
  }
}
