:root {
  --bg: #f0f5f9;
  --surface: #ffffff;
  --surface2: #f0efe9;
  --border: #cbd5e1;
  --border-strong: #64748b;

  --c-static:   #6c7a89;
  --c-relative: #7c3aed;
  --c-absolute: #dc2626;
  --c-fixed:    #0891b2;
  --c-sticky:   #d97706;
  --c-zindex:   #16a34a;
  --c-stacking: #9333ea;
  --c-debugger: #0f766e;

  --text: #1c1917;
  --muted: #78716c;
  --muted2: #4a5259;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --radius: 8px;
}

.about-section li {
  margin-bottom:8px;
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ── SIDEBAR ── */
.sidebar1 {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  border-radius: 8px
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0.875rem 0 0.3rem;
}
.sidebar-label:first-child { margin-top: 0; }

.pos-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.6rem 0.875rem;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pos-btn .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--btn-color);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.pos-btn:hover {
  border-color: var(--btn-color);
  background: color-mix(in srgb, var(--btn-color) 6%, transparent);
}

.pos-btn.active {
  border-color: var(--btn-color);
  background: color-mix(in srgb, var(--btn-color) 10%, white);
  color: var(--btn-color);
}

.pos-btn.active .dot { transform: scale(1.5); }

.pos-btn[data-pos="static"]   { --btn-color: var(--c-static); }
.pos-btn[data-pos="relative"] { --btn-color: var(--c-relative); }
.pos-btn[data-pos="absolute"] { --btn-color: var(--c-absolute); }
.pos-btn[data-pos="fixed"]    { --btn-color: var(--c-fixed); }
.pos-btn[data-pos="sticky"]   { --btn-color: var(--c-sticky); }
.pos-btn[data-pos="zindex"]   { --btn-color: var(--c-zindex); }
.pos-btn[data-pos="stacking"] { --btn-color: var(--c-stacking); }
.pos-btn[data-pos="debugger"] { --btn-color: var(--c-debugger); }

/* ── CONTROLS PANEL ── */
.controls-panel {
  display: none;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.25rem;
  padding: 0.875rem;
  background: #fafcff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.controls-panel.visible { display: flex; }

.ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ctrl-row label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted2);
  display: flex;
  justify-content: space-between;
}

.ctrl-row label .val {
  color: var(--text);
  font-weight: 700;
}

.ctrl-row input[type=range] {
  width: 100%;
  cursor: pointer;
}

.ctrl-hint {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted2);
  line-height: 1.55;
}

/* ── MAIN ── */
.main {
  padding-left: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── DESC CARD ── */
.desc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.desc-left h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  color: var(--active-color, var(--text));
  font-family: var(--mono);
}

.desc-left p {
  font-size: 0.85rem!important;
  line-height: 1.65;
  color: var(--muted2)!important;
}

.keypoints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.kp {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.18rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted2);
}

.code-badge {
  background: #1c1917;
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  white-space: pre;
  line-height: 1.75;
  min-width: 205px;
  max-width: 240px;
  overflow: hidden;
  color: #a8a29e;
  margin: 0;
  border: none;
  box-shadow: none;
  margin-top: 20px;
}

.code-badge .kw  { color: #fb923c; }
.code-badge .val { color: #86efac; }
.code-badge .cmt { color: #57534e; }

/* ── CANVAS ── */
.canvas-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  /*min-height: 420px;*/
  height: 100%;
}

/* ── SCENES ── */
.scene {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.scene.active {
  position: relative;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

/* ══ STATIC ══ */
#scene-static {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.static-box {
  background: #f0f5f9;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.125rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.static-box .bnum {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.static-box.focus {
  border-color: var(--c-static);
  background: color-mix(in srgb, var(--c-static) 20%, white);
}
.static-box.focus .bnum { background: var(--c-static); color: white; }
.static-box.focus .blbl { color: var(--text); font-weight: 700; }

.static-note {
  margin-top: 0.4rem;
  padding: 0.7rem 0.875rem;
  background: color-mix(in srgb, var(--c-static) 10%, white);
  border: 1.5px dashed color-mix(in srgb, var(--c-static) 40%, transparent);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted2);
  line-height: 1.6;
}

/* ══ RELATIVE ══ */
#scene-relative {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rel-box {
  background: #f0f5f9;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.125rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
}

.rel-slot { position: relative; }

.rel-ghost {
  border: 2px dashed color-mix(in srgb, var(--c-relative) 35%, transparent);
  border-radius: 6px;
  padding: 0.75rem 1.125rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--c-relative) 40%, transparent);
  background: color-mix(in srgb, var(--c-relative) 4%, white);
}

.rel-moved {
  position: relative;
  background: color-mix(in srgb, var(--c-relative) 10%, white);
  border: 2px solid var(--c-relative);
  border-radius: 6px;
  padding: 0.75rem 1.125rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--c-relative);
  font-weight: 700;
  transition: top 0.25s ease, left 0.25s ease;
}

/* ══ ABSOLUTE ══ */
#scene-absolute {
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
}

.abs-stage {
  position: relative;
  width: 320px;
  height: 280px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2px dashed color-mix(in srgb, var(--c-absolute) 35%, transparent);
  background: color-mix(in srgb, var(--c-absolute) 4%, white);
}

.abs-stage-label {
  position: absolute;
  top: 7px; left: 9px;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: color-mix(in srgb, var(--c-absolute) 55%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.abs-stage::before, .abs-stage::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: color-mix(in srgb, var(--c-absolute) 40%, transparent);
  border-style: solid;
}
.abs-stage::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.abs-stage::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.abs-el {
  position: absolute;
  background: color-mix(in srgb, var(--c-absolute) 12%, white);
  border: 2px solid var(--c-absolute);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--c-absolute);
  font-weight: 700;
  white-space: nowrap;
  transition: top 0.2s, left 0.2s;
}

.abs-line-h, .abs-line-v {
  position: absolute;
  background: color-mix(in srgb, var(--c-absolute) 25%, transparent);
  pointer-events: none;
}
.abs-line-h { height: 1px; left: 0; }
.abs-line-v { width: 1px; top: 0; }

.abs-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: flex-start;
  padding-top: 0.5rem;
}

/* ══ FIXED ══ */
#scene-fixed { }

.fixed-scroll-wrapper {
  height: 420px;
  overflow-y: scroll;
  position: relative;
  background: #f0f5f9;
}

.fixed-badge {
  position: sticky;
  top: 12px;
  float: right;
  clear: right;
  margin: 12px 12px 0 0;
  background: color-mix(in srgb, var(--c-fixed) 10%, white);
  border: 2px solid var(--c-fixed);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--c-fixed);
  font-weight: 700;
  line-height: 1.5;
  z-index: 10;
  pointer-events: none;
}

.fixed-content {
  padding: 0.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: 820px;
}

.fixed-hint {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted2);
  padding: 0.875rem 1.25rem 0.25rem;
}

.fixed-line {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.875rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fixed-line .ln {
  font-size: 0.58rem;
  color: var(--border-strong);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

/* ══ STICKY ══ */
#scene-sticky { }

.sticky-scroll-wrapper {
  height: 420px;
  overflow-y: scroll;
  background: #f0f5f9;
}

.sticky-header {
  position: sticky;
  top: 0;
  padding: 0.55rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid;
  transition: top 0.2s;
}

.sticky-pill {
  font-size: 0.6rem;
  padding: 0.1em 0.5em;
  border-radius: 20px;
  border: 1px solid currentColor;
  font-weight: 600;
  margin-left: auto;
  background: white;
}

.sh-a { background: color-mix(in srgb, var(--c-sticky)  20%, white); color: var(--c-sticky);   border-color: color-mix(in srgb, var(--c-sticky)  25%, transparent); }
.sh-b { background: color-mix(in srgb, var(--c-relative) 20%, white); color: var(--c-relative); border-color: color-mix(in srgb, var(--c-relative) 25%, transparent); }
.sh-c { background: color-mix(in srgb, var(--c-fixed)   20%, white); color: var(--c-fixed);    border-color: color-mix(in srgb, var(--c-fixed)   25%, transparent); }

.sticky-items {
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sticky-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.875rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted2);
}

/* ══ Z-INDEX ══ */
#scene-zindex {
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.z-stage {
  position: relative;
  width: 320px;
  height: 280px;
  flex-shrink: 0;
  border: 2px dashed color-mix(in srgb, var(--c-zindex) 30%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--c-zindex) 3%, white);
}

.z-card {
  position: absolute;
  width: 155px;
  height: 95px;
  border-radius: 8px;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  transition: box-shadow 0.2s;
  user-select: none;
}

.z-card .z-sub { font-size: 0.65rem; font-weight: 400; margin-top: 0.2rem; opacity: 0.65; }

#zcard-a { top: 35px;  left: 25px;  border-color: var(--c-absolute); background: color-mix(in srgb, var(--c-absolute) 10%, white); color: var(--c-absolute); }
#zcard-b { top: 85px;  left: 85px;  border-color: var(--c-relative); background: color-mix(in srgb, var(--c-relative) 10%, white); color: var(--c-relative); }
#zcard-c { top: 145px; left: 45px;  border-color: var(--c-fixed);    background: color-mix(in srgb, var(--c-fixed)    10%, white); color: var(--c-fixed); }

.z-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-top: 0.25rem;
}

.z-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.z-ctrl {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.z-ctrl label {
  font-family: var(--mono);
  font-size: 0.62rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.z-ctrl label .z-name { font-weight: 700; }
.z-ctrl label .z-val  { color: var(--muted2); }

.z-ctrl input[type=range] { width: 100%; cursor: pointer; }

#zctrl-a input { accent-color: var(--c-absolute); }
#zctrl-b input { accent-color: var(--c-relative); }
#zctrl-c input { accent-color: var(--c-fixed); }

/* ── SHARED INFO BLOCK ── */
.info-block {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted2);
}

.info-block strong {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--mono);
  margin-bottom: 0.25rem;
}

code { font-family: var(--mono); font-size: 0.88em; }

/* ══ STACKING CONTEXT ══ */
#scene-stacking {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stacking-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stacking-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stacking-col-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
}

.stacking-col-label.expected  { background: color-mix(in srgb, #16a34a 10%, white); color: #16a34a; }
.stacking-col-label.broken    { background: color-mix(in srgb, #dc2626 10%, white); color: #dc2626; }

.stacking-arena {
  position: relative;
  height: 160px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

/* Expected side — simple overlap */
.sc-box-outer-expected {
  position: absolute;
  top: 20px; left: 20px;
  width: 150px; height: 100px;
  border-radius: 6px;
  border: 2px solid var(--c-absolute);
  background: color-mix(in srgb, var(--c-absolute) 10%, white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--c-absolute); font-weight: 700;
  z-index: 1;
}

.sc-box-a-expected {
  position: absolute;
  top: 40px; left: 100px;
  width: 150px; height: 100px;
  border-radius: 6px;
  border: 2px solid var(--c-stacking);
  background: color-mix(in srgb, var(--c-stacking) 12%, white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--c-stacking); font-weight: 700;
  z-index: 100;
}

.sc-sub { font-size: 0.58rem; font-weight: 400; opacity: 0.7; margin-top: 2px; }

/* Broken side */
.sc-parent {
  position: absolute;
  top: 20px; left: 20px;
  width: 150px; height: 100px;
  border-radius: 6px;
  border: 2px dashed var(--c-absolute);
  background: color-mix(in srgb, var(--c-absolute) 8%, white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--c-absolute);
  transition: opacity 0.3s, filter 0.3s, transform 0.3s;
}

.sc-parent-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.sc-parent-trigger {
  font-size: 0.52rem;
  margin-top: 4px;
  opacity: 0.65;
  font-style: italic;
  text-align: center;
}

.sc-child {
  position: absolute;
  top: 30px; left: 40px;
  width: 110px; height: 60px;
  border-radius: 4px;
  border: 2px solid var(--c-absolute);
  background: color-mix(in srgb, var(--c-absolute) 15%, white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.62rem;
  color: var(--c-absolute); font-weight: 700;
  z-index: 100;
}

.sc-box-b {
  position: absolute;
  top: 40px; left: 100px;
  width: 150px; height: 100px;
  border-radius: 6px;
  border: 2px solid var(--c-stacking);
  background: color-mix(in srgb, var(--c-stacking) 12%, white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--c-stacking); font-weight: 700;
  z-index: 1;
}

/* Trigger buttons */
.trigger-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.trigger-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}

.trigger-btn:hover { border-color: var(--c-stacking); color: var(--c-stacking); }

.trigger-btn.on {
  border-color: var(--c-stacking);
  background: color-mix(in srgb, var(--c-stacking) 10%, white);
  color: var(--c-stacking);
}

.stacking-explainer {
  background: color-mix(in srgb, var(--c-stacking) 5%, white);
  border: 1.5px solid color-mix(in srgb, var(--c-stacking) 25%, transparent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--c-stacking);
  line-height: 1.6;
}

.stacking-explainer strong { display: block; margin-bottom: 0.2rem; color: var(--text); }
.sc-tag {
  position: absolute;
  top: 5px; left: 6px;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.sc-tag-broken {
  color: var(--c-absolute);
  opacity: 1;
}

.sc-gotcha-note {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted2);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  transition: all 0.3s;
}

.sc-gotcha-note.active {
  color: var(--c-stacking);
  border-color: color-mix(in srgb, var(--c-stacking) 40%, transparent);
  background: color-mix(in srgb, var(--c-stacking) 5%, white);
  font-weight: 700;
}

/* Explanation panel for debugger */
.dbg-explain {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--muted2);
  line-height: 1.55;
  transition: border-color 0.2s, background 0.2s;
}

.dbg-explain.warn {
  border-color: color-mix(in srgb, #d97706 30%, transparent);
  background: color-mix(in srgb, #d97706 5%, white);
  color: #92400e;
}

.dbg-explain.broken {
  border-color: color-mix(in srgb, #dc2626 30%, transparent);
  background: color-mix(in srgb, #dc2626 5%, white);
  color: #991b1b;
}

.dbg-explain-icon { flex-shrink: 0; font-size: 0.9rem; margin-top: 0.05rem; }

/* ══ LAYOUT DEBUGGER ══ */
#scene-debugger {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dbg-intro {
  background: color-mix(in srgb, var(--c-debugger) 6%, white);
  border: 1.5px solid color-mix(in srgb, var(--c-debugger) 20%, transparent);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 0.1rem;
}

.dbg-intro-title {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-debugger);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dbg-intro p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted2);
}

.dbg-intro strong { color: var(--text); }

.debugger-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dbg-ctrl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem 0.3rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.dbg-ctrl-label {
  color: var(--muted2);
  white-space: nowrap;
}

.dbg-ctrl select {
  font-family: var(--mono);
  font-size: 0.62rem;
  border: none;
  background: white;
  border-radius: 3px;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.dbg-reset {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: white;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}
.dbg-reset:hover { border-color: var(--text); color: var(--text); }

/* The mini page */
.mini-page {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f7f4;
  font-family: var(--mono);
  font-size: 0.68rem;
  position: relative;
  min-height: 320px;
  transform: translateZ(0);
}

.mp-nav {
  background: #1c1917;
  color: white;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
}
.mp-nav.pos-relative { position: relative; top: auto; left: auto; right: auto; z-index: auto; }
.mp-nav.pos-static   { position: static;   top: auto; left: auto; right: auto; z-index: auto; }
.mp-nav.pos-sticky   { position: sticky;   top: 0;    left: auto; right: auto; z-index: 50; }

.mp-nav-spacer {
  height: 37px;
  flex-shrink: 0;
}

.mp-nav.pos-relative ~ .mp-nav-spacer,
.mp-nav.pos-static   ~ .mp-nav-spacer,
.mp-nav.pos-sticky   ~ .mp-nav-spacer { height: 0; }

.mp-nav-brand { color: #fb923c; }
.mp-nav-links { display: flex; gap: 0.75rem; opacity: 0.6; font-size: 0.62rem; font-weight: 400; }

.mp-body {
  display: flex;
  min-height: 240px;
}

.mp-sidebar {
  width: 110px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}
.mp-sidebar.pos-static   { position: static; }
.mp-sidebar.pos-absolute { position: absolute; top: 0; left: 0; bottom: 0; z-index: 5; }
.mp-sidebar.pos-fixed    { position: fixed; top: 40px; left: 0; bottom: 0; z-index: 5; width: 110px; }

.mp-sidebar-item {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6rem;
  color: var(--muted2);
  background: var(--bg);
}
.mp-sidebar-item.active-item { background: color-mix(in srgb, var(--c-debugger) 10%, white); color: var(--c-debugger); font-weight: 700; }

.mp-content {
  flex: 1;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.mp-content-block {
  background: white;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.5rem 0.75rem;
  font-size: 0.62rem;
  color: var(--muted2);
  line-height: 1.5;
}

.mp-content-block.tall { min-height: 60px; }

.mp-tooltip {
  position: absolute;
  top: 12px; right: 12px;
  background: #1c1917;
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  font-size: 0.6rem;
  line-height: 1.4;
  max-width: 130px;
  z-index: 10;
  pointer-events: none;
}
.mp-tooltip.pos-relative { position: relative; top: auto; right: auto; }
.mp-tooltip.pos-static   { position: static;   top: auto; right: auto; }
.mp-tooltip.pos-fixed    { position: fixed;    top: 12px; right: 12px; }

.mp-tooltip::before {
  content: '▲';
  position: absolute;
  top: -10px; left: 12px;
  font-size: 0.5rem;
  color: #1c1917;
}

.mp-footer {
  background: #e0ddd5;
  padding: 0.5rem 1rem;
  font-size: 0.6rem;
  color: var(--muted2);
  display: flex;
  gap: 1rem;
  position: static;
}
.mp-footer.pos-sticky   { position: sticky; bottom: 0; }
.mp-footer.pos-fixed    { position: fixed;  bottom: 0; left: 0; right: 0; z-index: 50; }
.mp-footer.pos-absolute { position: absolute; bottom: 0; left: 0; right: 0; }

/* Position badges on mini-page elements */
.pos-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
}

/* status strip */
.dbg-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  align-items: center;
}

.dbg-status-item {
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  border: 1px solid;
}

.dbg-status-item.ok      { background: color-mix(in srgb, #16a34a 8%, white); color: #16a34a; border-color: color-mix(in srgb, #16a34a 25%, transparent); }
.dbg-status-item.warn    { background: color-mix(in srgb, #d97706 8%, white); color: #d97706; border-color: color-mix(in srgb, #d97706 25%, transparent); }
.dbg-status-item.broken  { background: color-mix(in srgb, #dc2626 8%, white); color: #dc2626; border-color: color-mix(in srgb, #dc2626 25%, transparent); }

.menu-btn { display: none; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 998;
}

/*.sidebar1 {
  z-index: 8;
}*/

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-close {
  position: absolute;
  top: 0px;
  right: 0px;
  padding: 4px 5px;
  border-radius: 4px;
  border: none;
  background: #d90036;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: none;

}

.sidebar-close:hover {
  background: #000;
}

.sidebar-close:hover {
  opacity: 1;
}

@media (max-width: 850px) {
	.sidebar-close {
		display: block;
	}
    .menu-btn {
        display: block;  z-index: 8;
        background: #4d4cff; color: white; border: none; padding: 1px 15px;
        border-radius: 6px; cursor: pointer;
		font-size:0.85em;
    }

    .layout { grid-template-columns: 1fr; }
	
	.main { padding:0; }

    .sidebar1 {
        position: fixed; top: 0; left: -320px;
        width: 320px; height: 100vh; z-index: 999; background:white;padding:10px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 20px rgba(0,0,0,0.1);
    }

    .sidebar1.open {
        transform: translateX(320px);
    }

}
   .comparison-table {
      width: 100%;
      border-collapse: collapse;
      margin: 1.5em 0;
      font-size: 0.95em;
    }
    .comparison-table th {
      background: #4a90d9;
      color: #fff;
      padding: 10px 14px;
      text-align: left;
    }
    .comparison-table td {
      padding: 9px 14px;
      border-bottom: 1px solid #e0e0e0;
    }
    .comparison-table tr:nth-child(even) td {
      background: #f5f8fd;
    }
    .comparison-table code {
      background: #e8f0fb;
      padding: 2px 6px;
      border-radius: 3px;
    }
    .yes { color: #2a9d2a; font-weight: bold; }
    .no  { color: #c0392b; font-weight: bold; }
    .both { color: #d47c00; font-weight: bold; }
    /* --- FAQ --- */
    .faq-section {
      margin: 2em 0;
    }
    .faq-item {
      border: 1px solid #e0e0e0;
      border-radius: 6px;
      margin-bottom: 1em;
      overflow: hidden;
    }
    .faq-item summary {
      padding: 1em 1.2em;
      font-weight: bold;
      cursor: pointer;
      background: #f8f9fa;
      list-style: none;
    }
    .faq-item summary::-webkit-details-marker { display: none; }
    .faq-item summary::before {
      content: '+ ';
      color: #4a90d9;
      font-weight: bold;
    }
    .faq-item[open] summary::before {
      content: '− ';
    }
    .faq-item p {
      padding: 1em 1.2em;
      margin: 0;
      border-top: 1px solid #e0e0e0;
    }
    .faq-item code {
      background: #e8f0fb;
      padding: 2px 6px;
      border-radius: 3px;
      font-size: 0.92em;
    }