:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #1b2930;
  background: #f3f6f5;
  --ink: #14272b;
  --muted: #4b6066;
  --line: #d6e0df;
  --accent: #08604f;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner, .identity, .result-heading, .stack-heading, .actions {
  display: flex; align-items: center;
}
.header-inner { min-height: 4rem; justify-content: space-between; gap: 1rem; }
.identity { gap: .7rem; font-weight: 700; font-size: .9rem; color: var(--ink); text-decoration: none; }
.header-inner nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem 1.25rem; font-size: .9rem; }
.mark {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: .45rem; background: var(--ink); color: #dcfbec;
  font: 700 .8rem var(--mono);
}
a { color: var(--accent); text-underline-offset: .2em; }
.intro { padding-block: clamp(2rem, 6vw, 4rem) 1.85rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.75rem); line-height: 1.05; letter-spacing: -.055em; color: var(--ink); }
.intro p { margin-top: .85rem; color: var(--muted); max-width: 45rem; line-height: 1.55; }
.intro p + p { margin-top: .5rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 1rem; }
.panel {
  display: flex; flex-direction: column; min-width: 0; gap: 1rem; padding: 1.2rem;
  background: #fff; border: 1px solid var(--line); border-radius: .85rem;
}
h2 { font-size: 1.12rem; letter-spacing: -.02em; }
h3 { font-size: .92rem; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, .46fr); gap: .65rem; }
.controls label { display: grid; gap: .35rem; min-width: 0; font-size: .875rem; font-weight: 600; }
select, textarea, button { font: inherit; }
select {
  appearance: none; min-width: 0; width: 100%; min-height: 2.75rem;
  border: 1px solid #bccdcc; border-radius: .4rem;
  padding: .4rem 1.9rem .4rem .65rem; background-color: #f7faf9; color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right .88rem center, right .62rem center;
  background-size: .27rem .27rem; background-repeat: no-repeat;
}
textarea {
  width: 100%; min-height: 17.5rem; flex: 1; resize: vertical;
  border: 1px solid #30484b; border-radius: .5rem; padding: .95rem;
  background: #16282b; color: #e4f5ed; font: 1rem/1.65 var(--mono);
  caret-color: #b0f0d8;
}
textarea::placeholder { color: #b5c9c4; }
.actions, .result-heading, .stack-heading { justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
button {
  min-height: 2.75rem; padding: .45rem 1.1rem; border: 1px solid transparent;
  border-radius: .4rem; background: var(--accent); color: white; font-weight: 700; cursor: pointer;
}
button:hover { background: #064e40; }
:focus-visible { outline: 2px solid #147764; outline-offset: 3px; }
.shortcut, .footnote, .stack-heading span, #status, #example-hint, .result-note { color: var(--muted); font-size: .875rem; }
.scope-help { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; font-size: .875rem; }
#example-hint { flex: 1 1 100%; margin: 0; line-height: 1.4; }
kbd { font-family: var(--mono); }
.result-block { display: grid; gap: .5rem; min-width: 0; }
pre {
  min-height: 6rem; max-height: 17rem; overflow: auto; margin: 0; padding: .8rem;
  border: 1px solid #dfe8e4; border-radius: .45rem; background: #f5f8f7;
  font: .875rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
#output { min-height: 10rem; }
.notice {
  padding: .65rem .8rem; background: #fff1ed; border: 1px solid #edc9bd;
  color: #862f20; border-radius: .45rem; overflow-wrap: anywhere;
}
.guide {
  margin-top: 1.5rem; padding: clamp(1rem, 3vw, 1.7rem);
  border: 1px solid var(--line); border-radius: .85rem; background: #fff;
  line-height: 1.6;
}
.guide h2 { font-size: 1.35rem; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2.5rem; margin-top: .85rem; }
.guide h3 { font-size: 1rem; }
.guide p { margin-top: .45rem; }
.guide code { font-family: var(--mono); color: var(--accent); }
.guide dl { margin: .65rem 0 0; }
.guide dt { font-weight: 700; }
.guide dd { margin: 0 0 .45rem; }
.guide-detail { margin: 1rem 0; padding-top: .85rem; border-top: 1px solid var(--line); }
.guide p.guide-detail { margin: 1rem 0 0; }
.guide .syntax-key { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1rem; }
.guide .syntax-key dd { margin-bottom: 0; }
.guide ol { margin-block: .55rem; padding-inline-start: 1.4rem; }
.guide li + li { margin-top: .3rem; }
.footnote { padding-block: 1.15rem 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.repository-link { display: inline-flex; align-items: center; gap: .4rem; }
.repository-link svg { width: 1rem; height: 1rem; fill: currentColor; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
@media (max-width: 46rem) {
  .shell { width: calc(100% - 1.5rem); }
  .workspace, .guide-grid { grid-template-columns: 1fr; }
  .panel { padding: .9rem; }
  textarea { min-height: 13rem; }
  .shortcut { display: none; }
}

.lookup-figure, .stack-figure {
  margin: 1rem 0;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #f7faf9;
}
.lookup-figure figcaption, .stack-figure figcaption {
  margin-bottom: .65rem;
  font-weight: 700;
}
.lookup-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.lookup-paths p, .stack-figure div { margin: 0; padding: .65rem; background: #fff; border-radius: .4rem; }
.stack-figure { display: grid; gap: .45rem; }
.stack-figure div { display: flex; align-items: center; gap: 1rem; }
.stack-figure div code { min-width: 4rem; padding: .35rem; text-align: center; background: #eaf2ef; border-radius: .3rem; }
.stack-figure span { color: var(--muted); }
@media (max-width: 46rem) {
  .lookup-paths { grid-template-columns: 1fr; }
}
