/* ── SIDE PANEL ── */
.sketch-ui-panel {
  position: fixed;
  top: 0;
  right: 0;
  background: #fff;
  border-left: 1px solid #000;
  width: 375px;
  height: 100%;
  padding: 38px 38px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.sketch-ui-spacer {
  flex: 1;
  min-height: 0;
}

/* The 22px default is sized for canvas-side chrome. In here a column of
   full-width buttons at that size reads as a wall, so they drop to the panel's
   own small step — the same 13px the slider readouts use. */
.sketch-ui-panel button {
  width: 100%;
  padding: 3px 10px;
  font-size: 12px;
}

.sketch-ui-label {
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* a description sits below a heading, so it takes the small size rather than
   competing with it */
.sketch-ui-paragraph {
  color: #888;
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.sketch-ui-color-row {
  display: flex;
  gap: 5px;
}

/* ── PANEL SECTIONS ──
   Shared by the sketches whose action buttons live at the foot of the panel
   itself rather than floating over it. `.stacked` drops the 120px reserve the
   floating bottom group needs, and border-box keeps the panel's 38px padding
   inside the viewport instead of pushing its last rows below the fold. */
.sketch-ui-panel.stacked {
  box-sizing: border-box;
  padding-bottom: 38px;
}

.sketch-ui-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 6px;
}

.sketch-ui-rule {
  height: 1px;
  background: #000;
  flex: none;
  /* the panel's 12px flex gap already spaces these */
  margin: 0;
}

.sketch-ui-hint {
  color: #888;
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

/* ── LABELLED CONTROL ROW ── */
.sketch-ui-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sketch-ui-rowlabel {
  flex: 0 0 108px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
}

.sketch-ui-row input[type="range"] { flex: 1; }

.sketch-ui-row select {
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
}

.sketch-ui-row input[type="color"] {
  flex: none;
  width: 48px;
  height: 30px;
}

.sketch-ui-value {
  flex: 0 0 44px;
  text-align: right;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #888;
}

/* ── SWATCH SELECT ──
   Stands in for a native <select> where each choice carries a color chip.
   The menu is a body-level, fixed-position element so the panel's own
   scrolling cannot clip it. */
.sketch-ui-select {
  flex: 1;
  min-width: 0;
  position: relative;
}

.sketch-ui-panel button.sketch-ui-select-btn,
.sketch-ui-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #fff;
  color: #000;
  border: 1px solid #bbb;
  font-family: 'CPMono', sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}

.sketch-ui-panel button.sketch-ui-select-btn:hover { border-color: #000; }

.sketch-ui-panel button.sketch-ui-select-btn:hover,
.sketch-ui-panel button.sketch-ui-select-btn:active {
  background: #fff;
  color: #000;
}

.sketch-ui-swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid #000;
}

.sketch-ui-select-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sketch-ui-select-caret {
  flex: none;
  font-size: 12px;
  color: #888;
}

.sketch-ui-select-menu {
  position: fixed;
  z-index: 700;
  display: none;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #000;
}

.sketch-ui-select-menu.open { display: flex; }

/* in the menu each name gets the room it needs; only the button ellipsizes */
.sketch-ui-select-menu .sketch-ui-select-name {
  flex: none;
  overflow: visible;
  text-overflow: clip;
}

.sketch-ui-select-option {
  border: none;
  border-bottom: 1px solid #eee;
}

.sketch-ui-select-option:last-child { border-bottom: none; }

.sketch-ui-select-option:hover { background: #000; color: #fff; }

.sketch-ui-select-option.sel { outline: 1px solid #000; outline-offset: -3px; }

.sketch-ui-check {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.sketch-ui-check label {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* sticks to the foot of the panel, so it stays reachable when the panel
   scrolls and still cannot overlap the content above it */
.sketch-ui-bottom {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 0;
  background: #fff;
}

/* ── BOTTOM BUTTONS ── */
.sketch-bottom-group {
  position: fixed;
  bottom: 20px;
  right: 38px;
  width: 375px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── CONFIRM MODAL ── */
#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#confirm-box {
  background: #fff;
  border: 1px solid #000;
  padding: 38px 60px;
  width: 500px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}

#confirm-message {
  color: #000;
  font-size: 22px;
  letter-spacing: 0.1em;
  line-height: 1.8;
}

#confirm-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

#confirm-buttons button {
  padding: 12px 32px;
  width: auto;
}
