/* Rounded display font, bundled into the image (no external requests) */
@font-face { font-family: Fredoka; font-weight: 400; font-display: swap; src: url(vendor/fonts/fredoka-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(vendor/fonts/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(vendor/fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(vendor/fonts/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  /* palette: navy field, coral red, cream, gold, rainbow */
  --bg: #12223b;
  --panel: #19304f;
  --panel2: #213e66;
  --panel3: #2b4f80;
  --border: #33598d;
  --text: #fdf6ea;
  --muted: #b3c3dc;
  --accent: #f4645a;
  --accent-strong: #e8473d;
  --accent-shadow: #a52d26;
  --accent-soft: rgba(244, 100, 90, .2);
  --cream: #fdf6ea;
  --cream-shadow: #d9c9ae;
  --gold: #ffc94a;
  --danger: #ff6b6b;
  --warn: #ffc94a;
  --ok: #6fdb5e;
  --rainbow: linear-gradient(90deg, #a46cf2, #4fb8f7, #6fdb5e, #ffd23f, #ff8c42, #f25454);
  --radius: 10px;
  color-scheme: dark;
  font-family: Fredoka, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 13.5px; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

#app {
  display: grid; height: 100vh;
  grid-template-rows: 56px minmax(0, 1fr) 40px;
  grid-template-columns: 240px minmax(0, 1fr) 304px;
  grid-template-areas: "top top top" "pal view side" "foot foot foot";
}

/* ---------- top bar ---------- */
#topbar { grid-area: top; position: relative; display: flex; align-items: center; gap: 4px; padding: 0 12px; background: var(--panel); min-width: 0; }
#topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--rainbow); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: .3px; margin-right: 8px; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-strong); box-shadow: 0 3px 0 var(--accent-shadow); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; stroke: var(--cream); fill: none; stroke-width: 2.2; stroke-linejoin: round; }
#projectName { background: transparent; border: 2px solid transparent; border-radius: 8px; padding: 4px 8px; width: 180px; font-weight: 600; }
#projectName:hover { border-color: var(--border); }
#projectName:focus { outline: none; border-color: var(--accent); background: var(--panel2); }
.sep { width: 2px; height: 26px; background: var(--border); margin: 0 5px; border-radius: 2px; }
.spacer { flex: 1; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; white-space: nowrap; font-weight: 500; }
.tb.icon { width: 36px; padding: 0; justify-content: center; }
.tb:hover:not(:disabled) { background: var(--panel3); }
.tb:disabled { opacity: .32; cursor: default; }
.tb.primary { background: var(--accent-strong); color: var(--cream); box-shadow: 0 3px 0 var(--accent-shadow); }
.tb.primary:hover { background: var(--accent); }
.tb.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-shadow); }
.tb.on, .mode.on, .tool.on { background: var(--cream); color: var(--accent-strong); box-shadow: 0 3px 0 var(--cream-shadow); }
.modes { display: flex; gap: 3px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 42px; background: var(--panel2); border: 2px solid var(--border); border-radius: 12px; padding: 5px; min-width: 230px; z-index: 30; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.menu.left { right: auto; left: 0; }
.menu button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--panel3); }
.menu hr { border: 0; border-top: 2px solid var(--border); margin: 4px 0; }
.menu .menu-row { display: flex; gap: 4px; padding: 4px; }
.menu .menu-row button { justify-content: center; background: var(--panel3); font-weight: 600; }
.menu .menu-row button:hover { background: var(--accent-strong); }

/* ---------- palette ---------- */
#palette { grid-area: pal; background: var(--panel); overflow-y: auto; padding: 12px 12px 18px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 12px 0 8px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.shape { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 6px; border-radius: 12px; background: var(--panel2); border: 2px solid transparent; cursor: grab; user-select: none; box-shadow: 0 3px 0 rgba(0,0,0,.22); transition: transform .08s; }
.shape:hover { border-color: var(--accent); background: var(--panel3); transform: translateY(-1px); }
.shape img { width: 100%; max-width: 56px; aspect-ratio: 1; pointer-events: none; }
.shape span { font-size: 11.5px; color: var(--muted); }
.settings { display: grid; gap: 9px; }
.settings label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
select, input[type=text], input[type=number] { background: var(--panel2); border: 2px solid var(--border); border-radius: 8px; padding: 5px 8px; min-width: 0; }
select:focus, input:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 14px; }

/* ---------- viewport ---------- */
#viewport { grid-area: view; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #1d3961; border-radius: 14px 14px 0 0; margin: 6px 6px 0; }
#canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#viewbtns { position: absolute; top: 10px; right: 10px; display: flex; gap: 3px; background: rgba(25, 48, 79, .9); border: 2px solid var(--border); border-radius: 12px; padding: 3px; backdrop-filter: blur(6px); z-index: 4; }
#viewbtns button { height: 30px; min-width: 32px; padding: 0 9px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 500; }
#viewbtns button:hover { background: var(--panel3); }
#viewbtns button.on { background: var(--accent-strong); color: var(--cream); }
#orthoBtn { min-width: 54px !important; }
#dimLabel { position: absolute; transform: translate(-50%, -100%); background: var(--cream); color: #1b2c47; font-weight: 600; padding: 2px 9px; border-radius: 7px; font-size: 12px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 2px 0 var(--cream-shadow); z-index: 3; }
#dropHint { position: absolute; inset: 12px; border: 3px dashed var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 600; font-size: 16px; pointer-events: none; background: var(--accent-soft); z-index: 5; }
[hidden] { display: none !important; }
#wpBadge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; background: rgba(25,48,79,.92); border: 2px solid var(--gold); color: var(--gold); border-radius: 12px; padding: 4px 4px 4px 10px; font-size: 12.5px; z-index: 4; }
#wpBadge button { border: 0; background: var(--panel3); color: var(--text); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 12px; }
#toolHint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--cream); color: #1b2c47; font-weight: 500; padding: 6px 14px; border-radius: 10px; font-size: 12.5px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 var(--cream-shadow); z-index: 4; }
#marquee { position: absolute; border: 2px solid var(--accent); background: var(--accent-soft); pointer-events: none; border-radius: 4px; z-index: 3; }
#measureLabel { position: absolute; transform: translate(-50%, -130%); background: var(--gold); color: #1b2c47; font-weight: 600; padding: 3px 9px; border-radius: 7px; font-size: 12px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 3; }
#measureLabel small { font-weight: 500; opacity: .75; margin-left: 6px; }
#webglError { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 24px; text-align: center; }

/* ---------- resize / rotate / lift handles (HTML overlay) ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
#hudSvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#hudSvg .foot { stroke: var(--cream); stroke-width: 1.3; stroke-dasharray: 6 4; fill: none; opacity: .75; }
#hudSvg .guide { stroke: var(--cream); stroke-width: 1; stroke-dasharray: 4 4; opacity: .45; }
#hudSvg .dim { stroke: var(--cream); stroke-width: 1.4; }
#hudSvg .dimtick { stroke: var(--cream); stroke-width: 1.2; opacity: .8; }
#hudSvg .lock { stroke-width: 2; stroke-dasharray: 10 6; }
#hudSvg .lock.x { stroke: #ff5a5a; } #hudSvg .lock.y { stroke: #5fd38a; }
.hd { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff; border: 2px solid #26292e; border-radius: 2px; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.hd.side { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.hd:hover, .hd.active { background: var(--accent-strong); border-color: #5b120e; }
.hd-dot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--cream); border: 1px solid #26292e; border-radius: 1px; pointer-events: auto; cursor: ew-resize; }
.hd-dot::after { content: ""; position: absolute; inset: -7px; }
.hd-dot:hover, .hd-dot.active { background: var(--accent); transform: scale(1.35); }
/* no visible scrollbars anywhere; panels still scroll with wheel / touch */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* rotate grips: curved double arrows coloured by axis (X red, Y green, Z blue), white outline */
.hd-rot { --ax: #ff6b6b; position: absolute; width: 34px; height: 24px; margin: -12px 0 0 -17px; pointer-events: auto; cursor: grab; display: grid; place-items: center; transition: transform .1s; }
.hd-rot.ax1 { --ax: #4cd07d; }
.hd-rot.ax2 { --ax: #4f9bff; }
.hd-rot svg { width: 32px; height: 21px; overflow: visible; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.hd-rot .ol path, .hd-rot .ol polygon { stroke: #fff; stroke-width: 5.2; }
.hd-rot .ol polygon { fill: #fff; }
.hd-rot .fg path { stroke: var(--ax); stroke-width: 2.6; }
.hd-rot .fg polygon { fill: var(--ax); stroke: var(--ax); stroke-width: 1; }
.hd-rot:hover, .hd-rot.active { transform: scale(1.18); }
.hd-rot:hover .fg path, .hd-rot.active .fg path { filter: brightness(1.15); }
#hudSvg .wheel { fill: rgba(58, 214, 255, .16); stroke: rgba(130, 228, 255, .85); stroke-width: 1.2; fill-rule: evenodd; }
#hudSvg .wheel.fine { fill: rgba(58, 214, 255, .07); }
#hudSvg .wtick { stroke: rgba(170, 236, 255, .9); stroke-width: 1; }
#hudSvg .wtick.fine { opacity: .6; }
#hudSvg .wedge { fill: rgba(255, 140, 66, .5); stroke: none; }
#hudSvg .wline { stroke: #ff8c42; stroke-width: 1.6; }
#hudSvg .wline.faint { opacity: .45; stroke-dasharray: 4 3; }
#hudSvg .snapg { stroke: #ff5fd2; stroke-width: 1.5; stroke-dasharray: 5 3; }
.hd-lift { position: absolute; width: 18px; height: 24px; margin: -12px 0 0 -9px; pointer-events: auto; cursor: ns-resize; transition: transform .1s; }
.hd-lift svg { width: 18px; height: 24px; fill: #4f9bff; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.hd-lift:hover, .hd-lift.active { transform: scale(1.18); }
.dimlbl { position: absolute; transform: translate(-50%, -50%); background: #fff; color: #1b2c47; border: 1px solid #c9ced6; border-radius: 4px; padding: 2px 8px; font-size: 12.5px; font-weight: 500; pointer-events: auto; cursor: text; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dimlbl:hover { border-color: var(--accent); }
.dimlbl input { width: 64px; border: 0; padding: 0; background: transparent; color: #1b2c47; font: inherit; outline: none; }
.anglbl { position: absolute; transform: translate(-50%, -150%); background: var(--accent-strong); color: var(--cream); border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
/* align dots: three per axis (min / middle / max) on dashed guides, X red, Y green, Z blue */
.align-dot { --ax: #ff6b6b; position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ax); border: 2.5px solid #fff; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: transform .1s; }
.align-dot.ax-y { --ax: #4cd07d; }
.align-dot.ax-z { --ax: #4f9bff; }
.align-dot.mid { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.align-dot:hover { transform: scale(1.45); }
#hudSvg .alignline { stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; opacity: .9; }
#hudSvg .alignline.ax-x { stroke: #ff6b6b; }
#hudSvg .alignline.ax-y { stroke: #4cd07d; }
#hudSvg .alignline.ax-z { stroke: #4f9bff; }
#hudSvg .alignbox { stroke: #ffc94a; stroke-width: 1; stroke-dasharray: 3 3; fill: none; opacity: .55; }
#hud .ax-x { border-color: #ff9a9a; } #hud .ax-y { border-color: #9be8b4; } #hud .ax-z { border-color: #9cc4ff; }

/* slice legend */
#sliceLegend { position: absolute; left: 10px; bottom: 12px; background: rgba(25,48,79,.94); border: 2px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 12px; display: grid; gap: 4px; z-index: 4; }
#sliceLegend b { font-weight: 600; margin-bottom: 2px; }
#sliceLegend span { display: flex; align-items: center; gap: 7px; }
#sliceLegend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- sidebar ---------- */
#sidebar { grid-area: side; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
#inspectorSheet { padding: 12px; overflow-y: auto; max-height: 66%; flex: none; }
#outlineWrap { padding: 0 12px 12px; overflow-y: auto; flex: 1; min-height: 0; border-top: 2px solid var(--border); }
.pill { background: var(--accent-strong); color: var(--cream); border-radius: 10px; padding: 0 7px; font-size: 11px; letter-spacing: 0; }
.insp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.insp-head input { flex: 1; font-weight: 600; font-size: 15px; background: transparent; border-color: transparent; }
.insp-head input:hover { border-color: var(--border); }
.insp-head .hib { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.insp-head .hib:hover { background: var(--panel3); color: var(--text); }
.insp-head .hib.on { color: var(--gold); }
.type { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
h4 { font-size: 11.5px; color: var(--muted); font-weight: 600; margin: 14px 0 7px; text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; justify-content: space-between; }
h4 label { text-transform: none; letter-spacing: 0; font-weight: 400; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 12px; border: 2px solid var(--border); background: var(--panel2); cursor: pointer; color: var(--muted); font-weight: 500; }
.tile:hover { border-color: var(--muted); color: var(--text); }
.tile.on { border-color: var(--cream); color: var(--text); background: var(--panel3); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.tile .chip { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25), 0 2px 0 rgba(0,0,0,.25); }
.tile .chip.hatch { background: repeating-linear-gradient(45deg, #c5ccd8 0 5px, #8792a5 5px 10px); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel2); border: 2px solid var(--border); border-radius: 10px; padding: 2px; gap: 2px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button { border: 0; background: transparent; padding: 6px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--cream); color: var(--accent-strong); }
.seg button:hover { color: var(--text); }
.seg button.on:hover { color: var(--accent-strong); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.swatch.on { border-color: var(--cream); transform: scale(1.1); }
input[type=color] { width: 28px; height: 24px; border: 2px solid var(--border); border-radius: 7px; background: var(--panel2); padding: 1px; cursor: pointer; }
.xyz { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.num { display: flex; align-items: center; background: var(--panel2); border: 2px solid var(--border); border-radius: 8px; overflow: hidden; }
.num:focus-within { border-color: var(--accent); }
.num input { border: 0; background: transparent; width: 100%; padding: 5px 4px; font-variant-numeric: tabular-nums; }
.ax { font-size: 11.5px; font-weight: 700; padding: 0 0 0 7px; }
.ax0 { color: #ff7a7a; } .ax1 { color: #6fdb8e; } .ax2 { color: #7fb2ff; }

/* sliders with a value bubble on the knob */
.param { margin-bottom: 10px; }
.param > span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.slider { position: relative; height: 30px; display: flex; align-items: center; }
.slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--panel3) var(--p, 0%)); outline: none; margin: 0; }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 22px; border-radius: 11px; background: transparent; cursor: grab; }
.slider input[type=range]::-moz-range-thumb { width: 30px; height: 22px; border: 0; border-radius: 11px; background: transparent; cursor: grab; }
.bubble { position: absolute; top: 4px; transform: translateX(-50%); min-width: 30px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--cream); color: #1b2c47; font-size: 12px; font-weight: 600; display: grid; place-items: center; pointer-events: none; box-shadow: 0 2px 0 var(--cream-shadow); border: 2px solid var(--accent); }
.bubble input { pointer-events: auto; width: 44px; border: 0; padding: 0; text-align: center; background: transparent; color: #1b2c47; font: inherit; outline: none; }
.param.text input, .param.text select { width: 100%; }
.param select { background: var(--bg); color: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; }
.engrave-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.engrave-row label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.engrave-row input { width: 58px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; border: 0; background: var(--panel3); cursor: pointer; font-weight: 500; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.btn:hover { background: #36609a; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.danger:hover { background: #7a2b2b; }
.btn.accent { background: var(--accent-strong); color: var(--cream); box-shadow: 0 3px 0 var(--accent-shadow); }
.btn.accent:hover { background: var(--accent); }
.align-grid { display: grid; grid-template-columns: 22px repeat(4, 1fr); gap: 4px; align-items: center; }
.align-grid button { padding: 5px 2px; font-size: 11.5px; border-radius: 7px; border: 0; background: var(--panel3); cursor: pointer; color: var(--text); }
.align-grid button:hover { background: var(--accent-strong); }
.empty h3 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); margin-top: 0; }
.empty p { color: var(--muted); line-height: 1.5; margin: 0 0 10px; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.keys li { display: flex; justify-content: space-between; gap: 8px; }
kbd { background: var(--panel3); border: 0; border-radius: 5px; padding: 0 6px; font-size: 11px; font-family: inherit; color: var(--text); box-shadow: 0 2px 0 rgba(0,0,0,.3); }

.ol-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 8px; cursor: pointer; }
.ol-row:hover { background: var(--panel2); }
.ol-row.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ol-row.dim .ol-name { opacity: .45; }
.dot { width: 13px; height: 13px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.dot.hole { background: repeating-linear-gradient(45deg, #c5ccd8 0 2px, #6c778a 2px 4px); }
.ol-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-name input { width: 100%; padding: 2px 4px; }
.ol-type { color: var(--muted); font-size: 11px; }
.ib { border: 0; background: transparent; padding: 2px; border-radius: 5px; cursor: pointer; color: var(--muted); display: inline-flex; opacity: .55; }
.ol-row:hover .ib, .ib.active { opacity: 1; }
.ib:hover { color: var(--text); background: var(--panel3); }

/* ---------- footer ---------- */
#status { grid-area: foot; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--panel); font-size: 12.5px; min-width: 0; }
#statusText { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
#statusText .warn { color: var(--warn); }
#layerCtl { display: flex; align-items: center; gap: 8px; }
#layerCtl select { padding: 2px 6px; }
#layerSlider { width: 190px; accent-color: var(--accent); }
#layerLabel { min-width: 160px; font-variant-numeric: tabular-nums; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; }
#sliceBtn { height: 28px; }

/* ---------- modals / dialogs ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 15, 28, .6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal-card { background: var(--panel); border: 2px solid var(--border); border-radius: 16px; width: min(920px, 100%); max-height: 86vh; overflow-y: auto; padding: 18px 20px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.modal-card header { display: flex; align-items: center; justify-content: space-between; }
.modal-card h2 { margin: 0; font-size: 20px; font-weight: 600; }
#designsGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.dcard { background: var(--panel2); border: 2px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.dcard.current { border-color: var(--accent); }
.dcard .thumb { aspect-ratio: 3 / 2; background: #1d3961 center / cover no-repeat; cursor: pointer; }
.dcard .meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.dcard .meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard .row { display: flex; gap: 4px; padding: 0 8px 10px; }
.dcard .row button { flex: 1; font-size: 12px; padding: 4px; }
.dcard.new { align-items: center; justify-content: center; min-height: 190px; cursor: pointer; color: var(--accent); gap: 8px; border-style: dashed; }
.dcard.new:hover { background: var(--panel3); }
.dialog-card { width: min(460px, 100%); }
.dlg-body { display: grid; gap: 10px; margin: 14px 0 18px; }
.dlg-f { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.dlg-f input, .dlg-f select { color: var(--text); }
.dlg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.dlg-c { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.dlg-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-top: 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
#cmdk { align-items: flex-start; padding-top: 12vh; }
.cmdk-card { width: min(560px, 100%); background: var(--panel); border: 2px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
#cmdkInput { width: 100%; border: 0; border-bottom: 2px solid var(--border); border-radius: 0; background: transparent; padding: 14px 16px; font-size: 16px; outline: none; }
#cmdkList { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-item.on, .cmdk-item:hover { background: var(--panel3); }
.cmdk-item .muted { font-size: 12px; }
#ctxMenu { position: fixed; top: 0; left: 0; right: auto; z-index: 70; min-width: 210px; width: max-content; max-height: 80vh; overflow-y: auto; }
#ctxMenu .ctx-label { padding: 6px 10px 4px; color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 60; pointer-events: none; }
.toast { background: var(--cream); color: #1b2c47; font-weight: 500; padding: 8px 16px; border-radius: 10px; box-shadow: 0 3px 0 var(--cream-shadow), 0 10px 24px rgba(0,0,0,.35); transition: opacity .3s, transform .3s; }
.toast.error { background: var(--accent-strong); color: var(--cream); box-shadow: 0 3px 0 var(--accent-shadow); }
.toast.warn { background: var(--gold); }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* =====================================================================
   Phones & tablets. body.mobile / body.landscape / body.touch are set from JS
   so CSS and the code agree on what "mobile" means.
   ===================================================================== */
.tbstrip { display: contents; }
.mobile-only, .touch-only { display: none !important; }
body.touch .touch-only { display: flex !important; }
.modsgrp { gap: 4px; align-items: center; }
.modbtn { flex: none; height: 36px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--border); background: transparent; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.modbtn.on { background: var(--cream); color: var(--accent-strong); border-color: var(--cream); box-shadow: 0 3px 0 var(--cream-shadow); }
.nbadge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent-strong); color: var(--cream); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

body.touch { -webkit-tap-highlight-color: transparent; }
body.touch button, body.touch .shape, body.touch .ol-row { touch-action: manipulation; }
body.touch .hd { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-width: 3px; }
body.touch .hd.side { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
body.touch .hd-dot { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
body.touch .hd-rot { width: 50px; height: 36px; margin: -18px 0 0 -25px; }
body.touch .hd-rot svg { width: 40px; height: 27px; }
body.touch .hd-lift { width: 34px; height: 36px; margin: -18px 0 0 -17px; display: grid; place-items: center; }
body.touch .hd-lift svg { width: 24px; height: 28px; }
body.touch .align-dot { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
body.touch .dimlbl { padding: 5px 10px; font-size: 14px; }
body.touch .swatch { width: 30px; height: 30px; }
body.touch input, body.touch select { font-size: 16px; } /* 16px stops phones zooming into fields */
body.touch .num input { padding: 8px 4px; }
body.touch .ib { padding: 6px; opacity: 1; }
body.touch .ol-row { padding: 9px 8px; }
body.touch .menu button { padding: 12px 12px; }
body.touch .slider { height: 38px; }
body.touch .slider input[type=range]::-webkit-slider-thumb { width: 40px; height: 34px; }

body.mobile { --top-h: 50px; --strip-h: 54px; --nav-h: 58px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); overscroll-behavior: none; }
body.mobile .mobile-only { display: flex !important; }
body.mobile .desk-only { display: none !important; }
body.mobile #app { display: block; position: relative; height: 100dvh; width: 100vw; }
body.mobile #topbar { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 6px 0; gap: 2px; z-index: 30; }
body.mobile .brand { margin-right: 2px; }
body.mobile .brand-name { display: none; }
body.mobile .brand .mark { width: 32px; height: 32px; }
body.mobile #projectName { width: auto; flex: 1; min-width: 40px; padding: 4px 6px; }
body.mobile #topbar > .sep, body.mobile .spacer { display: none; }
body.mobile .tb span { display: none; }
body.mobile .tb, body.mobile .tb.icon { height: 40px; min-width: 40px; }
body.mobile #viewport { position: absolute; margin: 0; border-radius: 0; left: 0; right: 0; top: calc(var(--top-h) + var(--safe-t)); bottom: calc(var(--strip-h) + var(--nav-h) + var(--safe-b)); }
body.mobile .tbstrip { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); height: var(--strip-h); display: flex; align-items: center; gap: 3px; padding: 0 8px; overflow-x: auto; overflow-y: hidden; background: var(--panel); border-top: 2px solid var(--border); z-index: 28; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.mobile .tbstrip::-webkit-scrollbar { display: none; }
body.mobile .tbstrip > * { flex: none; }
body.mobile .tbstrip .tb.icon { width: 44px; height: 44px; }
body.mobile .tbstrip .menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(var(--nav-h) + var(--strip-h) + var(--safe-b) + 8px); min-width: 0; }
body.mobile #mnav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--panel); border-top: 2px solid var(--border); z-index: 29; justify-content: space-around; align-items: stretch; }
#mnav button { position: relative; flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
#mnav button svg.i { width: 22px; height: 22px; }
#mnav button.on { color: var(--accent); }
#mnav button.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
/* slide-up sheets */
body.mobile #sidebar { display: contents; }
body.mobile .sheet { position: fixed; left: 0; right: 0; top: auto; bottom: calc(var(--nav-h) + var(--strip-h) + var(--safe-b)); max-height: min(58dvh, calc(100dvh - var(--top-h) - var(--strip-h) - var(--nav-h) - 40px)); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border: 2px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(0,0,0,.45); padding: 0 14px 16px; z-index: 27; transform: translateY(115%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; grid-area: auto; }
body.mobile .sheet.sheet-open { transform: none; visibility: visible; transition: transform .22s ease; }
body.mobile .sheet { max-height: min(58dvh, calc(100dvh - var(--top-h) - var(--strip-h) - var(--nav-h) - 40px)) !important; } /* beat the desktop #inspectorSheet cap */
body.mobile.landscape .sheet { max-height: none !important; }
body:not(.ready) .sheet { transition: none !important; } /* no slide-away flash while the layout switches on load */
body.mobile #outlineWrap { border-top: 2px solid var(--border); }
body.mobile #outlineWrap > h3 { display: none; }
body.mobile #status { display: flex; flex-direction: column; align-items: stretch; gap: 12px; height: auto; font-size: 13px; }
body.mobile #statusText { white-space: normal; line-height: 1.5; }
body.mobile #layerCtl { flex-wrap: wrap; gap: 10px; }
body.mobile #layerSlider { flex: 1 1 100%; width: 100%; order: 10; height: 34px; }
body.mobile #layerLabel { min-width: 0; }
.sheet-head { position: sticky; top: 0; z-index: 3; background: var(--panel); align-items: center; justify-content: space-between; padding: 16px 0 8px; font-weight: 600; font-size: 16px; }
.sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 2px; background: var(--border); }
body.mobile .shapes { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
body.mobile #viewbtns { top: 8px; right: 8px; left: 8px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
body.mobile #viewbtns::-webkit-scrollbar { display: none; }
body.mobile #viewbtns button { flex: none; height: 34px; }
body.mobile #toolHint { bottom: 10px; white-space: normal; max-width: calc(100% - 20px); text-align: center; }
body.mobile #sliceLegend { left: 8px; bottom: 8px; font-size: 11px; padding: 6px 8px; gap: 2px; max-width: 60%; }
body.mobile #wpBadge { top: 54px; left: 8px; }
body.mobile #toasts { top: calc(var(--top-h) + var(--safe-t) + 54px); width: calc(100% - 24px); }
body.mobile .toast { text-align: center; }
body.mobile .modal { padding: 10px; }
body.mobile .modal-card { padding: 14px; max-height: 92dvh; }
body.mobile #cmdk { padding-top: calc(var(--top-h) + 10px); }
body.mobile #designsGrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* landscape phones: tools on the left, nav on the right, panels slide in from the side */
body.mobile.landscape { --top-h: 44px; --rail-l: 56px; --rail-r: 68px; }
body.mobile.landscape #viewport { left: var(--rail-l); right: var(--rail-r); bottom: 0; }
body.mobile.landscape .tbstrip { top: calc(var(--top-h) + var(--safe-t)); bottom: 0; right: auto; width: var(--rail-l); height: auto; flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 6px 0; border-top: 0; border-right: 2px solid var(--border); }
body.mobile.landscape .tbstrip .sep { width: 26px; height: 2px; margin: 4px 0; }
body.mobile.landscape .modsgrp { flex-direction: column; }
body.mobile.landscape .modbtn { width: 50px; padding: 0 2px; font-size: 10.5px; white-space: normal; line-height: 1.05; height: 38px; }
body.mobile.landscape .tbstrip .menu { left: calc(var(--rail-l) + 8px); right: auto; width: 270px; top: calc(var(--top-h) + 8px); bottom: auto; }
body.mobile.landscape #mnav { top: calc(var(--top-h) + var(--safe-t)); left: auto; width: var(--rail-r); height: auto; flex-direction: column; border-top: 0; border-left: 2px solid var(--border); padding: 0 0 var(--safe-b); }
body.mobile.landscape #mnav button.on::before { top: 25%; bottom: 25%; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
body.mobile.landscape .sheet { top: calc(var(--top-h) + var(--safe-t)); bottom: 0; left: auto; right: var(--rail-r); width: min(380px, 62vw); max-height: none; border-radius: 18px 0 0 18px; border: 2px solid var(--border); border-right: 0; transform: translateX(115%); }
body.mobile.landscape .sheet.sheet-open { transform: none; }
body.mobile.landscape #toasts { top: calc(var(--top-h) + 48px); }

@media (max-width: 1250px) {
  #app { grid-template-columns: 206px minmax(0, 1fr) 270px; }
  .tb span { display: none; }
  body:not(.mobile) .tb.align-btn span { display: inline; } /* Align keeps its label */
  .tb:not(.icon) { padding: 0 9px; }
  #projectName { width: 120px; }
  #layerSlider { width: 110px; }
  #layerLabel { min-width: 120px; }
}

/* --- view cube --- */
#viewcube { position: absolute; left: 14px; top: 14px; width: 52px; height: 52px; z-index: 6; }
#viewcube .vc-cube { position: absolute; left: 26px; top: 26px; width: 0; height: 0; transform-style: preserve-3d; }
#viewcube .vc-face { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; padding: 0; margin: 0;
  display: grid; place-items: center; font: 600 9px/1 Fredoka, system-ui, sans-serif; letter-spacing: .04em; color: var(--cream);
  background: rgba(25, 48, 79, .92); border: 1.5px solid #4c6b95; border-radius: 4px; cursor: pointer; backface-visibility: hidden; }
#viewcube .vc-face:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
#viewcube .vc-home { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); width: 24px; height: 22px; padding: 0; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--cream); font-size: 13px; line-height: 1; cursor: pointer; }
#viewcube .vc-home:hover { background: var(--accent); color: #fff; }
body.mobile #viewcube { top: 60px; left: 12px; transform: scale(.85); transform-origin: 0 0; }
body.mobile.landscape #viewcube { top: 12px; }
/* --- sign-in screen --- */
.auth { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(1200px 600px at 20% 0%, #1d3a62 0%, var(--bg) 60%); }
.auth.hidden { display: none; }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 2px solid var(--border); border-radius: 18px; padding: 26px 24px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.45); position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rainbow); }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.auth-brand h1 { margin: 0; font-size: 26px; color: var(--cream); letter-spacing: .01em; }
.auth-logo svg { width: 36px; height: 36px; display: block; }
.auth-tabs { margin-bottom: 16px; }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.auth-field input { width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; border-radius: 10px; background: var(--bg); color: var(--cream); border: 1.5px solid var(--border); outline: none; }
.auth-field input:focus { border-color: var(--accent); }
.auth .reg-only { display: none; }
.auth.register .reg-only { display: block; }
.auth-hint { margin: -4px 0 10px; }
.auth-error { color: #ff8f86; background: rgba(244,100,90,.12); border: 1px solid rgba(244,100,90,.35); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; margin: 0 0 12px; }
.auth-submit { width: 100%; justify-content: center; padding: 11px; font-size: 15.5px; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#googleBtn { display: flex; justify-content: center; min-height: 44px; }
#authRetry { text-align: center; }

/* --- account menu --- */
.acct-btn span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
#acctMenu { min-width: 240px; }
.acct-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 4px; }
.acct-quota { margin-top: 6px; font-size: 12.5px; color: var(--gold); }
.acct-quota.full { color: #ff8f86; }
.dcard.banner { grid-column: 1 / -1; border: 2px dashed var(--gold); display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.dcard.new.full { opacity: .55; }

/* --- admin --- */
.admin-card { width: min(860px, calc(100vw - 32px)); }
.admin-scroll { overflow: auto; max-height: 65vh; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table .adm-limit { width: 70px; }
.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* --- grouped palette --- */
.shape-search { width: 100%; margin: 2px 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); color: var(--cream); border: 1.5px solid var(--border); font: inherit; font-size: 14px; outline: none; }
.shape-search:focus { border-color: var(--accent); }
.palgrp { margin-bottom: 8px; }
.palhead { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 2px; margin: 0 0 4px; background: none; border: 0; color: var(--cream); font: 600 12.5px/1.2 inherit; font-family: inherit; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; text-align: left; }
.palhead .chev { display: inline-block; transition: transform .15s; color: var(--muted); }
.palhead .count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 9px; background: var(--panel2); color: var(--muted); font-size: 11px; text-align: center; }
.palgrp.closed:not(.searching) .shapes { display: none; }
.palgrp.closed:not(.searching) .chev { transform: rotate(-90deg); }
.shape span { text-align: center; line-height: 1.15; }

/* --- shape modifiers --- */
.mods { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.modgrp { background: var(--panel2); border-radius: 10px; padding: 0 10px; border: 1.5px solid transparent; }
.modgrp[open] { padding-bottom: 10px; border-color: var(--border); }
.modgrp summary { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; color: var(--cream); font-weight: 600; font-size: 13.5px; }
.modgrp summary::-webkit-details-marker { display: none; }
.modgrp summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.modgrp[open] summary::before { transform: rotate(90deg); }
.modon { margin-left: auto; padding: 1px 7px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }
.param-hint { margin: -6px 0 8px; line-height: 1.3; }
.param.bool { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.param.bool input { width: 16px; height: 16px; accent-color: var(--accent); }
.param.bool span { color: var(--cream); font-size: 13px; }
.btn.small { padding: 4px 10px; font-size: 12px; margin-top: 4px; }
body.placing #viewport canvas { cursor: copy; }
/* height above the bed */
#hudSvg .liftshadow { fill: rgba(120, 190, 255, .16); stroke: rgba(150, 205, 255, .7); stroke-width: 1; stroke-dasharray: 4 3; }
#hudSvg .dimarrow { fill: var(--cream); }
.dimlbl.liftlbl.below { background: #ff8f86; color: #2a0f0d; }

/* --- print requests, tickets, site edition hooks --- */
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; } /* bot trap: people never see it */
.auth-privacy { display: none; margin: -6px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(111, 219, 94, .12); border: 1px solid rgba(111, 219, 94, .45); color: var(--cream); font-size: 13.5px; line-height: 1.4; }
.auth.usernames .auth-privacy { display: block; }
.auth.usernames .name-field { display: none !important; }
.ts-slot:empty, .auth .ts-slot:empty { display: none !important; }
.ts-slot { margin: 6px 0 12px; min-height: 65px; }
.brand .mark img, .auth-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.auth-logo img { width: 44px; height: 44px; }
.send-btn { font-weight: 600; }
.send-preview { display: grid; place-items: center; margin: 0 0 12px; }
.send-preview img { width: 100%; max-width: 360px; border-radius: 12px; background: var(--bg); border: 2px solid var(--border); }
.panel-card { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.panel-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-body { overflow: auto; }
.panel-card.ticket-card { width: min(760px, calc(100vw - 24px)); }
.panel-card.wide-card { width: min(980px, calc(100vw - 24px)); }
.ticket-img { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)); }
.ticket-help { margin: 12px 2px; color: var(--muted); }
.tickets { display: flex; flex-direction: column; gap: 8px; }
.ticket-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px; border-radius: 12px; background: var(--panel2); border: 1.5px solid var(--border); cursor: pointer; }
.ticket-row:hover { border-color: var(--accent); }
.ticket-row img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: none; }
.ticket-row .tr-main { flex: 1; min-width: 0; line-height: 1.35; }
.ticket-row .tr-open { display: flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; flex: none; }
.req-thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bg); display: block; }
.req-table .req-note { width: 100%; min-width: 140px; }
.req-table select, .req-table input { background: var(--bg); color: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; }
body.mobile .send-btn span { display: inline !important; }
/* seasonal drift layer over the 3D view (a site edition's theme gives it a picture) */
.season-drift { position: absolute; inset: 0; pointer-events: none; z-index: 1; background-repeat: repeat; background-size: 360px 360px; }
