.wpstl-imgsvg {
    --wpstl-accent: var(--awb-color5, #198fd9);
    --wpstl-accent-hover: #147ab9;
    --wpstl-border: #d7dee9;
    --wpstl-border-soft: #e9edf3;
    --wpstl-muted: #64748b;
    --wpstl-bg-soft: #f8fafc;
    --wpstl-panel: #ffffff;
    --wpstl-text: #172033;
    --wpstl-success: #166534;
    --wpstl-success-bg: #f0fdf4;
    --wpstl-error: #991b1b;
    --wpstl-error-bg: #fef2f2;
    --wpstl-info: #1e40af;
    --wpstl-info-bg: #eff6ff;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    color: var(--wpstl-text);
}
.wpstl-imgsvg * { box-sizing: border-box; }
.wpstl-imgsvg__header { margin-bottom: 14px; }
.wpstl-imgsvg__title { margin: 0 0 5px; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; }
.wpstl-imgsvg__intro { margin: 0; color: var(--wpstl-muted); max-width: 820px; line-height: 1.55; }

.wpstl-imgsvg__upload {
    min-height: 150px; border: 2px dashed var(--wpstl-border); border-radius: 12px;
    padding: 24px; background: var(--wpstl-bg-soft); display: flex; align-items: center;
    justify-content: center; gap: 14px; text-align: left; cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.wpstl-imgsvg__upload:hover,.wpstl-imgsvg__upload.is-dragging,.wpstl-imgsvg__upload:focus {
    border-color: var(--wpstl-accent); background: #f4f8ff; outline: none;
}
.wpstl-imgsvg.has-file .wpstl-imgsvg__upload { display: none; }
.wpstl-imgsvg__upload-icon {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid;
    place-items: center; background: #fff; border: 1px solid var(--wpstl-border); font-size: 22px;
}
.wpstl-imgsvg__upload-copy strong,.wpstl-imgsvg__upload-copy span { display: block; }
.wpstl-imgsvg__upload-copy span { color: var(--wpstl-muted); margin-top: 2px; }
.wpstl-imgsvg__file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.wpstl-imgsvg__notice { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.wpstl-imgsvg__notice--info { color: var(--wpstl-info); background: var(--wpstl-info-bg); }
.wpstl-imgsvg__notice--success { color: var(--wpstl-success); background: var(--wpstl-success-bg); }
.wpstl-imgsvg__notice--error { color: var(--wpstl-error); background: var(--wpstl-error-bg); }

.wpstl-imgsvg__workspace { margin-top: 12px; }
.wpstl-imgsvg__main {
    display: grid; grid-template-columns: minmax(330px,385px) minmax(0,1fr);
    height: clamp(600px, calc(100vh - 190px), 790px); min-height: 600px;
    border: 1px solid var(--wpstl-border); border-radius: 12px; overflow: hidden;
    background: var(--wpstl-panel); box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.wpstl-imgsvg__controls {
    min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--wpstl-border);
    background: #fff; overflow: hidden;
}
.wpstl-imgsvg__controls-inner {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 14px; scrollbar-width: thin;
}
.wpstl-imgsvg__controls-footer {
    flex: 0 0 auto;
    display: block;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--wpstl-border);
    background: #fff;
}

.wpstl-imgsvg__auto-note {
    margin-bottom: 8px;
    color: var(--wpstl-muted);
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

.wpstl-imgsvg__footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.wpstl-imgsvg__controls-footer .wpstl-imgsvg__export {
    margin: 0;
}

.wpstl-imgsvg__footer-actions .wpstl-imgsvg__button,
.wpstl-imgsvg__footer-actions .wpstl-imgsvg__export,
.wpstl-imgsvg__footer-actions .wpstl-imgsvg__export .wpstl-imgsvg__button {
    width: 100%;
}
.wpstl-imgsvg__viewport { min-width: 0; min-height: 0; padding: 14px; background: #f3f6fa; display: flex; }

.wpstl-imgsvg__source-card {
    margin-bottom: 14px; border: 1px solid var(--wpstl-border); border-radius: 9px;
    overflow: hidden; background: #fff;
}
.wpstl-imgsvg__source-head {
    min-height: 40px; padding: 8px 10px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--wpstl-border-soft);
}
.wpstl-imgsvg__source-head > div { min-width: 0; }
.wpstl-imgsvg__source-head strong { display: block; font-size: 13px; }
.wpstl-imgsvg__source-head span {
    display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-top: 1px; color: var(--wpstl-muted); font-size: 11px;
}
.wpstl-imgsvg__source-preview { height: 130px; min-height: 130px !important; padding: 8px !important; }
.wpstl-imgsvg__source-preview canvas { max-width: 100%; max-height: 114px; }
.wpstl-imgsvg__text-button,.wpstl-imgsvg__link-button {
    appearance: none; border: 0; background: transparent; color: var(--wpstl-accent);
    cursor: pointer; padding: 4px; font-weight: 700; font-size: 12px;
}
.wpstl-imgsvg__text-button:hover,.wpstl-imgsvg__link-button:hover { color: var(--wpstl-accent-hover); }

.wpstl-imgsvg__control-section { padding: 0 1px 14px; }
.wpstl-imgsvg__section-title { margin-bottom: 9px; font-size: 13px; font-weight: 800; color: #334155; }
.wpstl-imgsvg__compact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px;
}
.wpstl-imgsvg__field { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.wpstl-imgsvg__field > span { font-size: 11px; font-weight: 700; color: #475569; }
.wpstl-imgsvg__field select,.wpstl-imgsvg .wpstl-input {
    width: 100%; min-width: 0; min-height: 34px; padding: 5px 8px; border: 1px solid var(--wpstl-border);
    border-radius: 6px; background: #fff; font-size: 12px;
}
.wpstl-imgsvg__toggle-stack { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding-top: 15px; }
.wpstl-imgsvg__check-field {
    display: flex; flex-direction: row; align-items: flex-start; gap: 7px; margin: 0;
    font-size: 12px; line-height: 1.25; font-weight: 600; cursor: pointer;
}
.wpstl-imgsvg__check-field input { margin: 1px 0 0; }

.wpstl-imgsvg__range { display: block; margin: 10px 0 0; }
.wpstl-imgsvg__range-label {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px;
    font-size: 12px; font-weight: 700; color: #475569;
}
.wpstl-imgsvg__range output { min-width: 34px; text-align: right; color: var(--wpstl-muted); font-weight: 600; font-size: 11px; }
.wpstl-imgsvg__range input[type="range"] { width: 100%; height: 20px; margin: 0; accent-color: var(--wpstl-accent); }

.wpstl-imgsvg__advanced,.wpstl-imgsvg__palette-section {
    margin: 0 -14px; border: 0; border-top: 1px solid var(--wpstl-border-soft);
    border-radius: 0; background: #fff;
}
.wpstl-imgsvg__advanced > summary,.wpstl-imgsvg__palette-section > summary {
    padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 800;
    color: #334155; user-select: none;
}
.wpstl-imgsvg__advanced-grid,.wpstl-imgsvg__palette-body { padding: 0 14px 13px; }
.wpstl-imgsvg__advanced-toggles { display: grid; gap: 8px; margin-top: 10px; }
.wpstl-imgsvg__palette-help { margin: 0 0 7px; color: var(--wpstl-muted); font-size: 11px; line-height: 1.4; }
.wpstl-imgsvg__palette { border-top: 1px solid var(--wpstl-border-soft); }
.wpstl-imgsvg__palette-row {
    min-height: 43px; display: grid; grid-template-columns: minmax(75px,.85fr) minmax(104px,1fr) 52px;
    gap: 7px; align-items: center; border-bottom: 1px solid var(--wpstl-border-soft); font-size: 11px;
}
.wpstl-imgsvg__visibility,.wpstl-imgsvg__color-control { display: flex; align-items: center; min-width: 0; gap: 5px; }
.wpstl-imgsvg__visibility span { white-space: nowrap; }
.wpstl-imgsvg__color-control input[type="color"] {
    width: 28px; height: 26px; flex: 0 0 28px; padding: 0; border: 1px solid var(--wpstl-border);
    background: #fff; border-radius: 5px;
}
.wpstl-imgsvg__color-control code {
    max-width: 68px; overflow: hidden; text-overflow: ellipsis; color: var(--wpstl-muted); font-size: 10px;
}
.wpstl-imgsvg__path-count { color: var(--wpstl-muted); font-size: 10px; text-align: right; }
.wpstl-imgsvg__palette-row .wpstl-imgsvg__link-button {
    grid-column: 1 / -1; justify-self: start; margin-top: -5px; padding: 0 0 6px 23px; font-size: 10px;
}
.wpstl-imgsvg__full-button { width: 100%; margin-top: 10px; }

.wpstl-imgsvg__button {
    min-height: 38px; border: 1px solid var(--wpstl-accent); border-radius: 7px; padding: 7px 12px;
    cursor: pointer; background: var(--wpstl-accent); color: #fff; font-size: 12px; font-weight: 800;
    transition: background .15s ease,border-color .15s ease;
}
.wpstl-imgsvg__button:hover { background: var(--wpstl-accent-hover); border-color: var(--wpstl-accent-hover); }
.wpstl-imgsvg__button--secondary { background: #fff; color: #334155; border-color: var(--wpstl-border); }
.wpstl-imgsvg__button--secondary:hover { background: var(--wpstl-bg-soft); color: #172033; border-color: #cbd5e1; }
.wpstl-imgsvg__button:disabled { opacity: .55; cursor: wait; }

.wpstl-imgsvg__preview-card {
    flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border: 1px solid var(--wpstl-border); border-radius: 9px; overflow: hidden; background: #fff;
}
.wpstl-imgsvg__preview-head {
    flex: 0 0 auto; min-height: 48px; padding: 9px 12px; display: flex; justify-content: space-between;
    align-items: center; gap: 12px; border-bottom: 1px solid var(--wpstl-border);
}
.wpstl-imgsvg__preview-head > div { min-width: 0; }
.wpstl-imgsvg__preview-head strong { display: block; font-size: 14px; }
.wpstl-imgsvg__preview-sub { display: block; margin-top: 1px; color: var(--wpstl-muted); font-size: 10px; }
.wpstl-imgsvg__vector-meta { flex: 0 0 auto; color: var(--wpstl-muted); font-size: 11px; }

.wpstl-imgsvg__checker {
    display: flex; align-items: center; justify-content: center; overflow: hidden; background-color: #fff;
    background-image: linear-gradient(45deg,#edf1f5 25%,transparent 25%),
      linear-gradient(-45deg,#edf1f5 25%,transparent 25%),
      linear-gradient(45deg,transparent 75%,#edf1f5 75%),
      linear-gradient(-45deg,transparent 75%,#edf1f5 75%);
    background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0;
}
.wpstl-imgsvg__vector-preview { flex: 1 1 auto; min-height: 0; padding: 22px; }
.wpstl-imgsvg__vector-preview svg {
    display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
}
.wpstl-imgsvg__preview-footer {
    flex: 0 0 auto; min-height: 35px; padding: 8px 12px; border-top: 1px solid var(--wpstl-border);
    color: var(--wpstl-muted); font-size: 10px;
}

@media (max-width: 980px) {
    .wpstl-imgsvg__main { grid-template-columns: minmax(300px,350px) minmax(0,1fr); }
}
@media (max-width: 800px) {
    .wpstl-imgsvg__main { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
    .wpstl-imgsvg__controls { border-right: 0; border-bottom: 1px solid var(--wpstl-border); overflow: visible; }
    .wpstl-imgsvg__controls-inner { max-height: none; overflow: visible; }
    .wpstl-imgsvg__viewport { min-height: 460px; }
    .wpstl-imgsvg__preview-card { min-height: 440px; }
}
@media (max-width: 520px) {
    .wpstl-imgsvg__compact-grid { grid-template-columns: 1fr; }
    .wpstl-imgsvg__toggle-stack { padding-top: 0; }
    .wpstl-imgsvg__upload { min-height: 130px; text-align: center; flex-direction: column; }
    .wpstl-imgsvg__source-preview { height: 110px; min-height: 110px !important; }
    .wpstl-imgsvg__viewport { padding: 8px; min-height: 390px; }
    .wpstl-imgsvg__preview-card { min-height: 370px; }
}
