body { background: #fff3cf; }
#studio { width: min(1180px, 100%); margin: auto; padding: 20px 28px; }
.studio-header, .picture-heading, .palette-heading, .view-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
a { color: inherit; text-underline-offset: 4px; }
.studio-header a { display: inline-flex; align-items: center; min-height: 48px; font-size: 14px; }
h1 { margin: 0 0 22px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -1px; }
h1 span { color: #cd714d; font-size: .7em; }
h2 { font-size: 18px; margin: 0; }
button { background: #fffaf0; border-color: #decda6; padding: 9px 14px; }
button[aria-pressed=true]:not(.swatch) { border-color: #25465c; background: #e0eddf; }
main { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 32px; align-items: start; }
.picture { min-width: 0; }
.picture-heading { margin-bottom: 12px; }
#viewport { position: relative; height: min(66vh, 640px); overflow: hidden; background: #e3ecd9; border-radius: 22px; touch-action: none; }
#artwork { position: absolute; left: 50%; top: 50%; background: white; transform-origin: center; touch-action: none; box-shadow: 0 3px 14px #25465c22; }
#artwork:focus-visible { outline-offset: -4px; }
#cursor { position: absolute; pointer-events: none; width: 24px; height: 24px; border: 2px solid #25465c; outline: 2px solid white; border-radius: 50%; transform: translate(-50%,-50%); }
.view-tools { margin-top: 10px; font-size: 13px; }
aside { min-width: 0; padding-top: 4px; }
.palette-heading { margin-bottom: 16px; }
#custom-label { position: relative; display: grid; place-items: center; min-width: 80px; height: 48px; background: #fffaf0; border: 2px dashed #b09e78; border-radius: 16px; font-weight: 800; cursor: pointer; }
#custom { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#custom-label:focus-within { outline: 4px solid #214f87; }
#palette, #hint-colors { display: flex; gap: 10px; flex-wrap: wrap; padding: 5px; }
.swatch { flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: var(--color); border: 2px solid #25465c44; box-shadow: inset 0 0 0 3px #ffffff6b; color: white; font-size: 23px; text-shadow: 0 1px 3px #000, 0 -1px 3px #000; }
[data-level="1"] .swatch { flex-basis: 56px; width: 56px; height: 56px; }
.swatch[aria-pressed=true] { outline: 3px solid #25465c; outline-offset: 2px; }
#brush-tools, .actions, .secondary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
#brush-tools button { padding: 8px 10px; }
#hint-colors { background: #fffaf0; border-radius: 18px; margin-top: 16px; }
.actions button { flex: 1; padding: 8px; }
.gold { background: #f6c453; border-color: #c9972b; }
#status { min-height: 36px; font-size: 14px; line-height: 1.4; }
#keyboard-help { font-size: 12px; line-height: 1.9; color: #526779; }
footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; padding: 16px 0; }
footer a { display: inline-flex; align-items: center; min-height: 48px; }
footer span { align-self: center; }
#print-picture { display: none; }
@media (max-width: 859px) {
  #studio { padding: 8px 16px 90px; }
  h1 { font-size: 27px; margin-bottom: 14px; }
  main { display: block; }
  #viewport { height: min(55svh, 510px); }
  .picture-heading h2 { font-size: 16px; }
  .palette-heading { margin: 14px 0 6px; }
  #palette { flex-wrap: nowrap; overflow-x: auto; padding: 6px 5px 12px; }
  .actions { position: fixed; bottom: 0; left: 0; right: 0; z-index: 2; margin: 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: #fff3cf; border-top: 2px solid #ead9ab; }
  .actions button { min-height: 52px; }
  #keyboard-help { display: none; }
}
@media print {
  @page { margin: 0; }
  body { background: white; }
  body > :not(#print-picture) { display: none !important; }
  #print-picture { display: block; max-width: 100%; max-height: 100vh; width: auto; height: auto; margin: auto; }
}
