.studio-launch-link {
  color: #5e3f6e;
  background: transparent;
  font: 13px/1.5 var(--sans);
  min-height: 44px;
  padding: 10px 4px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.book-feature-copy .studio-launch-link { margin-left: 12px; }
.color-studio {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: 92vh;
  max-height: 92dvh;
  padding: 0;
  margin: auto;
  border: 1px solid #c8b9cf;
  border-radius: 14px;
  background: #faf7fa;
  color: #493951;
  box-shadow: 0 20px 80px #20172c66;
  overflow: auto;
  overscroll-behavior: contain;
}
.color-studio::backdrop { background: #231b32b3; }
body:has(#color-studio[open]) { overflow: hidden; }
.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 30px;
  border-bottom: 1px solid #d9cedd;
}
.studio-header p { font: italic 15px/1.3 var(--serif); color: #735a7f; margin: 0 0 5px; }
.studio-header h2 { font: 34px/1.12 var(--serif); letter-spacing: -.7px; margin: 0; }
.studio-header h2:focus { outline: none; }
.studio-close, .studio-zoom, .studio-history button, .studio-detail button {
  min-height: 44px;
  font: 12px/1.5 var(--sans);
  color: #563d63;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 12px;
}
.studio-layout {
  padding: 24px 30px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: 'art palette' 'art tools';
  gap: 16px 28px;
}
.studio-art { grid-area: art; min-width: 0; text-align: center; }
.studio-page-window {
  background: #e9e1ee;
  border-radius: 5px;
  border: 1px solid #d8cadd;
  overflow: auto;
  max-height: 64vh;
  max-height: 64dvh;
  overscroll-behavior: contain;
  padding: 9px;
}
.studio-paper { width: min(100%, 46vh, 540px); margin: 0 auto; box-shadow: 0 3px 12px #46325029; }
.studio-page-window.is-enlarged .studio-paper { width: max(165%, 600px); max-width: 1102px; }
#studio-canvas { display: block; width: 100%; height: auto; background: white; cursor: crosshair; }
.studio-palette { grid-area: palette; min-width: 0; }
.studio-instruction { font: 18px/1.5 var(--serif); margin: 0 0 16px; color: #5c4765; }
.studio-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.studio-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 7px 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #493951;
  font: 11px/1.4 var(--sans);
  min-height: 52px;
}
.studio-swatch::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: var(--swatch); border: 1px solid #796a7e66; }
.studio-swatch[aria-pressed="true"] { border-color: #70547e; background: #eee6f2; }
.studio-custom { display: inline-flex; align-items: center; gap: 9px; font: 12px/1.5 var(--sans); min-height: 44px; margin-top: 7px; }
#studio-custom { width: 36px; height: 30px; padding: 1px; border-radius: 4px; border: 1px solid #bdaac8; background: transparent; }
.studio-tools { grid-area: tools; min-width: 0; }
.studio-detail { border-block: 1px solid #ddd3e1; font: 12px/1.5 var(--sans); }
.studio-detail summary { cursor: pointer; padding: 13px 0; min-height: 44px; }
.studio-detail label { display: block; margin: 5px 0; }
.studio-detail select { font: inherit; padding: 7px; min-height: 42px; max-width: 100%; color: #493951; }
.studio-history { display: flex; margin: 6px 0 10px; }
.studio-history button:first-child { padding-left: 0; }
.color-studio button:disabled { opacity: .45; cursor: default; }
.studio-save { width: 100%; }
.studio-save small { font: 10px/1 var(--sans); }
.studio-status, .studio-keep { font: 12px/1.55 var(--sans); color: #66536f; margin: 9px 0 0; }
.studio-status:empty { display: none; }
.studio-fallback { display: inline-block; color: #644373; padding: 8px 0; }
.color-studio :is(button,input,summary,select,a):focus-visible { outline: 3px solid #713f87; outline-offset: 3px; }
@media (max-width: 700px) {
  .color-studio { width: calc(100% - 16px); max-height: 94dvh; }
  .studio-header { padding: 14px 16px; }
  .studio-header h2 { font-size: 26px; }
  .studio-header p { font-size: 13px; }
  .studio-layout { padding: 15px 16px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'palette' 'art' 'tools'; gap: 11px; }
  .studio-instruction { font-size: 16px; margin-bottom: 8px; }
  .studio-swatches { gap: 2px; }
  .studio-swatch { min-height: 46px; padding: 3px 0; gap: 3px; }
  .studio-swatch::before { width: 21px; height: 21px; }
  .studio-custom { margin-top: 0; }
  .studio-paper { width: min(100%, 50vh); }
  .studio-page-window { max-height: 67dvh; }
  .book-feature-copy .studio-launch-link { margin-left: 0; display: block; }
}
