:root {
  color-scheme: light;

  --canvas: #ffffff;
  --canvas-subtle: #f6f8fa;
  --canvas-inset: #eef1f4;
  --header: #1f2328;
  --header-ink: #d8dee4;
  --header-line: #3d444d;

  --fg: #1f2328;
  --fg-muted: #59636e;
  --fg-subtle: #818b98;

  --border: #d1d9e0;
  --border-muted: #e4e8ed;

  --accent: #0969da;
  --accent-muted: #ddf4ff;
  --marker: #1a7f37;
  --attention: #9a6700;
  --attention-line: #d4a72c;
  --attention-muted: #fff8c5;
  --danger: #cf222e;
  --danger-line: #ff818266;
  --danger-muted: #ffebe9;

  --terminal: #0d1117;
  --terminal-title: #161b22;
  --terminal-ink: #c9d1d9;

  --radius: 6px;
  --measure: 72ch;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;

  font-family: var(--font-sans);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --canvas: #0d1117;
    --canvas-subtle: #161b22;
    --canvas-inset: #010409;
    --header: #010409;
    --header-ink: #9198a1;
    --header-line: #3d444d;

    --fg: #e6edf3;
    --fg-muted: #9198a1;
    --fg-subtle: #6e7681;

    --border: #3d444d;
    --border-muted: #21262d;

    --accent: #4493f8;
    --accent-muted: #121d2f;
    --marker: #3fb950;
    --attention: #d29922;
    --attention-line: #6d4c1a;
    --attention-muted: #1f1a10;
    --danger: #f85149;
    --danger-line: #6b2b2b;
    --danger-muted: #1c1113;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #0d1117;
  --canvas-subtle: #161b22;
  --canvas-inset: #010409;
  --header: #010409;
  --header-ink: #9198a1;
  --header-line: #3d444d;

  --fg: #e6edf3;
  --fg-muted: #9198a1;
  --fg-subtle: #6e7681;

  --border: #3d444d;
  --border-muted: #21262d;

  --accent: #4493f8;
  --accent-muted: #121d2f;
  --marker: #3fb950;
  --attention: #d29922;
  --attention-line: #6d4c1a;
  --attention-muted: #1f1a10;
  --danger: #f85149;
  --danger-line: #6b2b2b;
  --danger-muted: #1c1113;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

img {
  display: block;
  max-width: 100%;
}

code,
pre {
  font-family: var(--font-mono);
}

p code,
li code,
td code,
th code,
blockquote code,
figcaption code,
dd code {
  padding: 0.2em 0.4em;
  border-radius: 6px;
  background: var(--canvas-inset);
  color: var(--fg);
  font-size: 85%;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 30;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Structural labels share the monospace utility face: the same voice the
   terminal blocks speak in. */
.kicker,
.eyebrow,
.step-label,
.card-head,
.hex-label,
.sidebar-title,
.breadcrumb,
.pager span,
.wiki-table thead th,
.toc > p {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1280px;
  min-height: 56px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand,
.nav-links,
.nav-right,
.lang-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: #1f2328;
  color: #7ee787;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.nav-links {
  gap: 16px;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  color: var(--header-ink);
  font-size: 14px;
  font-weight: 600;
}

.nav-links a:hover {
  color: #ffffff;
  text-decoration: none;
}

.nav-links a.is-current {
  color: #ffffff;
}

.nav-links a.is-current::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: #3fb950;
  content: "";
}

.nav-right {
  gap: 16px;
}

/* Two links, not a select: keyboard users can tab past without navigating. */
.lang-switch {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--header-line);
  border-radius: 6px;
}

.lang-switch a {
  padding: 5px 10px;
  border-right: 1px solid var(--header-line);
  color: var(--header-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.lang-switch a:last-child {
  border-right: 0;
}

.lang-switch a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

.lang-switch a[aria-current="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.theme-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--header-line);
  border-radius: 6px;
  background: transparent;
  color: var(--header-ink);
  cursor: pointer;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.theme-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-dark,
:root[data-theme="light"] .theme-toggle .icon-light {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-light,
:root[data-theme="light"] .theme-toggle .icon-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-light {
    display: none;
  }

  :root:not([data-theme]) .theme-toggle .icon-dark {
    display: block;
  }
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.home-main {
  max-width: 980px;
}

.home-hero {
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--border-muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border-muted);
}

.home-list {
  padding-top: 24px;
}

.kicker,
.eyebrow,
.step-label,
.hex-label,
.card-head,
.sidebar-title {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.step-label {
  color: var(--fg-subtle);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-muted);
  font-size: clamp(26px, 1.4vw + 22px, 32px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.document-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-muted);
}

.document-heading h1 {
  flex: 1 1 18rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.document-updated {
  flex: 0 0 auto;
  margin: 0;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

h2 {
  margin: 0 0 16px;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border-muted);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

h3 {
  margin: 24px 0 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.lead {
  max-width: var(--measure);
  color: var(--fg-muted);
  font-size: 17px;
}

.hero-actions,
.link-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
}

.post-card:hover {
  border-color: var(--accent);
}

.post-card h3 {
  margin: 4px 0 8px;
}

.post-card p:last-child {
  margin-bottom: 0;
}

.post-meta {
  margin-bottom: 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.post-link,
.primary-link,
.secondary-link,
.link-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas-subtle);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.post-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.primary-link {
  border-color: rgba(31, 136, 61, 0.6);
  background: #1f883d;
  color: #ffffff;
}

.primary-link:hover,
.secondary-link:hover,
.link-strip a:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.scope-panel,
.notice,
.case-card,
.callout,
.command-card,
.output-card,
.terminal-window,
.media,
.hex-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: none;
}

.scope-panel {
  overflow: hidden;
}

.scope-panel h2 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
  font-size: 14px;
  font-weight: 600;
}

.scope-panel dl {
  display: grid;
  margin: 0;
}

.scope-panel div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-muted);
}

.scope-panel div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.notice {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin: 24px 0;
  padding: 16px;
}

.notice h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 18px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.danger {
  border-color: var(--danger-line);
  background: var(--danger-muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.toc > p {
  margin: 0 0 8px;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
}

.toc a {
  display: block;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}

.toc a:hover {
  background: var(--canvas);
  color: var(--accent);
  text-decoration: none;
}

.toc a.is-active {
  border-left-color: var(--marker);
  color: var(--fg);
  font-weight: 600;
}

.article {
  min-width: 0;
  max-width: 900px;
}

.section {
  padding-top: 28px;
}

.section:first-child {
  padding-top: 4px;
}

.section > p,
.doc-article > p {
  max-width: var(--measure);
}

.case-list,
.phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.case-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--canvas-subtle);
  scroll-margin-top: 84px;
}

.case-card strong {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--accent);
  font-family: var(--font-mono);
}

.case-card p,
.callout p {
  margin-bottom: 0;
}

.callout {
  max-width: var(--measure);
  margin: 16px 0;
  padding: 14px 16px;
  border-color: var(--attention-line);
  background: var(--attention-muted);
}

.callout > strong {
  display: block;
  margin-bottom: 4px;
}

.callout.is-danger {
  border-color: var(--danger-line);
  background: var(--danger-muted);
}

.link-strip {
  margin: 14px 0 8px;
}

.article a {
  font-weight: 600;
}

.command-card,
.output-card,
.terminal-window {
  margin: 16px 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
}

.readonly {
  background: var(--canvas-subtle);
}

.copy-button {
  min-width: 64px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--canvas-subtle);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.55;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 16px;
}

/* Log and terminal panes stay on the terminal palette in both themes — in dark
   mode they sit flush with the page instead of punching a hole in it. */
.output-card pre {
  background: var(--terminal);
  color: var(--terminal-ink);
}

.log-output code {
  padding: 16px;
  white-space: normal;
}

.log-line {
  display: block;
}

.log-prefix {
  display: inline-block;
  min-width: 34px;
  margin-right: 8px;
  font-weight: 800;
}

.log-info {
  color: #d29922;
}

.log-ok {
  color: #3fb950;
}

.log-omit {
  display: grid;
  gap: 4px;
  width: max-content;
  margin: 10px 0 10px 13px;
}

.log-omit span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b949e;
  opacity: 0.9;
}

.log-callout {
  display: flex;
  width: max-content;
  margin: 10px 0;
  padding: 7px 10px;
  border: 1px solid #58a6ff;
  border-radius: 6px;
  background: rgba(56, 139, 253, 0.18);
  color: #c9d1d9;
  font-weight: 700;
}

.terminal-window {
  background: var(--terminal);
  color: var(--terminal-ink);
}

.terminal-titlebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #30363d;
  background: var(--terminal-title);
  color: #8b949e;
  font-size: 12px;
  font-weight: 600;
}

.terminal-controls {
  display: flex;
  gap: 7px;
}

.terminal-controls span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff7b72;
}

.terminal-controls span:nth-child(2) {
  background: #d29922;
}

.terminal-controls span:nth-child(3) {
  background: #3fb950;
}

.readonly-label {
  color: #8b949e;
  font-family: var(--font-mono);
  font-size: 11px;
}

.terminal-body {
  background: var(--terminal);
  color: var(--terminal-ink);
}

.terminal-body code {
  padding: 16px;
}

.prompt {
  color: #7ee787;
  font-weight: 700;
}

.dim-line {
  color: #8b949e;
}

.media {
  margin: 16px 0;
  overflow: hidden;
  background: var(--canvas);
}

.media img {
  width: 100%;
  height: auto;
  background: var(--canvas-subtle);
}

.media figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--border-muted);
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  font-size: 13px;
}

.wide img {
  max-height: 560px;
  object-fit: contain;
}

.ocdt-compare img {
  max-height: none;
  background: var(--canvas);
}

.tall {
  max-width: 720px;
}

.phone {
  align-self: start;
}

.phone img {
  max-height: 720px;
  object-fit: contain;
  background: var(--canvas-subtle);
}

.solo {
  max-width: 420px;
}

.hex-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: var(--canvas);
}

.hex-panel div {
  padding: 14px;
  border-right: 1px solid var(--border);
  background: var(--canvas-subtle);
}

.hex-panel div:last-child {
  border-right: 0;
}

.hex-panel code {
  display: block;
  margin-top: 6px;
  color: var(--fg);
  font-size: 20px;
  font-weight: 700;
}

.docs-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 196px;
  gap: 32px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.docs-sidebar,
.doc-toc {
  position: sticky;
  top: 80px;
}

.sidebar-title {
  margin: 0 0 6px;
  color: var(--fg-subtle);
  font-size: 11px;
}

.docs-nav {
  display: grid;
  gap: 2px;
  margin-bottom: 24px;
}

.docs-nav a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.45;
}

.docs-nav a:hover {
  background: var(--canvas-subtle);
  color: var(--fg);
  text-decoration: none;
}

.docs-nav a.is-current {
  border-left-color: var(--marker);
  background: var(--canvas-subtle);
  color: var(--fg);
  font-weight: 600;
}

.docs-nav.is-secondary {
  margin-bottom: 0;
}

.docs-nav.is-secondary a {
  color: var(--fg-subtle);
  font-size: 13px;
}

.docs-main {
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--fg-subtle);
  font-size: 12px;
}

.breadcrumb > * + *::before {
  margin-right: 8px;
  color: var(--border);
  content: "/";
}

.doc-article .section h2 {
  position: relative;
  scroll-margin-top: 84px;
}

/* Always rendered rather than revealed on hover: a transparent node is dropped
   from the accessibility tree, and there is no hover on a touch screen. */
.heading-copy {
  display: inline-flex;
  width: 32px;
  height: 32px;
  place-items: center;
  place-content: center;
  margin-left: 6px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--fg-subtle);
  cursor: pointer;
  vertical-align: middle;
}

.heading-copy svg {
  width: 14px;
  height: 14px;
}

.heading-copy:hover {
  border-color: var(--border);
  background: var(--canvas-subtle);
  color: var(--accent);
}

.heading-copy.is-copied,
.heading-copy.is-copied:hover {
  border-color: transparent;
  background: none;
  color: var(--marker);
}

.mobile-toc {
  display: none;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas-subtle);
}

.mobile-toc summary {
  padding: 10px 12px;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.mobile-toc[open] summary {
  border-bottom: 1px solid var(--border);
}

.mobile-toc nav {
  display: grid;
  gap: 2px;
  padding: 8px 12px 12px;
}

.mobile-toc a {
  display: block;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}

.mobile-toc a:hover,
.mobile-toc a.is-active {
  background: var(--canvas);
  color: var(--fg);
  text-decoration: none;
}

.mobile-toc a.is-active {
  border-left-color: var(--marker);
  font-weight: 600;
}

.doc-article ul,
.doc-article ol {
  max-width: var(--measure);
  margin: 0 0 16px;
  padding-left: 24px;
}

.doc-article li {
  margin-bottom: 8px;
}

.doc-article li > p {
  margin-bottom: 8px;
}

.doc-article li::marker {
  color: var(--fg-subtle);
}

.doc-article li:last-child {
  margin-bottom: 0;
}

blockquote {
  max-width: var(--measure);
  margin: 16px 0;
  padding: 2px 16px;
  border-left: 3px solid var(--border);
  color: var(--fg-muted);
}

.table-wrap {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wiki-table th,
.wiki-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-muted);
  text-align: left;
  vertical-align: top;
}

.wiki-table thead th {
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.wiki-table tbody tr:last-child td {
  border-bottom: 0;
}

.footnote {
  max-width: var(--measure);
  color: var(--fg-muted);
  font-size: 13px;
}

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.link-card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--fg);
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--canvas-subtle);
  text-decoration: none;
}

.link-card strong {
  color: var(--accent);
  font-size: 15px;
}

.link-card span {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border-muted);
}

.pager a {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
}

.pager a:hover {
  border-color: var(--accent);
  background: var(--canvas-subtle);
  text-decoration: none;
}

.pager span {
  color: var(--fg-subtle);
  font-size: 11px;
  font-weight: 600;
}

.pager strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.pager-next {
  text-align: right;
}

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  color: var(--fg-muted);
  border-top: 1px solid var(--border-muted);
  font-size: 13px;
}

.site-footer p {
  max-width: var(--measure);
  margin: 0;
}

.not-found-main {
  max-width: 720px;
  min-height: calc(100vh - 56px);
  padding-top: clamp(56px, 15vh, 144px);
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.not-found-note {
  margin-top: 24px;
  color: var(--fg-subtle);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .docs-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .doc-toc {
    display: none;
  }

  .mobile-toc {
    display: block;
  }
}

@media (pointer: coarse) {
  .theme-toggle,
  .heading-copy {
    width: 44px;
    height: 44px;
  }

  .copy-button {
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .hero,
  .content-grid,
  .notice {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article {
    max-width: none;
  }

  .docs-shell {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .docs-sidebar {
    position: static;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-muted);
  }

  .docs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
  }

  .docs-nav a {
    border: 1px solid var(--border);
    border-left-width: 2px;
    border-radius: 6px;
    background: var(--canvas-subtle);
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 16px;
  }

  .document-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .docs-shell {
    padding: 16px;
  }

  .topbar {
    gap: 10px;
    padding: 0 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .nav-right {
    gap: 10px;
  }

  h2 {
    font-size: 20px;
  }

  .lead {
    font-size: 16px;
  }

  .case-list,
  .phone-grid,
  .hex-panel,
  .post-card,
  .pager {
    grid-template-columns: 1fr;
  }

  .pager-next {
    text-align: left;
  }

  .scope-panel div {
    grid-template-columns: 1fr;
  }

  pre {
    font-size: 12px;
  }

  .notice,
  .case-card,
  .callout {
    padding: 12px;
  }
}

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