.h4bs-image-studio {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}
.h4bs-image-studio [hidden] { display: none !important; }
.h4bs-image-studio button,
.h4bs-image-studio a,
.h4bs-image-studio summary,
.h4bs-image-studio input[type="text"] { min-height: 44px; }
.wp-core-ui .h4bs-image-studio button,
.wp-core-ui .h4bs-image-studio a,
.wp-core-ui .h4bs-image-studio summary,
.wp-core-ui .h4bs-image-studio input[type="text"] { min-height: 44px !important; }
.h4bs-image-studio button:focus-visible,
.h4bs-image-studio a:focus-visible,
.h4bs-image-studio summary:focus-visible,
.h4bs-image-studio input:focus-visible,
.h4bs-image-studio canvas:focus-visible { outline: 3px solid #135e96; outline-offset: 2px; }
.h4bs-image-studio-start,
.h4bs-image-studio-save-panel,
.h4bs-image-studio-summary {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    padding: 1rem;
}
.h4bs-image-studio-start { max-width: 680px; }
.h4bs-image-studio-start h2,
.h4bs-image-studio-save-panel h2 { margin-top: 0; }
.h4bs-image-studio-workspace { display: grid; gap: .9rem; }
.h4bs-image-studio-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: .8rem; align-items: center; }
.h4bs-image-studio-summary div { display: grid; gap: .2rem; min-width: 0; }
.h4bs-image-studio-summary span { overflow-wrap: anywhere; }

.h4bs-image-studio-toolbar,
.h4bs-image-studio-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.h4bs-image-studio-controls label {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    background: #fff;
    border: 1px solid #dbe7e6;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
}
.h4bs-image-studio-controls-disclosure > summary { display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.h4bs-image-studio-controls-disclosure[open] > summary { margin-bottom: .65rem; }
.h4bs-image-studio-status { border-left: 4px solid #72aee6; margin: 0; padding: .75rem; background: #f0f6fc; }
.h4bs-image-studio-status[data-state="error"] { border-color: #d63638; background: #fcf0f1; }
.h4bs-image-studio-status[data-state="saved"] { border-color: #00a32a; background: #edfaef; }
.h4bs-image-studio-status[data-state="unsaved"],
.h4bs-image-studio-status[data-state="saving"] { border-color: #dba617; background: #fcf9e8; }
.h4bs-image-studio-save-panel { display: grid; gap: .8rem; }
.h4bs-image-studio-save-panel fieldset { display: grid; gap: .5rem; padding: 0; border: 0; }
.h4bs-image-studio-save-panel fieldset label { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.h4bs-image-studio-save-panel > label { display: grid; gap: .35rem; }
.h4bs-image-studio-save-panel input[type="text"] { width: min(100%, 680px); }
.h4bs-image-studio-save-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }

.h4bs-image-studio-canvas-wrap {
    border: 1px solid #dbe7e6;
    border-radius: 10px;
    background: #fff;
    padding: 0.5rem;
    max-width: 100%;
    overflow: auto;
}

@media (max-width: 782px) {
    .h4bs-image-studio-summary { grid-template-columns: 1fr; }
    .h4bs-image-studio-save-actions > *,
    .h4bs-image-studio-start .button { width: 100%; justify-content: center; }
    .h4bs-image-studio-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h4bs-image-studio-toolbar > * { width: 100%; white-space: normal; }
    .h4bs-image-studio-toolbar [data-h4bs-reset] { grid-column: 1 / -1; }
    .h4bs-image-studio-controls label { width: 100%; justify-content: space-between; box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
    .h4bs-image-studio * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.h4bs-image-studio canvas {
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
    cursor: crosshair;
    background:
        linear-gradient(45deg, #f7f7f7 25%, transparent 25%),
        linear-gradient(-45deg, #f7f7f7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f7f7f7 75%),
        linear-gradient(-45deg, transparent 75%, #f7f7f7 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
