:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --muted: 220 14.3% 95.9%;
  --muted-foreground: 220 8.9% 46.1%;
  --border: 220 13% 91%;
  --primary: 263.4 70% 50.4%;
  --primary-foreground: 210 20% 98%;
  --accent: 220 14.3% 95.9%;
  --accent-foreground: 220.9 39.3% 11%;
  --radius: 0.5rem;
  color-scheme: light;
}
.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 20% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 20% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --border: 217.2 32.6% 17.5%;
  --primary: 263.4 70% 50.4%;
  --primary-foreground: 210 20% 98%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 20% 98%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.planbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.95);
  backdrop-filter: saturate(180%) blur(8px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  text-decoration: none;
}
.brand-mark { color: hsl(var(--primary)); display: inline-flex; }
.divider { width: 1px; height: 24px; background: hsl(var(--border)); }
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}
.planbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  font-family: inherit;
}
.btn:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-icon { width: 32px; padding: 0; justify-content: center; }
.btn svg { width: 14px; height: 14px; }

.theme-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 144px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.15), 0 2px 4px -2px rgba(0,0,0,0.1);
  padding: 4px;
  z-index: 60;
  display: none;
}
.menu[data-open="true"] { display: block; }
.menu-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  padding: 6px 8px 4px;
}
.menu-sep { height: 1px; background: hsl(var(--border)); margin: 2px -4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 28px;
  font-size: 13px;
  color: hsl(var(--foreground));
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.menu-item:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.menu-item svg { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); }
.menu-item .check {
  position: absolute;
  left: 8px;
  opacity: 0;
  transition: opacity 120ms ease;
}
.menu-item[data-active="true"] .check { opacity: 1; color: hsl(var(--foreground)); }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 56px);
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 768px) { .layout { grid-template-columns: 1fr; } }

aside {
  border-right: 1px solid hsl(var(--border));
  padding: 32px 24px 32px 0;
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
@media (max-width: 768px) { aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid hsl(var(--border)); padding: 24px 16px; } }

aside .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  margin: 0 0 12px 12px;
}
aside nav { display: flex; flex-direction: column; gap: 2px; }
aside nav a {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 120ms ease, color 120ms ease;
}
aside nav a:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
aside nav a[aria-current="page"] {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

main { min-width: 0; padding: 48px 48px 96px; }
@media (max-width: 768px) { main { padding: 32px 16px 64px; } }

main h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 12px; color: hsl(var(--foreground)); }
main h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 40px 0 12px; color: hsl(var(--foreground)); }
main h3 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; color: hsl(var(--foreground)); }
main p, main li { font-size: 14.5px; color: hsl(var(--muted-foreground)); }
main strong { color: hsl(var(--foreground)); }
main a { color: hsl(var(--primary)); text-decoration: none; border-bottom: 1px solid hsl(var(--primary) / 0.3); transition: border-color 120ms ease; }
main a:hover { border-bottom-color: hsl(var(--primary)); }
main code {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
main pre {
  font-family: 'Geist Mono', ui-monospace, monospace;
  background: hsl(var(--muted));
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
main pre code { background: none; padding: 0; }
main blockquote { border-left: 3px solid hsl(var(--primary)); padding-left: 16px; margin-left: 0; color: hsl(var(--muted-foreground)); font-style: italic; }
main table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  font-size: 13px;
}
main th, main td { padding: 10px 14px; text-align: left; border-bottom: 1px solid hsl(var(--border)); }
main th {
  background: hsl(var(--muted));
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}
main tr:last-child td { border-bottom: 0; }
main ul, main ol { padding-left: 22px; }
main li { margin: 4px 0; }
main hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 32px 0; }