.palette .palette-board-trigger {
  width: 100%;
  margin: 0 0 12px;
  background: #e9efe7;
  border-color: #a8bbae;
  color: var(--green);
}

.palette .palette-board-trigger:hover {
  background: #dfeae0;
  border-color: #6f947e;
}

.palette-board {
  width: min(81rem, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 70px #17231e55;
}

.palette-board[open] {
  display: flex;
  flex-direction: column;
}

.palette-board::backdrop {
  background: #17231eba;
}

.palette-board__header,
.palette-board__footer {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px clamp(12px, 2vw, 25px);
}

.palette-board__header {
  border-bottom: 1px solid var(--line);
}

.palette-board__header h2 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.palette-board__header button {
  flex-shrink: 0;
}

.palette-board__header button span {
  margin-inline-start: 2px;
  font-size: 16px;
  line-height: 1;
}

.palette-board__body {
  min-height: 0;
  padding: clamp(8px, 1.8vw, 21px);
  overflow: auto;
  overscroll-behavior: contain;
}

.palette-board__viewer {
  min-width: 0;
  max-height: min(68vh, 52rem);
  max-height: min(68dvh, 52rem);
  overflow: auto;
  border: 1px solid #d8ded4;
  border-radius: 9px;
  background: #eef1e9;
}

.palette-board__viewer:has(img[hidden]),
.palette-board__feedback:has(p:empty):has(button[hidden]) {
  display: none;
}

.palette-board__viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(67vh, 51rem);
  max-height: min(67dvh, 51rem);
  margin-inline: auto;
}

.palette-board:has(#paletteBoardFullSize:checked) .palette-board__viewer img {
  max-width: none;
  max-height: none;
  margin-inline: 0;
}

.palette-board__feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.palette-board__feedback .error {
  color: #892a23;
}

.palette-board__footer {
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

.palette-board__footer button {
  margin-inline-start: auto;
}

.palette-board__scale {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.palette-board__scale input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

@media (max-width: 560px) {
  .palette-board {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .palette-board .action,
  .palette .palette-board-trigger {
    min-height: 42px;
  }
}
