/* Minimal theme: full-bleed stage with paper feel */
html,
body {
  height: 100%;
  margin: 0;
  font: 12px/1.35 "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #2a2a28;
  background: #fffef8;
}

#stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 250, 235, 0.9), transparent 55%),
    linear-gradient(#fffef8, #fff8ec);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#compositor {
  z-index: 0;
}

#wet-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  display: none;
}

#wet-host canvas {
  position: absolute;
  inset: auto;
  width: auto;
  height: auto;
  display: block;
}

/* Chrome is visual-only; stage receives all pointer events. */
#chrome {
  pointer-events: none;
  z-index: 2;
}

#ui-root {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 2;
  max-height: calc(100vh - 24px);
  overflow: auto;
  pointer-events: none;
}

.boot-block {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #fffef8;
  color: #2a2a28;
}

.boot-block h1 {
  margin: 0;
  font: 600 22px/1.3 "IBM Plex Sans", "Segoe UI", sans-serif;
}

.boot-block p {
  margin: 0;
  max-width: 36rem;
  font: 14px/1.45 "IBM Plex Sans", "Segoe UI", sans-serif;
  color: rgba(42, 42, 40, 0.8);
}

.ui-shell {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  max-width: 220px;
  padding: 8px;
  background: rgba(255, 254, 248, 0.88);
  border: 1px solid rgba(40, 36, 28, 0.1);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(40, 36, 28, 0.06);
  backdrop-filter: blur(6px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 36, 28, 0.08);
}

.mode-bar button {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid rgba(40, 36, 28, 0.18);
  background: #fff;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
}

.mode-bar button:hover:not(:disabled) {
  border-color: rgba(40, 36, 28, 0.35);
}

.mode-bar button.is-active {
  border-color: rgba(40, 36, 28, 0.55);
  background: rgba(40, 36, 28, 0.08);
}

.mode-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mode-hint {
  margin: 0;
  padding: 4px 0 0;
  font: 11px/1.35 inherit;
  color: rgba(40, 36, 28, 0.65);
}

.paint-density-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  font: 12px/1.35 inherit;
  color: rgba(40, 36, 28, 0.75);
  cursor: pointer;
  user-select: none;
}

.paint-density-toggle input {
  margin: 0;
}

.toolbar button,
.mat-btn {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid rgba(40, 36, 28, 0.18);
  background: #fff;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
}

.toolbar button:hover,
.mat-btn:hover {
  border-color: rgba(40, 36, 28, 0.35);
}

.toolbar button.is-active {
  border-color: rgba(40, 36, 28, 0.55);
  background: rgba(40, 36, 28, 0.08);
}

.tool-option-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 4px;
  font: 12px/1.35 inherit;
  color: rgba(40, 36, 28, 0.75);
  cursor: pointer;
  user-select: none;
}

.tool-option-toggle input {
  margin: 0;
}

.draw-confirm-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 254, 248, 0.94);
  border: 1px solid rgba(40, 36, 28, 0.14);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(40, 36, 28, 0.1);
  pointer-events: auto;
}

.draw-confirm-bar[hidden] {
  display: none;
}

.draw-confirm-btn {
  font: 16px/1 inherit;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(40, 36, 28, 0.18);
  border-radius: 6px;
  background: #fff;
  color: #2a2a28;
  cursor: pointer;
}

.draw-confirm-btn:hover {
  border-color: rgba(40, 36, 28, 0.4);
}

.draw-confirm-ok {
  color: #1a6b3c;
}

.draw-confirm-cancel {
  color: #a03030;
}

.bake-progress-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 12px;
  background: rgba(255, 254, 248, 0.94);
  border: 1px solid rgba(40, 36, 28, 0.14);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(40, 36, 28, 0.1);
  font: 13px/1 inherit;
  color: #2a2a28;
  pointer-events: none;
}

.bake-progress-bar[hidden] {
  display: none;
}

.materials-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 36, 28, 0.08);
}

.mat-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.mat-row-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-template-columns: none;
}

.mat-label {
  color: rgba(40, 36, 28, 0.7);
  white-space: nowrap;
}

.mat-select,
.mat-range,
.mat-color {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mat-select {
  font: inherit;
  padding: 3px 4px;
  border: 1px solid rgba(40, 36, 28, 0.18);
  border-radius: 3px;
  background: #fff;
  color: inherit;
}

.mat-color {
  height: 24px;
  padding: 0;
  border: 1px solid rgba(40, 36, 28, 0.18);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.mat-fill-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mat-fill-controls .mat-color {
  flex: 1;
}

.mat-btn-inline {
  flex: 0 0 auto;
  padding: 3px 8px;
  font-size: 0.85em;
  white-space: nowrap;
}

.mat-range {
  accent-color: #3a3832;
}

.mat-check {
  margin: 0;
}

.mat-context {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mat-custom-tip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 36, 28, 0.06);
}

.mat-tip-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tip-preview-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(40, 36, 28, 0.12);
  border-radius: 3px;
  background: #fffceb;
}

.mat-tip-preview-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mat-tip-preview-swatches .mat-row {
  grid-template-columns: 28px 1fr;
}

.mat-pressure-simple,
.mat-pressure-gauss {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mat-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 36, 28, 0.06);
}

.mat-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.mat-btn {
  width: auto;
}

.zoom-bar {
  pointer-events: auto;
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 8px 10px;
  background: rgba(255, 254, 248, 0.88);
  border: 1px solid rgba(40, 36, 28, 0.1);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(40, 36, 28, 0.06);
  backdrop-filter: blur(6px);
}

.zoom-bar input[type='range'] {
  flex: 1;
  min-width: 100px;
  accent-color: rgba(40, 36, 28, 0.75);
}

.zoom-bar .zoom-label {
  font: inherit;
  min-width: 3.5em;
  padding: 4px 6px;
  border: 1px solid rgba(40, 36, 28, 0.18);
  background: #fff;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  text-align: center;
}

.zoom-bar .zoom-label:hover {
  border-color: rgba(40, 36, 28, 0.35);
}
