/**
 * Schemafy Gutenberg Sidebar — RankMath-style redesign
 * v1.6.9
 */

/* ── Reset / base ─────────────────────────────────────────────────────────── */

.sch-sidebar,
.schemafy-sidebar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background: #fff !important;
    color: #1e1e1e;
}

/* Make the WP panel wrapper neutral */
.sch-sidebar .components-panel,
.schemafy-sidebar .components-panel {
    background: #fff !important;
    border: none !important;
}

/* Remove WP default panel body padding/borders */
.sch-sidebar .components-panel__body,
.schemafy-sidebar .components-panel__body {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.sch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.sch-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.sch-header__version {
    font-size: 10px;
    color: rgba(255,255,255,.65);
    background: rgba(255,255,255,.12);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
}

/* ── Tab bar ──────────────────────────────────────────────────────────────── */

.sch-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sch-tab {
    flex: 1;
    padding: 11px 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .12s, border-color .12s;
    outline: none;
}

.sch-tab:hover {
    color: #374151;
}

.sch-tab.is-active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    font-weight: 600;
}

/* ── Tab content wrapper ──────────────────────────────────────────────────── */

.sch-tab-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 24px;
}

/* ── Section ──────────────────────────────────────────────────────────────── */

.sch-section {
    padding: 14px 16px;
}

.sch-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sch-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0 16px;
}

/* ── Label ────────────────────────────────────────────────────────────────── */

.sch-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 8px;
}

.sch-label--mb {
    margin-bottom: 8px;
}

/* ── Input overrides for WP components ───────────────────────────────────── */

.sch-sidebar .components-text-control__input,
.schemafy-sidebar .components-text-control__input,
.sch-sidebar .components-textarea-control__input,
.schemafy-sidebar .components-textarea-control__input {
    font-size: 13px !important;
    padding: 9px 12px !important;
    border: 1px solid #e2e4e7 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #1e1e1e !important;
    transition: border-color .12s, box-shadow .12s !important;
    line-height: 1.5 !important;
}

.sch-sidebar .components-text-control__input:focus,
.schemafy-sidebar .components-text-control__input:focus,
.sch-sidebar .components-textarea-control__input:focus,
.schemafy-sidebar .components-textarea-control__input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79,70,229,.12) !important;
    outline: none !important;
}

.sch-sidebar .components-textarea-control__input,
.schemafy-sidebar .components-textarea-control__input {
    resize: vertical !important;
    min-height: 70px !important;
}

.sch-sidebar .components-base-control,
.schemafy-sidebar .components-base-control {
    margin-bottom: 0 !important;
}

.sch-sidebar .components-base-control__label,
.schemafy-sidebar .components-base-control__label {
    display: none !important; /* we use .sch-label instead */
}

/* ── Google Preview card ──────────────────────────────────────────────────── */

.sch-preview {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

.sch-preview__site-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sch-preview__fav {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sch-preview--mobile .sch-preview__fav {
    width: 16px;
    height: 16px;
}

.sch-preview__site-name {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    line-height: 1.3;
}

.sch-preview__domain {
    font-size: 12px;
    font-weight: 500;
    color: #202124;
}

.sch-preview__crumb {
    font-size: 11px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sch-preview__title {
    font-size: 17px;
    line-height: 1.3;
    color: #1a0dab;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    cursor: pointer;
}

.sch-preview--mobile .sch-preview__title {
    font-size: 15px;
}

.sch-preview__desc {
    font-size: 13px;
    line-height: 1.5;
    color: #4d5156;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
    margin: 0;
}

.sch-preview--mobile .sch-preview__desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
}

/* ── Device toggle ────────────────────────────────────────────────────────── */

.sch-device-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 5px;
    padding: 2px;
    gap: 2px;
}

.sch-device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    color: #6b7280;
    transition: all .12s;
}

.sch-device-btn:hover {
    color: #374151;
    background: #e5e7eb;
}

.sch-device-btn.is-active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* ── Footer note ──────────────────────────────────────────────────────────── */

.sch-note {
    margin: 0 16px;
    padding: 6px 10px;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
    border-radius: 4px;
    line-height: 1.5;
}

/* ── Schema list ──────────────────────────────────────────────────────────── */

.sch-schema-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.sch-schema-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid #e2e4e7;
    border-radius: 5px;
    background: #fff;
    transition: border-color .12s, box-shadow .12s;
}

.sch-schema-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 1px 3px rgba(79,70,229,.07);
}

.sch-schema-row.is-active {
    border-left: 3px solid #16a34a;
}

.sch-schema-row:not(.is-active) {
    opacity: .75;
}

.sch-schema-row__icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.sch-schema-row__info {
    flex: 1;
    min-width: 0;
}

.sch-schema-row__name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sch-schema-row__type {
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
}

/* ── Active dot ───────────────────────────────────────────────────────────── */

.sch-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sch-dot--on  { background: #16a34a; }
.sch-dot--off { background: #d1d5db; }

/* ── Row action icon buttons ──────────────────────────────────────────────── */

.sch-schema-row__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.sch-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: background .1s, color .1s;
    padding: 0;
}

.sch-icon-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.sch-icon-btn--muted {
    color: #9ca3af;
}

.sch-icon-btn--danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.sch-icon-btn:disabled {
    opacity: .4;
    cursor: default;
}

/* ── Add button ───────────────────────────────────────────────────────────── */

.sch-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px dashed #a5b4fc;
    border-radius: 5px;
    cursor: pointer;
    transition: all .12s;
    gap: 5px;
    margin-top: 4px;
}

.sch-add-btn:hover {
    background: #e0e7ff;
    border-color: #818cf8;
}

.sch-add-btn--primary {
    color: #fff;
    background: #4f46e5;
    border-style: solid;
    border-color: #4338ca;
}

.sch-add-btn--primary:hover {
    background: #4338ca;
}

/* ── URL pill ─────────────────────────────────────────────────────────────── */

.sch-url-pill {
    font-size: 10px;
    color: #4f46e5;
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 10px;
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 8px;
    border: 1px solid #c7d2fe;
}

/* ── Refresh button ───────────────────────────────────────────────────────── */

.sch-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    color: #9ca3af;
    transition: color .1s, background .1s;
    padding: 0;
    flex-shrink: 0;
}

.sch-refresh-btn:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.sch-empty {
    text-align: center;
    padding: 24px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px dashed #e2e4e7;
    margin-bottom: 8px;
}

.sch-empty__icon {
    font-size: 28px;
    opacity: .4;
    margin-bottom: 6px;
    line-height: 1;
}

.sch-empty p {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Spinner wrap ─────────────────────────────────────────────────────────── */

.sch-spinner-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* ── Toast notification ───────────────────────────────────────────────────── */

.sch-toast {
    margin: 10px 16px 0;
    padding: 8px 12px;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    animation: sch-fadein .2s ease;
}

/* ── Quick links ──────────────────────────────────────────────────────────── */

.sch-quicklinks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sch-quicklink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .1s;
}

.sch-quicklink:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

.sch-quicklink__icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* ── Inline editor picker (replaces Modal) ────────────────────────────────── */

.sch-picker {
    margin-top: 4px;
    margin-bottom: 4px;
    border: 1px solid #c7d2fe;
    border-radius: 7px;
    background: #f5f7ff;
    padding: 12px;
    animation: sch-fadein .15s ease;
}

.sch-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sch-picker__title {
    font-size: 12px;
    font-weight: 700;
    color: #3730a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    margin-right: 6px;
}

.sch-picker__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    flex-shrink: 0;
    padding: 0;
    transition: background .1s, color .1s;
}

.sch-picker__close:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.sch-picker__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 6px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e7ff;
    font-size: 13px;
}

.sch-picker__hint {
    font-size: 11px;
    color: #6b7280;
    margin: 0 0 8px;
}

.sch-picker__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 8px;
}

.sch-picker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    padding: 12px 8px;
    border: 1.5px solid #e0e7ff;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}

.sch-picker-card:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.sch-picker-card__icon {
    font-size: 22px;
    line-height: 1;
}

.sch-picker-card strong {
    font-size: 12px;
    color: #111827;
}

.sch-picker-card__desc {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.4;
}

.sch-picker__url {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 10px;
    color: #4f46e5;
    word-break: break-all;
    line-height: 1.5;
    border-top: 1px solid #e0e7ff;
    padding-top: 8px;
    margin-top: 4px;
}

/* Active state for edit icon button when picker is open */
.sch-icon-btn--active {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}

/* Expanded schema row: slightly highlighted */
.sch-schema-row.is-expanded {
    border-color: #a5b4fc;
    background: #f5f7ff;
}

/* ── Animations ───────────────────────────────────────────────────────────── */

@keyframes sch-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */

.sch-tab-content::-webkit-scrollbar       { width: 5px; }
.sch-tab-content::-webkit-scrollbar-track { background: #f9fafb; }
.sch-tab-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.sch-tab-content::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── WP component cleanup inside sidebar ─────────────────────────────────── */

/* Remove outer margin/padding from WP BaseControl */
.sch-sidebar .components-base-control__field,
.schemafy-sidebar .components-base-control__field {
    margin-bottom: 0 !important;
}

/* Fix WP Spinner size */
.sch-sidebar .components-spinner,
.schemafy-sidebar .components-spinner {
    margin: 0 !important;
}

/* Tab panel passthrough — we use our own tab system */
.sch-sidebar .components-tab-panel__tabs,
.schemafy-sidebar .components-tab-panel__tabs {
    display: none !important;
}

/* ── CharPill ─────────────────────────────────────────────────────────────── */

.sch-charpill {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
}

.sch-charpill__bar {
    flex: 1;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.sch-charpill__fill {
    height: 100%;
    border-radius: 2px;
    transition: width .25s, background .25s;
}

.sch-charpill__label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Keyword badges ───────────────────────────────────────────────────────── */

.sch-kw-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.sch-kw-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9px;
    white-space: nowrap;
}

.sch-kw-badge--ok {
    color: #15803d;
    background: #dcfce7;
}

.sch-kw-badge--miss {
    color: #92400e;
    background: #fef3c7;
}

/* ── Social platform subtabs ─────────────────────────────────────────────── */

.sch-social-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    padding: 0 12px;
    gap: 4px;
}

.sch-social-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .12s, border-color .12s;
    outline: none;
}

.sch-social-tab:hover {
    color: #374151;
}

.sch-social-tab.is-active {
    color: #1e1e1e;
    border-bottom-color: #1e1e1e;
    font-weight: 600;
}

.sch-social-tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    flex-shrink: 0;
}

.sch-social-tab__icon--fb {
    background: #1877f2;
    color: #fff;
}

.sch-social-tab__icon--tw {
    background: #000;
    color: #fff;
    font-style: normal;
    font-size: 11px;
}

/* ── Facebook preview ────────────────────────────────────────────────────── */

.sch-fb-preview {
    border: 1px solid #dde1e7;
    border-radius: 6px;
    overflow: hidden;
    font-family: Helvetica, Arial, sans-serif;
    background: #fff;
}

.sch-fb-preview__img {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background: #f0f2f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sch-fb-preview__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sch-fb-preview__img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e4e6eb;
}

.sch-fb-preview__body {
    padding: 10px 12px;
    border-top: 1px solid #dde1e7;
    background: #f0f2f5;
}

.sch-fb-preview__domain {
    font-size: 10px;
    color: #606770;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 2px;
}

.sch-fb-preview__title {
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.3;
    margin-bottom: 3px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sch-fb-preview__desc {
    font-size: 12px;
    color: #606770;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Twitter / X preview ─────────────────────────────────────────────────── */

.sch-tw-preview {
    border: 1px solid #cfd9de;
    border-radius: 14px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
}

.sch-tw-preview__img {
    width: 100%;
    aspect-ratio: 2 / 1;
    background: #eff3f4;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sch-tw-preview__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sch-tw-preview__img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.sch-tw-preview__caption {
    padding: 10px 12px;
}

.sch-tw-preview__title {
    font-size: 13px;
    font-weight: 600;
    color: #0f1419;
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sch-tw-preview__desc {
    font-size: 12px;
    color: #536471;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sch-tw-preview__domain {
    font-size: 11px;
    color: #536471;
}

/* Summary card variant — side by side */
.sch-tw-preview--summary {
    display: flex;
    border-radius: 14px;
    overflow: hidden;
}

.sch-tw-preview--summary .sch-tw-preview__thumb {
    width: 90px;
    flex-shrink: 0;
    background: #eff3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #cfd9de;
    overflow: hidden;
}

.sch-tw-preview--summary .sch-tw-preview__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sch-tw-preview--summary .sch-tw-preview__body {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
}

/* SelectControl inside social tab — keep compact */
.sch-section-header .components-select-control {
    margin: 0 !important;
}

.sch-section-header .components-select-control select {
    font-size: 11px !important;
    padding: 4px 24px 4px 8px !important;
    height: auto !important;
    border-color: #e2e4e7 !important;
    border-radius: 4px !important;
}

/* ── Image field ─────────────────────────────────────────────────────────── */

.sch-img-field {
    margin-bottom: 4px;
}

.sch-img-field__pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: border-color .12s, background .12s;
}

.sch-img-field__pick:hover {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4f46e5;
}

.sch-img-field__preview {
    position: relative;
    display: inline-block;
    width: 100%;
}

.sch-img-field__preview img {
    width: 100%;
    max-height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #e2e4e7;
    display: block;
}

.sch-img-field__remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    padding: 0;
    transition: background .12s;
}

.sch-img-field__remove:hover {
    background: rgba(220,38,38,.8);
}

/* ── Dirty / unsaved badge ───────────────────────────────────────────────── */

.sch-dirty-badge {
    font-size: 10px;
    font-weight: 600;
    color: #fef3c7;
    background: rgba(245,158,11,.25);
    border: 1px solid rgba(245,158,11,.4);
    padding: 2px 7px;
    border-radius: 9px;
    white-space: nowrap;
    animation: sch-fadein .2s ease;
}

/* ── URL row (pill + test link) ──────────────────────────────────────────── */

.sch-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.sch-url-row .sch-url-pill {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sch-test-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 9px;
    padding: 3px 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
}

.sch-test-link:hover {
    background: #e0e7ff;
    border-color: #818cf8;
    color: #3730a3;
    text-decoration: none;
}

/* ── JSON viewer ─────────────────────────────────────────────────────────── */

.sch-json-viewer {
    margin: 4px 0;
    border: 1px solid #e0e7ff;
    border-radius: 5px;
    background: #f5f7ff;
    overflow: hidden;
    animation: sch-fadein .15s ease;
}

.sch-json-viewer__pre {
    margin: 0;
    padding: 10px 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 10.5px;
    line-height: 1.6;
    color: #3730a3;
    overflow-x: auto;
    white-space: pre;
    max-height: 260px;
    overflow-y: auto;
}

/* ── Auto-detect section ─────────────────────────────────────────────────── */

.sch-detect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all .12s;
}

.sch-detect-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.sch-detect-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    color: #6b7280;
}

.sch-detect-result {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sch-detect-result__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sch-detect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sch-detect-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
    text-align: left;
}

.sch-detect-chip:hover {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #3730a3;
}

.sch-detect-chip__score {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 2px;
}

.sch-detect-chip:hover .sch-detect-chip__score {
    background: #e0e7ff;
    color: #4f46e5;
}

/* ── Word count badge ────────────────────────────────────────────────────── */

.sch-word-count {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9px;
    margin-bottom: 2px;
}

.sch-word-count.is-red   { color: #dc2626; background: #fee2e2; }
.sch-word-count.is-amber { color: #d97706; background: #fef3c7; }
.sch-word-count.is-blue  { color: #2563eb; background: #dbeafe; }
.sch-word-count.is-green { color: #16a34a; background: #dcfce7; }
