:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: #e6edf1;
  background: #0b1119;
  --line: #2a3946;
  --muted: #a5b5c3;
  --gold: #f2cc7b;
  --panel: #121d28;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0 20px 18px;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 16px;
  overflow: hidden;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select,
textarea {
  border: 1px solid #354857;
  border-radius: 7px;
  background: #0c1721;
  color: #e6edf1;
  padding: 9px 10px;
  min-width: 0;
  width: 100%;
}
input,
select,
button {
  min-height: 36px;
}
input[type='checkbox'] {
  width: auto;
  min-height: auto;
  accent-color: var(--gold);
}
select {
  text-overflow: ellipsis;
}
select option {
  color: #e6edf1;
  background: #101c27;
}
textarea {
  resize: vertical;
  font:
    12px/1.6 ui-monospace,
    Consolas,
    monospace;
}
button {
  cursor: pointer;
  font-weight: 550;
  line-height: 1.3;
}
button:hover:enabled {
  background: #253746;
  border-color: #637989;
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #251d0f;
  font-weight: 700;
}
button.primary:hover:enabled {
  background: #ffdb91;
  border-color: #ffdb91;
}
button.danger {
  color: #ffb6ae;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a {
  color: var(--gold);
}
.muted,
.previewHint {
  color: var(--muted);
  opacity: 1;
}
.label {
  color: #b9c8d4;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row > * {
  flex: 1 1 0;
  min-width: 0;
}
.row > button {
  flex-basis: 100px;
}
.row > div:empty {
  display: none;
}
.good {
  color: #a6dfbf;
}
.bad {
  color: #ffb2a7;
}
.eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.6px;
  color: var(--gold);
}
.designerHeader {
  grid-column: 1 / -1;
  min-height: 91px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}
.designerBrand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brandMark {
  width: 48px;
  height: 30px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
h1 {
  margin: 4px 0 0;
  font-size: 23px;
  letter-spacing: -0.7px;
  font-weight: 650;
}
.documentIdentity {
  display: grid;
  gap: 5px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.documentIdentity > span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  max-width: 220px;
}
.documentIdentity > span:last-child {
  color: var(--muted);
  font-size: 10px;
}
.fileActions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.fileActions button,
.fileActions a {
  width: auto;
  white-space: nowrap;
}
.testerLink {
  text-decoration: none;
  font-size: 12px;
  padding: 9px 10px;
}
.testerLink:hover {
  text-decoration: underline;
}
.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}
#stageCard {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  top: auto;
  height: auto;
  max-height: none;
  gap: 0;
}
.canvasToolbar {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.canvasTitle {
  display: grid;
  gap: 5px;
}
.gridControls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 12px;
  font-size: 10px;
  color: var(--muted);
}
.gridControls button,
.gridControls select {
  width: auto;
  min-height: 32px;
  font-size: 11px;
}
.gridControls button[aria-pressed='true'] {
  background: #2a3740;
  border-color: #a18b5b;
  color: #ffe2a6;
}
#canvasDimensions {
  font-size: 10px;
  color: var(--muted);
}
.viewportControls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 6px;
  padding: 0 18px 10px;
  color: var(--muted);
  font-size: 11px;
}
.viewportControls[hidden] { display: none; }
.viewportControls button { width: auto; min-width: 36px; min-height: 36px; font-size: 12px; }
.viewportControls output { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.viewportControls button[aria-pressed='true'] { background: #2a3740; border-color: #a18b5b; color: #ffe2a6; }
#canvasNavigationHint { flex-basis: 100%; font-size: 10px; line-height: 1.4; }
#stageRoot canvas.panMode { cursor: grab; }
#stageRoot canvas.panning { cursor: grabbing; }
#stageRoot canvas:focus-visible { outline: 2px solid #e4bd73; outline-offset: -3px; }
.viewControls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.viewControls button {
  width: auto;
  font-size: 11px;
  min-height: 32px;
}
.viewControls button.active {
  background: #2a3740;
  border-color: #a18b5b;
  color: #ffe2a6;
}
#btnUndo {
  margin-right: 8px;
}
.rarityControl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin-left: 8px;
}
#designerRarity {
  width: 112px;
  min-height: 32px;
  font-size: 10px;
  padding: 7px;
}
.shapePalette {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  padding: 0 18px;
}
.shapePalette button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 61px;
  font-size: 10px;
  border-color: #2b3b49;
  background: #16232f;
}
.shapePalette svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #a9c3d3;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shapePalette button[aria-pressed='true'] {
  background: #333024;
  border-color: #c4a361;
  color: #ffe1a1;
}
.shapePalette button[aria-pressed='true'] svg {
  stroke: #f4cf80;
}
.drawingGuide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  gap: 10px;
  padding: 8px 18px;
  font-size: 11px;
  color: var(--muted);
}
#btnFinishPoly {
  width: auto;
  font-size: 11px;
  min-height: 27px;
  padding: 5px 8px;
  flex-shrink: 0;
}
#btnFinishPoly:disabled {
  display: none;
}
#stageWrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 12px;
  border: 1px solid #263a46;
  border-radius: 8px;
  background: #080f16;
  overflow: hidden;
}
#stageRoot,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
canvas {
  display: block;
  touch-action: none;
}
.designerEmpty {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  text-align: center;
  display: grid;
  gap: 10px;
  pointer-events: none;
  color: #9fb4c3;
  font-size: 12px;
  line-height: 1.6;
}
.designerEmpty strong {
  font-size: 20px;
  letter-spacing: -0.5px;
  color: #d6e3eb;
  font-weight: 500;
}
.emptyGlyph {
  color: #c3a872;
  font-size: 55px;
  line-height: 1.1;
}
#status {
  padding: 10px 18px 4px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.canvasFooter {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 14px;
  padding: 6px 18px 12px;
  font-size: 10px;
  color: #9eb0bf;
}
#panelCard {
  padding: 0;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panelHeading {
  padding: 18px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panelHeading > span:last-child {
  color: var(--muted);
  font-size: 11px;
}
.workspaceTabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px 12px;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}
.workspaceTabs button {
  border: 0;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
}
.workspaceTabs button[aria-selected='true'] {
  background: #2b3540;
  color: #f8d999;
  box-shadow: inset 0 -2px #d9b76b;
}
#panelContent {
  padding: 14px 16px 20px;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #455b6c transparent;
}
.workspacePanel > :first-child {
  margin-top: 0 !important;
}
.panelIntro {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 14px;
}
#selInfo {
  font-size: 11px !important;
  background: #0c1721;
  padding: 9px 10px;
  border-radius: 7px;
  overflow-wrap: anywhere;
}
#objectFilter {
  margin: 4px 0;
  font-size: 12px;
}
#objectFilterEmpty {
  font-size: 12px;
}
#outlinerEntities {
  max-height: 150px !important;
  background: #0d1822;
  padding: 5px !important;
}
#outlinerEntities > [role='button']:hover {
  border-color: #748fa0 !important;
}
#outlinerEntities > [aria-pressed='true'] {
  background: #263b46 !important;
  border-color: #4c788a !important;
}
#outlinerEntities > [role='button'] {
  margin: 2px 0;
}
#inspectorPanel {
  padding: 8px 0;
}
.arrangeTools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}
.arrangeTools button {
  font-size: 11px;
}
.arrangeTools #btnAddVertex {
  grid-column: 1 / -1;
}
.collapsibleHeader {
  padding: 12px 10px;
  background: #1b2935;
  border-color: #324452;
  border-radius: 8px;
}
.collapsibleHeader .label {
  font-size: 12px;
  color: #d4e1ea;
}
.collapsibleHeader:hover {
  background: #263845;
}
.collapsibleBody {
  padding: 2px 1px 8px;
}
.collapsibleBody .row > button {
  font-size: 11px;
}
#secShapeTools {
  margin-top: 14px;
}
#btnPegHelp {
  margin-bottom: 4px;
}
#flipperInput {
  flex: 1 1 100%;
}
#jsonOut {
  height: 340px;
}
.productionExportTools {
  margin: 0;
  padding: 0 18px 12px;
}
.productionExportTools button {
  width: auto;
  font-size: 12px;
}
#spawnTemplateBanner {
  margin: 0 18px 12px;
  flex-wrap: wrap;
}
#spawnTemplateBanner button {
  width: auto;
}
body[data-view='production'] {
  grid-template-columns: minmax(0, 1fr);
}
body[data-view='production'] #shapePalette,
body[data-view='production'] #drawingGuide {
  display: none;
}
.creatorHelpOverlay {
  color: #e6edf1;
}
.creatorHelpSheet {
  border-color: #3d5263;
  background: #121d28;
}
.creatorHelpClose {
  width: auto;
}
.creatorHelpLead {
  font-size: 13px;
}
@media (min-width: 1600px) {
  body {
    grid-template-columns: minmax(0, 1fr) 440px;
    padding-inline: 28px;
  }
}
@media (max-width: 1200px) {
  .documentIdentity {
    display: none;
  }
  body {
    grid-template-columns: minmax(0, 1fr) 365px;
    padding-inline: 12px;
    gap: 0 12px;
  }
  .canvasToolbar {
    padding: 12px;
  }
  .canvasTitle {
    display: none;
  }
  .shapePalette {
    padding: 0 12px;
  }
}
@media (max-width: 960px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding: 0 12px 18px;
    gap: 12px;
  }
  .designerHeader {
    min-height: 0;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 0 0;
  }
  .fileActions {
    gap: 6px;
  }
  #stageCard {
    height: auto;
  }
  #panelCard {
    height: auto;
  }
  #stageWrap {
    min-height: 240px;
    height: clamp(280px, 45dvh, 500px);
    flex: none;
  }
  #panelContent {
    overflow: visible;
  }
  .workspaceTabs {
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 2;
  }
  .canvasTitle {
    display: grid;
  }
  body[data-view='production'] #stageCard {
    height: 85dvh;
  }
  body[data-view='production'] #stageWrap { height: auto; flex: 1; }
}
@media (max-width: 540px) {
  .designerHeader {
    display: block;
  }
  .designerBrand {
    margin-bottom: 15px;
  }
  .fileActions {
    margin: 0;
  }
  .fileActions button,
  .fileActions a {
    font-size: 11px;
    min-height: 36px;
  }
  .fileActions a {
    margin-left: auto;
  }
  .canvasTitle {
    display: none;
  }
  .canvasToolbar {
    padding: 10px;
  }
  .viewControls {
    width: 100%;
    gap: 5px;
  }
  #btnUndo {
    margin-right: 0;
  }
  .rarityControl {
    margin-left: auto;
    gap: 4px;
  }
  #designerRarity {
    width: 87px;
  }
  .shapePalette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 10px;
  }
  .shapePalette button {
    min-height: 44px;
    flex-direction: row;
    font-size: 10px;
    gap: 4px;
    padding: 6px 4px;
  }
  .shapePalette svg {
    width: 16px;
    height: 16px;
  }
  .drawingGuide {
    padding: 8px 12px;
    font-size: 10px;
  }
  .designerEmpty strong {
    font-size: 17px;
  }
  #stageCard {
    height: auto;
  }
  .canvasFooter > span:last-child {
    display: none;
  }
  .row > button {
    white-space: normal !important;
  }
  #panelContent {
    padding: 12px;
  }
}
@media (max-height: 700px) and (min-width: 961px) {
  .designerHeader {
    min-height: 70px;
    padding: 10px 0;
  }
  .shapePalette button {
    min-height: 43px;
    flex-direction: row;
    gap: 4px;
    padding: 6px 3px;
  }
  .shapePalette svg {
    width: 16px;
    height: 16px;
  }
  .canvasToolbar {
    padding-block: 10px;
  }
  #stageWrap {
    min-height: 140px;
  }
}
