/* Single source of truth for colors + layout tokens.
   Colors: docs/13-design-system.md (extracted from logo.png). Layout: docs/14-responsive-design.md. */

:root {
  --bg: #fffbf2;
  --surface: #ffffff;
  --surface-2: #fff1d6;
  --border: #f0ddbb;
  --text: #370b1f;
  --text-muted: #6b3a47;
  --text-subtle: #8a5a63;
  --primary: #f8af3a;
  --primary-hover: #e38a36;
  --on-primary: #370b1f;
  --accent: #a8460f;
  --highlight: #fde189;
  --ring: #e38a36;
  --buy: #15803d;
  --on-buy: #ffffff;
  --sell: #c2253a;
  --on-sell: #ffffff;
  --warning: #b45309;
  --gradient-brand: linear-gradient(90deg, #fde189 0%, #f8af3a 40%, #e38a36 75%, #d0661f 100%);
  --shadow: 0 1px 2px rgb(55 11 31 / 0.08);
  color-scheme: light;

  /* layout tokens */
  --gutter: 12px;
  --gap: 12px;
  --header-h: 56px;
  --bottom-nav-h: 58px;
  --action-bar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 480px) {
  :root {
    --gutter: 16px;
    --gap: 14px;
  }
}
@media (min-width: 900px) {
  :root {
    --gutter: 24px;
    --gap: 20px;
    --header-h: 64px;
  }
}

/* "system" mode: no data-theme attribute, follow the OS */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #16070e;
    --surface: #220d17;
    --surface-2: #2e1220;
    --border: #44192c;
    --text: #fff4e0;
    --text-muted: #d9b8a8;
    --text-subtle: #b08f86;
    --primary-hover: #fdd465;
    --accent: #f8af3a;
    --ring: #f8af3a;
    --buy: #22c55e;
    --on-buy: #16070e;
    --sell: #f43f5e;
    --on-sell: #16070e;
    --warning: #fdd465;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #16070e;
  --surface: #220d17;
  --surface-2: #2e1220;
  --border: #44192c;
  --text: #fff4e0;
  --text-muted: #d9b8a8;
  --text-subtle: #b08f86;
  --primary-hover: #fdd465;
  --accent: #f8af3a;
  --ring: #f8af3a;
  --buy: #22c55e;
  --on-buy: #16070e;
  --sell: #f43f5e;
  --on-sell: #16070e;
  --warning: #fdd465;
  --shadow: none;
  color-scheme: dark;
}

/* PoffertSwap docs. The colors, spacing and breakpoints come from the app's tokens.css, which the build puts in front of
   this file: change a color there and the docs follow. No raw color values here (docs/13). GitBook-style layout.
   Breakpoints (docs/14): 480 / 900 / 1180 / 1600. */

:root {
  --sidebar-w: 288px;
  --toc-w: 232px;
  --content-w: 760px;
  --radius: 12px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fredoka', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --scrim: rgb(0 0 0 / 0.55);
}
@media (min-width: 1600px) {
  :root {
    --content-w: 820px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden; /* a safety net only: nothing is allowed to be wider than the screen */
}
body.nav-open {
  overflow: hidden;
}
img,
svg {
  max-width: 100%;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 6px;
  color: var(--text-subtle);
  background: var(--surface);
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.skip:focus {
  top: 8px;
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-space {
  flex: 1;
}
.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--text);
}
.icon-btn:hover {
  background: var(--surface-2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brand img {
  border-radius: 8px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand-name span {
  color: var(--accent);
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
@media (max-width: 379px) {
  .brand-name {
    display: none;
  }
}
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  color: var(--text-muted);
}
.search-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}
.search-label,
.search-btn kbd {
  display: none;
}
.theme {
  display: none;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
}
.theme button,
.tools-theme button {
  width: 36px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
}
.theme button:hover,
.tools-theme button:hover {
  color: var(--text);
  background: var(--surface-2);
}
.theme button[aria-pressed='true'],
.tools-theme button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--on-primary);
}
.app-link {
  display: none;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.app-link:hover {
  background: var(--primary-hover);
}

/* ---------------------------------------------------------------- shell + sidebar */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1760px;
  margin: 0 auto;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
}
.scrim[hidden] {
  display: none;
}
.sidebar {
  position: fixed;
  z-index: 60;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(88vw, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px var(--gutter) calc(32px + var(--safe-b));
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  visibility: hidden;
  transition:
    transform 0.2s ease,
    visibility 0s linear 0.2s;
}
body.nav-open .sidebar {
  transform: none;
  visibility: visible;
  transition: transform 0.2s ease;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}
.nav-group {
  margin-bottom: 22px;
}
.nav-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-group a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
}
.nav-group a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-group a[aria-current='page'] {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-tools {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.tools-theme {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
}
.tools-theme button {
  width: 44px;
  height: 40px;
}
.sidebar-tools .app-link {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

/* ---------------------------------------------------------------- main column */
.main {
  min-width: 0;
  padding: 24px var(--gutter) 0;
}
.main:focus {
  outline: none;
}
.doc {
  max-width: var(--content-w);
  margin: 0 auto;
}
.crumb {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.doc h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.4rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.lead {
  margin: 0 0 20px;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.toc-inline {
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.toc-inline summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.toc-inline ul {
  list-style: none;
  margin: 0;
  padding: 0 14px 12px;
}
.toc-inline li a {
  display: block;
  padding: 6px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.toc-inline li.toc-l3 {
  padding-left: 14px;
}

/* ---------------------------------------------------------------- prose */
.prose {
  overflow-wrap: break-word;
  min-width: 0;
}
.prose > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose dl {
  margin: 0 0 1.1em;
}
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  line-height: 1.3;
}
.prose h2 {
  margin: 2.4em 0 0.7em;
  padding-top: 0.2em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
}
.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.15rem;
  font-weight: 600;
}
.prose h4 {
  margin: 1.5em 0 0.4em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}
.anchor {
  margin-left: 0.45em;
  color: var(--text-subtle);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
}
h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .anchor {
    display: none;
  }
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin: 0.4em 0;
}
.prose li > ul,
.prose li > ol {
  margin: 0.4em 0 0.2em;
}
.prose strong {
  font-weight: 600;
}
.prose hr {
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.prose blockquote:not(.callout) {
  margin: 1.2em 0;
  padding: 2px 16px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.code {
  margin: 1.2em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-subtle);
}
.copy {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.copy:hover {
  color: var(--text);
  border-color: var(--primary);
}
.copy.done {
  color: var(--buy);
  border-color: var(--buy);
}
.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.code pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.84rem;
  line-height: 1.65;
  overflow-wrap: normal;
  white-space: pre;
}
.table-wrap {
  margin: 1.3em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}
.table-wrap th,
.table-wrap td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.table-wrap th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}
.table-wrap tr:last-child td {
  border-bottom: 0;
}
.table-wrap .ta-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-wrap .ta-center {
  text-align: center;
}
.table-wrap td:first-child {
  font-weight: 500;
}

/* callouts */
.callout {
  --c: var(--primary);
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
}
.callout-tip {
  --c: var(--buy);
}
.callout-important {
  --c: var(--accent);
}
.callout-warning {
  --c: var(--warning);
}
.callout-danger {
  --c: var(--sell);
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.92rem;
}
.callout-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.callout-body > :last-child {
  margin-bottom: 0;
}
.callout-body p {
  margin: 0 0 0.6em;
}

/* figures */
.figure {
  margin: 1.6em 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.figure figcaption {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--text-subtle);
}
.fig-svg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
}
.fig-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fig-area {
  fill: var(--primary);
  opacity: 0.16;
  stroke: none;
}
.fig-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.fig-label {
  fill: var(--text-subtle);
  font: 16px var(--font-body);
}
.fig-note {
  fill: var(--text);
  font: 600 17px var(--font-body);
}
.fig-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2.5;
}

/* home + step lists */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  margin: 1.2em 0 1.6em;
}
.card-link {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.card-link:hover {
  border-color: var(--primary);
}
.card-link strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}
.card-link span {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.hero {
  margin: 0 0 1.4em;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--highlight) 28%, var(--surface)), var(--surface));
}
.hero p {
  margin: 0 0 0.8em;
  font-size: 1.1rem;
}
.hero p:last-child {
  margin-bottom: 0;
}
ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0 0 0.9em;
  padding-left: 46px;
  min-height: 34px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 0.92rem;
}
.flow {
  display: grid;
  gap: 8px;
  margin: 1.2em 0;
  padding: 0;
  list-style: none;
}
.flow li {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.flow li strong {
  display: block;
}
@media (min-width: 900px) {
  .flow {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* previous / next */
.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 3em 0 0;
}
.pager-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.pager-card:hover {
  border-color: var(--primary);
}
.pager-next {
  text-align: right;
}
.pager-dir {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.pager-title {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.site-footer {
  max-width: var(--content-w);
  margin: 3em auto 0;
  padding: 20px 0 calc(32px + var(--safe-b));
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-subtle);
}
.site-footer p {
  margin: 0 0 6px;
}

/* ---------------------------------------------------------------- right-hand "on this page" */
.toc {
  display: none;
}
.toc-title {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 12px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.4;
}
.toc li.toc-l3 a {
  padding-left: 24px;
}
.toc a:hover {
  color: var(--text);
}
.toc a.active {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--primary);
}

/* ---------------------------------------------------------------- search dialog */
.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 8px var(--gutter);
  background: var(--scrim);
}
.search-dialog[hidden] {
  display: none;
}
.search-panel {
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - 16px);
  display: flex;
  flex-direction: column;
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  overflow: hidden;
}
.search-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-subtle);
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming the page */
}
.search-input:focus {
  outline: none;
}
.search-close {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.search-results a:hover,
.search-results a[aria-selected='true'] {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}
.sr-page {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.sr-title {
  display: block;
  font-weight: 600;
}
.sr-snippet {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.search-results mark {
  background: var(--highlight);
  color: var(--on-primary);
  border-radius: 3px;
  padding: 0 1px;
}
.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}
.search-hint {
  display: none;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* ---------------------------------------------------------------- wider screens */
@media (min-width: 480px) {
  .search-label {
    display: inline;
  }
  .pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search-dialog {
    padding-top: 10dvh;
  }
  .search-panel {
    max-height: 76dvh;
  }
  .search-hint {
    display: flex;
  }
}
@media (min-width: 900px) {
  .menu-btn,
  .sidebar-head,
  .sidebar-tools,
  .scrim {
    display: none;
  }
  .theme,
  .app-link {
    display: inline-flex;
  }
  .search-btn {
    min-width: 220px;
    justify-content: flex-start;
    min-height: 40px;
  }
  .search-btn kbd {
    display: inline;
    margin-left: auto;
  }
  .topbar-space {
    flex: 1;
  }
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .sidebar {
    align-self: start;
    position: sticky;
    top: var(--header-h);
    z-index: 1;
    width: auto;
    height: calc(100dvh - var(--header-h));
    padding-top: 24px;
    transform: none;
    visibility: visible;
  }
  .nav-group a {
    min-height: 38px;
    padding: 5px 10px;
  }
  .main {
    padding-top: 36px;
  }
  .search-btn {
    margin-right: 4px;
  }
}
@media (min-width: 1180px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  }
  .toc {
    display: block;
    position: sticky;
    top: var(--header-h);
    align-self: start;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 36px var(--gutter) 32px 0;
  }
  .toc-inline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .scrim,
  .copy {
    display: none !important;
  }
  .shell {
    display: block;
  }
}
