@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
:root {
  --bg: #0e0e10;
  --panel: #17171a;
  --panel-2: #1e1f23;
  --panel-3: #131316;
  --line: #2a2b31;
  --line-2: #38393f;
  --line-3: #566070;
  --text: #e4e6ee;
  --text-2: #bcc1d0;
  --muted: #8e94a8;
  --faint: #636a80;
  --accent: #0B3948;
  --accent-2: #7fc0d6;
  --accent-dim: #082a35;
  --accent-bg: #0e3b4a;
  --accent-bg-2: #0c2f3b;
  --accent-line: #1f6a84;
  --on-accent: #e8f6fb;
  --on-accent-2: #bfe0ec;
  --logo-hi: #bfe6f2;
  --logo-lo: #0B3948;
  --glow: rgba(63, 160, 191, 0.45);
  --hover: #26272c;
  --hover-2: #222328;
  --hover-3: #2d2e35;
  --input-bg: #0b0b0d;
  --sel-bg: #1c2c40;
  --panel-glass: rgba(23, 23, 26, 0.92);
  --sel: #3d9bff;
  --danger: #ff5f5f;
  --radius: 6px;
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  --cond: "Barlow Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;
  --rim: rgba(238, 240, 246, 0.07);
  color: var(--text);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: tabular-nums; }
input, select, textarea { user-select: text; }

#app { display: grid; grid-template-rows: auto auto 1fr auto auto; grid-template-columns: minmax(0, 1fr); height: 100vh; }

/* ---------- top bar ---------- */
#topbar {
  display: flex; align-items: center; gap: 12px; padding: 7px 12px; min-width: 0; overflow: hidden;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: 0.3px; margin-right: 6px; }
.logo {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--logo-hi) 0 18%, var(--accent) 45%, var(--logo-lo) 100%);
  box-shadow: 0 0 12px var(--glow);
}
.spacer { flex: 1; }
.field { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.field select { min-width: 130px; }

button {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--line-3); background: var(--hover); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-2); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); border-color: var(--line-2); }
button.danger { color: var(--danger); }
button:disabled { opacity: 0.45; cursor: default; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line-2); background: var(--panel-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-bg); color: var(--accent-2); }

input[type="text"], input:not([type]), input[type="number"], select, textarea {
  background: var(--input-bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 6px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="color"] { width: 30px; height: 22px; padding: 0 2px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--input-bg); }
input[type="checkbox"] { accent-color: var(--accent-2); }

/* ---------- tool options ---------- */
#tooloptions {
  display: flex; align-items: center; gap: 14px; min-height: 34px; padding: 4px 12px;
  background: var(--panel-3); border-bottom: 1px solid var(--line); color: var(--muted);
}
#tooloptions .tname { color: var(--accent-2); font-weight: 600; }
#tooloptions label { display: flex; align-items: center; gap: 6px; }
#tooloptions input:not([type="checkbox"]) { width: 90px; }

/* ---------- main area ---------- */
#main { display: grid; grid-template-columns: 52px 1fr 310px; min-height: 0; }
#toolbox { background: var(--panel); border-right: 1px solid var(--line); padding: 4px 5px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
#toolbox::-webkit-scrollbar { display: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
#toolbox .grp { color: var(--faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px; text-align: center; margin: 8px 0 3px; }
#toolbox button {
  width: 40px; height: 32px; display: grid; place-items: center; padding: 0; margin: 1px 0;
  border-color: transparent; background: transparent; color: var(--text-2);
}
#toolbox button:hover { background: var(--hover); }
#toolbox button.on { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent-2); }
#toolbox svg { width: 22px; height: 22px; }

#views { position: relative; display: grid; min-width: 0; min-height: 0; }
#views.mode-plan { grid-template-columns: 1fr; }
#views.mode-plan #three { display: none; }
#views.mode-3d { grid-template-columns: 1fr; }
#views.mode-3d #plan { display: none; }
#views.mode-split { grid-template-columns: 1fr 1fr; }
#views.mode-split #three { border-left: 1px solid var(--line); }
.view { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#planCanvas { display: block; outline: none; }
#three canvas { display: block; }
#threeBar {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  pointer-events: none;
}
#threeBar > * { pointer-events: auto; }
#threeBar .seg button { background: var(--panel-glass); }
.slider { display: flex; align-items: center; gap: 6px; background: var(--panel-glass); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 2px 8px; color: var(--muted); }
#camFrame { position: absolute; z-index: 5; pointer-events: none; border: 1.5px solid rgba(255, 211, 77, 0.9); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.62); }
#camFrame::after { content: attr(data-label); position: absolute; left: 6px; top: 5px; font-size: 11.5px; color: #ffd34d; text-shadow: 0 1px 2px #000; }
#btnCamView.on { background: var(--accent-bg); color: var(--accent-2); }
.slider input { width: 90px; accent-color: var(--accent-2); }
#xfHint { background: var(--panel-glass); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 2px 8px; color: var(--muted); }
#xfHint b { font-weight: 600; }

/* ---------- side panels ---------- */
#side { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(200px, 1.25fr) minmax(160px, 1fr); background: var(--panel); border-left: 1px solid var(--line); min-height: 0; min-width: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-bottom: 1px solid var(--line); }
.panel-head { padding: 7px 12px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.panel-body { overflow-y: auto; padding: 8px 10px; min-height: 0; flex: 1; }
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.tabs button { flex: 1 1 auto; border: 0; border-radius: 0; background: transparent; padding: 7px 3px; font-size: 12px; white-space: nowrap; min-width: 0; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab { display: none; }
.tab.on { display: block; }

/* Object info */
.oip-type { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.oip-type b { font-size: 12.5px; }
.oip-type span { color: var(--muted); }
.oip-group { display: flex; align-items: center; gap: 4px; margin: -2px 0 8px; padding: 4px 6px; border: 1px dashed #3d9bff66; border-radius: 4px; }
.oip-group span { flex: 1; color: var(--muted); }
.oip-group button { padding: 2px 8px; }
.oip-group.open { border-color: #ffb84d88; }
.oip-sec { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; margin: 10px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.row { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 8px; margin: 3px 0; }
.row > span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row input:not([type="checkbox"]):not([type="color"]), .row select, .row textarea { width: 100%; }
.row .info { color: var(--text); white-space: normal; line-height: 1.35; overflow-wrap: anywhere; user-select: text; }
.row .pair { display: flex; gap: 6px; align-items: center; }
.row .swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid #0006; display: inline-block; }
.empty { color: var(--muted); padding: 14px 4px; line-height: 1.6; }
.empty kbd, .kbd { background: var(--hover); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 4px; font-size: 11px; }

/* Layers & classes lists */
.list-row { display: flex; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 4px; }
.list-row.active { background: var(--accent-bg-2); }
.list-row input.name { flex: 1; width: 0; min-width: 0; }
.list-row input.elev { width: 56px; flex: none; }
.list-row input[type="color"] { flex: none; width: 24px; }
.icon-btn { width: 24px; height: 22px; padding: 0; display: grid; place-items: center; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.on { color: var(--accent-2); }
.icon-btn svg { width: 15px; height: 15px; }
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: var(--muted); }

/* Fixture library */
.lib-search { width: 100%; margin-bottom: 8px; }
.lib-searchbar { position: relative; display: flex; align-items: center; margin-bottom: 8px; }
.lib-searchbar .lib-search { margin: 0; padding-left: 26px; padding-right: 24px; }
.lib-mag { position: absolute; left: 6px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.lib-mag svg { width: 15px; height: 15px; }
.lib-clear { position: absolute; right: 2px; padding: 0 6px; font-size: 15px; }
.picker { position: relative; min-width: 0; }
.picker-input { width: 100%; }
.picker-list { position: fixed; z-index: 60; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 4px; }
.picker-head { color: var(--muted); font-size: 11px; padding: 3px 6px 5px; }
.picker-cat { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 6px 2px; }
.picker-item { display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.picker-item small { color: var(--muted); white-space: nowrap; }
.picker-item:hover, .picker-item.on { background: var(--hover-3); }
.picker-item.cur span { color: var(--accent-2); }
.picker-empty { color: var(--muted); padding: 8px; }
.people-bar { display: flex; flex-direction: column; gap: 6px; padding: 2px 6px 8px; }
.skin-row { display: flex; gap: 5px; }
.skin-chip { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.skin-chip.on { border-color: var(--accent-2); }
.meter-read { display: flex; flex-direction: column; gap: 5px; }
.meter-big { display: flex; align-items: baseline; gap: 10px; }
.meter-big b { font-size: 20px; color: #4fd1c5; }
.meter-big span, .meter-stop span { color: var(--muted); }
.meter-stop { display: flex; align-items: baseline; gap: 10px; }
.meter-stop b { font-size: 16px; }
.meter-sub, .meter-note { color: var(--muted); font-size: 11px; }
.meter-note { margin-top: 4px; }
.meter-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meter-row span:first-child { color: var(--muted); }
.meter-planes, .meter-list { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.meter-planes th { color: var(--muted); font-weight: normal; font-size: 10.5px; }
.meter-planes td, .meter-planes th { text-align: center; padding: 2px; }
.meter-list td { padding: 2px 3px; border-top: 1px solid var(--line); }
.meter-list td:not(:first-child) { text-align: right; white-space: nowrap; }
.meter-list small { color: #c9a227; }
.lib-cat { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: 0.3px; margin: 2px 0; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.lib-cat:hover { background: var(--hover-2); color: var(--text); }
.lib-cat.open { color: var(--accent-2); }
.lib-cat span { color: var(--faint); }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 5px; cursor: pointer; border: 1px solid transparent; }
.lib-item:hover { background: var(--hover-2); }
.lib-item.on { border-color: var(--accent-line); background: var(--accent-bg-2); }
.lib-item canvas { width: 46px; height: 28px; flex: none; }
.lib-item .meta { color: var(--muted); font-size: 11px; }

/* Schedule drawer */
#schedule { height: min(290px, 36vh); background: var(--panel); border-top: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#schedule[hidden] { display: none; }
.sched-bar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.sched-bar b { margin-right: 8px; }
.sched-wrap { overflow: auto; flex: 1; }
table.sched { border-collapse: collapse; width: max-content; min-width: 100%; }
table.sched th { position: sticky; top: 0; background: var(--panel-2); text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line-2); cursor: pointer; color: var(--muted); font-weight: 600; }
table.sched th.sorted { color: var(--accent-2); }
table.sched td { padding: 1px 3px; border-bottom: 1px solid var(--panel-2); white-space: nowrap; }
table.sched td.ro { padding: 3px 6px; color: var(--text-2); }
table.sched tr.sel td { background: var(--sel-bg); }
table.sched td input { width: 100%; border-color: transparent; background: transparent; padding: 2px 4px; }
table.sched td input:hover { border-color: var(--line-2); }
table.sched td input:focus { background: var(--input-bg); border-color: var(--accent); }

/* ---------- status bar ---------- */
#status { display: flex; align-items: center; gap: 14px; padding: 4px 12px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); min-height: 30px; }
#prompt { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#databar { width: 170px; }
#databar.bad { border-color: var(--danger); }
#coords { font-variant-numeric: tabular-nums; min-width: 220px; text-align: right; }
#snapInfo { color: #ff8fb5; min-width: 70px; text-align: right; }

/* ---------- modal & toasts ---------- */
#modal { position: fixed; inset: 0; background: rgba(5, 6, 8, 0.55); display: grid; place-items: center; z-index: 50; }
#modal[hidden] { display: none; }
.dialog { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; min-width: 380px; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.dialog h2 { margin: 0; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
.dialog .body { padding: 12px 16px; overflow-y: auto; }
.dialog .body .row { grid-template-columns: 160px 1fr; }
.dialog .body p { color: var(--text-2); line-height: 1.55; margin: 4px 0 10px; }
.dialog .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.dialog table.keys { border-collapse: collapse; width: 100%; }
.dialog table.keys td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
.dialog table.keys td:first-child { white-space: nowrap; color: var(--accent-2); }

#toasts { position: fixed; right: 16px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--hover-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 12px; max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast.err { border-left-color: var(--danger); }
.toast a { color: var(--accent-2); cursor: pointer; margin-left: 8px; }

.inline-input { position: fixed; z-index: 40; min-width: 220px; }

/* ---------- welcome ---------- */
#welcome { position: fixed; inset: 0; background: rgba(8, 9, 12, 0.8); display: grid; place-items: center; z-index: 70; }
#welcome[hidden] { display: none; }
.welcome-card { width: 560px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.welcome-card h1 { margin: 0 0 4px; font-size: 26px; display: flex; align-items: center; gap: 12px; }
.welcome-card h1 .logo { width: 26px; height: 26px; }
.welcome-card p { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.welcome-actions { display: grid; gap: 10px; }
.welcome-actions button { text-align: left; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.welcome-actions button small { color: var(--muted); font-size: 11.5px; }
.welcome-actions button.primary small { color: var(--on-accent-2); }

.mbadge { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; vertical-align: 1px; }

.group-count { flex: none; min-width: 22px; padding: 0 6px; border-radius: 9px; background: var(--panel-2); color: var(--muted); font-size: 11px; text-align: center; }

/* =====================================================================================================
   Look & feel: bolder type, softer depth, roomier bars. Same palette as the home page.
   ===================================================================================================== */
body { background: radial-gradient(1200px 500px at 50% -10%, rgba(63, 160, 191, 0.08), transparent 60%), var(--bg); }
.brand, .panel-head, .tabs button, #toolbox .grp, .oip-sec, .dialog h2, .picker-cat, .lib-cat, table.sched th, #tooloptions .tname, .welcome-card h1 {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600;
}

/* top bar */
#topbar { gap: 14px; padding: 10px 16px; background: linear-gradient(180deg, var(--panel) 0%, var(--panel-3) 100%); border-bottom: 1px solid var(--rim); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.brand { font-size: 20px; letter-spacing: 0.06em; font-weight: 700; gap: 10px; margin-right: 10px; }
.logo { width: 22px; height: 22px; box-shadow: 0 0 18px var(--glow); }
button { border-radius: 7px; padding: 6px 13px; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s; }
button.primary { background: linear-gradient(180deg, #17566b, var(--accent)); border-color: transparent; box-shadow: 0 4px 16px rgba(63, 160, 191, 0.28); letter-spacing: 0.02em; }
button.primary:hover { background: linear-gradient(180deg, #1d6a84, #0f4558); box-shadow: 0 6px 22px rgba(63, 160, 191, 0.42); }
#topbar button:not(.primary):not(.ghost), #subbar button { font-family: var(--cond); font-size: 14.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.seg { border-radius: 8px; border-color: var(--line); background: var(--panel-3); padding: 2px; gap: 2px; }
.seg button { border: 0; border-radius: 6px; background: transparent; color: var(--text-2); padding: 5px 12px; }
.seg button:hover { background: var(--hover); }
.seg button.on { background: var(--accent-bg); color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 14px rgba(63, 160, 191, 0.18); }
input[type="text"], input:not([type]), input[type="number"], select, textarea { border-radius: 6px; padding: 5px 8px; border-color: var(--line); transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 160, 191, 0.18); }

/* second bar: drawing settings on the left, the current tool's options after them */
#subbar { display: flex; align-items: center; gap: 18px; min-height: 46px; padding: 6px 16px; min-width: 0; overflow: hidden; background: var(--panel-3); border-bottom: 1px solid var(--line); }
#subbar .ctx { display: flex; align-items: center; gap: 12px; flex: none; padding-right: 18px; border-right: 1px solid var(--line); }
#subbar .field { font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12.5px; font-weight: 600; gap: 8px; }
#subbar .field select { min-width: 140px; font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 400; }
#tooloptions { flex: 1; min-width: 0; min-height: 0; padding: 0; background: none; border: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#tooloptions .tname { font-size: 16px; margin-right: 6px; }

/* tool box */
#main { grid-template-columns: 60px 1fr 330px; }
#toolbox { padding: 6px 7px; background: var(--panel-3); border-right: 1px solid var(--line); }
#toolbox .grp { margin: 14px 0 5px; font-size: 11px; color: var(--faint); }
#toolbox button { width: 44px; height: 38px; margin: 2px 0; border-radius: 9px; }
#toolbox button:hover { background: var(--hover-3); color: var(--text); }
#toolbox button.on { background: var(--accent-bg); border-color: var(--accent-line); color: #fff; box-shadow: 0 0 18px rgba(63, 160, 191, 0.35); }
#toolbox svg { width: 23px; height: 23px; }

/* 3D bar floats over the view as frosted glass */
#threeBar { top: 12px; left: 12px; right: 12px; gap: 10px; }
#threeBar .seg, .slider, #xfHint { background: rgba(20, 20, 24, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--rim); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); border-radius: 10px; }
#threeBar .seg button { background: transparent; padding: 4px 11px; }
#threeBar .seg button.on { background: var(--accent-bg); }
.slider { padding: 4px 12px; font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; font-weight: 600; }
#views.mode-split #three { border-left: 1px solid var(--line-2); }

/* side panels */
#side { background: var(--panel-3); border-left: 1px solid var(--line); }
.panel { border-bottom: 1px solid var(--line); }
.panel-head { padding: 11px 16px; font-size: 15px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line); }
.panel-head::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--glow); vertical-align: 1px; }
.panel-body { padding: 12px 14px; }
.tabs { background: var(--panel); padding: 0 4px; }
.tabs button { padding: 10px 4px; font-size: 13.5px; border-radius: 0; }
.tabs button:hover { color: var(--text); background: transparent; }
.tabs button.on { color: #fff; border-bottom-color: var(--accent); box-shadow: 0 8px 14px -10px var(--glow); }
.row { margin: 5px 0; }
.oip-sec { font-size: 12.5px; margin: 16px 0 6px; padding-top: 12px; color: var(--accent-2); }
.oip-type b { font-size: 15px; }
.list-row { padding: 5px 6px; border-radius: 8px; }
.list-row.active { box-shadow: inset 0 0 0 1px var(--accent-line); }
.lib-item { padding: 6px 8px; border-radius: 9px; }
.lib-cat { padding: 7px 8px; font-size: 13.5px; border-radius: 7px; }
.empty { line-height: 1.7; }

/* status bar */
#status { padding: 6px 16px; min-height: 36px; background: var(--panel-3); border-top: 1px solid var(--line); font-size: 13px; }
#databar { width: 190px; }

/* dialogs, toasts, welcome */
#modal { background: rgba(5, 5, 8, 0.66); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dialog { border-radius: 14px; border: 1px solid var(--rim); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 60px rgba(63, 160, 191, 0.07); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.dialog h2 { padding: 16px 22px; font-size: 20px; letter-spacing: 0.07em; }
.dialog .body { padding: 16px 22px; }
.dialog .foot { padding: 14px 22px; }
.toast { border-radius: 10px; border-color: var(--rim); background: var(--panel-2); }
.welcome-card { border-radius: 18px; border-color: var(--rim); background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 80px rgba(63, 160, 191, 0.1); }
.welcome-card h1 { font-size: 40px; font-weight: 700; letter-spacing: 0.05em; }
.welcome-actions button { border-radius: 10px; padding: 14px 16px; font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.welcome-actions button:hover:not(.primary) { border-color: var(--accent-line); background: var(--accent-bg-2); }

/* fit-and-finish */
.tabs { flex-wrap: wrap; padding: 4px 8px 0; gap: 0 2px; }
.tabs button { flex: 1 1 auto; padding: 8px 8px; font-size: 13px; letter-spacing: 0.06em; }
.seg { max-width: 100%; flex-wrap: wrap; }
#threeBar .seg button { padding: 4px 9px; font-size: 14px; }
#toolbox button { height: 36px; }

/* fit fixes: eight side tabs share one row, and the 3D bar wraps instead of clipping */
#main { grid-template-columns: 60px 1fr 350px; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding: 10px 7px; font-size: 13px; letter-spacing: 0.04em; }
#threeBar .seg { flex-wrap: wrap; max-width: 100%; }
#threeBar .seg button { padding: 4px 9px; font-size: 13.5px; letter-spacing: 0.05em; }
#subbar .ctx { gap: 10px; }
#subbar .field select { min-width: 120px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 6px; overflow: visible; }
.tabs button { flex: none; padding: 9px 4px; }

/* Object Info gets the bigger share of the side panel: colour and modifiers need the room */
#side { grid-template-rows: minmax(260px, 1.7fr) minmax(160px, 1fr); }
