:root {
  --bg: #0e1016;
  --bg-2: #12151c;
  --panel: #171a22;
  --panel-2: #1e222c;
  --panel-3: #252a36;
  --line: #2a2f3c;
  --line-2: #353b4a;
  --text: #e7e9ef;
  --muted: #8d95a8;
  --accent: #f5b83d;
  --accent-2: #ffd27a;
  --accent-ink: #1d1400;
  --danger: #ef6a62;
  --ok: #4cc38a;
  --radius: 12px;
  --radius-sm: 8px;
  /* Cards sit on the page with a small shadow falling to the bottom right. */
  --shadow: 3px 4px 0 rgba(0, 0, 0, .28), 6px 10px 22px -8px rgba(0, 0, 0, .6);
  --shadow-sm: 2px 3px 0 rgba(0, 0, 0, .25), 4px 6px 12px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 5px 7px 0 rgba(0, 0, 0, .3), 12px 20px 40px -12px rgba(0, 0, 0, .7);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { background: radial-gradient(1200px 600px at 70% -10%, #1b2030 0%, transparent 60%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
code { background: var(--panel-3); padding: 1px 6px; border-radius: 5px; font-size: 12px; border: 1px solid var(--line); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0 4px; }
::selection { background: rgba(245, 184, 61, .35); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 18px; height: 60px;
  background: rgba(18, 21, 28, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .7);
}
.brand { font-weight: 800; letter-spacing: .2px; font-size: 16px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand::before {
  content: ""; width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(180deg, #9a6a35 0 42%, #3b250f 42% 50%, #8a5a2b 50%);
  box-shadow: inset 0 0 0 2px #3b250f, 2px 3px 0 rgba(0, 0, 0, .35);
}
.brand span { color: var(--accent); }
.plugin { color: var(--muted); flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toggle {
  display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer;
}
.toggle input { accent-color: var(--accent); margin: 0; }

button {
  border: 1px solid var(--line-2); background: var(--panel-2); border-radius: var(--radius-sm); padding: 7px 13px; cursor: pointer;
  transition: border-color .12s, background .12s, transform .06s, box-shadow .12s; box-shadow: 1px 2px 0 rgba(0, 0, 0, .25);
}
button:hover:not(:disabled) { border-color: var(--accent); background: var(--panel-3); }
button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: #c98f1f; font-weight: 700; }
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe09b, var(--accent-2)); border-color: #c98f1f; }
button.ghost { background: transparent; box-shadow: none; }
button.ghost:hover:not(:disabled) { background: var(--panel-2); }
button.small { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
.wide-btn { width: 100%; margin-top: 10px; padding: 9px; }

/* ---------------------------------------------------------------- layout */

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 360px; height: calc(100% - 60px); gap: 16px; padding: 16px; }
.sidebar, .inspector { overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 0 6px 10px 0; }
.sidebar > section {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); margin: 0 0 10px; font-weight: 700; }

.menu-list, .palette { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.menu-list li {
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 6px;
  border: 1px solid transparent; transition: background .12s;
}
.menu-list li small { font-size: 11px; }
.menu-list li:hover { background: var(--panel-2); }
.menu-list li.active { background: var(--panel-2); border-color: var(--line-2); box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm); }
.menu-list li.muted { cursor: default; font-size: 11px; text-transform: uppercase; letter-spacing: .9px; padding: 10px 4px 2px; }
.menu-list li.muted:hover { background: none; }
.menu-list li:last-child:not(.muted) { margin-top: 6px; border: 1px dashed var(--line-2); justify-content: center; }
.menu-list li:last-child:not(.muted):hover { border-color: var(--accent); }
.menu-list .dot { color: var(--accent); font-size: 10px; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: grab; font-size: 13px; border: 1px solid transparent; }
.palette li:hover { background: var(--panel-2); border-color: var(--line); }
.palette li.unplaced { opacity: .55; }
.palette li small { font-size: 11px; }
.palette .chip {
  width: 30px; height: 30px; border-radius: 6px; flex: none; display: grid; place-items: center; font-size: 8px; overflow: hidden;
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
}
.palette .chip img, .palette .chip .icon { width: 20px !important; height: 20px !important; }
#addExtraBtn { margin-top: 10px; width: 100%; }

.stage {
  overflow: auto; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1px, transparent 0) 0 0 / 22px 22px, var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty {
  max-width: 560px; margin-top: 30px; color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-lg); line-height: 1.6;
}
.empty h1 { color: var(--text); font-size: 24px; margin: 0 0 10px; letter-spacing: -.3px; }
.empty li { margin: 6px 0; }
.empty-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 8px; }

/* ---------------------------------------------------------------- the menu, drawn like the game's chest screen (GUI scale 2) */

.inventory {
  background: #c6c6c6; padding: 8px; color: #404040; user-select: none; border-radius: 4px;
  box-shadow:
    inset 2px 2px 0 #fff, inset 4px 4px 0 #fff, inset -2px -2px 0 #555, inset -4px -4px 0 #555,
    0 0 0 2px #000, 6px 8px 0 rgba(0, 0, 0, .35), 14px 22px 40px -10px rgba(0, 0, 0, .75);
}
.inv-title { font-family: "Minecraft", "Monocraft", "Pixelify Sans", monospace; font-size: 16px; line-height: 18px; margin: 0 0 6px 2px; min-height: 18px; white-space: pre; }
.inv-title span { text-shadow: none !important; }
.inv-label { margin-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(9, 36px); gap: 0; }
.grid.hotbar { margin-top: 8px; }
.grid.player .slot { cursor: default; }
.slot {
  width: 36px; height: 36px; background: #8b8b8b; position: relative; cursor: pointer;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; display: grid; place-items: center;
}
.slot:hover::before { content: ""; position: absolute; inset: 2px; background: rgba(255, 255, 255, .5); z-index: 2; pointer-events: none; }
.grid.player .slot:hover::before { display: none; }
.slot.selected { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 3; }
.slot.list:not(:has(.ico)) { background: #8f99a8; }
.slot.dragover { background: #a9a07a; }
.slot .ico { display: grid; place-items: center; pointer-events: none; }
.slot img, .icon { image-rendering: pixelated; pointer-events: none; display: block; }
.icon.pack { background-size: 100% auto; background-repeat: no-repeat; background-position: top center; }
.icon.head { background-repeat: no-repeat; image-rendering: pixelated; }
.slot .tile { border-radius: 3px; display: grid; place-items: center; font-size: 8px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; text-align: center; line-height: 1; }
.palette .tile { width: 20px !important; height: 20px !important; font-size: 6px; display: grid; place-items: center; color: #fff; border-radius: 3px; }
.slot .amount {
  position: absolute; right: 1px; bottom: -1px; z-index: 3; font-family: "Minecraft", "Monocraft", "Pixelify Sans", monospace;
  font-size: 16px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none;
}
.slot.glow .icon { animation: glint 3s linear infinite; }
@keyframes glint {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(160, 100, 255, 0)) brightness(1.05) saturate(1.1); }
  50% { filter: drop-shadow(0 0 3px rgba(170, 110, 255, .9)) brightness(1.35) saturate(1.4) hue-rotate(-12deg); }
}
.slot .slotno { position: absolute; left: 3px; top: 1px; font-size: 9px; color: rgba(0, 0, 0, .45); pointer-events: none; opacity: 0; z-index: 4; }
.slot:hover .slotno, body.show-slots .slot .slotno { opacity: 1; }

.trash {
  padding: 10px 18px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); text-align: center; font-size: 12px; color: var(--muted);
  background: rgba(239, 106, 98, .04); min-width: 340px;
}
.trash.dragover { background: rgba(239, 106, 98, .18); border-color: var(--danger); color: var(--text); }
.trail {
  color: var(--muted); font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 8px;
}

/* ---------------------------------------------------------------- the game's item tooltip */

.tooltip { position: fixed; z-index: 60; pointer-events: none; max-width: 440px; }
.mc-tip {
  background: rgba(16, 0, 16, .94); padding: 6px 8px 5px; position: relative;
  border: 2px solid transparent; border-image: linear-gradient(rgba(80, 0, 255, .55), rgba(40, 0, 127, .55)) 1;
  outline: 2px solid rgba(16, 0, 16, .94);
  font-family: "Minecraft", "Monocraft", "Pixelify Sans", monospace; font-size: 16px; line-height: 20px; color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f; white-space: pre;
}
.mc-tip.none { color: #aaa; font-size: 13px; }
.mc-tip .line.name { margin-bottom: 4px; }
.mc-tip .c0 { text-shadow: 2px 2px 0 #000; } .mc-tip .c1 { text-shadow: 2px 2px 0 #00002a; } .mc-tip .c2 { text-shadow: 2px 2px 0 #002a00; }
.mc-tip .c3 { text-shadow: 2px 2px 0 #002a2a; } .mc-tip .c4 { text-shadow: 2px 2px 0 #2a0000; } .mc-tip .c5 { text-shadow: 2px 2px 0 #2a002a; }
.mc-tip .c6 { text-shadow: 2px 2px 0 #3f2a00; } .mc-tip .c7 { text-shadow: 2px 2px 0 #2a2a2a; } .mc-tip .c8 { text-shadow: 2px 2px 0 #151515; }
.mc-tip .c9 { text-shadow: 2px 2px 0 #15153f; } .mc-tip .ca { text-shadow: 2px 2px 0 #153f15; } .mc-tip .cb { text-shadow: 2px 2px 0 #153f3f; }
.mc-tip .cc { text-shadow: 2px 2px 0 #3f1515; } .mc-tip .cd { text-shadow: 2px 2px 0 #3f153f; } .mc-tip .ce { text-shadow: 2px 2px 0 #3f3f15; }
.mc-tip .cf { text-shadow: 2px 2px 0 #3f3f3f; }
.tip-notes {
  margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 11px; line-height: 1.5; color: var(--muted); max-width: 440px; box-shadow: var(--shadow-sm);
}
.tip-notes:empty { display: none; }

/* ---------------------------------------------------------------- inspector cards */

.inspector > .muted { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: var(--shadow); }
.card:empty { display: none; }
.card-head { background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.card-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); font-weight: 700; }
.card-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); font-weight: 700; margin-bottom: 4px; display: block; }
.card-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 2px; }
.inspector label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; font-weight: 500; }
.inspector input, .inspector select, .inspector textarea, dialog input, dialog select, dialog textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 9px;
  transition: border-color .12s, box-shadow .12s;
}
.inspector input:focus, .inspector select:focus, .inspector textarea:focus, dialog input:focus, dialog select:focus, dialog textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 184, 61, .15);
}
.inspector input[type="checkbox"] { width: auto; accent-color: var(--accent); margin-right: 6px; }
.inspector textarea { min-height: 96px; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; resize: vertical; }
.inspector .row { display: flex; gap: 10px; }
.inspector .row > * { flex: 1; min-width: 0; }
.inspector h3 { margin: 4px 0 2px; font-size: 18px; letter-spacing: -.2px; }
.inspector .desc { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); margin: 4px 4px 0 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

details.more { margin: 12px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--bg-2); }
details.more.plain { margin: 0; border: 0; padding: 0; background: none; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::before { content: "\25B8"; color: var(--muted); transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 4px; }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; }
.flags label { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: normal; }

.click-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.click-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 10px; text-align: left; padding: 8px 10px; background: var(--bg-2);
  border-radius: var(--radius-sm); box-shadow: none; align-items: start;
}
.click-row.empty .click-what { color: var(--muted); font-style: italic; }
.click-name { color: var(--muted); font-size: 12px; font-weight: 600; }
.click-what { font-size: 12px; line-height: 1.45; }
.problems { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #f1cf7a; line-height: 1.5; }
.problems li { margin: 3px 0; }

/* ---------------------------------------------------------------- toast and dialogs */

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--accent);
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 70; max-width: 80vw; box-shadow: var(--shadow-lg);
}
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; max-width: 560px; padding: 22px 24px;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(5, 6, 10, .65); backdrop-filter: blur(3px); }
dialog h2 { font-size: 18px; text-transform: none; letter-spacing: -.2px; color: var(--text); margin: 0 0 10px; }
dialog.wide { max-width: 760px; width: calc(100vw - 32px); }
.command { display: flex; gap: 8px; align-items: center; background: var(--bg-2); padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.command code { flex: 1; font-size: 15px; background: none; border: 0; }
dialog form { display: flex; justify-content: flex-end; margin-top: 14px; }
dialog .guide-body { max-height: 70vh; overflow: auto; padding-right: 8px; font-size: 14px; line-height: 1.6; }
dialog .guide-body h2 { font-size: 13px; margin-top: 20px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.guide-table { border-collapse: collapse; font-size: 13px; }
.guide-table td { padding: 4px 10px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.sw { font-family: monospace; background: #111; padding: 0 4px; border-radius: 4px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 5px; }
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.template { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.template span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.template.active { border-color: var(--accent); background: #2a2618; box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-sm); }
.dialog-buttons, .row-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; align-items: center; }
.row-buttons { justify-content: flex-start; }
.row-buttons input { flex: 1; }
dialog h3 { font-size: 14px; margin: 6px 0; }

/* ---------------------------------------------------------------- help */

.inspector label .tip, .field-label .tip {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--panel-3);
  border: 1px solid var(--line-2); color: var(--accent); font-size: 10px; cursor: help; position: relative; vertical-align: 1px; font-weight: 700;
}
/* One floating bubble for every "?" tip: drawn above the page, so panel edges never cut it off. */
.tip-bubble {
  position: fixed; z-index: 90; max-width: 280px; padding: 9px 11px; pointer-events: none;
  background: #0b0c10; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.45;
  box-shadow: var(--shadow);
}
.tip-bubble[hidden] { display: none; }
.tour-target { outline: 3px solid var(--accent) !important; outline-offset: 4px; border-radius: var(--radius); position: relative; z-index: 15; }
.tour-card {
  position: fixed; z-index: 80; width: 310px; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.5;
}
.tour-buttons { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.tour-buttons .muted { margin-right: auto; font-size: 12px; }

/* ---------------------------------------------------------------- click builder */

dialog.builder { max-width: 1080px; padding: 0; overflow: hidden; max-height: 92vh; }
dialog.builder[open] { display: flex; flex-direction: column; }
.b-head, dialog.builder .dialog-buttons { flex: none; }
.b-head { padding: 18px 22px 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.b-head h2 { margin-bottom: 12px; }
.b-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.b-tab {
  border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: none; box-shadow: none;
  color: var(--muted); padding: 8px 12px; font-size: 13px;
}
.b-tab.active { background: var(--panel); color: var(--text); border-color: var(--line); margin-bottom: -1px; font-weight: 600; }
.b-body { display: grid; grid-template-columns: 230px 1fr; flex: 1; min-height: 0; height: 560px; }
.b-palette { padding: 14px; border-right: 1px solid var(--line); overflow: auto; background: var(--bg-2); }
.b-palette h4 { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); margin: 14px 0 6px; }
.b-chip {
  padding: 7px 10px; margin: 0 0 6px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--k, var(--line-2)); cursor: grab; font-size: 13px; box-shadow: var(--shadow-sm); user-select: none;
  transition: transform .1s, border-color .1s;
}
.b-chip:hover { border-color: var(--line-2); border-left-color: var(--k, var(--accent)); transform: translateX(2px); }
.k-talk { --k: #7aa7ff; } .k-menus { --k: #b78cff; } .k-commands { --k: #ff8f6b; } .k-rewards { --k: #5fd39a; } .k-flow { --k: #f5b83d; } .k-recipe { --k: #ff6fb1; }
.b-main { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.b-list { display: flex; flex-direction: column; gap: 8px; min-height: 44px; padding: 6px; border-radius: var(--radius-sm); border: 1px dashed transparent; transition: background .1s, border-color .1s; }
.b-list.root { padding: 0; }
.b-list.over { border-color: var(--accent); background: rgba(245, 184, 61, .06); }
.b-drop-end { font-size: 11px; color: var(--muted); text-align: center; padding: 8px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); opacity: .7; }
.b-step {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--k, var(--line-2)); border-radius: var(--radius-sm);
  padding: 8px 10px; box-shadow: var(--shadow-sm);
}
.b-step.dragging { opacity: .4; }
.b-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.b-handle { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; user-select: none; }
.b-name { font-weight: 600; font-size: 13px; min-width: 120px; }
.b-field { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 140px; margin: 0; }
.b-field span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.b-step input, .b-step select { padding: 6px 8px; }
.b-x { margin-left: auto; background: none; border: 0; box-shadow: none; color: var(--muted); font-size: 18px; padding: 0 4px; line-height: 1; }
.b-x:hover:not(:disabled) { color: var(--danger); background: none; }
.b-preview { margin-top: 8px; font-size: 14px; line-height: 18px; display: inline-block; white-space: pre-wrap; }
.b-if { --k: var(--accent); }
.b-if > .b-row select { width: auto; }
.b-conds { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px 24px; }
.b-cond { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--bg-2); padding: 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.b-cond select, .b-cond input { width: auto; flex: 1; min-width: 110px; }
.b-conds > button { align-self: flex-start; }
.b-branch { margin: 8px 0 0 24px; border-radius: var(--radius-sm); padding: 6px 8px; border: 1px solid var(--line); }
.b-branch.then { background: rgba(95, 211, 154, .05); border-left: 3px solid #5fd39a; }
.b-branch.else { background: rgba(239, 106, 98, .05); border-left: 3px solid var(--danger); }
.b-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--muted); margin: 0 0 4px 6px; }
.b-branch.then .b-label { color: #5fd39a; }
.b-branch.else .b-label { color: var(--danger); }
.b-main > * { flex-shrink: 0; }
.b-summary { position: sticky; bottom: -16px; margin-bottom: -16px; box-shadow: 0 -10px 16px -8px var(--panel); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.b-summary b { color: var(--text); }
dialog.builder .dialog-buttons { padding: 12px 18px; margin: 0; border-top: 1px solid var(--line); background: var(--panel-2); }

/* ---------------------------------------------------------------- Minecraft colour codes */

.c0 { color: #000; } .c1 { color: #00a; } .c2 { color: #0a0; } .c3 { color: #0aa; } .c4 { color: #a00; } .c5 { color: #a0a; }
.c6 { color: #fa0; } .c7 { color: #aaa; } .c8 { color: #555; } .c9 { color: #55f; } .ca { color: #5f5; } .cb { color: #5ff; }
.cc { color: #f55; } .cd { color: #f5f; } .ce { color: #ff5; } .cf { color: #fff; }
.fl { font-weight: 700; } .fo { font-style: italic; } .fn { text-decoration: underline; } .fm { text-decoration: line-through; }
.cond { color: #9d8cff; }

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 1200px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); height: auto; }
  .inspector { grid-column: 1 / -1; overflow: visible; }
  .sidebar { overflow: visible; }
}
@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .plugin { order: 3; flex-basis: 100%; }
  .layout { grid-template-columns: 1fr; padding: 12px 16px; }
  .stage { padding: 18px 8px; }
  .grid { grid-template-columns: repeat(9, 32px); }
  .slot { width: 32px; height: 32px; }
  .trash { min-width: 0; width: 100%; }
  .b-body { grid-template-columns: 1fr; height: auto; overflow: auto; }
  .b-palette { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
}

/* Plugin blocks in the click builder */
.k-plugin { --k: #3fd0c9; }
.b-group { margin: 0 0 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); box-shadow: var(--shadow-sm); }
.b-group > summary { cursor: pointer; padding: 7px 10px; font-weight: 600; font-size: 13px; list-style: none; display: flex; justify-content: space-between; }
.b-group > summary::-webkit-details-marker { display: none; }
.b-group[open] > summary { border-bottom: 1px solid var(--line); }
.b-group > .b-chip { margin: 6px 8px; box-shadow: none; }
.b-plugin { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .9px; color: #3fd0c9; font-weight: 700; }

/* Unsaved-draft bar and small menu types */
.draft-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); padding: 8px 12px; box-shadow: var(--shadow-sm); font-size: 13px;
}
.draft-bar span { margin-right: auto; }
.grid.small-menu { margin: 0 auto; }
#undoBtn, #redoBtn { font-size: 16px; padding: 5px 10px; }

.k-remember { --k: #c9a2ff; }
