/* Original Mickai studio: black/gold framing, light surfaces for careful reading. */
.p-labs { --lab-ink: #eee9dc; --lab-muted: #bfb8a7; --lab-surface: #151613; --lab-line: #4e4736; --lab-gold: #e2bd61; }
.lab { border-top: 1px solid var(--lab-line); color: var(--lab-ink); background: #11130f; scroll-margin-top: 90px; }
.lab .block__title { color: var(--lab-ink); }
.lab .eyebrow, .lab a { color: var(--lab-gold); }
.lab-hero { background: #11130f; }
.lab-hero .page-hero__title { max-width: 16ch; color: #f1ecdf; }
.lab-hero .page-hero__lead { color: #cfc6b2; }
.lab-hero .eyebrow, .lab-hero .crumbs a { color: #e2bd61; }
.lab-hero .crumbs { color: #bfb8a7; }
.lab-local { color: #d2c7a9; font-size: .9rem; margin: 24px 0; }
.lab-jump { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 950px; margin-top: 36px; }
.lab-jump a { padding: 20px; border: 1px solid #605231; border-radius: 4px; color: #f5efdF; background: #191b15; text-decoration: none; display: flex; align-items: center; gap: 16px; min-height: 68px; }
.lab-jump a:hover { border-color: #e2bd61; background: #22241b; }
.lab-jump span { color: #e2bd61; font: 500 .85rem var(--mono, monospace); }
.lab-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.lab-heading .block__title { margin-bottom: 0; }
.lab-badge { color: var(--lab-muted); font: 500 .75rem/1.5 var(--mono, monospace); border: 1px solid var(--lab-line); padding: 7px 10px; white-space: nowrap; border-radius: 3px; }
.lab-lead { color: var(--lab-muted); max-width: 80ch; line-height: 1.7; margin: 0 0 24px; }
.lab-note { color: var(--lab-muted); font-size: .88rem; line-height: 1.6; margin: 12px 0 20px; max-width: 95ch; }
.lab-kicker, .lab-h3 { font: 600 .75rem/1.4 var(--mono, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--lab-gold); }
.lab-kicker { margin: 0 0 10px; }
.lab-h3 { margin: 0; }
.lab-h3 span { text-transform: none; letter-spacing: 0; color: var(--lab-muted); margin-left: 12px; font-weight: 400; }
.lab label { font: 600 .82rem/1.5 var(--sans, system-ui); color: var(--lab-ink); }
.lab label span { color: var(--lab-muted); font-size: .75rem; font-weight: 400; margin-left: 8px; }
.lab-bar, .lab-actions, .lab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.lab-bar { margin: 0 0 20px; }
.lab-toolbar { justify-content: space-between; margin: 24px 0 14px; }
.lab select, .lab input[type="text"], .lab input[type="number"], .lab textarea {
  min-height: 44px; max-width: 100%; min-width: 0; border: 1px solid #71674e; border-radius: 4px; padding: 10px 12px; background: #11130f; color: var(--lab-ink); font: 400 1rem/1.4 var(--sans, system-ui); box-sizing: border-box;
}
.lab select { cursor: pointer; padding-right: 28px; }
.lab input[type="number"] { width: 160px; }
.lab input[type="text"] { width: 100%; }
.lab textarea { display: block; width: 100%; resize: vertical; min-height: 150px; font: 400 .86rem/1.7 var(--mono, monospace); tab-size: 2; }
.lab-code textarea { min-height: 360px; white-space: pre; overflow: auto; border: 0; border-top: 1px solid var(--lab-line); border-radius: 0 0 4px 4px; background: #0d100c; color: #f2efdf; padding: 16px; }
.lab select option { color: #f5f1e6; background: #11130f; }
.lab :is(button, input, textarea, select, summary, a, [tabindex]):focus-visible, .lab-jump a:focus-visible { outline: 3px solid var(--lab-gold); outline-offset: 4px; }
.lab-button { appearance: none; min-height: 44px; padding: 10px 16px; font: 600 .86rem/1.35 var(--sans, system-ui); border: 1px solid #71674e; border-radius: 4px; color: var(--lab-ink); background: #24271f; cursor: pointer; }
.lab-button:hover { border-color: var(--lab-gold); background: #323528; }
.lab-button--gold { color: #1a1b14; background: #e2bd61; border-color: #e2bd61; }
.lab-button--gold:hover { color: #12130d; background: #f3d483; }
.lab-button:disabled { color: #a39f93; background: #25261f; border-color: #454739; cursor: not-allowed; }
.lab-button--small { font-size: .8rem; padding: 8px 12px; }
.lab-key { font-size: .69rem; margin-left: 8px; font-weight: 400; }
.lab-status { color: var(--lab-muted); font-size: .8rem; margin: 0; min-height: 1.6em; }
.lab-brief { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; padding: 24px; color: #292b23; background: #f5f1e7; border-left: 4px solid #ba9440; border-radius: 3px; }
.lab-brief .lab-kicker { color: #70541b; }
.lab-brief h3 { margin: 0 0 16px; font: 600 1.25rem/1.4 var(--sans, system-ui); color: #24261f; }
.lab-brief ol { padding-left: 1.2rem; margin: 0; display: grid; gap: 10px; font-size: .93rem; }
.lab-check { border-left: 1px solid #c9bd9f; padding-left: 28px; font-size: .94rem; }
.lab-check p { margin-top: 0; line-height: 1.7; }
.lab-code { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lab-pane { display: grid; gap: 8px; min-width: 0; margin-bottom: 20px; }
.lab-code .lab-pane { gap: 0; margin: 0; border: 1px solid var(--lab-line); border-radius: 4px; background: #1c2018; }
.lab-pane-head { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; }
.lab-pane-head > span { color: #bcb5a3; font: 400 .68rem var(--mono, monospace); }
.lab-preview { background: #22261d; border: 1px solid var(--lab-line); border-radius: 4px; margin-top: 24px; overflow: hidden; }
.lab-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
.lab-preview-head h3 { margin: 0 auto 0 0; color: #eee9dc; font: 600 .9rem var(--sans, system-ui); }
.lab-preview-head select { font-size: .82rem; }
.lab-frame-host { width: 100%; margin: 0 auto; min-height: 240px; background: #faf8f2; color: #292b23; }
.lab-frame-host > p { padding: 24px; }
.lab-frame { display: block; width: 100%; height: 460px; min-height: 240px; border: 0; background: #faf8f2; }
.lab-console-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.lab-console { padding: 16px; margin: 0; min-height: 88px; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #0d100c; border: 1px solid var(--lab-line); border-radius: 4px; font: 400 .83rem/1.7 var(--mono, monospace); color: #dcdcc9; }
.lab-console__error { color: #ffc4ab; }
.lab-console__warn { color: #efd081; }
.lab-details { padding: 18px 0; margin: 16px 0 24px; border-top: 1px solid var(--lab-line); border-bottom: 1px solid var(--lab-line); color: var(--lab-muted); font-size: .9rem; line-height: 1.7; }
.lab-details summary { color: var(--lab-ink); font-weight: 600; cursor: pointer; min-height: 28px; }
.lab-details p, .lab-details ol { max-width: 100ch; }
.lab-details code { font: 400 .84rem var(--mono, monospace); color: var(--lab-gold); overflow-wrap: anywhere; }
.lab--paper { --lab-ink: #24271f; --lab-muted: #53584a; --lab-line: #c9c5b5; --lab-gold: #735719; background: #f6f3e9; color: #24271f; }
.lab--paper .block__title { color: #24271f; }
.lab--paper .eyebrow { color: #735719; }
.lab--paper :is(textarea, input[type="text"]) { color: #25291f; background: #fffef9; border-color: #8e927f; }
.lab--paper .lab-button { color: #2b2f24; background: #f4f0e3; border-color: #8a816a; }
.lab--paper .lab-button:hover { background: #e8dfc7; }
.lab--paper .lab-button--gold { background: #e2bd61; border-color: #94752f; color: #1a1b14; }
.lab--paper .lab-button:disabled { background: #e6e4db; color: #737369; border-color: #bfbcb0; }
.lab-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin: 24px 0; }
.lab-task { padding: 20px; background: #ece6d6; border-radius: 4px; font-size: .9rem; }
.lab-task h3 { margin: 6px 0 12px; font-size: 1.15rem; color: #24271f; }
.lab-task p:last-child { margin-bottom: 0; }
.lab-range { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 14px; }
.lab input[type="range"] { accent-color: #a47d20; width: min(360px, 100%); min-height: 44px; cursor: pointer; }
.lab-stat { color: var(--lab-ink); margin: 16px 0; line-height: 1.6; font-size: .91rem; }
.lab-next { color: #625021; font-size: .88rem; margin: 12px 0 20px; }
.lab-tokens { display: flex; flex-wrap: wrap; gap: 5px; padding: 16px 0; min-height: 48px; overflow-wrap: anywhere; }
.lab-tok { display: inline-block; max-width: 100%; padding: 5px 7px; border-radius: 4px; color: #192019; background: hsl(var(--h) 36% 84%); border: 1px solid hsl(var(--h) 18% 57%); font: 500 .88rem/1.45 var(--mono, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.lab-merges { max-height: 270px; overflow: auto; padding-left: 24px; font: 400 .87rem/1.8 var(--mono, monospace); overflow-wrap: anywhere; }
.lab-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.lab-sliders > div { background: #191d15; padding: 20px; border: 1px solid var(--lab-line); border-radius: 4px; }
.lab-sliders label { display: flex; justify-content: space-between; gap: 12px; }
.lab-sliders output { color: #e2bd61; font: 600 .85rem var(--mono, monospace); }
.lab-sliders p { color: var(--lab-muted); font-size: .82rem; line-height: 1.6; margin: 8px 0 0; }
.lab-sliders input[type="range"] { width: 100%; margin: 10px 0 0; }
.lab-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--lab-line); border-radius: 4px; }
.lab-prob-table { width: 100%; border-collapse: collapse; font: 400 .84rem/1.5 var(--mono, monospace); }
.lab-prob-table caption { text-align: left; padding: 12px 16px; font: 400 .83rem/1.5 var(--sans, system-ui); color: var(--lab-muted); background: #191d15; }
.lab-prob-table th, .lab-prob-table td { text-align: right; padding: 12px 16px; border-bottom: 1px solid #393d30; white-space: nowrap; }
.lab-prob-table th:first-child { text-align: left; }
.lab-prob-table thead th { color: #e2bd61; font: 600 .75rem/1.5 var(--sans, system-ui); }
.lab-prob-table tbody th { font-weight: 500; }
.lab-prob-table .is-off { color: #a1a594; }
.lab-prob { position: relative; display: inline-block; width: 150px; background: #2e3424; border-radius: 2px; overflow: hidden; text-align: right; }
.lab-prob > span:last-child { position: relative; display: block; color: #fffcef; padding: 4px 8px; }
.lab-bar-fill { position: absolute; inset: 0 auto 0 0; background: #665323; }
.lab-draws { font: 400 .9rem/1.8 var(--mono, monospace); padding: 18px; border: 1px solid var(--lab-line); background: #191d15; overflow-wrap: anywhere; min-height: 70px; }
.lab-more { max-width: 1000px; }
.lab-links { display: grid; gap: 12px; padding-left: 20px; }
@media (max-width: 1050px) { .lab-code { grid-template-columns: minmax(0, 1fr); } .lab-code textarea { min-height: 230px; } .lab-sliders { gap: 12px; } }
@media (max-width: 700px) { .lab-jump, .lab-brief, .lab-two, .lab-sliders { grid-template-columns: minmax(0, 1fr); } .lab-heading { display: block; } .lab-badge { display: inline-block; margin-top: 12px; white-space: normal; } .lab-check { border-left: 0; border-top: 1px solid #c9bd9f; padding: 20px 0 0; } .lab-brief { padding: 20px; gap: 20px; } .lab-key { display: none; } .lab-jump { gap: 8px; } .lab-jump a { padding: 14px 16px; min-height: 52px; } .lab-frame { height: 440px; } .lab-bar select { flex: 1 1 180px; } .lab-status { flex-basis: 100%; } }
@media (forced-colors: active) { .lab-button, .lab-tok, .lab-prob { border: 1px solid ButtonText; } .lab-bar-fill { background: Highlight; } }
@media print { .lab-frame-host, .lab-toolbar, .lab-bar, .lab-code, .lab-console, .lab-sliders, .lab-jump { display: none; } .lab { color: #111; background: white; } }
