@font-face {
  font-family: LabMono;
  src: url('/assets/fonts/FiraCode-Regular.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0c1118;
  --panel: #101922;
  --surface: #15212c;
  --border: #273745;
  --ink: #e4edf5;
  --muted: #91a4b7;
  --accent: #b1ed80;
  --cyan: #7ad8ed;
  --mono: LabMono, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--sans);
  min-width: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
select,
textarea {
  font: inherit;
}
button,
select {
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
textarea:focus-visible,
pre:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.skip-link {
  position: absolute;
  top: -90px;
  left: 20px;
  z-index: 50;
  background: var(--accent);
  color: var(--bg);
  padding: 10px;
}
.skip-link:focus {
  top: 10px;
}
.lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px clamp(8px, 1.4vw, 20px);
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}
.lab-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 550 15px/1.25 var(--mono);
  letter-spacing: -0.6px;
}
.lab-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  width: 28px;
  height: 28px;
}
.lab-brand small {
  display: block;
  color: var(--muted);
  font: 10px/1.6 var(--sans);
  letter-spacing: 0.3px;
  margin-top: 0;
}
.lab-header nav {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
}
.lab-header nav a:hover {
  color: var(--accent);
}
.blog-link {
  border-left: 1px solid var(--border);
  padding-left: 12px;
}
.lab-main {
  padding: 5px clamp(8px, 1.4vw, 20px) 12px;
  max-width: 1800px;
  margin: auto;
}
.lab-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lab-help {
  position: relative;
  margin-inline-start: 8px;
  font: 11px var(--sans);
  color: var(--ink);
  z-index: 20;
}
.lab-help summary {
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  list-style: none;
  white-space: nowrap;
}
.lab-help summary::-webkit-details-marker {
  display: none;
}
.lab-help summary > span {
  color: var(--cyan);
  border: 1px solid var(--border);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  text-align: center;
  line-height: 14px;
}
.lab-help > div {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  width: min(350px, calc(100vw - 24px));
  padding: 12px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 12px 25px #0005;
}
.lab-help ol {
  padding-left: 18px;
  margin: 0 0 8px;
}
.lab-help li {
  padding-bottom: 4px;
}
.lab-help p {
  color: var(--muted);
  font-size: 10px;
}
.lab-help kbd {
  font: 9px var(--mono);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 5px;
}
.lab-toolbar {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  padding: 3px 0;
  background: var(--bg);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.example-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.example-control label {
  font-size: 10px;
  color: var(--muted);
}
select {
  max-width: 340px;
  min-width: 210px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 11px var(--mono);
  padding: 9px 30px 9px 12px;
}
.execution-controls {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}
button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 8px 13px;
  font-size: 11px;
  line-height: 1.5;
}
button:hover:not(:disabled) {
  border-color: var(--muted);
}
.execution-controls button {
  min-height: 28px;
  padding: 4px 8px;
}

button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 650;
  min-width: 90px;
}
#stepButton:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #355d2b;
}
.implementation-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
}
.implementation-switch button {
  min-height: 28px;
  padding: 4px 8px;
}
.execution-controls button:not(.primary),
.implementation-switch button,
.lab-help summary {
  background: transparent;
  border-color: transparent;
}

.execution-controls button:not(.primary):hover:not(:disabled),
.implementation-switch button:hover,
.lab-help summary:hover {
  background: var(--surface);
  border-color: transparent;
}

.implementation-switch button[aria-pressed='true'] {
  color: var(--accent);
  background: #1d2a23;
}

.test-input-control,
.include-view-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.include-view-control input {
  accent-color: var(--accent);
}
.test-input-control select {
  min-width: 0;
  padding: 5px;
  color: var(--ink);
}
.session-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  font: 9px var(--mono);
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
[data-mode='ready'] .status-dot,
[data-mode='executing'] .status-dot {
  background: var(--accent);
}
[data-mode='error'] .status-dot {
  background: #ff9f9f;
}
.load-error {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 10px;
  background: #321f25;
  border-radius: 5px;
  margin-bottom: 6px;
  font-size: 12px;
}
.load-error pre {
  margin: 0;
  max-height: 40vh;
  overflow: auto;
  font: 1em/1.6 var(--mono);
}
.load-error-actions {
  display: flex;
  gap: 8px;
}
.load-error button {
  white-space: nowrap;
}
.lab-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) minmax(300px, 1fr) minmax(220px, 0.62fr);
  grid-template-rows: clamp(220px, 36dvh, 340px) minmax(145px, auto) minmax(150px, auto);
  gap: 6px;
  align-items: stretch;
}
.panel {
  background: var(--panel);
  border-radius: 4px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 5px 9px;
}
.panel-heading h2 {
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}
.panel-index {
  display: none;
}
#copyCode {
  padding-inline: 8px;
}
#copyCode span {
  display: block;
  font-size: 16px;
  line-height: 1;
}
.editor-panel {
  grid-column: 1;
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.editor-content {
  --editor-gutter: 32px;
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #0f1720;
}
.line-numbers {
  flex: 0 0 var(--editor-gutter);
  font: 11px/22px var(--mono);
  color: #62778b;
  text-align: right;
  padding: 8px 7px 8px 0;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}
#codeArea {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  font: 11px/22px var(--mono);
  tab-size: 4;
  white-space: pre;
}
#codeArea,
#codeHighlightPre {
  outline: none;
}
#codeArea.has-syntax-preview {
  position: relative;
  color: transparent;
  caret-color: var(--ink);
}
#codeArea.has-syntax-preview::selection {
  background: #80bfff50;
  color: transparent;
}
#codeArea.has-syntax-preview::placeholder {
  color: var(--muted);
}
#editorSyntax {
  position: absolute;
  inset: 0 0 0 var(--editor-gutter);
  margin: 0;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--ink);
  font: 11px/22px var(--mono);
  tab-size: 4;
  white-space: pre;
  pointer-events: none;
}
#editorSyntax code {
  display: block;
  font: inherit;
  white-space: inherit;
}
@media (forced-colors: active) {
  #editorSyntax {
    display: none;
  }
  #codeArea.has-syntax-preview {
    color: CanvasText;
  }
  #codeArea.has-syntax-preview::selection {
    background: Highlight;
    color: HighlightText;
  }
}
#codeHighlightPre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  font: 11px/22px var(--mono);
  tab-size: 4;
}
#codeHighlight {
  padding: 0;
  background: none;
  color: var(--ink);
  font: 11px/22px var(--mono) !important;
  display: block;
  white-space: pre;
}
.editor-content .token.keyword { color: #ff87b3; }
.editor-content .token.class-name,
.editor-content .token.type-name,
.editor-content .token.builtin { color: #80dcff; }
.editor-content .token.template-parameter { color: #afd5ee; }
.editor-content .token.function { color: #b5ef86; }
.editor-content .token.contract { color: #ffbf85; }
.editor-content .token.string,
.editor-content .token.char,
.editor-content .token.regex,
.editor-content .token.raw-string,
.editor-content .token.template-string { color: #ffe28c; }
.editor-content .token.number,
.editor-content .token.boolean,
.editor-content .token.constant { color: #c6a2ff; }
.editor-content .token.comment { color: #93a9bd; }
.editor-content .token.operator,
.editor-content .token.punctuation { color: #a5bbd2; }
#codeHighlight mark {
  background: #b1ed8045;
  color: inherit;
  border-bottom: 0;
  text-decoration: none;
  border-radius: 2px;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  padding: 4px 9px;
  font: 9px var(--mono);
  color: var(--muted);
  background: var(--panel);
}
.editor-content:focus-within + .editor-footer #editorMode {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.visual-panel {
  grid-column: 2/4;
  grid-row: 1;
  display: flex;
  flex-direction: column;
}
.visual-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background-image: radial-gradient(#273745 1px, transparent 1px);
  background-size: 18px 18px;
}
#sequence [data-copy-value] { cursor: pointer; }
#sequence [data-copy-value]:focus-visible { outline: 2px solid var(--accent); }
.visual-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  pointer-events: none;
  color: var(--muted);
  font-size: 12px;
}
#hg-right-a {
  min-height: 100%;
  position: relative;
}
#sequence svg {
  display: block;
}
.secondary-visual:empty {
  display: none;
}
.secondary-visual {
  height: 190px;
  overflow: auto;
  border-top: 1px solid var(--border);
}
.log-panel {
  grid-column: 2;
  grid-row: 2;
}
.metrics-panel {
  grid-column: 3;
  grid-row: 2;
}
.console-panel {
  grid-column: 1/3;
  grid-row: 3;
}
.state-panel {
  grid-column: 3;
  grid-row: 3;
}
.log-panel,
.state-panel {
  display: flex;
  flex-direction: column;
}
.log-panel .panel-heading,
.state-panel .panel-heading {
  flex-shrink: 0;
}
.panel-content {
  padding: 5px 9px 9px;
  max-height: 270px;
  overflow: auto;
}
.panel-content:empty {
  padding: 0;
}
.panel-placeholder {
  font-size: 11px;
  color: var(--muted);
  padding: 5px 9px 9px;
  max-width: 340px;
  line-height: 1.8;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font: 10px var(--mono);
}
.metrics p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--cyan);
}
.metrics b {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--muted);
  font-size: 10px;
}
.metrics:not(:empty) + .panel-placeholder,
.panel-content:not(:empty) + .panel-placeholder {
  display: none;
}
.panel-content #Status {
  font: 10px/1.9 var(--mono);
  margin: 0;
  color: var(--muted);
}
.console-output {
  font: 11px/1.8 var(--mono);
  max-height: 170px;
}
.console-output p {
  margin: 0 0 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.quiet-button {
  font-size: 9px;
  color: var(--muted);
  padding: 3px 6px;
  border: 0;
  background: none;
}
#hg-right-b-b-data {
  font: 10px/1.8 var(--mono);
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 5px 9px 9px;
  border: 0;
  resize: none;
  background: none;
  color: var(--muted);
  outline-offset: -3px;
}
.log-panel .panel-placeholder {
  position: absolute;
  top: 30px;
  pointer-events: none;
}
.lab-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px clamp(8px, 1.4vw, 20px) 14px;
  color: var(--muted);
  font: 9px var(--mono);
}
.lab-footer a:hover {
  color: var(--accent);
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-thumb {
  background: #334655;
  border-radius: 4px;
}
*::-webkit-scrollbar-track {
  background: #0c141c;
}
@media (min-width: 1500px) {
  .lab-workspace {
    grid-template-columns: minmax(490px, 1.6fr) minmax(380px, 1.1fr) minmax(250px, 0.65fr);
  }
  #codeArea,
  #editorSyntax,
  #codeHighlight {
    font-size: 12px !important;
  }
}
@media (max-width: 1050px) {
  .lab-workspace {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1fr);
    grid-template-rows: clamp(205px, 35dvh, 320px) 175px minmax(125px, auto) minmax(135px, auto);
  }
  .editor-panel {
    grid-column: 1;
    grid-row: 1/3;
  }
  .visual-panel {
    grid-column: 2;
    grid-row: 1;
  }
  .log-panel {
    grid-column: 2;
    grid-row: 2;
  }
  .metrics-panel {
    grid-column: 1;
    grid-row: 3;
  }
  .console-panel {
    grid-column: 2;
    grid-row: 3;
  }
  .state-panel {
    grid-column: 1/3;
    grid-row: 4;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    max-height: 160px;
  }
}
@media (max-width: 700px) {
  .lab-header {
    padding: 5px 8px;
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .lab-brand {
    font-size: 16px;
  }
  .lab-header nav {
    width: 100%;
    font-size: 10px;
    gap: 7px;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .blog-link {
    padding-left: 0;
    border-left: 0;
  }
  .lab-help {
    margin-inline-start: auto;
  }
  .lab-help summary {
    font-size: 0;
    padding: 7px;
  }
  .lab-help summary > span {
    font-size: 11px;
  }
  .lab-help > div {
    width: min(320px, calc(100vw - 32px));
    right: 0;
    top: 38px;
    font-size: 11px;
  }
  .example-control {
    flex-basis: 100%;
    min-width: 0;
    gap: 12px;
  }
  .example-control select {
    flex: 1;
    max-width: none;
    min-width: 0;
    width: 100%;
    font-size: 10px;
  }
  .execution-controls {
    gap: 7px;
  }
  .execution-controls button {
    padding: 8px 11px;
    font-size: 10px;
  }
  .execution-controls .primary {
    min-width: 80px;
  }
  .session-status {
    font-size: 8px;
  }
  .lab-workspace {
    display: flex;
    flex-direction: column;
  }
  .editor-panel {
    height: clamp(280px, 55dvh, 390px);
  }
  .visual-panel {
    height: clamp(210px, 42dvh, 310px);
  }
  .state-panel,
  .metrics-panel {
    min-height: 98px;
    max-height: 310px;
  }
  .console-panel,
  .log-panel {
    height: 155px;
  }
  .panel-heading h2 {
    font-size: 10px;
  }
  #codeArea,
  #editorSyntax,
  #codeHighlight {
    font-size: 11px !important;
  }
  .editor-content {
    --editor-gutter: 32px;
  }
  .line-numbers {
    font-size: 10px;
  }
  .metrics {
    max-height: 220px;
  }
  .console-output {
    max-height: 140px;
  }
  .lab-footer {
    padding: 15px 18px 25px;
    flex-direction: column;
    font-size: 8px;
    gap: 8px;
  }
  .load-error {
    grid-template-columns: minmax(0, 1fr);
    font-size: 11px;
  }
  .load-error-actions {
    justify-content: flex-end;
  }
  .load-error button {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.lab-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
}
body[data-mode='reference'] #hg-right-a {
  padding: 25px;
  min-width: 0;
}
#hg-right-a [id='Attribute'] {
  font: 12px/1.8 var(--mono);
  overflow-wrap: anywhere;
  margin: 0 0 10px;
}
#hg-right-a [id='Attribute'] a {
  color: var(--accent);
}
.editor-panel#hg-left {
  width: auto !important;
  max-width: none !important;
}
.line-numbers {
  font-size: 11px;
  line-height: 24px;
}
#codeArea,
#editorSyntax,
#codeHighlightPre,
#codeHighlight {
  font-size: 13px !important;
  line-height: 24px !important;
}
.metrics p span {
  color: var(--cyan);
  white-space: nowrap;
}
@media (max-width: 700px) {
  #codeArea,
  #editorSyntax,
  #codeHighlightPre,
  #codeHighlight {
    font-size: 12px !important;
  }
}

@media (min-width: 1051px) and (max-width: 1499px) {
  .lab-workspace {
    grid-template-columns: minmax(470px, 1.6fr) minmax(280px, 1fr) minmax(200px, 0.65fr);
  }
}
body[data-mode='reference'] #hg-right-a > h3 {
  font: 500 19px var(--mono);
  margin: 0 0 17px;
  color: var(--accent);
}
body[data-mode='reference'] #hg-right-a > p {
  font: 12px/1.8 var(--sans);
  color: var(--muted);
  max-width: 420px;
  margin: 0 0 20px;
}
body[data-mode='reference'] #hg-right-a > a {
  font: 11px var(--mono);
  color: var(--cyan);
}
.reference-attributes dt {
  font: 11px var(--sans);
  color: var(--muted);
  margin: 15px 0 5px;
}
.reference-attributes dd {
  font: 11px/1.8 var(--mono);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

/* Two.js sets a legacy font-family attribute on each SVG label. */
#sequence svg text {
  font-family: var(--mono);
  font-weight: 400;
}

.example-control > span {
  color: var(--muted);
  font-size: 11px;
}
#exampleSelect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 230px;
  font-family: var(--mono);
}
.algorithm-catalog {
  color: var(--ink);
  background: var(--panel);
  border: 0;
  border-radius: 8px;
  padding: 16px;
}
dialog.algorithm-catalog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
}
dialog.algorithm-catalog::backdrop {
  background: #02070caa;
}
.catalog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.catalog-heading h2 {
  font: 600 17px/1.3 var(--mono);
  margin: 0;
}
.catalog-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}
.catalog-search-label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}
.catalog-search {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--ink);
  font: 14px var(--mono);
}
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.catalog-filter { padding: 4px 8px; border-color: transparent; }
.catalog-filter[aria-pressed='true'] {
  color: var(--accent);
  background: #1d2a23;
}
.catalog-count {
  color: var(--muted);
  font-size: 11px;
  margin: 6px 0;
}
.catalog-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.catalog-card {
  position: relative;
  min-width: 0;
  border: 0;
  border-radius: 4px;
  padding: 9px 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.catalog-category {
  color: var(--muted);
  font-size: 11px;
}
.catalog-card h3 {
  font: 13px/1.6 var(--mono);
  overflow-wrap: anywhere;
  margin: 3px 0 6px;
}
.catalog-open {
  margin-top: auto;
  color: var(--accent);
  font-size: 12px;
}
button.catalog-open {
  background: transparent;
  border-color: transparent;
  padding: 3px 0;
}
.catalog-current {
  color: var(--accent);
  font: 10px var(--mono);
  margin-bottom: 4px;
}
.catalog-card.is-current { background: #1d2a23; }
.catalog-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 12px;
  color: var(--muted);
}
main.catalog-page {
  max-width: 1180px;
  margin: 12px auto;
  padding: 0 clamp(8px, 1.4vw, 20px);
}
@media (max-width: 800px) {
  .catalog-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 500px) {
  dialog.algorithm-catalog {
    padding: 10px;
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .catalog-results {
    grid-template-columns: 1fr;
  }
  #exampleSelect {
    width: 100%;
    min-width: 0;
  }
}
.catalog-confirm {
  border-radius: 4px;
  padding: 9px 10px;
  margin: 6px 0;
  background: var(--surface);
}
.catalog-confirm p {
  margin: 0 0 6px;
}
.catalog-confirm button {
  margin: 0 6px 0 0;
}

.lab-brand-mark {
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.lab-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.function-tooltip {
  position: fixed;
  z-index: 30;
  max-width: min(430px, calc(100vw - 16px));
  padding: 9px 36px 9px 12px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 20px #0006;
  font: 12px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.function-tooltip-example {
  display: inline-block;
  margin-top: 7px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.function-tooltip-example[hidden] {
  display: none;
}

.function-tooltip-close {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 18px;
  background: transparent;
  border-color: transparent;
}

.catalog-subcategory-row {
  align-items: center;
  margin-top: 4px;
  padding: 2px 0 2px 8px;
}
.catalog-subcategory-label {
  color: var(--muted);
  font-size: 12px;
  margin-inline-end: 2px;
}

.editor-references {
  flex: none;
  padding: 5px 9px 8px;
  font-size: 12px;
}
.editor-references h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: inherit;
  font-weight: 600;
}
.editor-references ul {
  margin: 0;
  padding-inline-start: 16px;
}
.editor-references a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.book-embedded-lab .lab-header,
.book-embedded-lab .lab-footer,
.book-embedded-lab .lab-title,
.book-embedded-lab .example-control {
  display: none;
}

.book-embedded-lab .lab-main {
  padding: 0 7px 8px;
}

.book-embedded-lab .execution-controls button {
  min-width: 0;
}

.book-embedded-lab .session-status {
  flex-basis: auto;
  gap: 6px;
  margin-inline-start: auto;
}

.book-embedded-lab .lab-help {
  margin-inline-start: 0;
}

.book-embedded-lab .lab-help summary {
  padding: 5px;
  font-size: 0;
}

.book-embedded-lab .lab-help summary > span {
  font-size: 11px;
}

.book-embedded-lab .lab-help > div {
  top: calc(100% + 5px);
  width: min(350px, calc(100vw - 30px));
}

.book-embedded-lab .lab-workspace {
  grid-template-rows: clamp(200px, 35dvh, 320px) minmax(130px, auto) minmax(135px, auto);
}

@media (min-width: 701px) and (max-width: 1050px) {
  .book-embedded-lab .lab-workspace {
    grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.85fr);
    grid-template-rows: clamp(200px, 34dvh, 300px) 170px minmax(120px, auto) minmax(135px, auto);
  }
}
