/* KUMODeck Game Studio docs — built by scripts/build-docs.mjs */
:root {
  --bg: #fbfbfa; --card: #fff; --sunk: #f3f2ef; --text: #18181b; --text-2: #6b6b70; --line: rgba(0,0,0,.08);
  --accent: #ff6a2b; --link: #c4470f; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.08); color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1a1a1c; --sunk: #19191b; --text: #f2f2f3; --text-2: #9d9da3; --line: rgba(255,255,255,.09);
    --link: #ff8a55; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.45); }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 16px; z-index: 10; background: var(--card); padding: 6px 12px; border-radius: 8px; }

header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
/* 60 px with 6 px on top: the brand clears the "Test" chip KUMODeck's test version keeps at the top-left (4 px in, 16 px
   high), as the front page's header does. */
.bar { max-width: 1240px; margin: 0 auto; padding: 6px 24px 0; height: 60px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.brand img { width: 22px; height: 22px; display: block; }
.sep { color: var(--text-2); opacity: .6; }
.section { color: var(--text); font-weight: 500; }
.grow { flex: 1; }
.lang, .gh { color: var(--text-2); }
.lang:hover, .gh:hover { color: var(--text); text-decoration: none; }
.gh { margin-left: 14px; }

.layout { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 200px minmax(0, 720px) 200px; gap: 48px; justify-content: space-between; }
.side, .toc { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 32px 0; font-size: 14px; }
.pages summary { list-style: none; display: none; }
.pages summary::-webkit-details-marker { display: none; }
.pages ol, .toc ol { list-style: none; margin: 0; padding: 0; }
.pages li a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: 8px; color: var(--text-2); }
.pages li a:hover { color: var(--text); background: var(--sunk); text-decoration: none; }
.pages li a[aria-current] { color: var(--text); background: var(--sunk); font-weight: 600; }
.toc p { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.toc li a { display: block; padding: 4px 0; color: var(--text-2); line-height: 1.4; }
.toc li a:hover { color: var(--text); text-decoration: none; }

main { padding: 40px 0 0; min-width: 0; }
article { font-size: 16px; }
article h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.025em; font-weight: 650; margin: 0 0 16px; text-wrap: balance; }
article h1 + p { font-size: 18px; color: var(--text-2); margin-top: 0; text-wrap: pretty; }
article h2 { font-size: 24px; letter-spacing: -.01em; font-weight: 600; margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--line); line-height: 1.25; }
article h3 { font-size: 17px; font-weight: 600; margin: 32px 0 8px; line-height: 1.35; }
article h4 { font-size: 15px; font-weight: 600; margin: 24px 0 4px; }
article h2, article h3 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--text-2); opacity: 0; font-weight: 400; padding-right: 6px; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: .7; text-decoration: none; }
article p, article li { text-wrap: pretty; }
article ul, article ol { padding-left: 22px; }
article li { margin: 4px 0; }
article li::marker { color: var(--text-2); }
article strong { font-weight: 600; }
code { font: .88em/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
kbd { display: inline-block; min-width: 1.6em; text-align: center; font: 600 .82em/1.5 system-ui, sans-serif; padding: 0 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); white-space: nowrap; }
.code { position: relative; margin: 16px 0; }
.code pre { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow-x: auto; }
.code pre code { background: none; border: 0; padding: 0; font-size: 13px; white-space: pre; overflow-wrap: normal; }
.code button { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); font: 600 12px system-ui, sans-serif; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.code button.done { color: var(--accent); }
figure { margin: 24px 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--sunk); }
figure img[src$=".svg"] { box-shadow: none; background: var(--card); }
figcaption { margin-top: 10px; font-size: 13px; color: var(--text-2); text-align: center; text-wrap: balance; }
blockquote { margin: 20px 0; padding: 12px 16px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); font-size: 15px; }
blockquote p { margin: 4px 0; }
.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--sunk); }
tr:last-child td { border-bottom: 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 64px 0 0; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font-weight: 600; }
.pager a:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration: none; }
.pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }
.pager .next { text-align: right; grid-column: 2; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 40px; padding: 24px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.foot a { color: var(--text-2); }
.foot a:hover { color: var(--text); }

/* A laptop: no "On this page" column. */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); gap: 40px; }
  .toc { display: none; }
}
/* A phone (the front page's line, 768): one column; the page list folds into one row under the bar. */
@media (max-width: 767.98px) {
  html { scroll-padding-top: 116px; }
  .bar { padding: 6px 16px 0; gap: 8px; }
  .gh { margin-left: 6px; }
  .layout { display: block; padding: 0 16px; }
  .side { position: sticky; top: 60px; z-index: 4; padding: 0; max-height: none; overflow: visible; margin: 0 -16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .pages summary { display: flex; gap: 8px; align-items: center; padding: 12px 16px; font-weight: 600; cursor: pointer; }
  .pages summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) translateY(-3px); }
  .pages[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
  .pages .here { font-weight: 400; color: var(--text-2); }
  .pages .here::before { content: "·"; margin-right: 8px; }
  .pages ol { padding: 0 16px 12px; }
  .pages li a { margin-left: 0; padding: 10px 12px; }
  main { padding-top: 24px; }
  article h1 { font-size: 30px; }
  article h1 + p { font-size: 17px; }
  article h2 { font-size: 21px; margin-top: 44px; }
  .anchor { display: none; }
  figure { margin: 20px 0; }
  figure img { border-radius: 10px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
