.sandbox-page-heading {
    width: 100%;
    max-width: var(--site-shell-width);
    margin: 0 auto;
    padding: 12px var(--site-shell-gutter);
    color: #20252b;
}
.sandbox-page-heading h1 { font-size: 18px; font-weight: 700; margin: 0; }
.sandbox-workspace {
    --sandbox-line: #d7dde1;
    --sandbox-ink: #20252b;
    --sandbox-muted: #59636c;
    --sandbox-accent: #18634a;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    max-width: var(--site-shell-width);
    margin: 0 auto;
    padding: 0 var(--site-shell-gutter) 16px;
    color: var(--sandbox-ink);
    letter-spacing: 0;
}
.sandbox-workspace *, .sandbox-alert * { box-sizing: border-box; }
.sandbox-workspace .hidden, .sandbox-workspace [hidden] { display: none !important; }
.sandbox-workspace h2, .sandbox-workspace h3 { font-size: 14px; font-weight: 650; margin: 0; }
.sandbox-workspace button, .sandbox-workspace select, .sandbox-workspace input {
    font: inherit;
    color: inherit;
}
.sandbox-workspace button, .sandbox-workspace select {
    min-height: 44px;
    touch-action: manipulation;
}
.sandbox-workspace button { cursor: pointer; }
.sandbox-workspace button:disabled { opacity: 0.4; cursor: not-allowed; }
.sandbox-workspace :is(button, input, select):focus-visible, #sandbox-canvas canvas:focus-visible {
    outline: 2px solid #18634a;
    outline-offset: 2px;
}
.sandbox-sidebar, .sandbox-stage { min-width: 0; background: #fff; border-top: 1px solid var(--sandbox-line); }
.sandbox-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sandbox-setup-heading { min-height: 52px; padding: 4px 12px; border-bottom: 1px solid var(--sandbox-line); }
#setup-summary { overflow-wrap: anywhere; }
#setup-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#sandbox-setup-fields { padding: 12px; }
.sandbox-field-heading { margin-bottom: 8px !important; }
.sandbox-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sandbox-field { display: flex; min-width: 0; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sandbox-muted); }
.sandbox-field input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #aeb8c0;
    border-radius: 6px;
    background: #fff;
    padding: 8px 6px;
    text-align: center;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
}
.sandbox-field input::-webkit-inner-spin-button, .sandbox-field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.sandbox-field input:disabled, #setup-panel select:disabled { color: #59636c; background: #f3f5f6; opacity: 1; }
.sandbox-products-heading { margin-top: 20px; }
.sandbox-workspace select { border: 1px solid #aeb8c0; border-radius: 6px; padding: 6px 8px; background: #fff; font-size: 14px; }
.sandbox-product { border-bottom: 1px solid var(--sandbox-line); padding: 8px 0 12px; }
.sandbox-product:last-child { border-bottom: 0; }
.sandbox-product input[type="color"] { width: 44px; height: 44px; padding: 5px; border: 0; background: transparent; cursor: pointer; }
.sandbox-product-fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.sandbox-product-fields .sandbox-field { grid-column: span 2; }
.sandbox-product-fields .sandbox-field:nth-child(n+4) { grid-column: span 3; }
.sandbox-start { width: 100%; min-height: 48px !important; border-radius: 6px; border: 0; background: var(--sandbox-accent); color: #fff !important; font-weight: 650 !important; margin-top: 12px; }
.sandbox-queue { padding: 8px 12px; }
.sandbox-count { font-size: 12px; color: var(--sandbox-muted); }
#box-queue-items { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.sandbox-queue-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
    padding: 8px;
    flex: 1 0 250px;
    border: 1px solid var(--sandbox-line);
    border-radius: 6px;
}
.sandbox-queue-row.is-active { border-color: #18634a; background: #edf6f0; box-shadow: inset 3px 0 #18634a; }
.sandbox-swatch { width: 10px; height: 24px; flex: 0 0 10px; border-radius: 2px; }
.sandbox-queue-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; font-size: 12px; overflow-wrap: anywhere; }
.sandbox-queue-info span { color: var(--sandbox-muted); }
.sandbox-queue-action { flex-shrink: 0; min-width: 44px; border: 1px solid #aeb8c0; border-radius: 6px; background: #fff; font-size: 13px !important; padding: 6px; }
.sandbox-queue-action[aria-pressed="true"] { color: #8a4310; border-color: #c97e32; }
#sandbox-placed-heading { padding: 12px 0; font-size: 12px; }
#sandbox-placed-items { display: flex; gap: 6px; flex-wrap: wrap; }
.sandbox-placed-action { min-width: 44px; padding: 6px; border: 1px solid var(--sandbox-line); border-radius: 4px; background: #fff; font-size: 12px !important; }
.sandbox-stage { scroll-margin-top: 8px; }
.sandbox-camera-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--sandbox-line); }
#sandbox-view { width: 96px; max-width: 100%; font-size: 12px; }
.sandbox-restart { margin-left: auto; padding: 6px 8px; border: 0; background: transparent; font-size: 12px !important; }
#sandbox-canvas { width: 100%; height: clamp(240px, 40svh, 500px); position: relative; overflow: hidden; background: #f0f2f5; }
#sandbox-canvas canvas { display: block; width: 100%; height: 100%; }
#sandbox-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; font-size: 14px; color: #59636c; text-align: center; }
.sandbox-controls { position: sticky; bottom: 0; z-index: 20; background: #fff; border-block: 1px solid var(--sandbox-line); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
.sandbox-control-options { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sandbox-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.sandbox-step legend { font-size: 11px; color: var(--sandbox-muted); margin-bottom: 4px; }
.sandbox-segments { display: flex; }
.sandbox-segments label { position: relative; display: block; cursor: pointer; }
.sandbox-segments input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sandbox-segments span { display: grid; place-items: center; width: 44px; min-height: 44px; border: 1px solid #aeb8c0; font-size: 13px; }
.sandbox-segments label + label span { border-left: 0; }
.sandbox-segments label:first-child span { border-radius: 6px 0 0 6px; }
.sandbox-segments label:last-child span { border-radius: 0 6px 6px 0; }
.sandbox-segments input:checked + span { background: #18634a; color: #fff; border-color: #18634a; }
.sandbox-segments input:focus-visible + span { outline: 2px solid #18634a; outline-offset: 2px; }
.sandbox-edge-toggle { display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 2px; font-size: 12px; cursor: pointer; }
.sandbox-edge-toggle input { width: 18px; height: 18px; accent-color: #18634a; }
.sandbox-history { display: flex; gap: 4px; }
.sandbox-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid #c4ccd1;
    border-radius: 6px;
    background: #fff;
    color: #303a42;
    user-select: none;
}
.sandbox-icon [data-sandbox-icon] { display: inline-flex; width: 20px; height: 20px; }
.sandbox-icon svg { width: 20px; height: 20px; pointer-events: none; }
.sandbox-icon[aria-pressed="true"] { background: #edf6f0; border-color: #18634a; color: #18634a; }
.sandbox-manipulation { display: grid; gap: 6px; }
.sandbox-movement { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.sandbox-movement .sandbox-move-controls { flex: 1 0 188px; }
.sandbox-shift-hint { color: var(--sandbox-muted); font-size: 11px; line-height: 18px; }
.sandbox-shift-hint.is-active { color: #18634a; font-weight: 700; }
.sandbox-icon.is-to-end { background: #edf6f0; border-color: #18634a; color: #18634a; }
.sandbox-move-controls { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 4px; }
.sandbox-action-controls { display: grid; grid-template-columns: repeat(6, minmax(44px, 1fr)); gap: 4px; }
.sandbox-manipulation .sandbox-icon { width: 100%; }
#sandbox-drop { background: #18634a; color: #fff; border-color: #18634a; }
#sandbox-position-reset { color: #8a4310; }
.sandbox-active-status { min-height: 18px; font-size: 11px; line-height: 18px; margin: 6px 0 0; color: var(--sandbox-muted); overflow-wrap: anywhere; }
.sandbox-warning { color: #b42318; }
.sandbox-active-status.sandbox-warning { color: #b42318; }
.sandbox-bounds-warning { margin: 0; padding: 8px 12px; border-top: 2px solid #b42318; background: #fff1f0; color: #b42318; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.sandbox-ok { color: #18634a; }
#sandbox-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); max-width: 90%; padding: 10px 16px; border-radius: 6px; background: #20252b; color: #fff; font-size: 14px; text-align: center; z-index: 200; opacity: 0; pointer-events: none; }
.sandbox-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; font-size: 12px; }
.sandbox-stats > div { display: flex; align-items: baseline; gap: 6px; }
.sandbox-stats span { color: var(--sandbox-muted); }
.sandbox-stats strong { font-size: 13px !important; overflow-wrap: anywhere; }
.sandbox-alert { padding: 24px; margin: 16px; width: 360px; max-width: calc(100% - 32px); border-radius: 8px; background: #fff; }
.sandbox-alert p { font-size: 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.sandbox-alert button { min-height: 44px; width: 100%; border-radius: 6px; background: #18634a; color: #fff; }
@media (hover: hover) {
    .sandbox-icon:hover:not(:disabled), .sandbox-queue-action:hover:not(:disabled) { background: #edf1f3; }
    #sandbox-drop:hover:not(:disabled), .sandbox-start:hover { background: #104e39; }
}
@media (min-width: 1024px) {
    .sandbox-workspace { grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
    #box-queue-items { display: grid; overflow: visible; }
    .sandbox-queue-row { min-width: 0; }
    #sandbox-canvas { height: clamp(340px, calc(100dvh - 300px), 760px); }
    .sandbox-controls { position: static; padding: 10px 12px; }
    .sandbox-control-options { justify-content: flex-start; gap: 16px; }
    .sandbox-history { margin-left: auto; }
    .sandbox-manipulation { display: flex; flex-wrap: wrap; gap: 12px; }
    .sandbox-move-controls, .sandbox-action-controls { display: flex; gap: 6px; }
    .sandbox-manipulation .sandbox-icon { width: 44px; }
}
@media (max-width: 359px) {
    .sandbox-action-controls { gap: 2px; }
}
