:root {
  color-scheme: light;
  font-family: system-ui, "Hiragino Sans", Meiryo, sans-serif;
  color: #172920;
  background: #fff;
  --muted: #526458;
  --line: #d9e5dc;
  --accent: #176645;
  --accent-dark: #104b31;
  --subtle: #f4f8f5;
  --mono: ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; }
body { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: clamp(1.9rem, 3.9vw, 3.55rem); font-weight: 780; letter-spacing: -.05em; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0; color: var(--muted); line-height: 1.65; }
a { color: var(--accent); font-weight: 650; text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
code { font-family: var(--mono); }
p code, .api-list code { color: var(--accent-dark); overflow-wrap: anywhere; }
.container { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.site-nav { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); }
.nav-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.nav-inner { min-height: 61px; padding-block: 9px; }
.brand { color: inherit; font-size: 1.15rem; font-weight: 780; text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 9px clamp(12px, 2.5vw, 28px); padding: 0; margin: 0; list-style: none; }
.nav-links a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.nav-links a:hover { color: var(--accent); text-decoration: underline; }
.hero { border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 8% 3%, #d7f0df, transparent 72%), #f5faf6; }
.hero-inner, .docs-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4.5vw, 64px); }
.hero-inner { align-items: center; padding-block: clamp(38px, 6.5vw, 86px); }
.hero p { max-width: 30em; margin-top: 18px; font-size: clamp(.95rem, 1.75vw, 1.075rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.action { display: inline-flex; align-items: center; min-height: 43px; padding: 8px 15px; border: 1px solid #a8beb0; border-radius: 7px; background: #fff; text-decoration: none; }
.action:hover { background: #eef7f1; }
.action.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.action.primary:hover { background: var(--accent-dark); }
.code-block { max-width: 100%; margin: 0; padding: 15px 17px; overflow: auto; border: 1px solid #2e4c3d; border-radius: 11px; background: #15291f; color: #edf7ee; font: .85rem/1.65 var(--mono); tab-size: 2; }
.hero .code-block { padding: clamp(15px, 2.4vw, 26px); box-shadow: 0 12px 25px #193e2624; }
.code-keyword { color: #a4e9b8; }
.code-string { color: #f1dca4; }
.page-section { padding-block: clamp(34px, 5vw, 62px); }
.page-section.tinted { background: var(--subtle); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 22px; }
.section-head p { max-width: 63ch; margin-top: 8px; }
.docs-grid .section-head { margin-bottom: 0; }
.docs-grid .section-head p + p { margin-top: 12px; }
.code-stack { display: grid; min-width: 0; gap: 8px; }
.code-stack h3:not(:first-child) { margin-top: 10px; }
.api-list { margin: 0; border-top: 1px solid var(--line); }
.api-list > div { display: grid; grid-template-columns: minmax(0, .76fr) minmax(0, 1fr); gap: 8px 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.api-list dt { font-weight: 680; }
.api-list dd { white-space: normal; color: var(--muted); line-height: 1.55; }
.section-link { margin-top: 17px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; }
.related-card { display: flex; flex-direction: column; gap: 7px; }
.related-card p { font-size: .9rem; }
.related-links { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: auto; padding-top: 5px; font-size: .9rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--subtle); }
.footer-inner { padding-block: 19px; color: var(--muted); font-size: .87rem; }
.workspace { display: grid; grid-template-columns: minmax(295px, 398px) minmax(0, 1fr); align-items: start; gap: 18px; }
.forms { display: grid; gap: 14px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.workspace .panel { box-shadow: 0 4px 14px #14341f0a; }
.heading, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.heading { margin-bottom: 15px; }
.state { flex-shrink: 0; padding: 4px 9px; border-radius: 5px; background: #edf3ed; color: #364e3e; font-size: .75rem; font-weight: 700; }
.state[data-active="true"] { color: #744322; background: #faecd8; }
label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 650; }
textarea, input[type="search"] { display: block; width: 100%; border: 1px solid #acbdb0; border-radius: 8px; padding: 11px 12px; color: inherit; background: #fff; font: inherit; }
textarea { resize: vertical; min-height: 82px; }
textarea::placeholder, input::placeholder { color: #65766b; }
:focus-visible { outline: 3px solid #358563; outline-offset: 3px; }
.actions { margin-top: 11px; }
.actions p, .trace p { font-size: .82rem; }
button { flex-shrink: 0; min-height: 38px; border: 1px solid var(--accent); border-radius: 7px; padding: 6px 14px; background: var(--accent); color: #fff; font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; }
button:hover { background: var(--accent-dark); }
button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover { background: #eef7f1; }
.preview dl { display: grid; gap: 8px; margin: 14px 0; }
.preview dl div { display: grid; grid-template-columns: 86px 1fr; gap: 8px; font-size: .86rem; }
dt { color: var(--muted); }
dd { min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#submit-status { border-top: 1px solid var(--line); padding-top: 10px; font-size: .85rem; }
.toggle { display: flex; align-items: center; gap: 6px; width: fit-content; margin-bottom: 7px; }
.toggle input { accent-color: var(--accent); }
.table-scroll { height: clamp(318px, 64vh, 575px); margin-top: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fdfefd; }
table { border-collapse: collapse; width: 100%; min-width: 450px; text-align: left; font-size: .78rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: #eaf1eb; color: #394e40; }
td:first-child { font-variant-numeric: tabular-nums; color: var(--muted); }
td:nth-child(2) { font-family: var(--mono); }
tr[data-kind="result"] { color: #174b32; background: #edf7f0; }
#empty { margin: 15px; }

@media (max-width: 820px) {
  .container { width: calc(100% - 40px); }
  .hero-inner, .docs-grid, .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 5.2rem; }
  .container { width: calc(100% - 32px); }
  .nav-inner { align-items: start; flex-direction: column; gap: 5px; }
  .nav-links a { font-size: .82rem; }
  .hero .code-block { white-space: pre-wrap; overflow-wrap: anywhere; }
  .api-list > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .panel { padding: 15px; }
  table { width: 100%; min-width: 0; table-layout: fixed; }
  th, td { padding: 8px 5px; white-space: normal; overflow-wrap: anywhere; }
  th:nth-child(1) { width: 52px; }
  th:nth-child(2) { width: 98px; }
  th:nth-child(3) { width: 58px; }
}
