:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --ink: #27251f;
  --muted: #69655c;
  --rule: #d8d3c7;
  --accent: #885b24;
  --code-paper: #eeebe2;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 28px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }
::selection { background: #ead6b7; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 10; top: 10px; left: 16px; transform: translateY(-160%); padding: 12px 18px; background: var(--ink); color: var(--paper); }
.skip-link:focus { transform: translateY(0); }

.site-header { display: flex; align-items: center; gap: 30px; max-width: 1384px; margin: 0 auto; min-height: 100px; padding: 20px 52px; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; text-decoration: none; }
.brand img { display: block; filter: grayscale(1) brightness(.45); }
.brand span { font-size: 18px; font-weight: 650; letter-spacing: .12em; }
.header-label { border-left: 1px solid var(--rule); padding-left: 30px; font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.ai-link { display: inline-flex; align-items: center; justify-content: center; gap: 20px; margin-left: auto; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 3px; font-size: 13px; font-weight: 600; text-decoration: none; }
.ai-link span { font-size: 19px; line-height: 1; font-weight: 400; }
.ai-link:hover { border-color: var(--accent); color: var(--accent); }

.guide-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 76px; max-width: 1280px; margin: 0 auto; padding: 66px 32px 110px; }
.guide-sidebar { align-self: start; position: sticky; top: 34px; min-width: 0; }
.sidebar-heading { display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 38px; }
.section-mark { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.contents-label { margin: 0 0 15px; font-size: 11px; line-height: 1.5; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.desktop-contents { max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; padding-right: 8px; padding-bottom: 8px; }
.contents-list { list-style: none; margin: 0; padding: 0; }
.contents-list li { margin: 0; }
.contents-list a { display: block; padding: 9px 0; text-decoration: none; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.contents-list a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.contents-list .toc-level-2:not(:first-child) { margin-top: 7px; }
.contents-list .toc-level-3 a { padding: 6px 0 6px 14px; color: var(--muted); font-size: 12px; border-left: 1px solid var(--rule); }
.contents-list .toc-level-3 a:hover { color: var(--accent); }
.mobile-contents { display: none; }
.guide-main { min-width: 0; }
.article-kicker { display: flex; align-items: center; gap: 13px; margin: 0 0 25px; font-size: 11px; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.kicker-line { width: 36px; height: 1px; background: var(--accent); }

.guide-content { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.guide-content h1, .guide-content h2, .guide-content h3, .guide-content h4 { scroll-margin-top: 32px; color: var(--ink); }
.guide-content h1 { max-width: 750px; font-family: var(--serif); font-size: clamp(42px, 4.6vw, 64px); font-weight: 400; line-height: 1.08; letter-spacing: -.045em; margin: 0 0 30px; text-wrap: balance; }
.guide-content h1 + p { font-size: 19px; line-height: 1.75; color: #4b483f; }
.guide-content h2 { margin: 70px 0 23px; padding-top: 35px; border-top: 1px solid var(--rule); font-family: var(--serif); font-size: 34px; font-weight: 400; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.guide-content h3 { margin: 38px 0 16px; font-size: 18px; font-weight: 650; line-height: 1.5; letter-spacing: -.015em; }
.guide-content h4 { margin: 28px 0 12px; font-size: 16px; line-height: 1.5; }
.guide-content p { margin: 0 0 22px; }
.guide-content strong { font-weight: 650; }
.guide-content a { text-decoration-color: #bca583; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.guide-content a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.guide-content ul, .guide-content ol { padding-left: 25px; margin: 20px 0 27px; }
.guide-content li { padding-left: 6px; margin: 12px 0; }
.guide-content li::marker { color: var(--accent); }
.guide-content li > p { margin-bottom: 10px; }
.guide-content li > ul, .guide-content li > ol { margin-top: 10px; margin-bottom: 12px; }
.guide-content blockquote { margin: 24px 0; padding: 20px 25px; border-left: 2px solid var(--accent); background: #efebe0; }
.guide-content blockquote p:last-child { margin-bottom: 0; }
.guide-content hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.guide-content img { max-width: 100%; height: auto; }
.guide-content :not(pre) > code { padding: .14em .3em; background: var(--code-paper); border-radius: 3px; font-family: var(--mono); font-size: .81em; overflow-wrap: anywhere; }
.guide-content h3 > code { font-weight: 500; background: transparent; padding: 0; font-size: .88em; }
.code-block { margin: 24px 0 32px; max-width: 100%; min-width: 0; border: 1px solid #d2cdc0; border-radius: 5px; background: var(--code-paper); overflow: hidden; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 12px 6px 20px; border-bottom: 1px solid #d9d4c8; background: #e8e4d9; }
.code-language { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: #5b574d; }
.copy-code { min-height: 36px; min-width: 66px; padding: 6px 12px; color: var(--ink); border: 1px solid #c5beb0; border-radius: 3px; background: var(--paper); font-size: 12px; cursor: pointer; }
.copy-code:hover { border-color: var(--accent); color: var(--accent); }
.copy-code:disabled { cursor: progress; opacity: .65; }
.guide-content pre { margin: 0; padding: 22px; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #aca494 transparent; font-family: var(--mono); font-size: 12px; line-height: 1.8; tab-size: 2; white-space: pre; overflow-wrap: normal; }
.guide-content pre code { font: inherit; white-space: inherit; overflow-wrap: normal; }
.table-wrap { margin: 26px 0; width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--rule); border-radius: 4px; scrollbar-width: thin; scrollbar-color: #aca494 transparent; }
.guide-content table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; text-align: left; }
.guide-content th, .guide-content td { padding: 15px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; min-width: 140px; }
.guide-content th { background: var(--code-paper); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.guide-content tbody tr:last-child td { border-bottom: 0; }
.guide-content tbody tr:nth-child(even) { background: #f1eee5; }
.guide-content > :last-child { margin-bottom: 0; }

@media (min-width: 1500px) {
  .guide-layout { gap: 96px; }
}

@media (max-width: 1050px) {
  .site-header { padding-left: 32px; padding-right: 32px; }
  .guide-layout { grid-template-columns: 206px minmax(0, 1fr); gap: 42px; }
  .guide-content { font-size: 15px; }
  .guide-content h1 + p { font-size: 18px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 20px; }
  .site-header { min-height: 80px; padding: 14px 22px; gap: 16px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: auto; }
  .brand span { font-size: 15px; letter-spacing: .1em; }
  .header-label { display: none; }
  .ai-link { padding: 0 12px; gap: 12px; font-size: 12px; }
  .guide-layout { display: block; padding: 24px 22px 64px; }
  .guide-sidebar { position: static; margin-bottom: 38px; }
  .sidebar-heading { margin-bottom: 18px; font-size: 10px; }
  .desktop-contents { display: none; }
  .mobile-contents { display: block; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .mobile-contents summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 0; font-size: 13px; cursor: pointer; list-style: none; }
  .mobile-contents summary::-webkit-details-marker { display: none; }
  .mobile-contents summary span { font-size: 20px; color: var(--accent); font-weight: 300; }
  .mobile-contents[open] summary span { transform: rotate(45deg); }
  .mobile-contents nav { padding: 0 0 20px; }
  .mobile-contents .contents-list a { min-height: 44px; display: flex; align-items: center; padding-top: 10px; padding-bottom: 10px; }
  .article-kicker { margin-bottom: 20px; font-size: 10px; }
  .guide-content { font-size: 15px; line-height: 1.85; }
  .guide-content h1 { font-size: clamp(38px, 10.3vw, 54px); margin-bottom: 24px; }
  .guide-content h1 + p { font-size: 17px; line-height: 1.8; }
  .guide-content h2 { margin-top: 50px; padding-top: 28px; font-size: 30px; }
  .guide-content h3 { font-size: 17px; }
  .guide-content blockquote { padding: 18px 20px; }
  .guide-content ul, .guide-content ol { padding-left: 22px; }
  .guide-content li { padding-left: 3px; }
  .guide-content pre { padding: 18px; font-size: 11px; }
  .code-toolbar { padding-left: 18px; min-height: 52px; }
  .copy-code { min-height: 44px; }
  .guide-content th, .guide-content td { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

@media print {
  body { background: white; }
  .site-header, .guide-sidebar, .article-kicker, .copy-code, .skip-link { display: none; }
  .guide-layout { display: block; max-width: none; padding: 0; }
  .guide-content { font-size: 11pt; }
  .guide-content h1 { font-size: 28pt; }
  .guide-content h2 { font-size: 21pt; }
  .guide-content pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 8pt; }
  .table-wrap { overflow: visible; }
}
