/* flashtrace website - single stylesheet, light + dark via [data-theme]. */

/* ---------- tokens ---------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --bg-raised: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --accent: #d97d0e;
  --accent-strong: #b45309;
  --accent-soft: #fdf3e3;
  --link: #b45309;
  --code-bg: #f7f6f3;
  --code-text: #292524;
  --tk-id: #b45309;
  --tk-kw: #92400e;
  --tk-arrow: #0e7490;
  --ok: #15803d;
  --no: #b91c1c;
  --info: #0e7490;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 8px 24px rgb(0 0 0 / 0.06);
  --topbar-h: 3.5rem;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #151312;
  --bg-soft: #1e1b19;
  --bg-raised: #201d1b;
  --text: #e7e5e4;
  --muted: #a8a29e;
  --border: #2e2a27;
  --accent: #f9c21d;
  --accent-strong: #fbbf24;
  --accent-soft: #2c2317;
  --link: #fbbf24;
  --code-bg: #1e1b19;
  --code-text: #d6d3d1;
  --tk-id: #f9c21d;
  --tk-kw: #e8964a;
  --tk-arrow: #56b6c2;
  --ok: #3fb950;
  --no: #f85149;
  --info: #56b6c2;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 8px 24px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

/* no-JS fallback: follow the OS preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #151312;
    --bg-soft: #1e1b19;
    --bg-raised: #201d1b;
    --text: #e7e5e4;
    --muted: #a8a29e;
    --border: #2e2a27;
    --accent: #f9c21d;
    --accent-strong: #fbbf24;
    --accent-soft: #2c2317;
    --link: #fbbf24;
    --code-bg: #1e1b19;
    --code-text: #d6d3d1;
    --tk-id: #f9c21d;
    --tk-kw: #e8964a;
    --tk-arrow: #56b6c2;
    --ok: #3fb950;
    --no: #f85149;
    --info: #56b6c2;
    color-scheme: dark;
  }
}

[data-theme='dark'] .only-light,
:root:not([data-theme='dark']) .only-dark {
  display: none;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--topbar-h) + 1rem);
}

body {
  margin: 0;
  overflow-x: clip;
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

code,
pre,
kbd {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
}

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

a:hover {
  text-decoration: underline;
}

/* Opt-in "↗" marker for external links; the arrow-worthy ones add this class
   next to EXT_ATTRS (\FE0E forces text over emoji presentation). */
.ext-mark::after {
  content: '\2197\FE0E';
  font-size: 0.75em;
  margin-left: 0.15em;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  font-weight: 650;
}

button {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #1e1e1e;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 80rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

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

.version-badge {
  font-size: 0.75rem;
  font-family: ui-monospace, Consolas, monospace;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg-soft);
}

.topbar-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.topbar-link {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-link:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.topbar-link.is-active {
  color: var(--text);
  font-weight: 600;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.sidebar-toggle {
  display: none;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  background: var(--bg-soft);
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  margin: 0;
  margin-left: auto;
}

/* ---------- landing ---------- */

.page-landing main {
  display: block;
}

.hero {
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem 1rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text) 55%, var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 1.75rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

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

.btn-primary {
  background: var(--accent);
  color: #1e1e1e;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-raised);
}

.btn-secondary:hover {
  background: var(--bg-soft);
}

/* sections */

.section {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3.5rem 1rem 0;
}

.section > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 46rem;
}

/* editor windows (hero + snippets), always dark like a real editor */

.ide-mock,
.mini-window {
  --code-bg: #1e1e1e;
  --code-text: #d4d4d4;
  --tk-id: #f9c21d;
  --tk-kw: #e8964a;
  --tk-arrow: #56b6c2;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #33302c;
  background: #1e1e1e;
  box-shadow: var(--shadow);
  color: #d4d4d4;
}

.dots {
  display: inline-flex;
  gap: 5px;
  margin-right: 0.6rem;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.dots i:nth-child(2) {
  background: #febc2e;
}

.dots i:nth-child(3) {
  background: #28c840;
}

.ide-chrome,
.mini-bar,
.term-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #161616;
  border-bottom: 1px solid #33302c;
  font-size: 0.75rem;
  color: #8b8b8b;
  font-family: ui-monospace, Consolas, monospace;
}

.ide-title {
  color: #8b8b8b;
}

.ide-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.ide-pane {
  min-width: 0;
}

.ide-pane + .ide-pane {
  border-left: 1px solid #33302c;
}

.pane-tab {
  display: inline-block;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-family: ui-monospace, Consolas, monospace;
  color: #d4d4d4;
  background: #1e1e1e;
  border-right: 1px solid #33302c;
  border-bottom: 2px solid var(--accent);
}

.ide-pane .code {
  border-top: 1px solid #33302c;
}

.code {
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
}

[data-trace] {
  outline: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 2px;
  border-radius: 2px;
  background: rgb(249 194 29 / 0.08);
}

.ide-term .term-bar {
  border-top: 1px solid #33302c;
}

.term-body {
  margin: 0;
  padding: 0.9rem 1rem;
  background: #141414;
  color: #d4d4d4;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
}

/* editor token colors */

.cmt {
  color: #6a9955;
}

.kw {
  color: #c586c0;
}

.ty {
  color: #4ec9b0;
}

.md-h {
  color: #569cd6;
  font-weight: 600;
}

.tk-id {
  color: var(--tk-id);
}

.tk-kw {
  color: var(--tk-kw);
  font-weight: 600;
}

.tk-arrow {
  color: var(--tk-arrow);
  font-weight: 600;
}

/* terminal report colors */

.t-green {
  color: #3fb950;
}

.t-red {
  color: #f85149;
}

.t-yellow {
  color: #d29922;
}

.t-cyan {
  color: #56b6c2;
}

.t-dim {
  color: #8b8b8b;
}

.t-bold {
  font-weight: 700;
}

/* how it works */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

/* grid/flex items must not let long code lines widen the page */
.step,
.feature,
.install-card,
.hero > *,
.ex-files > .mini-window,
[role='tabpanel'] {
  min-width: 0;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.step-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

.step p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.9rem;
  min-height: 4.5em;
}

/* features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.feature {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  background: var(--bg-raised);
}

.feature h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* examples */

[role='tablist'] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

[role='tab'] {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

[role='tab']:hover {
  color: var(--text);
}

[role='tab'][aria-selected='true'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}

.example-tabs > [role='tabpanel'] {
  margin-top: 1.25rem;
}

.ex-blurb {
  color: var(--muted);
  max-width: 46rem;
  margin: 0 0 1rem;
}

.io-tabs [role='tablist'] {
  margin-bottom: 0.9rem;
}

.io-tabs [role='tab'] {
  border-radius: 6px;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
}

.ex-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

/* install */

.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.install-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  background: var(--bg-raised);
}

.install-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.install-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.9rem 0 0.75rem;
}

.cmd-block {
  position: relative;
  border-radius: 8px;
  background: #1e1e1e;
  border: 1px solid #33302c;
}

.cmd-block pre {
  margin: 0;
  padding: 0.8rem 5rem 0.8rem 1rem;
  color: #d4d4d4;
  font-size: 0.85rem;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid #44403c;
  background: #2a2724;
  color: #d4d4d4;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
}

.copy-btn.is-copied {
  color: #3fb950;
  border-color: #3fb950;
}

/* ---------- docs ---------- */

.doc-layout {
  max-width: 90rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr) 14rem;
  gap: 2rem;
  padding: 0 1rem;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 1.5rem 0.5rem 2rem 0;
  border-right: 1px solid var(--border);
}

.nav-group + .nav-group {
  margin-top: 1.5rem;
}

.nav-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.4rem 0.75rem;
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-group a {
  display: block;
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-group a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

.nav-group a.is-current {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 600;
}

.sidebar-backdrop {
  display: none;
}

.doc-main {
  padding: 2rem 0 3rem;
  min-width: 0;
}

.doc-content {
  max-width: 46rem;
}

.doc-content h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.doc-content h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
}

.doc-content h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

.heading-anchor {
  margin-left: 0.4rem;
  color: var(--muted);
  opacity: 0;
  font-weight: 400;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.doc-content p,
.doc-content li {
  color: var(--text);
}

.doc-content li + li {
  margin-top: 0.25rem;
}

.doc-content pre {
  position: relative;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--code-text);
}

.doc-content :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  font-size: 0.85em;
}

.doc-content table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.doc-content th,
.doc-content td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: var(--bg-soft);
}

.doc-content blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  color: var(--muted);
}

/* reveal-on-hover only where hover exists; touch devices get a
   permanently visible button, as there is no way to discover it otherwise */
@media (hover: hover) {
  .doc-content pre .copy-btn {
    opacity: 0;
  }

  .doc-content pre:hover .copy-btn,
  .doc-content pre .copy-btn:focus-visible {
    opacity: 1;
  }
}

/* right rail */

.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 2rem 0 2rem 0.5rem;
  font-size: 0.85rem;
}

.toc-label {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.toc ul {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

/* Rail marker that flows to span the sections currently on screen. */
.toc-flow {
  position: absolute;
  left: -1px;
  width: 2px;
  top: 0;
  height: 0;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toc li a {
  display: block;
  padding: 0.2rem 0 0.2rem 0.75rem;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1.5px;
}

.toc li.toc-l3 a {
  padding-left: 1.5rem;
}

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

.toc li a.is-active {
  color: var(--accent-strong);
}

/* ---------- legal notice ---------- */

.page-legal .section {
  padding-bottom: 3.5rem;
}

.page-legal .doc-content {
  margin-inline: auto;
}

.legal address {
  font-style: normal;
  line-height: 1.7;
  color: var(--text);
}

/* license: the tool repo's raw LICENSE text. Shrink-wrap the block and center
   it so the text's own space-centered header reads as intended. */
.license-doc {
  max-width: 52rem;
}

.license-doc h1 {
  text-align: center;
}

.license-doc pre {
  width: fit-content;
  max-width: 100%;
  margin: 1.75rem auto 0;
  padding: 2rem 2.5rem;
  font-size: 0.9rem;
}

/* GitHub-style summary panel above the raw license text */
.license-summary {
  margin-top: 1.75rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  box-shadow: var(--shadow);
}

.license-summary-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.license-summary-kicker {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.license-summary-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}

.license-summary-desc {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.license-summary-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.license-col-label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.license-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.license-col li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.85rem;
}

.license-col li svg {
  flex-shrink: 0;
}

.lic-ok svg {
  color: var(--ok);
}

.lic-no svg {
  color: var(--no);
}

.lic-info svg {
  color: var(--info);
}

.license-summary-note {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* labeled divider between the summary panel and the raw text */
.license-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.license-divider::before,
.license-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .license-summary-cols {
    grid-template-columns: 1fr;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .toc {
    display: none;
  }

  .doc-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step p {
    min-height: 0;
  }
}

@media (max-width: 860px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    inset: var(--topbar-h) auto 0 0;
    z-index: 50;
    width: min(18rem, 85vw);
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem 2rem;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 45;
    background: rgb(0 0 0 / 0.4);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }
}

@media (max-width: 700px) {
  .ide-panes {
    grid-template-columns: 1fr;
  }

  .ide-pane + .ide-pane {
    border-left: none;
    border-top: 1px solid #33302c;
  }

  .topbar-nav .topbar-link[href='/'] {
    display: none;
  }
}
