@layer studio {
  :root {
    --page: #fcfbf8;
    --panel: #fffefb;
    --ink: #41413c;
    --muted: #74736c;
    --accent: #55564f;
    --accent-soft: #faf5e6;
    --line: #ece9e1;
    --control-surface: #ffffff;
    --control-hover: #faf6eb;
    --selection-line: #cfc19c;
    --action-fill: #f3ecd8;
    --action-hover: #ece2c6;
    --focus-ring: #cfc19c66;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
  }
  [hidden] {
    display: none !important;
  }
  .studio-tabs,
  .brand-caption {
    display: none;
  }
  .primary-button {
    background: var(--action-fill);
    color: var(--ink);
  }
  .primary-button:hover {
    background: var(--action-hover);
  }
  .render-notice {
    position: absolute;
    z-index: 30;
    top: 16px;
    left: 16px;
    right: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff8df;
    color: #594e2e;
    font-size: 13px;
    box-shadow: 0 4px 18px #0001;
  }
  .render-notice button {
    margin-left: 12px;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
  }
  #cropEditorCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) {
    --touch-min: 36px;
    --studio-sidebar: clamp(400px, 38vw, 600px);
    height: 100dvh;
    min-height: 440px;
    overflow: hidden;
    display: grid;
    grid-template-rows: 72px minmax(0, 1fr) 32px;
    background: var(--page);
    font-size: 14px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .site-header {
    height: auto;
    max-width: none;
    width: 100%;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .brand {
    gap: 12px;
    font-size: 22px;
    letter-spacing: .08em;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .brand-mark {
    width: 25px;
    height: 29px;
    border-radius: 3px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .brand-caption {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: .08em;
    padding-left: 15px;
    border-left: 1px solid var(--line);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .privacy-note {
    font-size: 12px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--studio-sidebar);
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    height: 100%;
    min-height: 0;
    padding: 24px 28px 12px;
    overflow: hidden;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0;
    min-height: 44px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-heading > div {
    display: block;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .eyebrow {
    font-size: 9px;
    letter-spacing: .16em;
    color: var(--muted);
    margin: 0 0 8px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) h1 {
    font-family: inherit;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: .01em;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .dimension-label {
    font-size: 10px;
    text-align: right;
    line-height: 1.5;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-stage.crop-editor-active > #previewCanvas,
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-stage.crop-editor-active > .fullscreen-button {
    visibility: hidden;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-stage {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
      radial-gradient(
        ellipse at 45% 35%,
        #faf9f5,
        #f5f2eb);
    box-shadow: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #previewCanvas {
    display: block;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    box-shadow: 0 10px 35px #38312812, 0 1px 3px #3831280d;
    cursor: zoom-in;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-stage:not(.has-image) #previewCanvas {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .preview-hint {
    text-align: center;
    margin: 0;
    min-height: 20px;
    font-size: 11px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .empty-state {
    padding: 32px;
    gap: 16px;
    color: var(--muted);
    max-width: 100%;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .empty-state strong {
    font-size: 23px;
    font-weight: 500;
    color: var(--ink);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .empty-state > span:last-of-type {
    font-size: 13px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .empty-icon {
    width: 70px;
    height: 70px;
    background: #ffffffa6;
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: 4px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .fullscreen-button {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    top: 14px;
    right: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: #fbf9f7e8;
    color: var(--ink);
    border: 1px solid var(--line);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .fullscreen-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .fullscreen-save-button,
  body[data-layout=desktop]:not(.preview-fullscreen) .fullscreen-adjust-button {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .editor-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
    overflow: hidden;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .upload-section {
    padding: 20px 24px 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    flex: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .upload-button {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px dashed var(--line);
    background: #faf7f1;
    border-radius: 10px;
    font-size: 13px;
    justify-content: center;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .file-status {
    margin: 0;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .file-status.is-error {
    color: var(--danger);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .cache-bar {
    flex: none;
    padding: 0 24px 14px;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .cache-copy {
    font-size: 10px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .draft-actions {
    gap: 10px;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .draft-actions button {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #saveDraftButton {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #editorFields {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    flex: 1;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #editorFields:disabled {
    opacity: .55;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #editorFields > .form-section,
  body[data-layout=desktop]:not(.preview-fullscreen) #editorFields > .metadata-settings {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .style-section {
    display: block;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 24px 26px;
    margin: 0;
    border: 0;
    scrollbar-width: thin;
    scrollbar-color: #d6d0c9 transparent;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .section-title-row h2 {
    font-size: 13px;
    font-weight: 600;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .reset-style-button {
    font-size: 10px;
    color: var(--muted);
    min-height: 28px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .record-style-card {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .record-style-card .section-title-row {
    margin-bottom: 10px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fcfbf7;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-button.is-active {
    border-color: var(--selection-line);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 0 1px var(--selection-line);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-mini {
    display: block;
    width: 24px;
    height: 30px;
    margin: 0;
    flex: none;
    opacity: .85;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-mini::before {
    background:
      linear-gradient(
        145deg,
        #eee8d5,
        #d2c9ac);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .studio-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    gap: 0;
    margin: 0 0 22px;
    padding: 0;
    position: sticky;
    top: -22px;
    z-index: 5;
    background: var(--panel);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .studio-tabs button {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    min-height: 43px;
    font-size: 13px;
    cursor: pointer;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .studio-tabs button[aria-selected=true] {
    color: var(--accent);
    border-bottom-color: var(--selection-line);
    font-weight: 600;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #adjustButton,
  body[data-layout=desktop]:not(.preview-fullscreen) .adjust-dialog-title,
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-tabbar,
  body[data-layout=desktop]:not(.preview-fullscreen) .adjust-close {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .adjust-dialog:not([hidden]),
  body[data-layout=desktop]:not(.preview-fullscreen) .adjust-sheet {
    display: contents;
    position: static;
    height: auto;
    max-height: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-group {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-group > summary {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-group-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 0;
    margin: 0;
    max-height: none;
    overflow: visible;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot > * {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .form-section {
    order: 0;
    display: grid;
    gap: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .font-size-range-field {
    order: 1;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .metadata-settings {
    order: 2;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .title-field-row {
    display: grid;
    gap: 6px;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .text-input,
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .text-input {
    transform: none;
    width: 100%;
    min-height: 42px;
    height: auto;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.65;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    box-shadow: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .textarea {
    min-height: 128px;
    resize: vertical;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .title-input {
    min-height: 72px;
    resize: vertical;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .text-input:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
    border-color: var(--accent);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .textarea-label,
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .textarea-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 0;
    line-height: 1.6;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .character-count {
    font-size: 10px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .range-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .font-size-range-field input[type=range] {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .metadata-content {
    padding: 12px 0 0;
    display: grid;
    gap: 14px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot .metadata-field-card {
    padding: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #trayTextSlot summary {
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .field-note,
  body[data-layout=desktop]:not(.preview-fullscreen) .field-note:empty {
    font-size: 10px;
    line-height: 1.6;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .advanced-settings {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .advanced-settings > summary {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .advanced-content {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #advancedContent > .adjustable-style-controls {
    display: grid;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .select-row,
  body[data-layout=desktop]:not(.preview-fullscreen) .color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .select-row > span,
  body[data-layout=desktop]:not(.preview-fullscreen) .color-row > span:first-child {
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .color-control,
  body[data-layout=desktop]:not(.preview-fullscreen) .select-input {
    min-height: 38px;
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #exportFormat {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .select-row:has(#exportFormat) {
    display: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .adjustable-style-controls {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    gap: 18px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .template-controls {
    display: none;
    padding: 0 0 22px;
    margin: 0;
    border: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .option-block,
  body[data-layout=desktop]:not(.preview-fullscreen) .range-field {
    margin: 0;
    padding: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .option-label,
  body[data-layout=desktop]:not(.preview-fullscreen) .range-field > span:first-child {
    font-size: 12px;
    color: var(--ink);
    margin-bottom: 8px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .option-label small {
    font-size: 10px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .font-picker,
  body[data-layout=desktop]:not(.preview-fullscreen) .ratio-picker {
    gap: 6px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .font-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .ratio-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .position-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .magazine-font-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .magazine-spacing-picker button {
    min-height: 36px;
    border-radius: 7px;
    font-size: 12px;
    padding: 7px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-order-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card {
    height: auto;
    max-height: none;
    min-height: 96px;
    min-width: 0;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8f6f3;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card > span {
    width: 100%;
    display: grid;
    gap: 4px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card strong {
    font-size: 13px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card small {
    display: block;
    font-size: 10px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card button,
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 6px;
    font-size: 11px;
    color: var(--accent);
    opacity: 1;
    cursor: pointer;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-slot-card button:disabled,
  body[data-layout=desktop]:not(.preview-fullscreen) #swapPhotosButton:disabled {
    opacity: .4;
    cursor: default;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #swapPhotosButton {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    padding: 5px 14px;
    color: var(--accent);
    grid-column: 1/-1;
    justify-self: center;
    min-height: 32px;
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) #photoCropControls {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    gap: 18px;
    width: 100%;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-control-row,
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-crop-ratio-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 8px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-control-row > span,
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-crop-ratio-row > span {
    display: block;
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-crop-ratio-picker {
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    overflow: visible;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-crop-ratio-picker button {
    color: var(--muted);
    border: 1px solid var(--line);
    background: white;
    cursor: pointer;
    width: auto;
    min-width: 0;
    padding: 8px;
    min-height: 36px;
    font-size: 12px;
    border-radius: 7px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-slot-picker,
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-layout-picker {
    display: flex;
    gap: 6px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-slot-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-layout-picker button {
    border: 1px solid var(--line);
    background: white;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 34px;
    min-width: 62px;
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-geometry-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    width: 100%;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-margin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-number-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-number-caption {
    font-size: 11px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-photo-group .photo-crop-note {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .photo-crop-ratio-picker .is-active,
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-slot-picker .is-active,
  body[data-layout=desktop]:not(.preview-fullscreen) .dual-photo-direction-picker .is-active,
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-format-buttons .is-active {
    background: var(--accent-soft);
    border-color: var(--selection-line);
    color: var(--accent);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-margin-control > span {
    font-size: 11px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-save-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-save-controls > * {
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-format-control {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-format-buttons,
  body[data-layout=desktop]:not(.preview-fullscreen) .dual-photo-direction-picker {
    display: flex;
    gap: 6px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-format-buttons button,
  body[data-layout=desktop]:not(.preview-fullscreen) .dual-photo-direction-picker button,
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-save-draft-button {
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 7px;
    color: var(--accent);
    cursor: pointer;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-save-draft-button {
    width: 100%;
    background: var(--accent-soft);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-draft-row {
    display: grid;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.7;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .tray-draft-row small {
    font-size: 10px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .adjust-quick-layout-controls {
    display: grid;
    gap: 18px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .panel-actions {
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    background: var(--panel);
    position: static;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .primary-button {
    min-height: 46px;
    padding: 12px;
    background: var(--action-fill);
    color: var(--ink);
    font-size: 13px;
    border-radius: 10px;
    box-shadow: 0 3px 7px #4d413114;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .primary-button:hover {
    background: var(--action-hover);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .panel-actions .text-button {
    padding: 6px 0;
    font-size: 11px;
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) > footer {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0 28px;
    font-size: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .draft-library {
    position: absolute;
    z-index: 40;
    inset: 12px;
    margin: 0;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: auto;
    box-shadow: 0 12px 40px #352f2626;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .draft-library-head h2 {
    font-size: 18px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-editor {
    inset: 12px;
    padding: 16px;
    border-radius: 12px;
    gap: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-editor-header {
    font-size: 14px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-editor-header small {
    font-size: 11px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-editor-zoom {
    grid-template-columns: 100px minmax(0, 1fr);
    font-size: 12px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .crop-editor-actions button {
    min-height: 40px;
    font-size: 13px;
  }
  body[data-layout=desktop]:not(.preview-fullscreen)[data-editor-tab=text] #trayTextGroup,
  body[data-layout=desktop]:not(.preview-fullscreen)[data-editor-tab=photo] #trayPhotoGroup,
  body[data-layout=desktop]:not(.preview-fullscreen)[data-editor-tab=save] #traySaveGroup,
  body[data-layout=desktop]:not(.preview-fullscreen)[data-editor-tab=style] .advanced-settings,
  body[data-layout=desktop]:not(.preview-fullscreen)[data-editor-tab=style] .template-controls:not([hidden]) {
    display: block;
  }
  body[data-layout=desktop]:not(.preview-fullscreen)[data-template=polaroid] .title-field-row {
    display: none !important;
  }
  @media (max-width: 1000px) {
    body[data-layout=desktop]:not(.preview-fullscreen) {
      --studio-sidebar:clamp(340px, 42vw, 420px);
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .preview-column {
      padding: 18px 16px 10px;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .preview-stage {
      padding: 20px;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .preview-heading h1 {
      font-size: 18px;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .dimension-label {
      display: none;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .style-section {
      padding-inline: 20px;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .site-header {
      padding-inline: 20px;
    }
    body[data-layout=desktop]:not(.preview-fullscreen) .privacy-note {
      display: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition: none !important;
    }
  }
}
@layer studio {
  body[data-layout=desktop]:not(.preview-fullscreen) {
    row-gap: 0;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .fullscreen-button {
    bottom: auto;
    left: auto;
    height: auto;
    width: auto;
    min-height: 34px;
    box-shadow: 0 2px 8px #0001;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .upload-button {
    color: var(--accent);
    box-shadow: none;
  }
  body[data-layout=desktop]:not(.preview-fullscreen) .upload-button:hover {
    background: #f3efe7;
    transform: none;
  }
}
