/* a clearer "5" for Pixelify Sans (tools/make-five.py): same family name, only U+0035, so every 5 in the display font
   uses it and the rest stays Pixelify. Its own 5 is round like an S, so "$35" read as "$38" */
@font-face { font-family: "Pixelify Sans"; src: url("/site/fonts/pixelify-five.woff2") format("woff2"); font-weight: 400 700; font-style: normal; unicode-range: U+0035; font-display: swap; }

/* Blockwright / Moxel Worlds editor. Same product language as the site (public/site/site.css):
   amber = the AI + primary action, teal = live state + the active tool, violet = depth.
   Spacing scale 4 / 8 / 12 / 16 / 24. Controls: 32px (bar), 28px (panel), 24px (inline). */
:root {
  --amber: #3fd6c8;
  --amber-hi: #9ff5e8;
  --amber-ink: #022421;
  --teal: #6cc970;
  --violet: #b45cff;
  --rose: #ff5a6e;
  --accent: var(--teal);
  --ai: var(--amber);
  --bg-0: #0a0b0b;
  --bg-1: #121414;
  --bg-2: #1a1d1d;
  --bg-3: #232727;
  --panel: rgba(16, 18, 18, 0.86);
  --glass: rgba(14, 16, 16, 0.78);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-3: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededed;
  --text-dim: #a6aeae;
  --text-faint: #6c7474;
  --radius: 0px;
  --radius-sm: 0px;
  --radius-xs: 0px;
  --font-display: "Pixelify Sans", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t: 160ms var(--ease);
  --shadow-float: 0 16px 44px -16px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.25);
  --left-w: clamp(232px, 15vw, 300px);
  --right-w: clamp(272px, 17vw, 360px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.45 var(--font-body);
  background: radial-gradient(1100px 560px at 72% -12%, rgba(108, 201, 112, 0.06), transparent 62%),
              radial-gradient(900px 520px at -10% 110%, rgba(63, 214, 200, 0.06), transparent 60%), var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
input, textarea { user-select: text; }
::selection { background: rgba(63, 214, 200, 0.35); color: #fff; }
.hidden { display: none !important; }
.dim { color: var(--text-dim); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { font-family: var(--font-mono); font-size: 0.92em; color: #e6eaea; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; padding: 0.05em 0.4em; }
kbd {
  font: 500 10.5px/1 var(--font-mono); color: var(--text-dim); background: var(--bg-3); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 0; padding: 3px 5px 2px; white-space: nowrap;
}

/* ---------- icons ----------
   tools/make-icons.mjs draws them (shared with the model editor): ink shapes with a white outline and a teal accent, in
   the cursors' style. Their colours are these variables, so a state can recolour an icon without touching the sprite. */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  --ic-line: #dfe5e7; --ic-ink: #15181b; --ic-acc: #3fd6c8; }
button:hover .ic, .btn:hover .ic, a:hover .ic { --ic-line: #ffffff; }
button.on .ic, button[aria-pressed=true] .ic, .btn.on .ic { --ic-line: #9ff3ea; }
button:disabled .ic { --ic-line: #8b9396; }
button.primary .ic { --ic-line: #10302d; --ic-ink: #eafffb; --ic-acc: #10302d; }

/* ---------- buttons ---------- */
button, .btn {
  font: 500 12.5px/1 var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); height: 30px; padding: 0 11px; cursor: var(--cur-pointer); white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: var(--cur-not-allowed); transform: none; }
button.icon { width: 30px; padding: 0; }
button.sm, .btn.sm { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
button.sm.icon, .btn.sm.icon { width: 26px; padding: 0; }
button.sm .ic, .btn.sm .ic { width: 14px; height: 14px; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
button.on, .btn.on { color: var(--teal); background: rgba(108, 201, 112, 0.1); border-color: rgba(108, 201, 112, 0.4); }
button.primary {
  color: var(--amber-ink); font-weight: 600; border-color: transparent;
  background: linear-gradient(180deg, var(--amber-hi), var(--amber));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 -2px 0 rgba(10, 90, 85, 0.22) inset, 0 8px 22px -12px rgba(63, 214, 200, 0.7);
}
button.primary:hover { background: linear-gradient(180deg, #b8fff2, var(--amber-hi)); border-color: transparent; }
button.primary .ic { stroke-width: 2; }

/* focus: amber like the site */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
#gl:focus-visible { outline: none; }

/* ---------- form controls ---------- */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: var(--cur-pointer);
  --fill: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 0;
  background: linear-gradient(90deg, var(--teal) 0 var(--fill), rgba(255, 255, 255, 0.1) var(--fill) 100%);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #eef7e2; border: 3px solid var(--teal); box-shadow: 0 0 0 4px rgba(108, 201, 112, 0); transition: box-shadow var(--t);
}
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(108, 201, 112, 0.16); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(63, 214, 200, 0.7); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 0; background: rgba(255, 255, 255, 0.1); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 0; background: var(--teal); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #eef7e2; border: 3px solid var(--teal); }

.select, .props select {
  -webkit-appearance: none; appearance: none; font: 500 12.5px/1 var(--font-body); color: var(--text);
  height: 30px; padding: 0 28px 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); cursor: var(--cur-pointer);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  transition: border-color var(--t), background-color var(--t);
}
.select:hover, .props select:hover { border-color: rgba(255, 255, 255, 0.24); background-color: var(--bg-3); }
.select option, .props select option { background: var(--bg-2); }

/* toggle switches (all .check checkboxes) */
.check { display: flex; align-items: center; gap: 10px; min-height: 28px; color: var(--text-dim); cursor: var(--cur-pointer); transition: color var(--t); }
.check:hover { color: var(--text); }
.check input, .feat-row input { --sw: var(--teal); }   /* the switch's colour when on (the Render panel uses its own) */
/* switches: square like the rest of the UI. Off = dark track, grey knob; on = a tinted track with an accent edge and a
   solid accent knob (no dark knob on a bright fill) */
.check input {
  -webkit-appearance: none; appearance: none; flex: none; box-sizing: border-box; width: 30px; height: 16px; margin: 0; border-radius: 0; cursor: var(--cur-pointer); position: relative;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); transition: background var(--t), border-color var(--t);
}
.check input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 0; background: #8e9999;
  transition: transform 160ms var(--ease), background var(--t), box-shadow var(--t);
}
.check:hover input { border-color: rgba(255, 255, 255, 0.34); }
.check input:checked { background: color-mix(in srgb, var(--sw) 20%, transparent); border-color: var(--sw); }
.check input:checked::after { transform: translateX(14px); background: var(--sw); box-shadow: 0 0 6px color-mix(in srgb, var(--sw) 55%, transparent); }
.check input:focus-visible, .feat-row input:focus-visible { outline: 2px solid var(--sw); outline-offset: 2px; }

/* ---------- tooltip (positioned by app.js) ---------- */
.tip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 260px; display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: var(--radius-xs); background: #262119; border: 1px solid var(--border-strong);
  color: var(--text); font: 500 12px/1.35 var(--font-body); box-shadow: 0 10px 28px -10px #000;
  opacity: 0; transform: translateY(2px); transition: opacity 120ms, transform 120ms;
}
.tip.show { opacity: 1; transform: none; }
.tip kbd { flex: none; }

/* ---------- layout ---------- */
#app {
  display: grid; height: 100vh;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w); grid-template-rows: 52px minmax(0, 1fr);
  grid-template-areas: "top top top" "left stage right";
}

/* ---------- top bar ---------- */
.top {
  grid-area: top; position: relative; z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border); background: rgba(9, 12, 18, 0.92);
}
.top-l, .top-c, .top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-r { justify-content: flex-end; }
.top-c { gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; flex: none; color: inherit; text-decoration: none; border-radius: var(--radius-xs); }
a.brand:hover span { color: #fff; }
.brand img { width: 24px; height: 24px; border-radius: 0; }
.brand span { font: 700 16px/1 var(--font-display); letter-spacing: -0.02em; }
.brand em {
  font: 500 10.5px/1 var(--font-mono); font-style: normal; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 0; padding: 3px 7px;
}
.vsep { width: 1px; height: 22px; background: var(--border); flex: none; margin: 0 6px; }
.title { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; }
.title input {
  font: 600 14px/1.2 var(--font-body); color: var(--text); background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-xs); padding: 2px 6px; margin-left: -7px; width: min(300px, 100%); min-width: 0; text-overflow: ellipsis;
  transition: border-color var(--t), background var(--t);
}
.title input:hover { border-color: var(--border); }
.title input:focus { outline: none; border-color: rgba(63, 214, 200, 0.55); background: var(--surface); }
#schemSize { font: 11px/1.2 var(--font-mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-group { display: flex; gap: 2px; }
.btn-group button { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-group button:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.seg { display: flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border); }
.seg button { height: 26px; padding: 0 11px; border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; color: var(--text-dim); }
.seg button:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.pill {
  display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 11px; border-radius: 0; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-weight: 500; white-space: nowrap; transition: color 300ms, border-color 300ms, background 300ms; margin-right: 4px;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); transition: background 300ms, box-shadow 300ms; }
.pill.live { color: var(--amber); border-color: rgba(63, 214, 200, 0.4); background: rgba(63, 214, 200, 0.08); }
.pill.live i { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.fx-btn { color: #b8fff2; border-color: rgba(63, 214, 200, 0.3); background: rgba(63, 214, 200, 0.05); }
.fx-btn:hover { border-color: rgba(63, 214, 200, 0.6); background: rgba(63, 214, 200, 0.1); }
.fx-btn.on { color: #fff; border-color: var(--amber); background: rgba(63, 214, 200, 0.22); box-shadow: none; }

/* export menu */
.menu { position: relative; }
.menu .chev { width: 13px; height: 13px; margin-left: -2px; opacity: 0.75; transition: transform var(--t); }
.menu.open .chev { transform: rotate(180deg); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 290px; z-index: 30; display: none; padding: 6px;
  background: rgba(22, 25, 25, 0.98); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 22px 60px -14px rgba(0, 0, 0, 0.85);
}
.menu.open .menu-pop { display: block; animation: popIn 140ms var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.menu-pop a {
  display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: var(--cur-pointer); color: var(--text); outline-offset: -2px;
}
.menu-pop a .ic { grid-row: span 2; color: var(--text-faint); }
.menu-pop a b { font-weight: 600; font-size: 13px; }
.menu-pop a span { grid-column: 2; color: var(--text-dim); font-size: 11.5px; }
.menu-pop a:hover, .menu-pop a:focus-visible { background: var(--surface-2); }
.menu-pop a:hover .ic { color: var(--text-dim); }
.menu-pop a.feat { background: rgba(63, 214, 200, 0.07); border: 1px solid rgba(63, 214, 200, 0.18); margin-bottom: 4px; }
.menu-pop a.feat .ic { color: var(--amber); fill: var(--amber); stroke-width: 1.5; }
.menu-pop a.feat:hover { background: rgba(63, 214, 200, 0.13); }
.menu-label { padding: 8px 10px 4px; font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- side panels ---------- */
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.left { grid-area: left; border-right: 1px solid var(--border); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.right { grid-area: right; border-left: 1px solid var(--border); }
.panel > section { border-bottom: 1px solid var(--border); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 10px 0 8px; }
.sec-toggle {
  flex: 1; justify-content: flex-start; gap: 6px; height: 28px; padding: 0 6px; border: none; background: transparent; min-width: 0;
  color: var(--text-faint);
}
.sec-toggle:hover { background: transparent; color: var(--text-dim); }
.sec-toggle h3 { margin: 0; font: 600 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: inherit; }
.sec-toggle .chev { width: 13px; height: 13px; transform: rotate(90deg); transition: transform var(--t); }
.sec.collapsed .sec-toggle .chev { transform: none; }
.sec.collapsed .sec-body { display: none; }
.sec-body { padding: 0 14px 14px; }
.count { font: 11px/1 var(--font-mono); color: var(--text-faint); padding-right: 4px; }
.row-btns { display: flex; gap: 2px; }

/* maps list */
.schem-list { list-style: none; margin: 0 -6px; padding: 0; max-height: clamp(116px, 24vh, 300px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.schem-list li {
  position: relative; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: var(--cur-pointer);
  display: flex; flex-direction: column; gap: 2px; transition: background var(--t), border-color var(--t);
}
.schem-list li:hover { background: var(--surface-2); }
.schem-list li.on { background: rgba(108, 201, 112, 0.07); border-color: rgba(108, 201, 112, 0.28); }
.schem-list li.on::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 2px; border-radius: 0; background: var(--teal); }
.schem-list li b { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schem-list li small { color: var(--text-faint); font: 10.5px/1.3 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schem-list li .del { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; opacity: 0; border: none; background: none; color: var(--text-faint); }
.schem-list li .del .ic { width: 14px; height: 14px; }
.schem-list li:hover .del, .schem-list li .del:focus-visible { opacity: 1; }
.schem-list li .del:hover { color: var(--rose); background: rgba(255, 90, 110, 0.1); }
.schem-list li:hover, .schem-list li:focus-within { padding-right: 60px; }
.schem-list li .set { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; opacity: 0; border: none; background: none; color: var(--text-faint); }
.schem-list li .set .ic { width: 14px; height: 14px; }
.schem-list li:hover .set, .schem-list li .set:focus-visible { opacity: 1; }
.schem-list li .set:hover { color: var(--text); background: var(--surface-2); }
.schem-list li b { display: flex; align-items: center; min-width: 0; }
.schem-list li b .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schem-list li .feat-tag { flex: none; display: inline-block; margin-left: 6px; padding: 1px 4px; font: 600 9px/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet); border: 1px solid rgba(180, 92, 255, 0.35); vertical-align: 1px; }

/* tools */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tools button {
  position: relative; flex-direction: column; gap: 5px; height: 54px; padding: 0; font-size: 11.5px; color: var(--text-dim);
}
.tools button .ic { width: 18px; height: 18px; }
.tools button:hover { color: var(--text); }
.tools button kbd { position: absolute; top: 4px; right: 5px; background: none; border: none; padding: 0; font-size: 9.5px; color: var(--text-faint); }
.tools button.on { color: var(--teal); background: rgba(108, 201, 112, 0.1); border-color: rgba(108, 201, 112, 0.45); box-shadow: 0 0 0 1px rgba(108, 201, 112, 0.08) inset; }
.tools button.on kbd { color: rgba(108, 201, 112, 0.7); }
.brush { display: grid; grid-template-columns: auto 1fr 14px auto; align-items: center; gap: 10px; margin-top: 12px; color: var(--text-dim); font-size: 12px; }
.brush .num { color: var(--text); text-align: right; font-size: 12px; }
.brush #shapeBtn { min-width: 58px; }
.hint { margin: 10px 0 0; color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }

/* view */
.field { margin-bottom: 10px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; color: var(--text-dim); font-size: 12px; }
.field-row .num { font-size: 11px; color: var(--text); }
.sec[data-sec=view] .check { min-height: 30px; }

/* markers */
.marker-list { list-style: none; margin: 0 -6px; padding: 0; max-height: clamp(96px, 22vh, 260px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.marker-list:empty { margin: 0; }
.marker-list:empty::after { content: 'No markers yet. Press K, then click a spot. Your AI can add them too.'; display: block; color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }
.marker-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 22px; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 10px; border-radius: var(--radius-xs); cursor: var(--cur-pointer); font-size: 12.5px; }
.marker-list li:hover { background: var(--surface-2); }
.marker-list li i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
.marker-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marker-list li small { color: var(--text-faint); font: 10.5px var(--font-mono); white-space: nowrap; }
.marker-list li button { width: 22px; height: 22px; padding: 0; opacity: 0; border: none; background: none; color: var(--text-faint); }
.marker-list li button .ic { width: 13px; height: 13px; }
.marker-list li:hover button, .marker-list li button:focus-visible { opacity: 1; }
.marker-list li button:hover { color: var(--rose); background: rgba(255, 90, 110, 0.1); }
.marker-list li.spawn span::after { content: ' · spawn'; color: var(--text-faint); font-size: 11px; }

/* bill of materials */
.materials { list-style: none; margin: 0 -6px; padding: 0; max-height: clamp(120px, 30vh, 420px); overflow-y: auto; }
.materials:empty::after { content: 'Counts appear once something is built.'; display: block; padding: 0 6px; color: var(--text-faint); font-size: 11.5px; }
.materials li { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 6px; font-size: 12px; cursor: var(--cur-pointer); border-radius: var(--radius-xs); }
.materials li:hover { background: var(--surface-2); }
.materials li img { width: 20px; height: 20px; image-rendering: pixelated; flex: none; }
.materials li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.materials li:hover span { color: var(--text); }
.materials li b { font: 500 11px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- right panel: selected block, mix, palette ---------- */
.selected { padding: 14px 14px 12px; }
.sel-card { display: flex; gap: 12px; align-items: center; }
.sel-card img { width: 52px; height: 52px; flex: none; padding: 4px; image-rendering: pixelated; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sel-meta { min-width: 0; }
.sel-name { font: 650 14px/1.25 var(--font-body); overflow-wrap: anywhere; }
#selType { color: var(--text-faint); font: 11px/1.4 var(--font-mono); margin-top: 2px; }
.props { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin-top: 12px; align-items: center; }
.props:empty { display: none; }
.props label { color: var(--text-dim); font: 11px var(--font-mono); }
.props select { height: 26px; font-size: 12px; width: 100%; }

.mix-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.mix-list > .dim { color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }
.mix-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 52px 22px; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 6px; border-radius: var(--radius-xs); background: var(--surface); border: 1px solid var(--border); }
.mix-row img { width: 20px; height: 20px; image-rendering: pixelated; }
.mix-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.mix-row input { width: 100%; height: 22px; font: 11.5px var(--font-mono); color: var(--text); background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 0 4px; text-align: right; }
.mix-row input:focus { outline: none; border-color: rgba(63, 214, 200, 0.55); }
.mix-row button { width: 22px; height: 22px; padding: 0; border: none; background: none; color: var(--text-faint); }
.mix-row button:hover { color: var(--rose); background: rgba(255, 90, 110, 0.1); }
.mix-bar { display: flex; height: 6px; border-radius: 0; overflow: hidden; margin-top: 4px; gap: 1px; }

.palette { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 14px 0; border-bottom: none !important; }
.search { position: relative; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 10px; color: var(--text-faint); pointer-events: none; }
.search input {
  width: 100%; height: 34px; font: 13px var(--font-body); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 76px 0 33px; transition: border-color var(--t), background var(--t);
}
.search input::placeholder { color: var(--text-faint); }
.search input:hover { border-color: rgba(255, 255, 255, 0.22); }
.search input:focus { outline: none; border-color: rgba(63, 214, 200, 0.6); background: var(--bg-3); }
.search #blockCount { position: absolute; right: 34px; font-size: 10.5px; color: var(--text-faint); pointer-events: none; }
.search .search-key { position: absolute; right: 9px; pointer-events: none; }
.search input:focus ~ .search-key { opacity: 0; }
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 10px 0; }
.cats button { min-width: 0; height: 24px; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; border-radius: 0; color: var(--text-dim); background: transparent; }
.cats button:hover { color: var(--text); }
.cats button.on { color: var(--teal); border-color: rgba(108, 201, 112, 0.45); background: rgba(108, 201, 112, 0.1); }
.grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 3px;
  align-content: start; margin: 0 -6px; padding: 0 4px 14px 6px;
}
.grid .cell {
  aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface); display: grid; place-items: center;
  cursor: var(--cur-pointer); transition: background var(--t), border-color var(--t), transform 120ms;
}
.grid .cell:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-1px); }
.grid .cell.on { border-color: var(--teal); background: rgba(108, 201, 112, 0.1); box-shadow: 0 0 0 1px rgba(108, 201, 112, 0.25); }
.grid .cell img { width: 72%; height: 72%; image-rendering: pixelated; }
.grid:empty::after { content: 'No blocks match.'; grid-column: 1 / -1; padding: 16px 0; text-align: center; color: var(--text-faint); font-size: 12px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 0; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.16); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- stage + floating HUDs ---------- */
.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; container: stage / inline-size; }
#gl { display: block; width: 100%; height: 100%; outline: none; }

/* tool strip across the top of the view (desktop; app.js moves #tools, #brushRow, #toolHint and .view-dock into it) */
.toolstrip {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: rgba(13, 13, 12, 0.86); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px);
}
.sec[data-sec=tools].in-strip { display: none; }
.ts-slot { display: flex; align-items: center; min-width: 0; }
.ts-sep { width: 1px; height: 22px; background: var(--border-strong); flex: none; }
.toolstrip .tools { display: flex; gap: 2px; }
.toolstrip .tools button { width: 36px; height: 32px; padding: 0; flex-direction: row; border-color: transparent; background: transparent; }
.toolstrip .tools button:hover { background: var(--surface-2); }
.toolstrip .tools button.on { background: rgba(63, 214, 200, 0.14); border-color: rgba(63, 214, 200, 0.5); box-shadow: none; }
.toolstrip .tools button .ic { width: 22px; height: 22px; }
.toolstrip .tools button .tl, .toolstrip .tools button kbd { display: none; }
.toolstrip .brush { margin: 0; grid-template-columns: auto 96px 12px auto; gap: 8px; }
.toolstrip .brush #shapeBtn { height: 28px; min-width: 64px; }
.ts-hint { flex: 1; }
.toolstrip .hint { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-faint); font-size: 12px; }
.ts-right { margin-left: auto; }
.toolstrip .view-dock { position: static; flex-direction: row; gap: 2px; padding: 0; background: none; border: none; box-shadow: none; backdrop-filter: none; }
.toolstrip .view-dock button { width: 34px; height: 32px; }
.toolstrip .view-dock button .ic { width: 20px; height: 20px; }
.toolstrip .view-dock button[aria-pressed=true] { background: rgba(63, 214, 200, 0.14); }
.tools button .tl { display: contents; }
.float { background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(12px); box-shadow: var(--shadow-float); }

/* top-right: axis gizmo, viewport dock under it */
#gizmo { position: absolute; top: 50px; right: 12px; width: 96px; height: 96px; pointer-events: none; transition: right 200ms var(--ease); }
.view-dock {
  position: absolute; top: 112px; right: 30px; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 0;
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(12px); box-shadow: var(--shadow-float); transition: right 200ms var(--ease);
}
.view-dock button { width: 32px; height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--text-dim); border-radius: 0; }
.view-dock button:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.view-dock button[aria-pressed=true] { color: var(--teal); }
.view-dock button:disabled { opacity: 0.35; }

/* bottom: status bar (hover readout + render stats) */
.statusbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 12px; pointer-events: none; font: 11px/1 var(--font-mono); color: var(--text-faint);
  background: linear-gradient(180deg, rgba(10, 11, 11, 0), rgba(10, 11, 11, 0.72) 55%); z-index: 2;
}
.statusbar .hud { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#hover { color: var(--text-dim); }
#hover b { color: var(--text); font-weight: 500; }
#hover:empty::before { content: 'Drag to orbit · right-drag to pan · wheel to zoom'; color: var(--text-faint); }
#stats { flex: none; text-align: right; opacity: 0.55; }   /* render stats: there for perf checks, quieter than the hints */
@container stage (max-width: 760px) { #stats { display: none; } }

/* bottom-left: live activity feed (newest at the bottom) */
.feed {
  position: absolute; left: 12px; bottom: 38px; display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none;
  max-width: min(44%, 420px); max-height: 32%; overflow: hidden; transition: bottom 200ms var(--ease);
}
.feed div {
  flex: none; display: flex; align-items: center; gap: 7px; width: max-content; max-width: 100%; height: 26px; padding: 0 11px 0 9px; border-radius: 0;
  font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(10px);
  animation: feedIn 260ms var(--ease); transition: opacity 1.2s;
}
.feed div::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.feed div b { color: var(--teal); font-weight: 600; }
.feed div.ai { border-color: rgba(63, 214, 200, 0.32); }
.feed div.ai::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.feed div.ai b { color: var(--amber); }
.feed div.old { opacity: 0; }
@keyframes feedIn { from { transform: translateY(8px); opacity: 0; } }

/* bottom-right: minimap */
.minimap {
  position: absolute; right: 12px; bottom: 38px; width: clamp(160px, 14vw, 240px); aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: var(--cur-crosshair);
  border: 1px solid var(--border-strong); background: rgba(10, 11, 11, 0.85); box-shadow: var(--shadow-float); transition: bottom 200ms var(--ease);
}
.minimap img, .minimap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.minimap span {
  position: absolute; left: 6px; bottom: 6px; padding: 3px 6px; border-radius: 0; font: 10.5px/1 var(--font-mono); color: var(--text-dim);
  background: rgba(10, 11, 11, 0.75); pointer-events: none;
}

/* bottom-centre: contextual selection toolbar; feed + minimap step up while it's open */
.selbar {
  position: absolute; left: 12px; right: 12px; bottom: 38px; width: max-content; max-width: calc(100% - 24px); margin: 0 auto;
  display: flex; align-items: center; gap: 2px; z-index: 5; flex-wrap: wrap; justify-content: center;
  padding: 4px; border-radius: var(--radius); background: rgba(16, 18, 18, 0.9); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-float); backdrop-filter: blur(14px); animation: selIn 200ms var(--ease);
}
@keyframes selIn { from { transform: translateY(8px); opacity: 0; } }
.selbar .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.selbar button { height: 30px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--text-dim); }
.selbar button.icon { width: 30px; padding: 0; }
.selbar button:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.selbar button.accent { color: var(--teal); }
.selbar button.danger { color: #ff9db1; }
.selbar button.danger:hover { background: rgba(255, 90, 110, 0.12); }
.sel-info { font: 11.5px var(--font-mono); color: var(--text-dim); padding: 0 10px 0 8px; white-space: nowrap; }
.sel-info b { color: var(--text); font-weight: 600; }
.stage:has(#selbar:not(.hidden)) .feed,
.stage:has(#selbar:not(.hidden)) .minimap { bottom: 88px; }

/* top-centre: toast */
.toast {
  position: absolute; top: 14px; left: 50%; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; z-index: 8;
  max-width: min(560px, calc(100% - 260px)); padding: 8px 14px; border-radius: 0; font-size: 12.5px; text-align: center;
  background: rgba(32, 28, 23, 0.96); border: 1px solid var(--border-strong); box-shadow: var(--shadow-float);
  transition: opacity 200ms, transform 200ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 90, 110, 0.5); color: #ffc2cf; }
.toast.show.has-act { pointer-events: auto; }
.toast .toast-act { margin-left: 8px; padding: 2px 8px; background: none; color: var(--text); border: 1px solid var(--border-strong); font: inherit; font-weight: 600; cursor: pointer; }
.toast .toast-act:hover { border-color: currentColor; }
/* incidents.js banner: the server noticed a problem itself */
.incident-bar { position: absolute; z-index: 8; top: 58px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 240px));
  padding: 7px 14px; font-size: 12.5px; line-height: 1.4; text-align: center; color: #ffe2b0; pointer-events: none;
  background: rgba(40, 30, 14, 0.94); border: 1px solid rgba(255, 180, 58, 0.5); box-shadow: var(--shadow-float); }
.has-incident .toast { top: 112px; }
.confirm-email-bar { position:fixed; z-index:50; top:8px; left:50%; transform:translateX(-50%); max-width:calc(100% - 24px); display:flex; align-items:center; gap:12px; padding:8px 12px; border:1px solid #d99b37; border-radius:8px; background:#30240d; color:#ffe1a3; font:14px system-ui,sans-serif; box-shadow:0 4px 18px #0008; }
.confirm-email-bar button { border:1px solid #d99b37; border-radius:5px; padding:5px 9px; background:#493516; color:#ffe1a3; cursor:pointer; white-space:nowrap; }

/* empty + loading states */
.empty { position: absolute; inset: 0 0 28px; display: grid; place-items: center; pointer-events: none; padding: 24px; }
.empty-card {
  width: min(440px, 100%); text-align: center; padding: 28px 30px 24px; border-radius: 0;
  background: rgba(16, 18, 18, 0.82); border: 1px solid var(--border); backdrop-filter: blur(12px); box-shadow: var(--shadow-float);
}
.empty-art {
  width: 44px; height: 44px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 0; color: var(--amber);
  background: rgba(63, 214, 200, 0.1); border: 1px solid rgba(63, 214, 200, 0.25);
}
.empty-art .ic { width: 22px; height: 22px; }
.empty-card h2 { margin: 0 0 8px; font: 700 20px/1.15 var(--font-display); letter-spacing: -0.02em; }
.empty-card p { margin: 0; color: var(--text-dim); line-height: 1.55; }
.empty-card .eg {
  margin: 16px 0; padding: 10px 12px; border-radius: var(--radius-sm); text-align: left; font-size: 12.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline;
}
.empty-card .eg span { flex: none; font: 600 10px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.empty-card .empty-alt { font-size: 12px; color: var(--text-faint); }
.spinner { width: 26px; height: 26px; margin: 0 auto 14px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.1); border-top-color: var(--teal); animation: spin 0.8s linear infinite; }
/* the connect card and the tour sit on the map; dragging and building around them still work */
.first-run { z-index: 5; pointer-events: none; overflow: auto; }
.first-run .empty-card { width: min(520px, 100%); max-height: 100%; overflow: auto; text-align: left; pointer-events: auto; }
/* no 3D, or Worlds could not open: the card is the whole screen, with no editor around it that cannot work */
.first-run[data-state=webgl], .first-run[data-state=lost], .first-run[data-state=failed] { position: fixed; inset: 0; z-index: 60; padding: 24px; pointer-events: auto; background: var(--bg-0); }
/* and none of the editor under it: on a phone its top bar, never arranged without 3D, made the page 505px wide,
   the phone zoomed out and the card ran off the screen */
#app:has(.first-run[data-state=webgl], .first-run[data-state=lost], .first-run[data-state=failed]) > :not(.stage) { display: none; }
/* one card at a time: the empty-map hint comes back when the first-run card goes */
.stage:has(#firstRun:not(.hidden)) #empty { display: none; }
.first-run-code + p { margin-top: 10px; }
.first-run .empty-card h2 { margin-bottom: 12px; }
.first-run .empty-card p + p, .first-run .empty-card p + label { margin-top: 14px; }
.first-run label { display: block; color: var(--text); font-weight: 600; }
.first-run select, .first-run button { font: inherit; cursor: pointer; }
.first-run select { width: 100%; margin: 8px 0; padding: 8px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.first-run-code { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: var(--surface-2); color: var(--text); font: 12px/1.5 var(--font-mono); }
.first-run-link { display: block; width: fit-content; margin-top: 14px; color: var(--teal); }
.first-run ol { padding-left: 22px; line-height: 1.7; }
.first-run-action { margin: 10px 10px 0 0; padding: 8px 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- render view panel (floats top-left of the stage) ---------- */
.fx-panel {
  position: absolute; left: 12px; top: 54px; width: 272px; z-index: 6; max-height: calc(100% - 94px); overflow-y: auto;
  border-radius: var(--radius); background: rgba(16, 18, 18, 0.9); border: 1px solid rgba(63, 214, 200, 0.26);
  backdrop-filter: blur(14px); box-shadow: var(--shadow-float); animation: popIn 180ms var(--ease);
}
.fx-head { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--border); }
.fx-head > .ic { color: var(--amber); }
.fx-head b { flex: 1; font: 700 14px/1 var(--font-display); letter-spacing: -0.01em; color: #ffe0b0; }
.fx-body { padding: 4px 14px 12px; }
.fx-label { display: block; margin: 10px 0 6px; font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.fx-label.field-row { display: flex; }
.fx-label .num { letter-spacing: 0; text-transform: none; font-weight: 500; }
.fx-presets { width: 100%; }
.fx-presets button { flex: 1; padding: 0; font-size: 12px; }
.fx-presets button.on { background: rgba(63, 214, 200, 0.16); color: #ffd9a3; border-color: rgba(63, 214, 200, 0.4); }
.fx-panel .select { width: 100%; }
.fx-toggles { display: grid; grid-template-columns: 1fr; }
.fx-toggles .check { font-size: 12.5px; min-height: 28px; }
.fx-panel input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--amber) 0 var(--fill), rgba(255, 255, 255, 0.1) var(--fill) 100%); }
.fx-panel input[type=range]::-webkit-slider-thumb { border-color: var(--amber); background: #fff6e8; }
.fx-panel .check input { --sw: var(--amber); }
.fx-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); }
.fx-foot button { height: 30px; }

/* ---------- build animation (js/buildanim.js): same card as the render panel, on the right of the stage ---------- */
.anim-panel { left: auto; right: 120px; width: 288px; }
.anim-panel.busy { opacity: 0.55; pointer-events: none; }
.anim-time { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.anim-time .num { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.anim-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.anim-two .select { width: 100%; }
#animAngleRow[hidden] { display: none; }
.anim-vid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.anim-vid .seg button { padding: 0 8px; font-size: 12px; }
.anim-vid .seg button.on { background: rgba(63, 214, 200, 0.16); color: #c9fff6; border-color: rgba(63, 214, 200, 0.4); }
.anim-note { margin: 10px 0 0; color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }
.anim-note.warn { color: #ffcf8a; }
.anim-note:empty { display: none; }
.anim-state { color: var(--amber); margin-top: 6px; }
.anim-foot { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr); }
.anim-foot #animStop { width: 30px; padding: 0; }
.anim-foot #animStop:disabled { opacity: 0.3; }
/* the video's 16:9 frame inside the view while the panel is open: what's outside it isn't in the video */
.anim-guide {
  position: absolute; z-index: 0; pointer-events: none; outline: 1px solid rgba(255, 255, 255, 0.28); outline-offset: -1px;
  box-shadow: 0 0 0 200vmax rgba(5, 7, 7, 0.38);
}
/* export overlay: the canvas renders at the video size meanwhile, so it's covered by a progress card + thumbnail */
.anim-busy { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 16px; background: rgba(8, 10, 10, 0.86); backdrop-filter: blur(6px); }
.anim-busy-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 18px; background: rgba(20, 23, 23, 0.96); border: 1px solid rgba(63, 214, 200, 0.3); box-shadow: var(--shadow-float); }
.anim-busy-card > b { font: 700 15px/1.2 var(--font-display); color: #e6fffb; }
.anim-busy-card canvas { width: 100%; aspect-ratio: 16 / 9; background: #050606; border: 1px solid var(--border); }
.anim-bar { height: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.anim-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-hi)); transition: width 120ms linear; }
.anim-busy-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-dim); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 5, 5, 0.62); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(4px); padding: 24px; }
.modal-card {
  width: min(760px, 100%); max-height: 100%; overflow-y: auto; padding: 20px 24px 22px; border-radius: 0;
  background: rgba(22, 25, 25, 0.98); border: 1px solid var(--border-strong); box-shadow: 0 30px 80px -20px #000; animation: popIn 180ms var(--ease);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font: 700 20px/1.1 var(--font-display); letter-spacing: -0.02em; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.kgroup h4 { margin: 0 0 6px; font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.kgroup > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 27px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-dim); font-size: 12.5px; }
.kgroup > div > span:last-child:not(:first-child) { display: flex; gap: 4px; }

/* ---------- map dialog: new map / map settings ---------- */
.map-dlg { width: min(520px, 100%); display: flex; flex-direction: column; gap: 18px; }
.map-dlg .modal-head { margin-bottom: 0; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span, .feat-head h4 { font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.fld input {
  height: 34px; padding: 0 10px; font: 500 14px/1 var(--font-body); color: var(--text); background: var(--bg-1);
  border: 1px solid var(--border-strong); border-radius: 0; outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.fld input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(63, 214, 200, 0.16); }
.feat-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.feat-head h4 { margin: 0; }
.feat-head span { color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.feat-list { display: flex; flex-direction: column; gap: 8px; }
.feat-row {
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px; padding: 12px 14px; cursor: var(--cur-pointer);
  background: var(--surface); border: 1px solid var(--border); transition: border-color var(--t), background var(--t);
}
.feat-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.feat-row:has(input:checked) { border-color: rgba(108, 201, 112, 0.45); background: rgba(108, 201, 112, 0.06); box-shadow: inset 2px 0 0 var(--teal); }
.feat-row b { display: flex; align-items: center; gap: 8px; font: 600 15px/1.1 var(--font-display); color: var(--text); }
.feat-row b i { font: 600 9.5px/1 var(--font-mono); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 3px 5px; border: 1px solid var(--border-strong); }
.feat-row:has(input:checked) b i { color: var(--teal); border-color: rgba(108, 201, 112, 0.45); }
.feat-row p { margin: 6px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.feat-row input {
  -webkit-appearance: none; appearance: none; flex: none; box-sizing: border-box; width: 34px; height: 20px; margin: 2px 0 0; border-radius: 0; cursor: var(--cur-pointer); position: relative;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); transition: background var(--t), border-color var(--t);
}
.feat-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: #8e9999; transition: transform 160ms var(--ease), background var(--t), box-shadow var(--t); }
.feat-row input:checked { background: color-mix(in srgb, var(--sw) 20%, transparent); border-color: var(--sw); }
.feat-row input:checked::after { transform: translateX(14px); background: var(--sw); box-shadow: 0 0 6px color-mix(in srgb, var(--sw) 55%, transparent); }
.cb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; overflow-x: hidden; }
.cb-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.cb-list li > div { min-width: 0; }
.cb-list li b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-list li small { display: block; color: var(--text-faint); font: 10.5px/1.4 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-sw { display: flex; }
.cb-sw i { width: 12px; height: 18px; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.cb-list li .del { width: 24px; height: 24px; padding: 0; border: none; background: none; color: var(--text-faint); }
.cb-list li .del:hover { color: var(--rose); background: rgba(255, 90, 110, 0.1); }
.cb-list li .del .ic { width: 14px; height: 14px; }
.cb-list:empty::after { content: 'None yet. Ask your AI, e.g. "make a teal glowing mushroom biome and paint it around the lake".'; display: block; color: var(--text-faint); font-size: 12px; line-height: 1.5; padding: 4px 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.modal-foot button { height: 34px; padding: 0 16px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .top { gap: 12px; }
  .top-c { gap: 8px; }
  .seg button { padding: 0 9px; }
}
/* narrow viewport (1280-class screens): one-row selection bar */
@container stage (max-width: 880px) {
  .sel-info span { display: none; }
  .selbar button { padding: 0 8px; }
  .selbar button.icon { width: 28px; padding: 0; }
  .selbar .sep { margin: 0 2px; }
}
@media (max-width: 1440px) {
  .cats { gap: 4px 3px; }
  .cats button { font-size: 11px; }
}
@media (max-width: 1360px) {
  .pill { padding: 0 9px; }
}
@media (max-width: 1200px) {
  .brand em { display: none; }
  .fx-btn span { display: none; }
  .fx-btn { width: 30px; padding: 0; }
}
@media (max-height: 820px) {
  .sec-head { height: 36px; }
  .tools button { height: 48px; gap: 4px; }
  .selected { padding-top: 12px; padding-bottom: 10px; }
  .sel-card img { width: 44px; height: 44px; }
  .hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; } }

/* ---------------- sketches panel + sketch editor (js/sketch.js) ---------------- */
.ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ref-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: var(--cur-pointer); transition: border-color var(--t), background var(--t); }
.ref-list li:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ref-list img { width: 52px; height: 36px; object-fit: cover; border-radius: 0; background: #f6f3ec; display: block; }
.ref-list b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-list small { color: var(--text-faint); font-size: 11px; }
.ref-list .del { width: 24px; height: 24px; padding: 0; background: transparent; border-color: transparent; color: var(--text-faint); opacity: 0; }
.ref-list li:hover .del, .ref-list .del:focus-visible { opacity: 1; }
.ref-list .del:hover { color: var(--rose); }
.ref-list .del .ic { width: 13px; height: 13px; }

body.sk-open { overflow: hidden; }
.sk { position: fixed; inset: 0; z-index: 900; display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "tools stage" "tools foot"; background: radial-gradient(1200px 700px at 60% 40%, #1a1d1d, var(--bg-0)); color: var(--text); }
.sk[hidden] { display: none; }
.sk-top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(10px); }
.sk-name { width: 200px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: 600 14px var(--font-body); }
.sk-modes { display: inline-flex; padding: 3px; gap: 2px; border-radius: 0; background: var(--bg-2); border: 1px solid var(--border); }
.sk-modes button { height: 26px; border: 0; background: transparent; font-size: 12.5px; padding: 0 10px; }
.sk-modes button.on { background: rgba(108, 201, 112, 0.12); color: var(--teal); }
.sk-area { display: inline-flex; align-items: center; gap: 5px; font: 500 12px var(--font-mono); color: var(--text-faint); }
.sk-area[hidden] { display: none; }
.sk-area input[type=number] { width: 64px; height: 28px; padding: 0 6px; border-radius: 0; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: 500 12px var(--font-mono); }
.sk-area select { height: 28px; border-radius: 0; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font-size: 12px; padding: 0 6px; }
.sk-area .check { margin-left: 4px; font-family: var(--font-body); }
.sk-sp { flex: 1; }
.sk-tools { grid-area: tools; padding: 14px 12px; border-right: 1px solid var(--border); background: var(--panel); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sk-toolgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sk-toolgrid button { height: 40px; padding: 0; }
.sk-toolgrid .ic { width: 19px; height: 19px; }
.sk-size { display: grid; gap: 6px; font-size: 12px; color: var(--text-dim); }
.sk-size b { color: var(--text); }
.sk-h { font: 700 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-top: 4px; }
.sk-h small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.sk-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sk-zones button { height: 30px; justify-content: flex-start; gap: 7px; padding: 0 7px; font-size: 12px; background: transparent; }
.sk-zones i { width: 14px; height: 14px; border-radius: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); flex: none; }
.sk-zones span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-zones button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); }
.sk-inks { display: flex; gap: 6px; flex-wrap: wrap; }
.sk-inks button { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid var(--border-strong); }
.sk-inks button.on { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(108, 201, 112, 0.35); }
.sk-row { display: flex; gap: 6px; margin-top: auto; }
.sk-stage { grid-area: stage; position: relative; display: grid; place-items: center; padding: 18px; min-height: 0; overflow: hidden; }
.sk-cv { max-width: 100%; max-height: 100%; border-radius: 0; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08); touch-action: none; background: #f6f3ec; }
.sk-coord { position: absolute; left: 26px; bottom: 26px; font: 600 12px var(--font-mono); color: #2b2f37; background: rgba(246, 243, 236, 0.9); padding: 4px 8px; border-radius: 0; pointer-events: none; }
.sk-coord:empty { display: none; }
.sk-foot { grid-area: foot; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: center; padding: 10px 18px 14px; }
.sk-note { height: 58px; resize: none; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); padding: 8px 10px; font: 13.5px/1.45 var(--font-body); }
.sk-note:focus, .sk-name:focus { outline: none; border-color: rgba(108, 201, 112, 0.55); }
.sk-help { margin: 0; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.sk-help b { color: var(--text-dim); }
.sk-help code { font-family: var(--font-mono); color: var(--amber); }
@media (max-width: 1100px) { .sk-foot { grid-template-columns: 1fr; } .sk-help { display: none; } }
.sk [hidden] { display: none !important; }

/* ---------- phone ----------
   Same query as `phone` in app.js. Portrait: top bar, 3D view, tab bar at the bottom; each tab opens one panel as a
   bottom sheet. Landscape phone: the tab bar becomes a rail on the left and sheets slide in beside it.
   Everything below is phone-only; the desktop layout above is untouched. */
.mnav, .sheet-bar, .touch-only, .selbar .mv, .selbar .mv-toggle { display: none; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  :root { --nav-h: 60px; --top-h: 52px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
  html, body { overscroll-behavior: none; }
  body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
  /* the layout is fixed: page pinch/double-tap zoom only breaks it (the 3D view has its own pinch zoom) */
  #app, .modal, .sk { touch-action: pan-x pan-y; }
  .desk-only { display: none; }
  .touch-only { display: block; }
  kbd { display: none; }

  /* controls: 40px+ tap targets, 16px inputs (no iOS focus zoom) */
  button, .btn { height: 40px; font-size: 14px; }
  button.icon, button.sm.icon, .btn.sm.icon { width: 40px; }
  button.sm, .btn.sm { height: 40px; font-size: 14px; padding: 0 12px; }
  button .ic, button.sm .ic, .btn.sm .ic { width: 18px; height: 18px; }
  .select, .props select { height: 40px; font-size: 16px; }
  input[type=range] { height: 40px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
  .check { min-height: 44px; font-size: 15px; }
  .check input { width: 40px; height: 24px; border-radius: 0; }
  .check input::after { width: 16px; height: 16px; top: 3px; left: 3px; }
  .check input:checked::after { transform: translateX(16px); }

  #app {
    height: 100dvh; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(var(--top-h) + var(--safe-t)) minmax(0, 1fr) calc(var(--nav-h) + var(--safe-b));
    grid-template-areas: "top" "stage" "nav";
  }

  /* top bar: logo, map name, undo/redo, AI dot, render, export */
  .top { display: flex; gap: 2px; padding: var(--safe-t) calc(6px + var(--safe-r)) 0 calc(10px + var(--safe-l)); }
  .top-l { flex: 1; gap: 8px; }
  .top-c, .top-r { flex: none; gap: 2px; }
  .brand span, .brand em, .vsep, #helpBtn { display: none; }
  .brand img { width: 28px; height: 28px; }
  .title { flex: 1; }
  .title input { font-size: 16px; width: 100%; margin-left: -6px; padding: 4px 6px; }
  #schemSize { font-size: 13.5px; }
  .btn-group { gap: 0; }
  .pill { width: 28px; padding: 0; justify-content: center; margin: 0 2px; border-color: transparent; }
  .pill span { display: none; }
  .pill i { width: 9px; height: 9px; }
  .fx-btn { width: 40px; padding: 0; }
  .fx-btn span { display: none; }
  #exportBtn { width: 44px; padding: 0; gap: 0; }
  /* History opens the account page in a new tab; on a phone its text label squeezed the map name down to one letter */
  #historyBtn { display: none; }
  #exportBtn span, #exportBtn .chev { display: none; }
  .menu-pop { position: fixed; top: calc(var(--top-h) + var(--safe-t) + 4px); right: calc(8px + var(--safe-r)); width: min(320px, calc(100vw - 16px)); max-height: calc(100dvh - var(--top-h) - var(--safe-t) - 16px); overflow-y: auto; }
  .menu-pop a { padding: 11px 12px; }
  .menu-pop a b { font-size: 15px; }
  .menu-pop a span { font-size: 13px; }

  /* tab bar */
  .mnav {
    grid-area: nav; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); z-index: 45;
    padding: 0 var(--safe-r) var(--safe-b) var(--safe-l); background: rgba(12, 10, 8, 0.97); border-top: 1px solid var(--border);
  }
  .mnav button {
    height: var(--nav-h); flex-direction: column; gap: 4px; padding: 0; border: none; border-radius: 0; background: transparent;
    color: var(--text-dim); font: 500 14px/1 var(--font-body); position: relative;
  }
  .mnav button .ic, .mnav img { width: 22px; height: 22px; }
  .mnav img { image-rendering: pixelated; }
  .mnav button.on { color: var(--teal); background: rgba(108, 201, 112, 0.08); }
  .mnav button.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; border-radius: 0; background: var(--teal); }
  .mnav button:active { transform: none; background: var(--surface-2); }

  /* sheets: the two side panels, one open at a time (body[data-sheet] from app.js) */
  .left, .right {
    display: none; position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b));
    max-height: min(64dvh, calc(100dvh - var(--top-h) - var(--safe-t) - var(--nav-h) - var(--safe-b) - 56px));
    padding: 0 var(--safe-r) 0 var(--safe-l); border: none; border-top: 1px solid var(--border-strong); border-radius: 12px 12px 0 0;
    background: rgba(20, 17, 14, 0.98); box-shadow: 0 -18px 50px -20px #000; overscroll-behavior: contain; animation: sheetUp 200ms var(--ease);
  }
  @keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
  .left { overflow-y: auto; scrollbar-gutter: auto; }
  body[data-sheet=maps] .left, body[data-sheet=tools] .left, body[data-sheet=view] .left, body[data-sheet=more] .left { display: flex; }
  body[data-sheet=blocks] .right { display: flex; height: min(70dvh, calc(100dvh - var(--top-h) - var(--safe-t) - var(--nav-h) - var(--safe-b) - 56px)); max-height: none; }
  .left .sec { display: none; }
  body[data-sheet=maps] .sec[data-sec=maps], body[data-sheet=tools] .sec[data-sec=tools], body[data-sheet=view] .sec[data-sec=view],
  body[data-sheet=more] .sec[data-sec=markers], body[data-sheet=more] .sec[data-sec=refs], body[data-sheet=more] .sec[data-sec=materials] { display: block; }
  .panel > section:last-child { border-bottom: none; }
  .panel > .sheet-bar {
    display: flex; align-items: center; justify-content: space-between; flex: none; height: 48px; padding: 0 8px 0 18px;
    position: sticky; top: 0; z-index: 2; background: rgba(20, 17, 14, 0.98); border-bottom: 1px solid var(--border);
  }
  .sheet-bar::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 0; background: rgba(255, 255, 255, 0.16); }
  .sheet-bar b { font: 700 17px/1 var(--font-display); letter-spacing: -0.01em; }
  /* single-section sheets: the sheet bar is the title, so hide the section's own; sections never collapse here */
  body:not([data-sheet=more]) .left .sec-toggle { visibility: hidden; }
  body[data-sheet=tools] .sec[data-sec=tools] > .sec-head, body[data-sheet=view] .sec[data-sec=view] > .sec-head { display: none; }
  .sec.collapsed .sec-body { display: block; }
  .sec-toggle { pointer-events: none; }
  .sec-toggle .chev { display: none; }
  .sec-head { height: 48px; padding: 0 8px 0 10px; }
  .sec-toggle h3 { font-size: 14px; }
  .sec-body { padding: 4px 18px 18px; }
  .hint, .marker-list:empty::after, .materials:empty::after, .mix-list > .dim { font-size: 14px; }
  .count { font-size: 14px; }
  /* Maps sheet: its new/import buttons sit beside the sheet title instead of on a row of their own */
  body[data-sheet=maps] .sec[data-sec=maps] > .sec-head { position: absolute; top: 4px; right: calc(52px + var(--safe-r)); z-index: 3; height: 40px; padding: 0; }
  body[data-sheet=maps] .sec[data-sec=maps] .sec-toggle { display: none; }

  /* maps */
  .schem-list { max-height: none; margin: 0 -8px; gap: 4px; }
  .schem-list li { padding: 10px 52px 10px 12px; }
  .schem-list li b { font-size: 15px; }
  .schem-list li small { font-size: 14px; }
  .schem-list li .del { width: 40px; height: 40px; opacity: 0.8; right: 4px; }
  /* tools */
  .tools { gap: 8px; }
  .tools button { height: 64px; font-size: 14px; }
  .tools button .ic { width: 22px; height: 22px; }
  .brush { font-size: 15px; margin-top: 16px; grid-template-columns: auto 1fr 18px auto; }
  .brush .num { font-size: 15px; }
  /* view */
  #viewSeg { margin-bottom: 14px; }
  #viewSeg button { flex: 1; height: 40px; font-size: 14px; }
  .field { margin-bottom: 12px; }
  .field-row { font-size: 14px; }
  .field-row .num { font-size: 14px; }
  /* more: markers, sketches, materials */
  .marker-list { max-height: none; }
  .marker-list li { height: 44px; font-size: 15px; grid-template-columns: 10px minmax(0, 1fr) auto 40px; }
  .marker-list li small { font-size: 14px; }
  .marker-list li button { width: 40px; height: 40px; opacity: 0.8; }
  .ref-list li { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .ref-list img { width: 64px; height: 44px; }
  .ref-list b { font-size: 15px; }
  .ref-list small { font-size: 14px; }
  .ref-list .del { width: 40px; height: 40px; opacity: 0.8; }
  .materials { max-height: none; }
  .materials li { height: 40px; font-size: 14px; }
  .materials li b { font-size: 14px; }
  .materials li img { width: 24px; height: 24px; }

  /* blocks sheet */
  .selected { padding: 12px 18px 10px; }
  .sel-card img { width: 48px; height: 48px; }
  .sel-name { font-size: 16px; }
  #selType, .props label { font-size: 14px; }
  .props select { height: 40px; }
  .mix-row { height: 46px; grid-template-columns: 26px minmax(0, 1fr) 64px 40px; font-size: 14px; }
  .mix-row img { width: 24px; height: 24px; }
  .mix-row input { height: 36px; font-size: 16px; }
  .mix-row button { width: 40px; height: 40px; }
  .palette { padding: 10px 18px 0; }
  .search input { height: 44px; font-size: 16px; padding-right: 64px; }
  .search .search-key { display: none; }
  .search #blockCount { right: 12px; font-size: 14px; }
  .cats { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 10px -18px; padding: 0 18px; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cats button { flex: none; height: 40px; padding: 0 14px; font-size: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; padding-bottom: 18px; }
  .grid .cell:hover { transform: none; }

  /* 3D view overlays */
  #gl { -webkit-touch-callout: none; }
  .toolstrip { display: none; }
  #gizmo { width: 64px; height: 64px; top: 8px; right: calc(8px + var(--safe-r)); }
  .view-dock { top: 80px; right: calc(12px + var(--safe-r)); }
  .view-dock button { width: 40px; height: 40px; }
  .statusbar { height: 32px; padding: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); font-size: 12px; }
  #stats { display: none; }
  #hover:empty::before { content: 'Drag to orbit · two fingers: pan + pinch zoom'; }
  body.touched .statusbar { display: none; }
  .feed { left: calc(8px + var(--safe-l)); bottom: 40px; max-width: calc(100% - 96px); }
  .feed div { font-size: 13px; height: 30px; }
  .minimap { width: 112px; right: calc(8px + var(--safe-r)); bottom: 40px; }
  .stage:has(#selbar:not(.hidden)) .feed, .stage:has(#selbar:not(.hidden)) .minimap { display: none; }
  .toast { top: 10px; max-width: calc(100% - 100px); font-size: 14px; left: calc(50% - 36px); }
  .empty { inset: 0 0 32px; padding: 16px 84px 16px 16px; }
  .empty-card { padding: 20px 18px 18px; }
  .empty-card h2 { font-size: 19px; }
  .empty-card p, .empty-card .eg { font-size: 14px; }
  .empty-card .eg { flex-direction: column; gap: 6px; }
  .empty-card .empty-alt { font-size: 14px; }

  /* selection bar: wraps to two rows; Move swaps it for a nudge pad */
  .selbar { bottom: 8px; left: 8px; right: 8px; max-width: calc(100% - 16px); gap: 2px; }
  .selbar button { height: 40px; padding: 0 11px; font-size: 14px; }
  .selbar button.icon { width: 40px; }
  .sel-info { font-size: 14px; }
  .selbar .mv-toggle { display: inline-flex; }
  .selbar.moving > :not(.mv):not(.sel-info) { display: none; }
  .selbar.moving .mv { display: inline-flex; }
  .selbar.moving .mv.icon { width: 44px; }

  /* render view settings: a sheet over the bottom of the 3D view */
  .fx-panel { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); top: auto; bottom: 8px; width: auto; max-height: calc(100% - 16px); }
  .fx-head b { font-size: 16px; }
  .fx-label { font-size: 13.5px; }
  .fx-label .num { font-size: 14px; }
  .fx-presets button { height: 40px; font-size: 14px; }
  .fx-toggles { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .fx-toggles .check { font-size: 14px; min-height: 44px; }
  .fx-foot button { height: 40px; }
  /* build animation: the same bottom sheet (opening it closes the render settings and any panel sheet) */
  .anim-panel { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); width: auto; }
  .anim-time .num { font-size: 13px; }
  .anim-vid .seg button { height: 40px; font-size: 14px; padding: 0 10px; }
  .anim-note { font-size: 13px; }
  .anim-foot #animStop { width: 44px; }
  .anim-busy-foot { font-size: 14px; }
  .anim-busy-foot button { height: 40px; }

  /* help sheet (still reachable from nothing on a phone, but keep it usable) */
  .modal { padding: 12px; }
  .keys { grid-template-columns: 1fr; }

  /* sketch editor: stack it - top bar, canvas, tools strip, note */
  .sk {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "stage" "tools" "foot";
    padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  }
  .sk-top { gap: 6px; padding: 8px 10px; }
  .sk-name { flex: 1 1 140px; width: auto; height: 40px; font-size: 16px; }
  .sk-modes button { height: 40px; font-size: 14px; padding: 0 8px; }
  .sk-area { flex-wrap: wrap; font-size: 13px; }
  .sk-area input[type=number] { width: 58px; height: 36px; font-size: 16px; }
  .sk-area select { height: 36px; font-size: 16px; }
  .sk-sp { display: none; }
  .sk-stage { padding: 8px; }
  .sk-tools { flex-direction: row; align-items: flex-start; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px; border-right: none; border-top: 1px solid var(--border); }
  .sk-tools > * { flex: none; }
  .sk-toolgrid { grid-template-columns: repeat(4, 44px); }
  .sk-toolgrid button { height: 44px; }
  .sk-size { width: 150px; font-size: 14px; }
  .sk-h { display: none; }
  .sk-zones { grid-template-columns: repeat(4, 112px); }
  .sk-zones button { height: 40px; font-size: 13px; }
  .sk-inks { width: 120px; }
  .sk-inks button { width: 34px; height: 34px; }
  .sk-row { margin-top: 0; flex-direction: column; }
  .sk-foot { grid-template-columns: 1fr; padding: 8px 10px 10px; }
  .sk-note { height: 52px; font-size: 16px; }
  .sk-help { display: none; }
}
/* landscape phone: tab bar becomes a left rail, sheets open beside it at full height */
@media (max-height: 500px) and (pointer: coarse) {
  :root { --top-h: 46px; --rail-w: 76px; }
  #app {
    grid-template-columns: calc(var(--rail-w) + var(--safe-l)) minmax(0, 1fr); grid-template-rows: calc(var(--top-h) + var(--safe-t)) minmax(0, 1fr);
    grid-template-areas: "top top" "nav stage";
  }
  .mnav { grid-template-columns: 1fr; grid-template-rows: repeat(5, minmax(0, 1fr)); padding: 0 0 var(--safe-b) var(--safe-l); border-top: none; border-right: 1px solid var(--border); }
  .mnav button { height: auto; min-height: 44px; gap: 3px; font-size: 14px; }
  .mnav button .ic, .mnav img { width: 20px; height: 20px; }
  .mnav button.on::before { top: 22%; bottom: 22%; left: 0; right: auto; width: 2px; height: auto; }
  .left, .right, body[data-sheet=blocks] .right {
    top: calc(var(--top-h) + var(--safe-t)); bottom: 0; left: calc(var(--rail-w) + var(--safe-l)); right: auto; width: min(380px, 52vw);
    height: auto; max-height: none; padding: 0 0 var(--safe-b); border-top: none; border-right: 1px solid var(--border-strong); border-radius: 0;
    box-shadow: 18px 0 50px -20px #000; animation-name: sheetSide;
  }
  @keyframes sheetSide { from { transform: translateX(-24px); opacity: 0; } }
  .sheet-bar { height: 44px; }
  .sheet-bar::before { display: none; }
  #gizmo { width: 56px; height: 56px; top: 6px; }
  .view-dock { top: 66px; }
  .view-dock button { width: 40px; height: 40px; }
  .fx-panel { right: auto; top: 8px; width: min(340px, 60%); }
  .anim-panel { right: auto; }
  .empty { padding: 8px 70px 8px 12px; }
  .empty-card { padding: 14px 16px; }
  .empty-card .eg { margin: 10px 0; }
  .empty-art { display: none; }
  /* sketch editor: canvas needs the height, so tools go back to a side column */
  .sk { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "tools stage" "tools foot"; }
  .sk-top { padding: 6px 10px; }
  .sk-area { flex-wrap: nowrap; }
  .sk-name { flex: 0 1 160px; }
  .sk-tools { flex-direction: column; overflow-y: auto; overflow-x: hidden; border-top: none; border-right: 1px solid var(--border); }
  .sk-toolgrid { grid-template-columns: repeat(4, 1fr); }
  .sk-zones { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sk-zones button { width: auto; min-width: 0; }
  .sk-size, .sk-inks { width: auto; }
  .sk-row { flex-direction: row; }
  .sk-note { height: 44px; }
}

/* cursors:start (written by tools/make-cursors.mjs; edit that, not this) */
:root {
  --cur-default: url("/site/img/cursors/default.png") 3 3, auto;
  --cur-pointer: url("/site/img/cursors/pointer.png") 10 3, pointer;
  --cur-text: url("/site/img/cursors/text.png") 13 13, text;
  --cur-grab: url("/site/img/cursors/grab.png") 13 13, grab;
  --cur-grabbing: url("/site/img/cursors/grabbing.png") 13 13, grabbing;
  --cur-move: url("/site/img/cursors/move.png") 13 13, move;
  --cur-crosshair: url("/site/img/cursors/crosshair.png") 13 13, crosshair;
  --cur-break: url("/site/img/cursors/break.png") 13 13, crosshair;
  --cur-eyedropper: url("/site/img/cursors/eyedropper.png") 6 20, crosshair;
  --cur-brush: url("/site/img/cursors/brush.png") 6 20, crosshair;
  --cur-zoom-in: url("/site/img/cursors/zoom-in.png") 10 10, zoom-in;
  --cur-not-allowed: url("/site/img/cursors/not-allowed.png") 3 3, not-allowed;
  --cur-progress: url("/site/img/cursors/progress.png") 3 3, progress;
}
@supports (cursor: image-set(url("/site/img/cursors/default.png") 1x) 0 0, auto) {
  :root {
    --cur-default: image-set(url("/site/img/cursors/default.png") 1x, url("/site/img/cursors/default@1.5x.png") 1.5x, url("/site/img/cursors/default@2x.png") 2x) 3 3, auto;
    --cur-pointer: image-set(url("/site/img/cursors/pointer.png") 1x, url("/site/img/cursors/pointer@1.5x.png") 1.5x, url("/site/img/cursors/pointer@2x.png") 2x) 10 3, pointer;
    --cur-text: image-set(url("/site/img/cursors/text.png") 1x, url("/site/img/cursors/text@1.5x.png") 1.5x, url("/site/img/cursors/text@2x.png") 2x) 13 13, text;
    --cur-grab: image-set(url("/site/img/cursors/grab.png") 1x, url("/site/img/cursors/grab@1.5x.png") 1.5x, url("/site/img/cursors/grab@2x.png") 2x) 13 13, grab;
    --cur-grabbing: image-set(url("/site/img/cursors/grabbing.png") 1x, url("/site/img/cursors/grabbing@1.5x.png") 1.5x, url("/site/img/cursors/grabbing@2x.png") 2x) 13 13, grabbing;
    --cur-move: image-set(url("/site/img/cursors/move.png") 1x, url("/site/img/cursors/move@1.5x.png") 1.5x, url("/site/img/cursors/move@2x.png") 2x) 13 13, move;
    --cur-crosshair: image-set(url("/site/img/cursors/crosshair.png") 1x, url("/site/img/cursors/crosshair@1.5x.png") 1.5x, url("/site/img/cursors/crosshair@2x.png") 2x) 13 13, crosshair;
    --cur-break: image-set(url("/site/img/cursors/break.png") 1x, url("/site/img/cursors/break@1.5x.png") 1.5x, url("/site/img/cursors/break@2x.png") 2x) 13 13, crosshair;
    --cur-eyedropper: image-set(url("/site/img/cursors/eyedropper.png") 1x, url("/site/img/cursors/eyedropper@1.5x.png") 1.5x, url("/site/img/cursors/eyedropper@2x.png") 2x) 6 20, crosshair;
    --cur-brush: image-set(url("/site/img/cursors/brush.png") 1x, url("/site/img/cursors/brush@1.5x.png") 1.5x, url("/site/img/cursors/brush@2x.png") 2x) 6 20, crosshair;
    --cur-zoom-in: image-set(url("/site/img/cursors/zoom-in.png") 1x, url("/site/img/cursors/zoom-in@1.5x.png") 1.5x, url("/site/img/cursors/zoom-in@2x.png") 2x) 10 10, zoom-in;
    --cur-not-allowed: image-set(url("/site/img/cursors/not-allowed.png") 1x, url("/site/img/cursors/not-allowed@1.5x.png") 1.5x, url("/site/img/cursors/not-allowed@2x.png") 2x) 3 3, not-allowed;
    --cur-progress: image-set(url("/site/img/cursors/progress.png") 1x, url("/site/img/cursors/progress@1.5x.png") 1.5x, url("/site/img/cursors/progress@2x.png") 2x) 3 3, progress;
  }
}
html { cursor: var(--cur-default); }
a[href], button:not(:disabled), [role="button"], [role="tab"], summary, label[for], select, input[type="range"], input[type="checkbox"], input[type="radio"] { cursor: var(--cur-pointer); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]), textarea, [contenteditable="true"] { cursor: var(--cur-text); }
button:disabled, .btn[disabled], [aria-disabled="true"] { cursor: var(--cur-not-allowed); }
[aria-busy="true"] { cursor: var(--cur-progress); }
#gl { cursor: var(--cur-crosshair); }
#gl[data-cur="break"] { cursor: var(--cur-break); }
#gl[data-cur="pick"] { cursor: var(--cur-eyedropper); }
#gl[data-cur="paint"] { cursor: var(--cur-brush); }
#gl[data-cur="orbit"] { cursor: var(--cur-grabbing); }
#gl[data-cur="pan"] { cursor: var(--cur-move); }
.minimap { cursor: var(--cur-crosshair); }
/* cursors:end */

/* ===== Same look as Moxel Models (2026-10-12) =====
   Leif preferred the Models editor's look. Values are copied from what /models/ actually serves: cubewright's
   public/app.css after the THEME colour swap in src/cloud/models-host.js, plus public/site/models-theme.css.
   Panels keep the neutral greys (Models uses the same #0a0b0b/#121414/#1a1d1d); the top bar, viewport (view.js setSky)
   and Render panel are navy; teal = selected/active; Pixelify titles; Render is a plain button like Models'. */
body { font: 13px/1.45 var(--font-body);
  background: radial-gradient(1100px 560px at 72% -12%, rgba(108, 201, 112, 0.06), transparent 62%),
              radial-gradient(900px 520px at -10% 110%, rgba(63, 214, 200, 0.06), transparent 60%), #0a0b0b; }
.top { background: rgba(11, 15, 22, 0.75); backdrop-filter: blur(14px); }
/* sidebars + tool bar: Models' .panel and .toolstrip (navy glass sidebars, grey tool bar) */
.left.panel, .right.panel { background: rgba(11, 15, 22, 0.55); backdrop-filter: blur(12px); }
.toolstrip { background: rgba(16, 18, 18, 0.86); backdrop-filter: blur(12px); }
/* titles: Models' .sec-head h3 and #modelName */
.sec-toggle h3 { font: 700 11px/1 var(--font-display); letter-spacing: 0.01em; text-transform: uppercase; color: var(--text-faint); }
.sec-toggle:hover h3 { color: var(--text-dim); }
#schemName { font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: 0.01em; }
#schemSize { font: 11px/1.2 var(--font-body); color: var(--text-dim); }
/* buttons: Models' button.primary (Export, Save render); Render is a plain button that turns teal when on (#renderBtn) */
/* flat teal tint (was a teal-to-pink gradient: the pink was the old amber theme's, never mapped to Moxel's colours) */
button.primary { color: var(--text); font-weight: inherit; background: rgba(63, 214, 200, 0.16); border-color: rgba(63, 214, 200, 0.45); box-shadow: none; }
button.primary:hover { background: rgba(63, 214, 200, 0.24); border-color: #3fd6c8; }
button.primary .ic { --ic-line: #022421; --ic-ink: #9ff5e8; --ic-acc: #022421; stroke-width: inherit; }
.fx-btn { color: var(--text); border-color: var(--border); background: var(--surface); }
.fx-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.fx-btn.on { color: #3fd6c8; border-color: rgba(63, 214, 200, 0.5); background: rgba(63, 214, 200, 0.1); }
/* Models' buttons are plain 13px text (Worlds' were 12.5px medium) */
.top button, .seg button, .fx-panel button { font-size: 13px; font-weight: 400; }
.seg button { color: var(--text); }
/* selected / active = teal (Models' --accent), not green */
.seg button.on { background: rgba(63, 214, 200, 0.14); color: #3fd6c8; border-color: var(--border); }
.schem-list li.on { background: rgba(63, 214, 200, 0.08); border-color: rgba(63, 214, 200, 0.3); }
.schem-list li.on::before { background: #3fd6c8; }
.cats button.on { color: #3fd6c8; border-color: rgba(63, 214, 200, 0.45); background: rgba(63, 214, 200, 0.1); }
.tools button.on { color: #3fd6c8; background: rgba(63, 214, 200, 0.14); border-color: rgba(63, 214, 200, 0.5); box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #3fd6c8 0 var(--fill), rgba(255, 255, 255, 0.1) var(--fill) 100%); }
input[type=range]::-webkit-slider-thumb { border-color: #3fd6c8; background: #eafffb; }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(63, 214, 200, 0.16); }
/* switches: Models' .check (the hosted theme squares the track; the knob stays round) */
.check input, .fx-panel .check input { width: 30px; height: 17px; background: var(--bg-2); border-color: rgba(255, 255, 255, 0.12); }
.check input::after { top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--text-faint); }
.check:hover input { border-color: rgba(255, 255, 255, 0.12); }
.check input:checked, .fx-panel .check input:checked { background: rgba(63, 214, 200, 0.25); border-color: rgba(63, 214, 200, 0.6); }
.check input:checked::after, .fx-panel .check input:checked::after { transform: translateX(13px); background: #3fd6c8; box-shadow: none; }
/* Render panel: Models' .render-panel / .rp-head */
.fx-panel { background: rgba(11, 15, 22, 0.92); border-color: rgba(63, 214, 200, 0.28); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8); }
.fx-head > .ic { color: #3fd6c8; }
.fx-head b { font: 700 14px/1 var(--font-body); letter-spacing: 0; color: var(--text); }
.fx-presets button.on { color: #3fd6c8; }

/* floating surfaces are navy glass like Models' (.menu-pop, .render-panel, tooltips, dialogs) */
.menu-pop { padding: 5px; background: rgba(16, 21, 30, 0.96); border-color: rgba(255, 255, 255, 0.12); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8); backdrop-filter: blur(16px); }
.menu-pop a.feat { background: transparent; border-color: transparent; margin-bottom: 0; }
.menu-pop a.feat:hover { background: var(--surface-2); }
.menu-pop a.feat b { color: #3fd6c8; }
.menu-pop a b { font-weight: 700; }
.menu-label { font: 700 10.5px/1.45 var(--font-body); letter-spacing: 1px; }
.tip { background: #10151e; border-color: rgba(255, 255, 255, 0.12); }
.modal { background: rgba(4, 5, 8, 0.62); }
.modal-card { background: rgba(16, 21, 30, 0.98); border-color: rgba(255, 255, 255, 0.12); }
.empty-card { background: rgba(16, 21, 30, 0.82); }
/* segmented buttons (Iso/Front/Side/Top, time of day): Models' divided strip, not a boxed group */
.seg { padding: 0; gap: 0; background: transparent; overflow: hidden; }
.seg button { height: 29px; padding: 0 10px; border: none; border-radius: 0; color: var(--text); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { border-color: var(--border); }
.seg button.on { border-color: var(--border); }
.fx-presets button { height: 27px; font-size: 12px; }
/* small bits */
.top button.icon { color: var(--text); }
.schem-list li small, .schem-list li .meta { font: 11px/1.45 var(--font-body); }
.schem-list li b { font-size: 13px; }
#aiPill { font-weight: 400; }
.modal-head button { font-size: 13px; }
.fx-foot { background: transparent; }
.ts-sep { background: rgba(255, 255, 255, 0.12); }

/* Pixelify Sans draws "fi" as one glyph that reads like "A" ("Try your first build" showed as "Arst"): no ligatures anywhere */
*, *::before, *::after { font-variant-ligatures: no-common-ligatures !important; }   /* on every element + important: the font: shorthand on headings resets ligature settings, so an inherited one never sticks */

/* camera lens section in the Render panel (index.html #fxCam, app.js "camera lens") */
.fx-cam { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.fx-cam-body { display: none; }
.fx-cam.on .fx-cam-body { display: block; }
.fx-cam-looks { margin: 10px 0 2px; }
.fx-cam-focus { display: flex; gap: 6px; }
.fx-cam-focus button { flex: 1; justify-content: center; }
#camPick.on { color: #3fd6c8; border-color: rgba(63, 214, 200, 0.5); background: rgba(63, 214, 200, 0.1); }

/* Share to Explore (app.js, moxel.gg only): a teal-outlined button so people notice they can publish */
.share-btn { color: #3fd6c8; border-color: rgba(63, 214, 200, 0.45); background: rgba(63, 214, 200, 0.06); }
.share-btn:hover { border-color: #3fd6c8; background: rgba(63, 214, 200, 0.14); }
@media (max-width: 1100px) { .share-btn span { display: none; } .share-btn { width: 30px; padding: 0; } }
#openInServerBtn { width: auto; padding: 0 10px; white-space: nowrap; }
#openInServerBtn span { display: inline; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { #openInServerBtn { padding: 0 7px; font-size: 11px; } }

.share-prompt { width: min(560px, calc(100vw - 32px)); padding: 0; color: var(--text); background: rgba(16, 21, 30, 0.98); border: 1px solid rgba(63, 214, 200, 0.35); border-radius: 8px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65); }
.share-prompt::backdrop { background: rgba(4, 5, 8, 0.68); backdrop-filter: blur(3px); }
.share-prompt-card { display: grid; grid-template-columns: 210px 1fr; }
.share-prompt-picture { width: 210px; height: 100%; min-height: 270px; object-fit: cover; background: var(--bg-2); }
.share-prompt-body { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.share-prompt-body h2 { margin: 0; font: 400 25px/1.1 'Pixelify Sans', var(--font-display); }
.share-prompt-body p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.share-prompt-giveaway { padding: 9px 10px; color: #9ff5e8 !important; background: rgba(63, 214, 200, 0.08); border-left: 2px solid #3fd6c8; }
.share-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
@media (max-width: 560px) { .share-prompt-card { grid-template-columns: 1fr; } .share-prompt-picture { width: 100%; height: 150px; min-height: 0; } .share-prompt-body { padding: 18px; } }

/* ---------- export screen (app.js openExport): edition cards, version, format rows ---------- */
.exp-dlg { width: min(560px, 100%); display: flex; flex-direction: column; gap: 16px; }
.exp-dlg .modal-head { margin-bottom: 0; }
.exp-eds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exp-ed { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 14px 14px 13px; cursor: var(--cur-pointer); background: var(--surface); border: 1px solid var(--border); transition: border-color var(--t), background var(--t); }
.exp-ed:hover { border-color: var(--border-strong); background: var(--surface-2); }
.exp-ed input, .exp-fmt input { position: absolute; opacity: 0; pointer-events: none; }
.exp-ed b { font: 400 17px/1.1 'Pixelify Sans', var(--font-display); color: var(--text); }
.exp-ed span { color: var(--text-faint); font-size: 11.5px; line-height: 1.4; }
.exp-ed:has(input:checked) { border-color: rgba(63, 214, 200, 0.6); background: rgba(63, 214, 200, 0.08); box-shadow: inset 0 -2px 0 #3fd6c8; }
.exp-ed:has(input:focus-visible), .exp-fmt:has(input:focus-visible) { outline: 2px solid #3fd6c8; outline-offset: 2px; }
.exp-ver select { height: 34px; padding: 0 10px; font: 500 14px/1 var(--font-body); color: var(--text); background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 0; }
.exp-ver small { color: var(--text-faint); font-size: 11.5px; line-height: 1.45; }
.exp-fmts { display: flex; flex-direction: column; gap: 6px; }
.exp-fmt { position: relative; display: block; padding: 10px 12px; cursor: var(--cur-pointer); background: var(--surface); border: 1px solid var(--border); transition: border-color var(--t), background var(--t); }
.exp-fmt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.exp-fmt b { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.exp-fmt b i { font: 500 11px/1 var(--font-mono); font-style: normal; color: var(--text-faint); }
.exp-fmt p { margin: 4px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.exp-fmt p em { font-style: normal; color: #ffb35c; }
.exp-fmt:has(input:checked) { border-color: rgba(63, 214, 200, 0.6); background: rgba(63, 214, 200, 0.08); box-shadow: inset 2px 0 0 #3fd6c8; }
.exp-fmt:has(input:checked) b i { color: #3fd6c8; }
.exp-note { margin: -4px 0 0; color: var(--text-faint); font-size: 12px; line-height: 1.45; }
.exp-note:empty { display: none; }
#exportGo { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 560px) { .exp-eds { grid-template-columns: 1fr; } }

/* resource packs (Render panel) */
.pack-row { display: flex; gap: 6px; align-items: center; }
.pack-row .select { flex: 1; min-width: 0; }
.pack-info { margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: var(--text-faint); }
.pack-row { flex-wrap: wrap; }
.pack-row .select { flex: 1 0 100%; }

/* Admin actions get their own row on phones. */
@media (max-width: 700px) {
  :root { --top-h: 96px; }
  .top { flex-wrap: wrap; align-content: center; row-gap: 4px; }
  .top-l { min-width: 96px; }
  .top-r { flex: 0 0 100%; justify-content: flex-end; gap: 2px; }
  .top-r .share-btn { padding-inline: 6px; font-size: 11px; }
  #friendsButton { width: auto; }
  #friendsButton span { display: inline; }
}

.share-prompt { color: var(--text); background: var(--bg-2, #10151e); }
.share-prompt-result { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 8px; background: var(--bg-2, #10151e); color: var(--text); box-shadow: 0 8px 32px #0005; }
.share-prompt-result a { color: var(--text); text-decoration: underline; }

.share-prompt-giveaway { color: var(--text) !important; }

/* The admin shortcut uses the authenticated account, and occupies space only for admins. */
.nav-admin { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 6px; color: var(--text-dim); text-decoration: none; font-size: 13px; border-radius: var(--radius-sm); }
.nav-admin:hover, .nav-admin:focus-visible { color: var(--text); background: var(--bg-2); }
.nav-admin svg { flex: none; }
.left > .nav-admin { display: none; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  body[data-sheet=more] .left > .nav-admin { display: flex; min-height: 44px; margin: 8px 12px; font-size: 15px; }
}
