:root {
  color-scheme: dark;
  --espresso: #17120e;
  --espresso-2: #211812;
  --graphite: #17191a;
  --graphite-2: #202223;
  --birch: #d8b88d;
  --birch-light: #f0dfc2;
  --cream: #fff7e9;
  --cream-muted: #cfbfaa;
  --brass: #c99851;
  --brass-light: #e0b873;
  --green: #82b996;
  --red: #e58a7f;
  --amber: #d9ad68;
  --line: rgba(221, 188, 139, .22);
  --line-strong: rgba(226, 190, 136, .42);
  --panel: rgba(22, 21, 19, .92);
  --panel-soft: rgba(32, 28, 24, .9);
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  --showroom-x: 0px;
  --showroom-y: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--espresso);
  color: var(--cream);
}

button,
input,
select,
textarea { font: inherit; color: inherit; }

button,
.upload-btn {
  border: 1px solid var(--line);
  background: rgba(54, 44, 34, .72);
  border-radius: 4px;
  padding: .62rem .82rem;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

button:hover,
.upload-btn:hover {
  border-color: var(--line-strong);
  background: rgba(82, 63, 43, .8);
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.upload-btn:focus-within {
  outline: 2px solid var(--brass-light);
  outline-offset: 2px;
}

button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
a { color: inherit; }

.showroom-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #17120e;
  pointer-events: none;
}

.showroom-photo {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.78) contrast(.98) brightness(.49);
  transform: translate3d(var(--showroom-x), var(--showroom-y), 0) scale(1.025);
  animation: showroom-breathe 24s ease-in-out infinite alternate;
}

.showroom-fox {
  position: absolute;
  right: -5vw;
  bottom: -17vh;
  width: clamp(360px, 38vw, 630px);
  height: auto;
  opacity: .17;
  mix-blend-mode: screen;
  filter: saturate(.7) sepia(.18) brightness(.9);
  mask-image: linear-gradient(to top, transparent 0, #000 28%, #000 75%, transparent 100%);
  transform: translate3d(calc(var(--showroom-x) * -.45), calc(var(--showroom-y) * -.45), 0);
}

.showroom-logo {
  position: absolute;
  left: 26vw;
  top: 10vh;
  width: clamp(230px, 25vw, 430px);
  height: auto;
  opacity: .11;
  mix-blend-mode: screen;
  filter: sepia(.2) saturate(.5);
  mask-image: radial-gradient(ellipse at center, #000 34%, transparent 74%);
  transform: translate3d(calc(var(--showroom-x) * .35), calc(var(--showroom-y) * .35), 0);
}

.showroom-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 54% 45%, transparent 0 18%, rgba(10, 8, 6, .12) 52%, rgba(8, 6, 5, .72) 100%),
    linear-gradient(90deg, rgba(9, 7, 5, .68), rgba(9, 7, 5, .12) 34%, rgba(9, 7, 5, .18) 68%, rgba(9, 7, 5, .68));
}

@keyframes showroom-breathe {
  from { transform: translate3d(var(--showroom-x), var(--showroom-y), 0) scale(1.025); }
  to { transform: translate3d(calc(var(--showroom-x) - 5px), calc(var(--showroom-y) - 3px), 0) scale(1.04); }
}

.app-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 82px;
  padding: 8px;
  gap: 8px;
}

.topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(480px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(19, 17, 15, .96), rgba(32, 27, 22, .91), rgba(17, 17, 16, .96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid rgba(233, 208, 169, .35);
  border-radius: 50%;
  background: #071417;
  box-shadow: 0 0 22px rgba(90, 200, 201, .15);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy strong,
.brand-copy small { display: block; }

.brand-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: .015em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--cream-muted);
  font-size: .61rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.project-title {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 13px;
  row-gap: 2px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
}

.project-title > .eyebrow { grid-column: 1 / -1; }
.project-title strong { font-family: Georgia, "Times New Roman", serif; font-size: .96rem; font-weight: 500; }

.project-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cream-muted);
  font-size: .64rem;
  white-space: nowrap;
}

.project-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px currentColor;
}

.project-state.ok { color: #a6d5b7; }
.project-state.ok i { background: var(--green); }
.project-state.error { color: #f0aaa2; }
.project-state.error i { background: var(--red); }

.eyebrow {
  color: var(--brass-light);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.top-actions button { white-space: nowrap; }
.icon-btn { min-width: 37px; padding: .48rem .58rem; font-size: 1.08rem; }
.ghost { background: rgba(24, 23, 21, .54); }
.primary {
  border-color: #d6ad72;
  background: linear-gradient(180deg, #e2c092, #bd884b);
  color: #1a120b;
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255, 255, 255, .34), 0 7px 20px rgba(194, 139, 75, .16);
}
.primary:hover { background: linear-gradient(180deg, #efd0a6, #ca9759); }

.studio-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: 288px minmax(480px, 1fr) 310px;
  gap: 8px;
}

.panel,
.workspace {
  min-height: 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(205, 160, 98, .48) transparent;
  background: linear-gradient(180deg, rgba(23, 22, 20, .95), rgba(30, 25, 21, .91));
}

.library-panel { padding: 14px; }
.inspector-panel { padding: 15px; }

.showroom-nav {
  display: grid;
  gap: 6px;
  padding: 3px 0 16px;
  border-bottom: 5px solid rgba(32, 23, 16, .96);
  box-shadow: 0 7px 0 rgba(186, 139, 82, .13), 0 13px 22px rgba(0, 0, 0, .25);
}

.showroom-nav > .eyebrow { margin-bottom: 2px; }

.showroom-nav-card {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(197, 157, 106, .17);
  border-radius: 2px;
  background:
    linear-gradient(96deg, rgba(122, 83, 48, .84), rgba(62, 44, 31, .94)),
    url("./assets/showroom-dr-damson.png") center / cover;
  color: var(--cream);
  text-align: left;
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 236, 202, .08), 0 5px 12px rgba(0, 0, 0, .18);
}

.showroom-nav-card > span {
  grid-row: 1 / -1;
  color: #e5cda9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .7rem;
}

.showroom-nav-card strong { font-size: .72rem; letter-spacing: .01em; }
.showroom-nav-card small { color: #d0b997; font-size: .58rem; }

.showroom-nav-card.active {
  border-color: rgba(229, 193, 140, .62);
  background: linear-gradient(96deg, rgba(178, 128, 68, .92), rgba(91, 60, 36, .96));
  box-shadow: inset 3px 0 var(--birch-light), 0 6px 18px rgba(0, 0, 0, .24);
}

.template-library { padding-top: 21px; scroll-margin-top: 12px; }
.shape-library { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.shape-filters { display: grid; grid-template-columns: 1.15fr .85fr; gap: 6px; margin-bottom: 8px; }
.shape-filters input,
.shape-filters select { min-width: 0; padding: .48rem; border: 1px solid var(--line); border-radius: 2px; background: rgba(12, 12, 11, .7); font-size: .61rem; }
.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 286px; overflow: auto; padding-right: 2px; }
.shape-card { min-width: 0; padding: 5px; background: linear-gradient(145deg, rgba(93, 63, 38, .36), rgba(28, 25, 22, .84)); text-align: left; }
.shape-card img { display: block; width: 100%; height: 48px; object-fit: contain; padding: 4px; border-radius: 2px; background: #ead7b9; filter: sepia(.18) contrast(1.25); }
.shape-card span { display: block; overflow: hidden; margin-top: 4px; color: #eadcc7; font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 12px;
}

.panel-heading.compact { align-items: center; margin-bottom: 8px; }
.panel h1,
.panel h2 { margin: .25rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; font-weight: 500; }

.material-chip {
  border: 1px solid rgba(213, 177, 126, .3);
  background: rgba(130, 90, 50, .2);
  color: #e1c89f;
  padding: .32rem .46rem;
  font-size: .55rem;
  white-space: nowrap;
}

.upload-btn {
  padding: .43rem .52rem;
  border-style: dashed;
  border-color: rgba(221, 181, 125, .45);
  color: #e1c395;
  font-size: .62rem;
}
.upload-btn input { display: none; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-card {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(93, 63, 38, .42), rgba(28, 25, 22, .84));
  text-align: left;
}

.template-card.active {
  border-color: var(--brass-light);
  background: linear-gradient(145deg, rgba(156, 107, 54, .52), rgba(43, 33, 26, .9));
  box-shadow: 0 0 0 1px rgba(224, 184, 115, .24), 0 8px 26px rgba(0, 0, 0, .28);
}

.template-card img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: contain;
  border-radius: 2px;
  background: linear-gradient(140deg, #f5e7d1, #c9a97b);
  filter: sepia(.14) contrast(1.12);
}

.template-card span {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: #eadcc7;
  font-size: .64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.module-nav button {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: .4rem .2rem;
  border-radius: 2px;
  background: rgba(24, 22, 20, .78);
  color: var(--cream-muted);
  font-size: .52rem;
}
.module-nav button span { color: var(--brass-light); font-family: Georgia, serif; font-size: .62rem; }

.references {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.references summary,
.inspector-panel summary { cursor: pointer; font-size: .72rem; font-weight: 750; }
.references summary span { float: right; color: var(--brass-light); }
.references p { color: var(--cream-muted); font-size: .62rem; line-height: 1.45; }

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.reference-grid button { padding: 4px; }
.reference-grid img { width: 100%; height: 52px; object-fit: contain; border-radius: 2px; background: #e7d3b4; }

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 61px;
  overflow: hidden;
  background: rgba(17, 17, 16, .93);
}

.workspace-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(125px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(45, 36, 28, .9), rgba(25, 23, 21, .96));
}

.workbench-label { display: grid; gap: 2px; min-width: 0; }
.workbench-label strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: .75rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 11, .55);
}
.segmented button { padding: .42rem .58rem; border: 0; background: transparent; color: var(--cream-muted); font-size: .65rem; }
.segmented button.active { background: rgba(188, 136, 74, .29); color: #f3dec0; box-shadow: inset 0 0 0 1px rgba(221, 178, 116, .22); }

.zoom-controls { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: .64rem; }
.zoom-controls button { padding: .39rem .53rem; }
.zoom-controls span { min-width: 42px; color: var(--cream-muted); text-align: center; }

.canvas-wrap {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(179, 137, 83, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(179, 137, 83, .075) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, rgba(103, 80, 54, .42), transparent 52%),
    #121313;
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
}

.canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 15px;
  z-index: -1;
  border: 1px solid rgba(219, 177, 119, .17);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.canvas-plaque {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: -1;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 50%;
  opacity: .09;
  filter: sepia(.35) saturate(.55);
}
.canvas-plaque img { width: 100%; height: 100%; object-fit: cover; }

.canvas-fox {
  position: absolute;
  left: -26px;
  top: -12px;
  z-index: -1;
  width: 220px;
  height: 250px;
  overflow: hidden;
  opacity: .075;
  filter: saturate(.55) sepia(.16);
  mask-image: linear-gradient(135deg, #000 12%, rgba(0, 0, 0, .86) 40%, transparent 78%);
}
.canvas-fox img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

#paperCanvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }

.loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: rgba(17, 15, 13, .84);
  color: var(--cream-muted);
  font-size: .72rem;
}
.loading.show { display: grid; }
.loading span {
  width: 27px;
  height: 27px;
  border: 2px solid rgba(202, 163, 109, .24);
  border-top-color: var(--brass-light);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  transform: translateX(-50%);
  padding: .55rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(20, 17, 14, .94);
  box-shadow: var(--shadow);
  color: #ead8ba;
  font-size: .68rem;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow: auto;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(27, 25, 22, .96), rgba(20, 19, 18, .98));
}

.statusbar > div:not(.status-pill) { display: flex; flex-direction: column; white-space: nowrap; }
.statusbar small { color: var(--cream-muted); font-size: .52rem; letter-spacing: .08em; text-transform: uppercase; }
.statusbar strong { margin-top: 3px; font-size: .7rem; }

.status-pill {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: .42rem .62rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  white-space: nowrap;
}
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px currentColor; }
.status-pill strong { margin: 0; }
.status-pill.ok { border-color: rgba(104, 171, 129, .45); color: #a6d5b7; }
.status-pill.ok span { background: var(--green); }
.status-pill.error { border-color: rgba(213, 115, 105, .47); color: #f0aaa2; }
.status-pill.error span { background: var(--red); }

.validation-box {
  margin: 10px 0 4px;
  padding: .72rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 2px;
  background: rgba(14, 14, 13, .55);
  color: var(--cream-muted);
  font-size: .66rem;
  line-height: 1.45;
}
.validation-box.ok { border-color: rgba(104, 171, 129, .43); border-left-color: var(--green); color: #b9dcc5; }
.validation-box.error { border-color: rgba(213, 115, 105, .43); border-left-color: var(--red); color: #f0b5ae; }

.inspector-panel details {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.inspector-panel summary { color: #e9d9c2; }
.inspector-panel summary span { margin-right: 5px; color: var(--brass-light); font-family: Georgia, serif; font-size: .66rem; }

.control-stack { display: grid; gap: 10px; margin-top: 12px; }
.control-stack[disabled] { display: none; }
.control-stack legend { padding: 0 .35rem; color: var(--brass-light); font-size: .67rem; }
.shape-empty { margin-top: 10px; padding: .65rem; border: 1px dashed var(--line); color: var(--cream-muted); font-size: .61rem; line-height: 1.45; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 7px !important; }
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.button-grid button { min-width: 0; padding: .5rem .35rem; font-size: .59rem; }
.shape-weld-status { margin: 0; padding: .55rem; border-left: 2px solid var(--brass); background: rgba(91, 62, 35, .22); color: var(--cream-muted); font-size: .59rem; line-height: 1.4; }
.layers-list { display: grid; gap: 5px; margin-top: 10px; }
.layer-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: .45rem .5rem; border: 1px solid var(--line); background: rgba(14, 14, 13, .45); font-size: .58rem; }
.layer-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-row button { padding: .2rem .35rem; font-size: .58rem; }
.layer-badge { min-width: 46px; color: var(--brass-light); font-size: .49rem; font-weight: 800; letter-spacing: .06em; }
.control-stack label { display: grid; gap: 5px; color: #c7b9a7; font-size: .63rem; }
.control-stack output { float: right; color: var(--brass-light); text-align: right; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

input[type="number"],
select,
textarea {
  width: 100%;
  padding: .53rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: rgba(12, 12, 11, .7);
}
textarea { resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: var(--brass-light); }
input[type="range"] { width: 100%; accent-color: var(--brass); }

.danger { border-color: rgba(213, 115, 105, .35); background: rgba(97, 39, 35, .22); color: #efb0aa; }

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 15px;
  color: var(--cream-muted);
  font-size: .6rem;
}
.cut-line,
.engrave-line { width: 18px; border-top: 3px solid var(--birch-light); }
.engrave-line { margin-left: 8px; border-top: 1px dashed var(--brass-light); }

.showroom-dock {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.25fr repeat(6, minmax(105px, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 21, 18, .94), rgba(15, 15, 14, .97));
  box-shadow: var(--shadow);
  backdrop-filter: blur(17px);
}

.dock-intro {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 0 13px;
  border-right: 1px solid var(--line);
}
.dock-intro strong { font-family: Georgia, "Times New Roman", serif; font-size: .78rem; font-weight: 500; }

.showroom-dock > a,
.showroom-dock > button {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid rgba(204, 163, 109, .2);
  border-bottom: 4px solid rgba(78, 52, 32, .88);
  border-radius: 2px;
  background: linear-gradient(105deg, rgba(96, 66, 40, .67), rgba(35, 29, 24, .89));
  color: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .2);
}
.showroom-dock > a:hover,
.showroom-dock > button:hover { border-color: rgba(224, 184, 115, .48); transform: translateY(-2px); }
.showroom-dock span { color: var(--brass-light); font-size: .49rem; font-weight: 800; letter-spacing: .13em; }
.showroom-dock strong { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.showroom-dock small { overflow: hidden; color: var(--cream-muted); font-size: .53rem; text-overflow: ellipsis; white-space: nowrap; }

.showroom-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: .72rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(26, 21, 17, .97);
  box-shadow: var(--shadow);
  color: #ead8ba;
  font-size: .7rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: opacity .2s ease, transform .2s ease;
}
.showroom-toast.show { opacity: 1; transform: translate(-50%, 0); }

body.preview-mode .panel,
body.preview-mode .workspace-toolbar,
body.preview-mode .statusbar,
body.preview-mode .showroom-dock,
body.preview-mode .project-title { opacity: .14; pointer-events: none; }
body.preview-mode .workspace { grid-column: 1 / -1; }
body.preview-mode .canvas-wrap { position: fixed; inset: 80px 8px 8px; z-index: 5; border: 1px solid var(--line); }

@media (max-width: 1180px) {
  .studio-shell { grid-template-columns: 240px minmax(430px, 1fr) 280px; }
  .topbar { grid-template-columns: minmax(190px, 1fr) auto minmax(390px, 1fr); }
  .project-title { padding: 0 12px; }
  .compact-action,
  .top-actions .ghost { display: none; }
  .showroom-dock { grid-template-columns: repeat(6, minmax(90px, 1fr)); }
  .dock-intro { display: none; }
}

@media (max-width: 900px) {
  html,
  body { overflow: auto; }
  .app-frame { height: auto; min-height: 100%; grid-template-rows: auto auto auto; }
  .topbar { position: sticky; top: 8px; z-index: 10; grid-template-columns: 1fr auto; }
  .project-title { display: none; }
  .top-actions button:not(.primary) { display: none; }
  .studio-shell { display: flex; flex-direction: column; }
  .workspace { order: -1; height: 72vh; min-height: 550px; }
  .library-panel,
  .inspector-panel { overflow: visible; }
  .showroom-nav { grid-template-columns: repeat(2, 1fr); }
  .showroom-nav > .eyebrow { grid-column: 1 / -1; }
  .template-grid { grid-template-columns: repeat(4, 1fr); }
  .showroom-dock { grid-template-columns: repeat(2, 1fr); }
  .showroom-dock > *:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .showroom-photo,
  .showroom-fox,
  .showroom-logo { transform: none !important; }
}

/* Generator DXF SVG By DrDamson 1.4 — launcher and Box Generator */
.brand[type="button"] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.brand[type="button"]:hover { border-color: transparent; background: transparent; transform: none; }
.project-title-launcher,
.project-title-box,
.box-actions,
.module-launcher,
.box-studio { display: none; }

body.mode-launcher .project-title-launcher,
body.mode-box .project-title-box,
body.mode-ornament .project-title-ornament { display: grid; }
body.mode-launcher .project-title-ornament,
body.mode-launcher .project-title-box,
body.mode-box .project-title-launcher,
body.mode-box .project-title-ornament,
body.mode-ornament .project-title-launcher,
body.mode-ornament .project-title-box { display: none; }
body.mode-ornament .ornament-actions,
body.mode-box .box-actions { display: flex; }
body.mode-launcher .ornament-actions,
body.mode-launcher .box-actions,
body.mode-box .ornament-actions,
body.mode-ornament .box-actions { display: none; }

body.mode-box .studio-shell,
body.mode-box .showroom-dock { display: none; }
body.mode-launcher .module-launcher { display: grid; }
body.mode-box .box-studio { display: grid; }
.project-state.ready,
.status-pill.ready { color: #a6d5b7; }
.project-state.ready i,
.status-pill.ready span { background: var(--green); }
.validation-box.ready { border-color: rgba(104, 171, 129, .43); border-left-color: var(--green); color: #b9dcc5; }

.module-launcher {
  position: absolute;
  inset: 88px 8px 8px;
  z-index: 20;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  overflow: auto;
  padding: clamp(24px, 4vw, 58px);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(18, 16, 14, .98), rgba(38, 29, 22, .93)),
    url("./assets/showroom-dr-damson.png") center / cover;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.launcher-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}
.launcher-copy { max-width: 730px; }
.launcher-copy h1 {
  margin: .22em 0 .16em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.4vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}
.launcher-copy p { max-width: 620px; margin: 0; color: var(--cream-muted); font-size: clamp(.75rem, 1.05vw, 1rem); line-height: 1.6; }
.launcher-version {
  min-width: 150px;
  display: grid;
  justify-items: end;
  padding: 0 0 4px 24px;
  border-left: 1px solid var(--line-strong);
}
.launcher-version span { color: var(--brass-light); font-size: .55rem; font-weight: 800; letter-spacing: .2em; }
.launcher-version strong { font-family: Georgia, serif; font-size: 2.3rem; font-weight: 400; line-height: 1; }
.launcher-version small { margin-top: 5px; color: var(--cream-muted); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; }

.module-choice-grid {
  width: 100%;
  max-width: 1240px;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto;
}
.module-choice {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: minmax(150px, 1fr) auto auto;
  gap: 14px;
  overflow: hidden;
  padding: 17px;
  border: 1px solid rgba(221, 184, 126, .28);
  border-bottom: 5px solid rgba(101, 67, 39, .9);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(102, 70, 43, .58), rgba(25, 22, 19, .96));
  box-shadow: inset 0 1px rgba(255, 244, 222, .08), 0 22px 48px rgba(0, 0, 0, .27);
  color: inherit;
  text-align: left;
}
.module-choice:hover {
  border-color: rgba(232, 197, 145, .62);
  background: linear-gradient(145deg, rgba(135, 91, 52, .66), rgba(31, 26, 21, .98));
  box-shadow: inset 0 1px rgba(255, 244, 222, .12), 0 28px 58px rgba(0, 0, 0, .38);
  transform: translateY(-4px);
}
.choice-number {
  position: absolute;
  top: 26px;
  left: 27px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 204, 160, .42);
  background: rgba(20, 17, 14, .78);
  color: var(--birch-light);
  font-family: Georgia, serif;
  font-size: .72rem;
}
.choice-art {
  grid-column: 1 / -1;
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid rgba(224, 187, 134, .16);
  background: #e6d4b7;
}
.choice-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 42px rgba(44, 27, 14, .24); pointer-events: none; }
.choice-art > img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; filter: sepia(.18) saturate(.76) contrast(1.06); }
.choice-art-photo > img:first-child { object-position: center 48%; filter: sepia(.2) saturate(.72) brightness(.82); }
.choice-art-photo .choice-fox { position: absolute; right: -3%; bottom: -42%; width: 42%; height: auto; opacity: .76; filter: sepia(.12) saturate(.8); }
.choice-copy { min-width: 0; display: grid; gap: 4px; }
.choice-copy small { color: var(--brass-light); font-size: .54rem; font-weight: 800; letter-spacing: .17em; }
.choice-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2vw, 2rem); font-weight: 500; }
.choice-copy > span { max-width: 420px; color: var(--cream-muted); font-size: .68rem; line-height: 1.45; }
.choice-cta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #ead5b5;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .02em;
}
.choice-cta b { color: var(--brass-light); font-family: Georgia, serif; font-size: 1.1rem; }
.launcher-footer {
  max-width: 1240px;
  width: 100%;
  display: flex;
  gap: 22px;
  margin: 0 auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--cream-muted);
  font-size: .56rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.launcher-footer span:first-child { margin-right: auto; }
.launcher-footer i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.box-studio {
  grid-row: 2 / 4;
  min-height: 0;
  grid-template-columns: 264px minmax(480px, 1fr) 310px;
  gap: 8px;
}
.box-library-panel { padding: 14px; }
.box-type-list { display: grid; gap: 7px; }
.box-type-card,
.box-back-card {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
  padding: 10px;
  border-radius: 2px;
  background: linear-gradient(100deg, rgba(92, 62, 39, .58), rgba(29, 26, 23, .87));
  text-align: left;
}
.box-type-card > span,
.box-back-card > span { grid-row: 1 / -1; color: var(--brass-light); font-family: Georgia, serif; font-size: .7rem; }
.box-type-card strong,
.box-back-card strong { font-size: .72rem; }
.box-type-card small,
.box-back-card small { color: var(--cream-muted); font-size: .57rem; line-height: 1.35; }
.box-type-card.active { border-color: var(--brass-light); background: linear-gradient(100deg, rgba(166, 113, 59, .69), rgba(52, 38, 28, .93)); box-shadow: inset 3px 0 var(--birch-light), 0 8px 20px rgba(0, 0, 0, .23); }
.box-how-it-works { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.box-how-it-works ol { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.box-how-it-works li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; align-items: center; }
.box-how-it-works li > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--brass-light); font-family: Georgia, serif; font-size: .63rem; }
.box-how-it-works li div { display: grid; gap: 2px; }
.box-how-it-works li strong { font-size: .65rem; }
.box-how-it-works li small { color: var(--cream-muted); font-size: .56rem; line-height: 1.35; }
.box-back-card { margin-top: 22px; border-style: dashed; }
.box-workspace { grid-template-rows: 58px minmax(0, 1fr) 61px; }
.box-toolbar { grid-template-columns: minmax(140px, 1fr) auto minmax(150px, 1fr); }
.box-view-note { display: flex; align-items: center; gap: 7px; color: var(--cream-muted); font-size: .56rem; letter-spacing: .08em; }
.cut-swatch { width: 19px; border-top: 2px solid #f0e1c8; }
.engrave-swatch { width: 19px; border-top: 1px dashed var(--brass-light); }
.box-canvas-wrap {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 30px;
  background:
    linear-gradient(rgba(179, 137, 83, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(179, 137, 83, .07) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, rgba(103, 80, 54, .38), transparent 55%),
    #121313;
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
}
.box-canvas-wrap::before { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(219, 177, 119, .17); pointer-events: none; }
#boxPreview {
  position: relative;
  z-index: 1;
  width: min(94%, 980px);
  max-height: 92%;
  overflow: visible;
  border: 1px solid rgba(215, 181, 132, .38);
  background: rgba(240, 223, 194, .055);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .34), inset 0 0 60px rgba(0, 0, 0, .22);
  transform-origin: center;
  transition: transform .16s ease;
}
.preview-cut path { fill: rgba(223, 190, 140, .08); stroke: #f1dfc3; stroke-width: 1.15; vector-effect: non-scaling-stroke; }
.preview-cut path:hover { fill: rgba(210, 153, 83, .22); stroke: #ffdca8; }
.preview-labels text { fill: var(--brass-light); font-family: Inter, sans-serif; font-size: 5px; letter-spacing: .02em; pointer-events: none; }
.box-plaque { z-index: 0; }
.box-ruler { position: absolute; z-index: 2; opacity: .45; pointer-events: none; }
.box-ruler-x { left: 30px; right: 30px; top: 17px; height: 8px; border-top: 1px solid var(--line-strong); }
.box-ruler-y { top: 30px; bottom: 30px; left: 17px; width: 8px; border-left: 1px solid var(--line-strong); }
.box-inspector-panel { padding: 15px; }
.dimension-mode { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); background: rgba(12, 12, 11, .55); }
.dimension-mode button { border: 0; background: transparent; color: var(--cream-muted); font-size: .61rem; }
.dimension-mode button.active { background: rgba(188, 136, 74, .29); color: #f3dec0; box-shadow: inset 0 0 0 1px rgba(221, 178, 116, .22); }
.input-unit { display: grid; grid-template-columns: 1fr 34px; align-items: center; border: 1px solid var(--line); background: rgba(12, 12, 11, .7); }
.input-unit input { border: 0; background: transparent; }
.input-unit i { color: var(--cream-muted); font-size: .58rem; font-style: normal; text-align: center; }
.box-export-card { display: grid; gap: 6px; margin-top: 16px; padding: 13px; border: 1px solid rgba(213, 177, 126, .3); background: linear-gradient(145deg, rgba(126, 82, 42, .25), rgba(16, 15, 14, .65)); }
.box-export-card strong { font-family: Georgia, serif; font-size: .79rem; font-weight: 500; }
.box-export-card p { margin: 0 0 5px; color: var(--cream-muted); font-size: .58rem; line-height: 1.45; }
.box-export-card button { width: 100%; }
.box-statusbar { gap: 18px; }

@media (max-width: 1260px) {
  .box-studio { grid-template-columns: 225px minmax(420px, 1fr) 285px; }
  .box-how-it-works { display: none; }
  .box-actions .compact-action,
  .box-actions .ghost { display: none; }
  .launcher-copy h1 { font-size: clamp(2rem, 4vw, 3.7rem); }
}

@media (max-width: 900px) {
  .app-frame { grid-template-rows: auto auto; }
  body.mode-box .box-studio { grid-row: 2; }
  .module-launcher { position: fixed; inset: 88px 8px 8px; min-height: calc(100vh - 96px); grid-template-rows: auto auto auto; padding: 22px 14px; }
  body.mode-launcher .project-title-launcher,
  body.mode-box .project-title-box,
  body.mode-ornament .project-title-ornament { display: none; }
  body.mode-ornament #helpMenuBtn { display: inline-block; }
  .launcher-hero { align-items: start; }
  .launcher-version { display: none; }
  .module-choice-grid { grid-template-columns: 1fr; }
  .module-choice-grid { min-height: auto; }
  .module-choice { min-height: 300px; }
  .launcher-footer { flex-wrap: wrap; }
  .launcher-footer span:first-child { width: 100%; margin-right: 0; }
  body.mode-box .box-studio { display: flex; flex-direction: column; }
  .box-workspace { order: -1; height: 68vh; min-height: 500px; }
  .box-library-panel,
  .box-inspector-panel { overflow: visible; }
  .box-type-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .box-back-card { max-width: 260px; }
}

@media (max-width: 600px) {
  .topbar { grid-template-columns: 1fr auto; }
  .brand-copy strong { font-size: .85rem; }
  .brand-copy small { font-size: .48rem; }
  .box-actions button { display: none; }
  .box-actions .primary { display: inline-block; }
  .module-launcher { gap: 20px; }
  .module-choice { min-height: 270px; grid-template-rows: 125px auto auto; }
  .choice-art { min-height: 125px; }
  .box-type-list { grid-template-columns: 1fr; }
  .box-toolbar { grid-template-columns: 1fr auto; }
  .box-view-note { display: none; }
  .box-canvas-wrap { padding: 24px; }
  .box-statusbar > div:nth-of-type(3),
  .box-statusbar > div:nth-of-type(5) { display: none; }
}
