.page-tool--social-image-safe-area-preview .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--social-image-safe-area-preview .tool-setup__body {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.page-tool--social-image-safe-area-preview .tool-setup__side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.page-tool--social-image-safe-area-preview .tool-platforms {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.page-tool--social-image-safe-area-preview .tool-platforms .label {
    display: block;
    margin-bottom: 7px;
}

.page-tool--social-image-safe-area-preview .tool-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 9.5rem;
    padding: 14px;
    border: 2px dashed var(--line-2);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.page-tool--social-image-safe-area-preview .tool-drop:hover,
.page-tool--social-image-safe-area-preview .tool-drop.is-dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.page-tool--social-image-safe-area-preview .tool-drop:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.page-tool--social-image-safe-area-preview .tool-drop__inner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.page-tool--social-image-safe-area-preview .tool-drop__inner[hidden] {
    display: none;
}

.page-tool--social-image-safe-area-preview .tool-drop__title {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.98rem;
}

.page-tool--social-image-safe-area-preview .tool-drop__hint {
    max-width: 30ch;
    font-size: 0.78rem;
    color: var(--faint);
}

.page-tool--social-image-safe-area-preview .tool-drop__preview {
    max-width: 100%;
    max-height: 9rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.page-tool--social-image-safe-area-preview .tool-drop__preview[hidden] {
    display: none;
}

.page-tool--social-image-safe-area-preview .tool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.page-tool--social-image-safe-area-preview .tool-chip {
    position: relative;
    display: inline-flex;
}

.page-tool--social-image-safe-area-preview .tool-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-tool--social-image-safe-area-preview .tool-chip__label {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.7rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.page-tool--social-image-safe-area-preview .tool-chip__label:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.page-tool--social-image-safe-area-preview .tool-chip input:checked + .tool-chip__label {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--accent);
}

.page-tool--social-image-safe-area-preview .tool-chip input:focus-visible + .tool-chip__label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.page-tool--social-image-safe-area-preview .tool-note {
    margin: 0;
    min-height: 2.4em;
    color: var(--muted);
    font-size: 0.82rem;
}

.page-tool--social-image-safe-area-preview .tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-tool--social-image-safe-area-preview .tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.page-tool--social-image-safe-area-preview .tool-stage-panel,
.page-tool--social-image-safe-area-preview .tool-controls {
    min-width: 0;
}

.page-tool--social-image-safe-area-preview .tool-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.page-tool--social-image-safe-area-preview .tool-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    cursor: pointer;
}

.page-tool--social-image-safe-area-preview .tool-toggle input {
    accent-color: var(--accent);
    margin: 0;
}

.page-tool--social-image-safe-area-preview .tool-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(45deg, var(--surface-3) 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%) 0 8px / 16px 16px,
        linear-gradient(45deg, transparent 75%, var(--surface-3) 75%) 8px -8px / 16px 16px,
        linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%) -8px 0 / 16px 16px,
        var(--surface-2);
}

.page-tool--social-image-safe-area-preview .tool-stage .empty-state {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 2.5rem 1rem;
}

.page-tool--social-image-safe-area-preview .tool-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000;
    box-shadow: var(--shadow-md);
}

.page-tool--social-image-safe-area-preview .tool-frame[hidden],
.page-tool--social-image-safe-area-preview .tool-frame__overlay[hidden],
.page-tool--social-image-safe-area-preview .tool-frame__grid[hidden],
.page-tool--social-image-safe-area-preview .tool-frame__marker[hidden] {
    display: none;
}

.page-tool--social-image-safe-area-preview .tool-frame__img {
    position: absolute;
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.page-tool--social-image-safe-area-preview .tool-frame__overlay {
    position: absolute;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-xs);
    box-shadow: 0 0 0 100vmax rgba(10, 12, 17, 0.42);
    pointer-events: none;
}

.page-tool--social-image-safe-area-preview .tool-frame__overlay::after {
    content: "text-safe area";
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.1rem 0.4rem;
    border-radius: 0 0 var(--radius-xs) 0;
    background: var(--accent);
    color: var(--accent-fg);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.page-tool--social-image-safe-area-preview .tool-frame__grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.45) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
    background-size: 33.3333% 33.3333%;
    background-position: -1px -1px;
}

.page-tool--social-image-safe-area-preview .tool-frame__marker {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(10, 12, 17, 0.55), inset 0 0 0 2px rgba(10, 12, 17, 0.55);
    pointer-events: none;
}

.page-tool--social-image-safe-area-preview .tool-frame__marker::after {
    content: "";
    position: absolute;
    inset: 50% 50% auto auto;
    width: 4px;
    height: 4px;
    transform: translate(50%, -50%);
    border-radius: 50%;
    background: #fff;
}

.page-tool--social-image-safe-area-preview .tool-meta-list {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 14px;
    margin: 14px 0 0;
}

.page-tool--social-image-safe-area-preview .tool-meta-list dt {
    color: var(--faint);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.page-tool--social-image-safe-area-preview .tool-meta-list dd {
    margin: 0;
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.page-tool--social-image-safe-area-preview .tool-controls__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-tool--social-image-safe-area-preview .tool-status {
    margin: 0;
    font-size: 0.82rem;
}

.page-tool--social-image-safe-area-preview .tool-control__value {
    color: var(--muted);
    font-weight: 500;
}

.page-tool--social-image-safe-area-preview .tool-range {
    width: 100%;
    margin: 0;
    accent-color: var(--accent);
}

.page-tool--social-image-safe-area-preview .tool-advanced {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    padding: 0 12px;
}

.page-tool--social-image-safe-area-preview .tool-advanced summary {
    padding: 10px 0;
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.page-tool--social-image-safe-area-preview .tool-advanced[open] summary {
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.page-tool--social-image-safe-area-preview .tool-insets {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 16px;
    margin-bottom: 12px;
}

.page-tool--social-image-safe-area-preview .tool-advanced .btn {
    margin-bottom: 12px;
}

.page-tool--social-image-safe-area-preview .tool-about__text {
    max-width: 82ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-tool--social-image-safe-area-preview .tool-about__text code,
.page-tool--social-image-safe-area-preview .tool-about__text strong {
    color: var(--ink-2);
}

.page-tool--social-image-safe-area-preview .tool-about__text code {
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    font-family: var(--font-mono);
}

@media (max-width: 900px) {
    .page-tool--social-image-safe-area-preview .tool-workspace {
        grid-template-columns: 1fr;
    }

    .page-tool--social-image-safe-area-preview .tool-setup__body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-tool--social-image-safe-area-preview .panel__head {
        flex-wrap: wrap;
    }

    .page-tool--social-image-safe-area-preview .tool-insets {
        grid-template-columns: 1fr;
    }

    .page-tool--social-image-safe-area-preview .tool-drop__preview {
        max-height: 6rem;
    }
}
