.workshop-mode-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.icon-controls > p, .icon-preview-panel > p, .icon-upload small { color: var(--muted); line-height: 1.5; }
.icon-controls > p { margin: 16px 0 0; }
.icon-template-options, .icon-tool-options, .icon-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-template-options .secondary-button, .icon-tool-options .secondary-button { padding: 8px 10px; min-height: 40px; }
.icon-tool-options .is-active, .icon-choice-row .is-active { border-color: var(--brand-orange); color: var(--brand-yellow); }
.icon-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-choice-row .secondary-button { min-height: 40px; padding: 7px 10px; }
.icon-choice-row small { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; }
.icon-option-hint { margin: 8px 0 10px; color: var(--muted); font-size: .83rem; line-height: 1.4; }
.icon-shape-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.icon-shape-toolbar .icon-option-hint { margin: 0; }
.icon-shape-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.icon-shape-button { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 9px; border: 1px solid var(--line); color: var(--muted-strong); background: transparent; cursor: pointer; font: inherit; font-size: .8rem; text-align: left; }
.icon-shape-button svg { flex: 0 0 22px; width: 22px; height: 22px; fill: currentColor; }
.icon-shape-button:hover, .icon-shape-button.is-active { border-color: var(--brand-orange); color: var(--brand-yellow); }
.icon-shape-button:focus-visible { outline: 2px solid var(--brand-yellow); outline-offset: 2px; }
.icon-brush-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.icon-brush-size { flex: 1 1 190px; max-width: 300px; }
.icon-brush-size-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.icon-brush-label, .icon-brush-size output { color: var(--muted-strong); font-size: .8rem; }
.icon-brush-size input[type=range] { display: block; width: 100%; margin: 8px 0 2px; accent-color: var(--brand-orange); cursor: pointer; }
.icon-brush-size-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.icon-stretch { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted-strong); font-size: .8rem; cursor: pointer; }
.icon-stretch input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-orange); }
.icon-rotate { flex: 0 0 auto; min-height: 40px; padding: 7px 12px; }
.icon-swatch { width: 38px; height: 38px; padding: 0; border: 2px solid var(--line); background: var(--swatch); cursor: pointer; }
.icon-swatch.is-active { outline: 2px solid var(--brand-yellow); outline-offset: 2px; }
.icon-custom-color { display: flex; align-items: center; gap: 5px; color: var(--muted-strong); }
.icon-custom-color input { width: 36px; height: 36px; padding: 0; border: 0; background: none; }
.icon-upload { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.icon-upload input[type=file] { max-width: 100%; }
.icon-upload small { display: block; font-size: .85rem; }
.icon-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.icon-canvas-shell { width: min(100%, 440px); margin: 24px auto 0; outline: 1px solid var(--line); }
#iconCanvas { display: block; width: 100%; aspect-ratio: 1; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
#iconCanvas:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 4px; }
.icon-preview-panel > p { max-width: 440px; margin: 12px auto; font-size: .88rem; }
.icon-small-preview { display: flex; align-items: center; gap: 14px; width: min(100%, 440px); margin: 24px auto; color: var(--muted-strong); }
#iconSmallPreview { width: 64px; height: 64px; image-rendering: pixelated; border: 2px solid var(--line); }
#iconSmallPreview.is-photo { width: min(160px, 45vw); height: auto; aspect-ratio: 16 / 9; }
.icon-output-options #iconPhotoBackground { margin-top: 14px; }
.icon-actions { flex-wrap: wrap; }
/* Keep the canvas, guidance and output preview together while settings scroll. */
@media (min-width: 901px) {
  .icon-preview-panel { position: sticky; top: 120px; align-self: start; }
  /* Give the sticky preview space to stay in view at the last controls. */
  .icon-controls { padding-bottom: 240px; }
  /* Leave room for the panel heading, help text and the wider photo preview. */
  .icon-canvas-shell { width: min(100%, 440px, max(100px, calc(100vh - 420px))); }
}
@media (max-width: 650px) { .workshop-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); } .workshop-mode-button:nth-of-type(3) { border-left: 0; } }
.icon-check input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; }
@media (max-width: 900px) {
  .icon-studio { display: flex; flex-direction: column; padding: 18px 14px; }
  .icon-controls, .icon-preview-panel { display: contents; }
  .icon-controls > .flyer-controls-heading { order: 0; }
  .icon-controls > p:not(.flyer-status) { order: 1; }
  .icon-controls > .icon-output-options { order: 2; }
  .icon-controls > .icon-starters { order: 3; }
  .icon-controls > .icon-grid-options { order: 3; }
  .icon-preview-panel > .flyer-preview-heading { order: 3; margin-top: 20px; }
  .icon-canvas-shell { order: 4; width: min(100%, 360px); margin-top: 12px; }
  .icon-preview-panel > p { order: 5; }
  .icon-controls > .icon-colors { order: 6; }
  .icon-controls > .icon-tools { order: 7; }
  .icon-controls > .icon-shapes { order: 8; }
  .icon-small-preview { order: 9; margin: 16px auto; }
  .icon-upload { order: 10; }
  .icon-actions { order: 11; }
  .icon-controls > .flyer-status { order: 12; }
  /* A compact live preview stays visible beside crop controls on small screens. */
  .icon-studio:has(#iconUploadControls:not([hidden])) .icon-small-preview {
    position: sticky;
    top: 76px;
    z-index: 5;
    width: min(100%, 360px);
    padding: 8px 10px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
  }
  .icon-studio:has(#iconUploadControls:not([hidden])) #iconSmallPreview:not(.is-photo) { width: 72px; height: 72px; }
  .icon-studio:has(#iconUploadControls:not([hidden])) #iconSmallPreview.is-photo { width: min(128px, 40vw); }
}
