html, body { height: 100%; }
body.color-page { background: #FFF8E6; }
.color-app { display: flex; flex-direction: column; min-height: 100%; }
.color-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 20px 8px; }
.color-bar h1 { margin: 0; font-size: 1.55rem; }
.color-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-tools button, .picker-toggle {
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
  background: #fff; color: #2B2350; box-shadow: 0 3px 0 #E6DCC2;
}
.color-tools button[aria-pressed="true"] { background: #2B2350; color: #fff; box-shadow: 0 3px 0 #1a1633; }
.color-tools .pri { background: #FFC234; box-shadow: 0 3px 0 #F08A00; color: #2B2350; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 8px; align-items: center; }
.swatch {
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; cursor: pointer;
  box-shadow: 0 0 0 2px #2B2350; padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 4px #2B2350, 0 0 0 8px #FFC234; }
.stage-wrap { flex: 1; min-height: 0; padding: 0 16px 16px; display: flex; }
.stage {
  flex: 1; min-height: 300px; position: relative; background: #fff; border-radius: 24px;
  box-shadow: 0 10px 30px rgba(43,35,80,.12); overflow: hidden; touch-action: none;
  display: grid; place-items: center;
}
#color-canvas { max-width: 100%; max-height: 100%; display: block; touch-action: none; cursor: pointer; }
.picker {
  display: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
  padding: 8px 20px 24px; max-height: 50vh; overflow: auto;
}
.picker.show { display: grid; }
.picker button { background: #fff; border: 0; border-radius: 16px; padding: 8px; cursor: pointer; text-align: center; font: inherit; font-weight: 700; box-shadow: 0 4px 0 #E6DCC2; color: #2B2350; }
.picker img { width: 100%; height: 120px; object-fit: contain; display: block; }
.hint { padding: 0 20px 12px; font-weight: 600; color: #4A4178; }
@media (max-width: 700px) {
  .swatch { width: 42px; height: 42px; }
  .color-bar h1 { font-size: 1.25rem; }
  .color-tools button { padding: 12px 14px; }
}
@media print {
  .site-header, .site-footer, .color-bar, .palette, .color-tools, .picker, .hint, .skip, .menu-btn { display: none !important; }
  body, .stage-wrap, .stage { background: #fff; box-shadow: none; }
  .stage-wrap { padding: 0; }
  #color-canvas { width: 100%; height: auto; }
}
body.color-page .site-footer { display: none; }
body.color-page .color-app { min-height: calc(100vh - 72px); }
body.color-page .site-header { position: sticky; top: 0; z-index: 8; }

body.color-page, body.color-page html { overflow: hidden; }
body.color-page #main { padding: 0; margin: 0; }
body.color-page .color-app { height: calc(100dvh - 77px); max-height: calc(100dvh - 77px); min-height: 0; overflow: hidden; }
