:root {
  --page: #f6f4ef;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #171714;
  --muted: #6e6c64;
  --line: #ddd9cf;
  --line-soft: #ebe8df;
  --accent: #aa583f;
  --accent-dark: #7e3e2c;
  --accent-soft: #f3e4dc;
  --code: #24231f;
  --shadow: 0 18px 50px rgba(52, 45, 34, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.65; }
a { color: inherit; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 20; padding: 8px 12px; transform: translateY(-150%); border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { transform: translateY(0); }

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(221, 217, 207, 0.86);
  background: rgba(246, 244, 239, 0.9);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--ink); color: white; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.brand > span:last-child { display: grid; line-height: 1.2; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.app-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 650; text-decoration: none; }
.app-link:hover { border-color: var(--accent); color: var(--accent-dark); }

.docs-shell { display: grid; grid-template-columns: 248px minmax(0, 840px); gap: 64px; width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.docs-sidebar { position: sticky; top: 100px; align-self: start; padding: 42px 0; }
.docs-sidebar > p { margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.docs-sidebar nav { display: grid; gap: 3px; }
.docs-sidebar a { padding: 7px 11px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; text-decoration: none; }
.docs-sidebar a:hover { border-left-color: var(--accent); color: var(--ink); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.docs-content { min-width: 0; padding: 54px 0 80px; }

.hero { padding: 58px; border: 1px solid var(--line); border-radius: 26px; background: radial-gradient(circle at 90% 5%, var(--accent-soft), transparent 32%), var(--surface-strong); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 9px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 18px; font-size: clamp(42px, 7vw, 72px); line-height: 0.98; letter-spacing: -0.055em; }
h2 { margin-bottom: 20px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.035em; }
h3 { margin-bottom: 8px; font-size: 16px; line-height: 1.3; }
.lead { max-width: 600px; margin-bottom: 30px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions a { padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 700; text-decoration: none; }
.primary-action { border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary-action:hover { background: var(--accent-dark); }
.secondary-action { border: 1px solid var(--line); background: var(--surface); }
.secondary-action:hover { border-color: var(--accent); }

.doc-section { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 26px; padding: 78px 4px; border-bottom: 1px solid var(--line); }
.section-number { padding-top: 3px; color: var(--accent); font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.doc-section > div:last-child > p:not(.eyebrow) { color: #494841; }
.steps, .check-list, .rule-list { display: grid; gap: 0; margin: 30px 0 0; padding: 0; list-style: none; }
.steps li, .check-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px; padding: 19px 0; border-top: 1px solid var(--line-soft); }
.steps li > span, .check-list li > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.steps p, .check-list p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.callout { margin-top: 28px; padding: 18px 20px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--accent-soft); }
.callout strong { font-size: 13px; }
.callout p { margin: 4px 0 0; color: #5f4338 !important; font-size: 14px; }
.callout.warning { border-left-color: #b57d18; background: #f8efd8; }
.callout.warning p { color: #5d4b28 !important; }

.feature-grid, .compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.feature-grid article, .compare-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.feature-grid p, .compare-grid p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.feature-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 18px; border-radius: 9px; background: var(--ink); color: white; font-size: 11px; font-weight: 800; }
.code-card { overflow: hidden; margin: 28px 0; border-radius: 14px; background: var(--code); color: #f7f2e8; box-shadow: var(--shadow); }
.code-card-title { padding: 11px 17px; border-bottom: 1px solid #3b3933; color: #aaa79f; font-size: 11px; }
pre { overflow-x: auto; margin: 0; padding: 20px; font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }

.spec-table { overflow: hidden; margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.spec-row { display: grid; grid-template-columns: 0.8fr 1.15fr 1.6fr; gap: 16px; padding: 14px 17px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.spec-row:first-child { border-top: 0; }
.spec-row span { color: var(--muted); }
.spec-head { background: #eeece5; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.flow { display: flex; align-items: center; gap: 10px; margin: 28px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.flow span { flex: 1; padding: 10px; border-radius: 8px; background: #f0eee7; font-size: 11px; font-weight: 700; text-align: center; }
.flow b { color: var(--accent); font-weight: 500; }
.compare-grid { margin-bottom: 20px; }

.troubleshooting { margin-top: 26px; border-top: 1px solid var(--line); }
.troubleshooting details { padding: 17px 0; border-bottom: 1px solid var(--line); }
.troubleshooting summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.troubleshooting details p { margin: 11px 0 0; padding-right: 28px; color: var(--muted); font-size: 14px; }
.rule-list { border-top: 1px solid var(--line); }
.rule-list li { display: grid; grid-template-columns: 1.1fr 1.6fr; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rule-list span { color: var(--muted); }
.docs-footer { display: flex; align-items: end; justify-content: space-between; padding: 48px 4px 0; }
.docs-footer p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.docs-footer a { color: var(--accent-dark); font-size: 13px; font-weight: 700; }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; width: min(760px, calc(100% - 36px)); }
  .docs-sidebar { display: none; }
  .docs-content { padding-top: 30px; }
}

@media (max-width: 620px) {
  .docs-topbar { height: 60px; padding: 0 16px; }
  .brand small { display: none; }
  .app-link { padding: 8px 10px; }
  .docs-shell { width: calc(100% - 24px); }
  .hero { padding: 34px 24px; border-radius: 20px; }
  h1 { font-size: 43px; }
  .doc-section { grid-template-columns: 1fr; gap: 12px; padding: 54px 4px; }
  .feature-grid, .compare-grid { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; gap: 3px; }
  .spec-head { display: none; }
  .flow { align-items: stretch; flex-direction: column; }
  .flow b { transform: rotate(90deg); text-align: center; }
  .rule-list li { grid-template-columns: 1fr; gap: 5px; }
  .docs-footer { align-items: start; flex-direction: column; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
