:root {
  --paper:#fff;
  --canvas:#f7f8fa;
  --text:#263247;
  --muted:#59677a;
  --accent:#365c98;
  --soft:#eaf0f9;
  --line:#dce2ea;
  --control:#7c8999;
  --code:#f3f5f8;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--paper);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  font-size:15px;
  line-height:1.65;
}

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

a:hover {
  text-decoration:underline;
}

a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:4px;
}

button,input {
  font:inherit;
}

button,summary {
  cursor:pointer;
}

.skip-link {
  position:fixed;
  top:-100px;
  left:16px;
  padding:12px 20px;
  background:var(--paper);
  z-index:10;
}

.skip-link:focus {
  top:12px;
}

.topbar {
  height:82px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 38px;
  gap:20px;
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:21px;
  font-weight:700;
  letter-spacing:-.7px;
  color:var(--text);
  text-decoration:none;
}

.brand-mark {
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  background:var(--text);
  color:#fff;
  border-radius:5px;
  font-family:Georgia,serif;
  font-size:28px;
  line-height:1;
}

.brand-mark span {
  color:#a9c5ef;
}

.brand-label {
  font-size:12px;
  letter-spacing:0;
  font-weight:400;
  color:var(--muted);
  padding-left:20px;
  margin-left:12px;
  border-left:1px solid var(--line);
}

.api-link {
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  color:var(--text);
  padding:10px 0;
  white-space:nowrap;
}

.api-link span {
  margin-left:10px;
  color:var(--accent);
}

.workspace {
  display:grid;
  grid-template-columns:248px minmax(0,1fr) 206px;
  max-width:1600px;
  margin:0 auto;
  min-height:calc(100vh - 82px);
}

.sidebar {
  padding:34px 22px 28px;
  border-right:1px solid var(--line);
  background:var(--canvas);
  display:flex;
  flex-direction:column;
  min-width:0;
}

.sidebar form label {
  display:block;
  font-size:12px;
  font-weight:600;
  margin-bottom:8px;
}

.search-row {
  display:flex;
  background:var(--paper);
  border:1px solid var(--control);
  border-radius:5px;
}

.search-row input {
  width:100%;
  min-width:0;
  padding:9px 10px;
  border:0;
  background:transparent;
  font-size:13px;
  color:var(--text);
}

.search-row button {
  border:0;
  border-left:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  width:36px;
  flex-shrink:0;
}

.search-row button:hover {
  background:var(--soft);
}

.page-nav {
  margin-top:34px;
}

.page-nav summary {
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  padding:8px 4px;
  display:flex;
  justify-content:space-between;
}

.page-nav summary::marker {
  content:'';
}

.page-nav summary:after {
  content:'−';
  margin-left:8px;
}

.page-nav:not([open]) summary:after {
  content:'+';
}

.page-nav summary span {
  margin-left:auto;
  font-weight:400;
}

.page-nav nav {
  padding-top:9px;
}

.page-link {
  display:flex;
  align-items:baseline;
  gap:10px;
  color:var(--muted);
  padding:10px 11px;
  font-size:13px;
  text-decoration:none;
  border-radius:4px;
  overflow-wrap:anywhere;
  margin:2px 0;
}

.page-link span {
  color:var(--muted);
  flex-shrink:0;
}

.page-link:hover {
  background:#edf0f4;
  text-decoration:none;
}

.page-link[aria-current] {
  background:var(--soft);
  color:var(--accent);
  font-weight:600;
  box-shadow:inset 2px 0 var(--accent);
}

.all-pages {
  margin-bottom:14px;
}

.sidebar-note {
  margin-top:auto;
  padding:60px 8px 0;
  font-size:12px;
  color:var(--muted);
  line-height:1.9;
}

.sidebar-note>span:last-child {
  padding-left:15px;
}

.status-dot {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#568066;
  margin-right:9px;
}

main {
  min-width:0;
  padding:32px clamp(28px,5vw,78px) 30px;
  max-width:980px;
  width:100%;
  margin:0 auto;
}

main:focus {
  outline:none;
}

.breadcrumb {
  font-size:12px;
  color:var(--muted);
  display:flex;
  gap:12px;
  align-items:baseline;
  overflow-wrap:anywhere;
}

.breadcrumb a {
  color:var(--muted);
  text-decoration:none;
}

.breadcrumb span {
  color:#818c9b;
}

.article-header {
  margin:46px 0 34px;
}

.eyebrow {
  color:var(--accent);
  font-size:11px;
  font-weight:650;
  letter-spacing:1.1px;
  text-transform:uppercase;
  margin:0 0 14px;
}

h1 {
  font-size:clamp(30px,3.2vw,44px);
  font-weight:620;
  line-height:1.2;
  letter-spacing:-1.6px;
  margin:0 0 20px;
  overflow-wrap:anywhere;
}

.lead {
  font-size:16px;
  line-height:1.8;
  color:var(--muted);
  max-width:560px;
  margin:0;
}

.article-meta {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--muted);
}

.article-meta a {
  text-decoration:none;
}

.list-heading {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  border-bottom:1px solid var(--line);
  padding:10px 0 14px;
  margin-top:42px;
  gap:12px;
}

.list-heading h2 {
  font-size:13px;
  font-weight:650;
  margin:0;
}

.list-heading>span {
  font-size:12px;
  color:var(--muted);
}

.page-row {
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:23px 0;
  border-bottom:1px solid var(--line);
  text-decoration:none;
  color:var(--text);
}

.page-row:hover {
  text-decoration:none;
}

.page-row:hover h3 {
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:4px;
}

.page-row h3 {
  font-size:17px;
  font-weight:600;
  letter-spacing:-.25px;
  margin:0 0 5px;
  overflow-wrap:anywhere;
}

.page-row p {
  font-size:13px;
  color:var(--muted);
  margin:0 0 10px;
  line-height:1.7;
  overflow-wrap:anywhere;
}

.page-slug {
  font:11px ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--muted);
}

.row-arrow {
  color:var(--accent);
  font-size:20px;
}

.content-footer {
  display:flex;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
  border-top:1px solid var(--line);
  margin-top:55px;
  padding-top:20px;
  font-size:11px;
  color:var(--muted);
}

.page-list+.content-footer {
  border:0;
  margin-top:28px;
}

.content-footer a {
  text-decoration:none;
}

.outline {
  padding:90px 24px 20px 8px;
  min-width:0;
}

.outline .eyebrow {
  color:var(--muted);
  font-size:10px;
  letter-spacing:.8px;
}

.outline nav {
  border-left:1px solid var(--line);
  padding-left:15px;
}

.outline nav a {
  display:block;
  color:var(--muted);
  text-decoration:none;
  font-size:12px;
  padding:6px 0;
  line-height:1.5;
  overflow-wrap:anywhere;
}

.outline nav a:hover {
  color:var(--accent);
}

.outline nav .subheading {
  padding-left:10px;
}

.outline-guide {
  display:block;
  font-size:11px;
  margin-top:30px;
  text-decoration:none;
}

.outline-note {
  font-size:12px;
  color:var(--muted);
  line-height:1.8;
}

.prose {
  font-size:15px;
  line-height:1.85;
  overflow-wrap:anywhere;
}

.prose>:first-child {
  margin-top:0;
}

.prose h1,.prose h2,.prose h3,.prose h4 {
  scroll-margin-top:24px;
  line-height:1.35;
  letter-spacing:-.4px;
  color:var(--text);
}

.prose h1,.prose h2 {
  font-size:23px;
  font-weight:620;
  margin:36px 0 14px;
}

.prose h3 {
  font-size:18px;
  margin:28px 0 12px;
}

.prose p {
  margin:16px 0;
}

.prose li {
  padding-left:3px;
  margin:6px 0;
}

.prose ul,.prose ol {
  padding-left:24px;
}

.prose strong {
  font-weight:650;
}

.prose code {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:.84em;
  background:var(--code);
  padding:3px 5px;
  border-radius:4px;
}

.prose pre {
  background:var(--code);
  border:1px solid var(--line);
  padding:19px 21px;
  border-radius:5px;
  overflow:auto;
  line-height:1.7;
  max-width:100%;
  tab-size:2;
}

.prose pre code {
  padding:0;
  border:0;
  background:transparent;
  font-size:12px;
  overflow-wrap:normal;
}

.prose blockquote {
  border-left:3px solid var(--accent);
  padding:3px 20px;
  margin:25px 0;
  background:#f5f8fc;
  color:var(--muted);
}

.prose hr {
  border:0;
  border-top:1px solid var(--line);
  margin:30px 0;
}

.prose table {
  display:block;
  width:100%;
  overflow:auto;
  border-collapse:collapse;
  font-size:13px;
}

.prose th,.prose td {
  padding:11px 14px;
  border:1px solid var(--line);
  text-align:left;
  min-width:105px;
}

.prose th {
  background:var(--canvas);
  font-weight:600;
}

.prose img {
  max-width:100%;
  height:auto;
}

.empty {
  padding:35px 0;
}

.empty h3 {
  font-size:20px;
  margin:0;
}

.empty p {
  color:var(--muted);
}

.button-link {
  display:inline-block;
  margin-top:28px;
  font-size:14px;
}

@media(min-width:1600px) {
  .workspace {
    border-left:1px solid var(--line);
    border-right:1px solid var(--line);
  }
}

@media(max-width:1150px) {
  .workspace {
    grid-template-columns:225px minmax(0,1fr);
  }
  .outline {
    grid-column:2;
    padding:0 40px 35px;
  }
  .outline nav {
    display:flex;
    flex-wrap:wrap;
    gap:5px 20px;
  }
  .outline-note,.outline-guide {
    display:none;
  }
  main {
    padding:32px 40px;
  }
  .brand-label {
    display:none;
  }
}

@media(max-width:680px) {
  .topbar {
    height:70px;
    padding:0 20px;
  }
  .brand {
    font-size:19px;
  }
  .api-link {
    font-size:12px;
  }
  .workspace {
    display:block;
    min-height:calc(100vh - 70px);
  }
  .sidebar {
    padding:18px 20px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .sidebar form label {
    font-size:11px;
  }
  .search-row input {
    padding:10px 12px;
    font-size:16px;
  }
  .search-row button {
    width:44px;
  }
  .page-nav {
    margin-top:8px;
  }
  .page-nav summary {
    padding:10px 0;
  }
  .page-nav nav {
    display:flex;
    overflow-x:auto;
    gap:6px;
    padding:4px 0 8px;
  }
  .page-link {
    flex-shrink:0;
    margin:0;
    max-width:230px;
    padding:10px 12px;
  }
  .all-pages {
    margin-bottom:0;
  }
  .sidebar-note {
    display:none;
  }
  main {
    padding:22px 22px 28px;
  }
  .article-header {
    margin:32px 0 28px;
  }
  h1 {
    letter-spacing:-1px;
    font-size:33px;
  }
  .lead {
    font-size:15px;
  }
  .list-heading {
    margin-top:30px;
  }
  .outline {
    padding:0 22px 30px;
  }
  .prose {
    font-size:15px;
  }
  .prose pre {
    padding:15px;
  }
  .content-footer {
    margin-top:35px;
  }
  .page-row {
    padding:20px 0;
  }
  .page-row h3 {
    font-size:16px;
  }
  .article-meta {
    gap:8px;
  }
  .breadcrumb {
    font-size:11px;
  }
}

@media(forced-colors:active) {
  .page-link[aria-current] {
    outline:1px solid CanvasText;
  }
  .search-row {
    border-color:CanvasText;
  }
}

.compact-outline {
  display:none;
}

pre:focus-visible,table:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:3px;
}

@media(max-width:1150px) {
  .compact-outline {
    display:block;
    margin:0 0 28px;
    padding:12px 15px;
    border:1px solid var(--line);
    border-radius:5px;
    font-size:13px;
  }
  .compact-outline summary {
    font-weight:600;
    color:var(--accent);
  }
  .compact-outline nav {
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:15px 0 4px;
  }
  .compact-outline a {
    text-decoration:none;
  }
  .outline:has(nav) {
    display:none;
  }
}

/* Account, project navigation, and writing flows share the reader's typography. */
.header-actions, .form-actions { display:flex; align-items:center; gap:20px; }
.header-actions form { margin:0; }
.account-name { font-size:12px; color:var(--muted); max-width:180px; overflow-wrap:anywhere; }
.text-button { border:0; background:transparent; color:var(--accent); padding:10px 0; font-size:13px; cursor:pointer; }
.project-picker { margin-bottom:18px; border:1px solid var(--line); border-radius:5px; background:var(--paper); }
.project-picker summary { padding:10px 12px; font-weight:600; font-size:14px; overflow-wrap:anywhere; }
.project-picker summary span { float:right; }
.project-picker nav { display:flex; flex-direction:column; padding:0 8px 8px; }
.project-picker nav a { padding:8px; text-decoration:none; font-size:13px; overflow-wrap:anywhere; }
.project-picker nav a[aria-current] { font-weight:650; background:var(--soft); }
.new-page { display:block; padding:9px 12px; margin-bottom:20px; border:1px solid var(--accent); border-radius:5px; text-decoration:none; font-size:13px; font-weight:600; }
.auth-page { max-width:510px; padding:65px 30px; margin:auto; }
.auth-page .brand { margin-bottom:70px; }
.auth-page .lead { margin-bottom:28px; }
.primary-button { display:inline-block; padding:11px 18px; border:1px solid var(--accent); border-radius:5px; background:var(--accent); color:white; font:inherit; font-size:14px; font-weight:600; text-decoration:none; cursor:pointer; text-align:center; }
.primary-button:hover { background:#284775; text-decoration:none; }
.auth-page .primary-button { width:100%; }
.auth-divider { text-align:center; color:var(--muted); font-size:12px; margin:25px 0; }
.stack-form { display:flex; flex-direction:column; gap:10px; }
.stack-form label { font-size:14px; font-weight:600; }
.stack-form input:not([type=hidden]), .stack-form textarea { width:100%; padding:12px; border:1px solid var(--control); border-radius:5px; color:var(--text); background:var(--paper); font:inherit; }
.stack-form textarea { resize:vertical; font:13px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace; min-height:300px; }
.stack-form textarea:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.field-help { font-size:12px; line-height:1.7; color:var(--muted); margin:4px 0 18px; }
.form-error { padding:16px; margin:20px 0; border:1px solid #ad3f37; background:#fff6f4; color:#842a24; border-radius:5px; font-size:14px; overflow-wrap:anywhere; }
.form-error p { margin:8px 0 0; }
.form-actions { flex-wrap:wrap; font-size:14px; }
.page-row h2 { font-size:20px; margin:0 0 8px; }
.edit-link { font-weight:650; }
@media(max-width:1150px) { .account-name { display:none; } }
@media(max-width:680px) {
  .header-actions { gap:14px; }
  .topbar { padding:0 16px; }
  .header-actions .api-link { font-size:11px; }
  .header-actions .api-link span { display:none; }
  .project-picker { margin-bottom:12px; }
  .new-page { margin-bottom:12px; }
  .auth-page { padding:35px 22px; }
  .auth-page .brand { margin-bottom:45px; }
  .stack-form input:not([type=hidden]) { font-size:16px; }
}
