.mcdp {
  --mcdp-bg: #e8ece6;
  --mcdp-surface: #f6f8f3;
  --mcdp-ink: #1b221d;
  --mcdp-muted: #5a6659;
  --mcdp-line: #c9d1c4;
  --mcdp-grid: #dde3d8;
  --mcdp-major: #b7c1b1;
  --mcdp-block: #357a72;
  --mcdp-block-hi: #5aa59b;
  --mcdp-block-lo: #24564f;
  --mcdp-stair: #6fb0a6;
  --mcdp-stair-lo: #3f7f76;
  --mcdp-slab: #b4d6cf;
  --mcdp-slab-lo: #6fa59c;
  --mcdp-spire: #b98a2c;
  --mcdp-spire-hi: #d9ad4f;
  --mcdp-spire-lo: #8a6418;
  --mcdp-on-block: #f3fbf9;
  --mcdp-placed: #c3cfc6;
  --mcdp-ghost: #d9e6e2;
  --mcdp-stone: #8d9590;
  --mcdp-stone-hi: #a9b0ab;
  --mcdp-stone-lo: #6e7671;
  --mcdp-wall-ghost: #d3d6d1;
  --mcdp-mark: #c27c12;
  --mcdp-hl: rgba(194, 124, 18, 0.16);
  --mcdp-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  container-type: inline-size;
  color-scheme: light;
  background: var(--mcdp-bg);
  color: var(--mcdp-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 20px;
  border-radius: 8px;
  max-width: 100%;
  text-align: left;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mcdp {
    --mcdp-bg: #131915; --mcdp-surface: #1b231e; --mcdp-ink: #e4eae1; --mcdp-muted: #98a594; --mcdp-line: #2f3a32;
    --mcdp-grid: #232c26; --mcdp-major: #3a473e; --mcdp-block: #4a9f94; --mcdp-block-hi: #71c3b8; --mcdp-block-lo: #2c6c64;
    --mcdp-stair: #84c9bf; --mcdp-stair-lo: #2c6c64; --mcdp-slab: #c3e6e0; --mcdp-slab-lo: #5d9a91;
    --mcdp-spire: #d9a443; --mcdp-spire-hi: #f0c56a; --mcdp-spire-lo: #a37722; --mcdp-on-block: #0d1a17;
    --mcdp-placed: #34433c; --mcdp-ghost: #28352f; --mcdp-stone: #6d7570; --mcdp-stone-hi: #868e89; --mcdp-stone-lo: #535a56;
    --mcdp-wall-ghost: #2d322f; --mcdp-mark: #e6a23c; --mcdp-hl: rgba(230, 162, 60, 0.16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .mcdp {
  --mcdp-bg: #131915; --mcdp-surface: #1b231e; --mcdp-ink: #e4eae1; --mcdp-muted: #98a594; --mcdp-line: #2f3a32;
  --mcdp-grid: #232c26; --mcdp-major: #3a473e; --mcdp-block: #4a9f94; --mcdp-block-hi: #71c3b8; --mcdp-block-lo: #2c6c64;
  --mcdp-stair: #84c9bf; --mcdp-stair-lo: #2c6c64; --mcdp-slab: #c3e6e0; --mcdp-slab-lo: #5d9a91;
  --mcdp-spire: #d9a443; --mcdp-spire-hi: #f0c56a; --mcdp-spire-lo: #a37722; --mcdp-on-block: #0d1a17;
  --mcdp-placed: #34433c; --mcdp-ghost: #28352f; --mcdp-stone: #6d7570; --mcdp-stone-hi: #868e89; --mcdp-stone-lo: #535a56;
  --mcdp-wall-ghost: #2d322f; --mcdp-mark: #e6a23c; --mcdp-hl: rgba(230, 162, 60, 0.16);
  color-scheme: dark;
}
.mcdp *, .mcdp *::before, .mcdp *::after { box-sizing: border-box; }
.mcdp [hidden] { display: none !important; }
.mcdp h1, .mcdp h2, .mcdp h3, .mcdp h4, .mcdp p, .mcdp ul, .mcdp li { margin: 0; padding: 0; border: 0; text-transform: none; letter-spacing: normal; color: inherit; font-family: inherit; }
.mcdp-wrap { display: grid; gap: 24px; }

.mcdp-head { display: grid; gap: 4px; }
.mcdp-eyebrow { font-family: var(--mcdp-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mcdp-muted); }
.mcdp .mcdp-title { font-size: clamp(30px, 5vw, 42px); letter-spacing: -.02em; font-weight: 700; line-height: 1.1; }
.mcdp-head p { max-width: 62ch; color: var(--mcdp-muted); }

.mcdp-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
@container (max-width: 760px) { .mcdp-layout { grid-template-columns: minmax(0, 1fr); } }

.mcdp-panel { background: var(--mcdp-surface); border: 1px solid var(--mcdp-line); border-radius: 6px; padding: 18px; display: grid; gap: 20px; }
.mcdp-field { display: grid; gap: 8px; }
.mcdp-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mcdp-muted); display: flex; justify-content: space-between; gap: 8px; }
.mcdp-label label { font: inherit; color: inherit; margin: 0; }
.mcdp-label small { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; }
.mcdp-pair { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.mcdp input[type="range"] { width: 100%; margin: 0; accent-color: var(--mcdp-block); background: transparent; border: 0; box-shadow: none; }
.mcdp input[type="number"] {
  width: 100%; height: auto; margin: 0; font: 600 16px var(--mcdp-mono); color: var(--mcdp-ink); background: var(--mcdp-bg);
  border: 1px solid var(--mcdp-line); border-radius: 4px; padding: 6px 8px; box-shadow: none; font-variant-numeric: tabular-nums;
}
.mcdp select {
  width: 100%; height: auto; margin: 0; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--mcdp-ink);
  background: var(--mcdp-bg); border: 1px solid var(--mcdp-line); border-radius: 4px; padding: 7px 8px; box-shadow: none;
}
.mcdp input:focus-visible, .mcdp select:focus-visible, .mcdp button:focus-visible, .mcdp-seg input:focus-visible + span { outline: 2px solid var(--mcdp-mark); outline-offset: 2px; }

.mcdp-seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); border: 1px solid var(--mcdp-line); border-radius: 4px; overflow: hidden; }
.mcdp-seg label { position: relative; cursor: pointer; margin: 0; }
.mcdp-seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.mcdp-seg span { display: block; text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 700; line-height: 1.3; border-left: 1px solid var(--mcdp-line); }
.mcdp-seg label:first-child span { border-left: 0; }
.mcdp-seg input:checked + span { background: var(--mcdp-block); color: var(--mcdp-on-block); }
.mcdp p.mcdp-hint { font-size: 13px; color: var(--mcdp-muted); }

.mcdp-stage { display: grid; gap: 14px; min-width: 0; }
.mcdp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--mcdp-line); border-radius: 6px; background: var(--mcdp-surface); }
.mcdp-stat { padding: 12px 14px; border-left: 1px solid var(--mcdp-line); display: grid; gap: 2px; min-width: 0; align-content: start; }
.mcdp-stat:first-child { border-left: 0; }
.mcdp-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mcdp-muted); }
.mcdp-v { font-family: var(--mcdp-mono); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.mcdp-s { font-size: 12px; color: var(--mcdp-muted); }
@container (max-width: 560px) {
  .mcdp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcdp-stat:nth-child(3) { border-left: 0; }
  .mcdp-stat:nth-child(n+3) { border-top: 1px solid var(--mcdp-line); }
}

.mcdp-views { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
@container (max-width: 980px) { .mcdp-views { grid-template-columns: minmax(0, 1fr); } }
.mcdp-view { display: grid; gap: 10px; min-width: 0; }
.mcdp-view-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; min-height: 32px; }
.mcdp h3, .mcdp h4 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.mcdp-toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.mcdp-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mcdp button {
  font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--mcdp-ink); background: var(--mcdp-surface);
  border: 1px solid var(--mcdp-line); border-radius: 4px; padding: 6px 10px; margin: 0; cursor: pointer;
  text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; width: auto;
}
.mcdp button:hover { border-color: var(--mcdp-block); background: var(--mcdp-surface); color: var(--mcdp-ink); }
.mcdp button:disabled { opacity: .4; cursor: default; border-color: var(--mcdp-line); }
.mcdp-layer-name { font-family: var(--mcdp-mono); font-weight: 600; font-size: 15px; min-width: 9ch; text-align: center; font-variant-numeric: tabular-nums; }
.mcdp-readout, .mcdp-progress { font-family: var(--mcdp-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.mcdp-readout { color: var(--mcdp-muted); }
.mcdp-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--mcdp-muted); align-items: center; }
.mcdp-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }

.mcdp-canvas-box { background: var(--mcdp-surface); border: 1px solid var(--mcdp-line); border-radius: 6px; overflow: auto; max-height: 80vh; padding: 12px; }
.mcdp canvas { display: block; margin: 0 auto; max-width: none; }
.mcdp canvas.mcdp-click { cursor: crosshair; touch-action: manipulation; }
.mcdp canvas.mcdp-side { cursor: pointer; }

.mcdp-guide { display: grid; gap: 16px; }
.mcdp .mcdp-h { font-size: 24px; font-weight: 700; line-height: 1.2; }
.mcdp-guide-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@container (max-width: 760px) { .mcdp-guide-cols { grid-template-columns: minmax(0, 1fr); } }
.mcdp-card { background: var(--mcdp-surface); border: 1px solid var(--mcdp-line); border-radius: 6px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.mcdp-card p { max-width: 65ch; }
.mcdp-tips { display: grid; gap: 8px; padding-left: 18px !important; }
.mcdp-tips li { list-style: disc; max-width: 65ch; }

.mcdp-rows { max-height: 520px; overflow: auto; border: 1px solid var(--mcdp-line); border-radius: 6px; background: var(--mcdp-surface); }
.mcdp table { border-collapse: collapse; width: 100%; margin: 0; font-size: 14px; border: 0; background: transparent; }
.mcdp th { position: sticky; top: 0; background: var(--mcdp-surface); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mcdp-muted); padding: 10px 12px; border: 0; border-bottom: 1px solid var(--mcdp-line); z-index: 1; }
.mcdp td { padding: 6px 12px; border: 0; border-bottom: 1px solid var(--mcdp-grid); background: transparent; font-family: var(--mcdp-mono); font-variant-numeric: tabular-nums; vertical-align: middle; color: var(--mcdp-ink); }
.mcdp td.mcdp-n, .mcdp th.mcdp-n { text-align: right; width: 1%; white-space: nowrap; }
.mcdp td.mcdp-t { font-family: inherit; color: var(--mcdp-muted); }
.mcdp td.mcdp-mix { font-size: 12px; color: var(--mcdp-muted); white-space: nowrap; }
.mcdp tbody.mcdp-pick tr { cursor: pointer; }
.mcdp tbody.mcdp-pick tr:hover td { background: var(--mcdp-grid); }
.mcdp tr.mcdp-hl td, .mcdp tbody.mcdp-pick tr.mcdp-hl:hover td { background: var(--mcdp-hl); }
.mcdp-runs { display: flex; flex-wrap: wrap; gap: 4px; }
.mcdp-r { display: inline-block; min-width: 28px; text-align: center; padding: 1px 6px; border-radius: 3px; font-family: var(--mcdp-mono); font-size: 13px; line-height: 1.5; }
.mcdp-r.mcdp-on { background: var(--mcdp-block); color: var(--mcdp-on-block); font-weight: 600; }
.mcdp-r.mcdp-off { border: 1px dashed var(--mcdp-major); color: var(--mcdp-muted); }
