/*
 * Contentosapp Studio Admin — New Production/Pipeline styles.
 * Extracted from costudio-admin.css for tab-specific loading.
 */

/* ── Nova Produção: shell + cards (ref. mockups/costudio-nova-producao.html) ─ */

.fos-np-section {
    margin: 12px 0 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ── Nova Produção: layout container ───────────────────────────────────── */
.fos-np-layout {
    margin-top: 12px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 961px) {
    .fos-np-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 12px;
        align-items: start;
    }
}

@media (max-width: 960px) {

    .fos-summary-rail {
        position: static !important;
        order: 10;
        margin-top: 12px;
    }

    .fos-np-main-col {
        order: 5;
    }

    .fos-refs-tabs {
        display: grid !important;
    }
}

.fos-np-main-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* ── Section Cards (Numbered) ────────────────────────────────────────── */
.fos-np-section-card {
    background: #fff !important;
    border: 1px solid var(--fos-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--fos-shadow) !important;
    overflow: hidden;
    margin-bottom: 0 !important;
    /* Gap handled by parent */
}

#fos-refs-card {
    position: relative;
    z-index: 3;
    overflow: visible;
}

.fos-np-section-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--fos-border);
    background: #fff;
    border-radius: 12px 12px 0px 0px;
}

.fos-np-section-card__num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--fos-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.fos-np-section-card__title-wrap {
    flex: 1;
}

.fos-np-section-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fos-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fos-np-section-card__subtitle {
    font-size: 12px;
    color: var(--fos-text-dim);
    margin: 2px 0 0;
}

.fos-np-section-card__body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Type Chips (Visual) ─────────────────────────────────────────────── */
.fos-np-type-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.fos-np-type-chip {
    display: block;
    cursor: pointer;
    position: relative;
}

.fos-np-type-chip input {
    position: absolute;
    opacity: 0;
}

.fos-np-type-chip__box {
    padding: 14px 10px;
    border-radius: 10px;
    background: var(--fos-bg-soft);
    border: 1px solid var(--fos-border);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.fos-np-type-chip__icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.fos-np-type-chip__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--fos-text);
}

.fos-np-type-chip__desc {
    display: block;
    font-size: 10px;
    color: var(--fos-text-dim);
    line-height: 1.3;
}

.fos-np-type-chip input:checked+.fos-np-type-chip__box {
    background: #fff;
    border: 2px solid var(--fos-primary);
    box-shadow: 0 0 0 3px var(--fos-primary-faint);
}

.fos-np-type-chip input:checked+.fos-np-type-chip__box .fos-np-type-chip__label {
    color: var(--fos-primary);
}

.fos-np-type-chip__check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--fos-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fos-np-type-chip input:checked~.fos-np-type-chip__check {
    opacity: 1;
    transform: scale(1);
}

/* ── Context Panels (Inside Article Type Section) ────────────────────── */
.fos-type-panel {
    display: none;
    padding: 16px;
    background: var(--fos-primary-faint);
    border: 1px solid var(--fos-primary-border);
    border-radius: 10px;
}

.fos-type-panel--active {
    display: block;
    animation: fos-tab-fade-in 0.2s ease;
}

/* ── Segmented Control (Publish/Exec) ────────────────────────────────── */
.fos-np-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--fos-bg-soft);
    border: 1px solid var(--fos-border);
    border-radius: 10px;
    width: fit-content;
}

.fos-np-segmented__btn {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--fos-text-sub);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fos-np-segmented__btn.is-active {
    background: #fff;
    color: var(--fos-primary);
    border-color: var(--fos-primary-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Summary Rail (Sticky) ───────────────────────────────────────────── */
.fos-summary-rail {
    position: sticky;
    top: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fos-summary-card {
    background: #fff;
    border: 1px solid var(--fos-border);
    border-radius: 14px;
    box-shadow: var(--fos-shadow-lg);
    overflow: hidden;
}

.fos-summary-card__header {
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(108, 71, 255, 0.1) 0%, rgba(108, 71, 255, 0.02) 100%);
    border-bottom: 1px solid var(--fos-border);
}

.fos-summary-card__eyebrow {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fos-text-dim);
}

.fos-summary-card__title {
    font-size: 13px;
    font-weight: 400;
    color: var(--fos-text-dim);
    line-height: 1.45;
    font-style: italic;
    margin-top: 2px;
}

.fos-summary-card__body {
    padding: 11px 18px;
}

.fos-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--fos-border);
}

.fos-summary-row:last-child {
    border-bottom: none;
}

.fos-summary-row__key {
    font-size: 12px;
    color: var(--fos-text-dim);
}

.fos-summary-row__val {
    font-size: 12px;
    font-weight: 600;
    color: var(--fos-text);
    text-align: right;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fos-summary-language {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.fos-summary-language img {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.fos-summary-card__footer {
    padding: 14px 18px;
    background: var(--fos-bg-soft);
    border-top: 1px solid var(--fos-border);
}

.fos-summary-progress-bar {
    height: 6px;
    background: var(--fos-border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.fos-summary-progress-fill {
    height: 100%;
    background: var(--fos-primary);
    width: 0%;
    transition: width 0.4s ease;
}

/* ── Pipeline Preview in Rail ────────────────────────────────────────── */
.fos-pipeline-preview {
    background: #fff;
    border: 1px solid var(--fos-border);
    border-radius: 12px;
    box-shadow: var(--fos-shadow);
    overflow: hidden;
}

.fos-pipeline-preview__header {
    padding: 10px 16px;
    background: var(--fos-bg-soft);
    border-bottom: 1px solid var(--fos-border);
}

.fos-pipeline-preview__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fos-text-dim);
}

.fos-pipeline-preview__body {
    padding: 8px 16px;
}

.fos-pipeline-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    transition: opacity 0.2s;
}

.fos-pipeline-step--skipped {
    opacity: 0.35;
}

.fos-pipeline-step__icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--fos-primary-faint);
    border: 1px solid var(--fos-primary-border);
    display: grid;
    place-items: center;
    font-size: 11px;
    flex-shrink: 0;
}

.fos-pipeline-step--skipped .fos-pipeline-step__icon {
    background: var(--fos-bg-soft);
    border-color: var(--fos-border);
}

.fos-pipeline-step__name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--fos-text);
    flex: 1;
}

.fos-pipeline-step--skipped .fos-pipeline-step__name {
    text-decoration: line-through;
    color: var(--fos-text-dim);
}

.fos-pipeline-step__num {
    font-size: 10px;
    font-weight: 700;
    color: var(--fos-text-dim);
}

/* ── Footer Bar ──────────────────────────────────────────────────────── */
.fos-np-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #fff;
    border: 1px solid var(--fos-border);
    border-radius: 14px;
    box-shadow: var(--fos-shadow-md);
}

.fos-np-section-card--links {
    opacity: 1;
}

.fos-np-section-card__header {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--fos-border, #e5e7eb);
}

.fos-np-section-card__header--with-badge {
    align-items: center;
}

.fos-np-section-card__header-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.fos-np-section-card__header-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--fos-primary-light, #eae6ff);
    border: 1px solid rgba(108, 71, 255, 0.25);
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
    line-height: 1;
}

.fos-np-section-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text, #111827);
    letter-spacing: -0.1px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fos-np-section-card__desc {
    font-size: 11px;
    color: var(--fos-text-dim, #6b7280);
    margin: 4px 0 0;
    line-height: 1.45;
}

.fos-np-badge-optional {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--fos-bg-soft, #f8f8f9);
    color: var(--fos-text-dim, #6b7280);
    border: 1px solid var(--fos-border, #e5e7eb);
    flex-shrink: 0;
}

.cts-input.fos-np-date-input {
    width: auto;
    font-size: 12px;
    font-weight: 400;
    padding: 9px 12px;
}

.fos-np-section-card__body {
    padding: 20px;
}

/**
 * Campos do formulário — mesmo padrão do Content Hub (.fos-filter-bar):
 * fundo var(--fos-bg-soft), borda #d1d5db, texto 12px, focus → fundo branco.
 */
/* M14: Labels de formulário — mínimo 13px para legibilidade (era 12px) */
.fos-np-section-card .cts-field>label,
.fos-np-section-card label.cts-field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fos-text);
    line-height: 1.35;
}

.fos-np-section-card .cts-field input.cts-input[type="text"],
.fos-np-section-card .cts-field input.cts-input[type="search"],
.fos-np-section-card .cts-field input.cts-input[type="email"],
.fos-np-section-card .cts-field textarea.cts-input,
.fos-np-section-card input.cts-input.fos-np-links-input {
    padding: 8px 12px;
    border-radius: 7px;
    border: 1px solid var(--fos-border-input, #d1d5db);
    background: var(--fos-bg-soft, #f8f8f9);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--fos-text, #111827);
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
    min-height: 0;
    width: auto;
}

.fos-np-section-card .cts-field input.cts-input::placeholder,
.fos-np-section-card .cts-field textarea.cts-input::placeholder,
.fos-np-section-card input.cts-input.fos-np-links-input::placeholder {
    color: var(--fos-text-dim, #6b7280);
    font-weight: 400;
}

/* M12 aplicado: usa token centralizado --fos-focus-ring nos inputs do form */
.fos-np-section-card .cts-field input.cts-input:focus,
.fos-np-section-card .cts-field textarea.cts-input:focus,
.fos-np-section-card input.cts-input.fos-np-links-input:focus {
    border-color: var(--fos-primary, #6C47FF);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.18);
    outline: none;
}

.fos-field-heading {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.fos-field-heading .cts-field__label {
    margin-bottom: 0;
}

.fos-np-section-card .fos-ai-input-wrap {
    width: 100%;
}

.fos-np-section-card .fos-ai-input-wrap input.cts-input[type="text"] {
    width: 100%;
}

.fos-np-section-card .fos-ai-input-wrap--adornment {
    position: relative;
}

.fos-np-section-card .fos-ai-input-wrap--adornment input.cts-input[type="text"] {
    padding-right: 38px;
}

.fos-ai-input-suggest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid rgba(108, 71, 255, 0.22);
    border-radius: 7px;
    background: rgba(108, 71, 255, 0.06);
    color: var(--fos-primary, #6C47FF);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

.fos-ai-input-suggest .dashicons {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    font-size: 14px;
    line-height: 14px;
}

.fos-ai-input-suggest:hover:not(:disabled),
.fos-ai-input-suggest:focus:not(:disabled) {
    border-color: rgba(108, 71, 255, 0.42);
    background: rgba(108, 71, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.08);
    outline: none;
}

.fos-ai-input-suggest:disabled {
    cursor: default;
    opacity: 0.58;
    box-shadow: none;
}

.fos-ai-input-suggest.is-loading {
    min-width: 104px;
}

.fos-ai-input-suggest.is-loading .dashicons {
    display: none;
}

.fos-ai-input-suggest.is-loading::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border: 2px solid rgba(108, 71, 255, 0.22);
    border-top-color: var(--fos-primary, #6C47FF);
    border-radius: 50%;
    animation: fos-ai-input-spin 650ms linear infinite;
}

/* ── Adornment variant (icon inside input field, right-aligned) ── */

.fos-ai-input-suggest--adornment {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    min-height: unset;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    opacity: 0.45;
}

.fos-ai-input-suggest--adornment svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.fos-ai-input-suggest--adornment:hover:not(:disabled),
.fos-ai-input-suggest--adornment:focus:not(:disabled) {
    border: none;
    background: rgba(108, 71, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.08);
    opacity: 1;
}

.fos-ai-input-suggest--adornment:disabled {
    opacity: 0.22;
    box-shadow: none;
}

.fos-ai-input-suggest--adornment.is-loading {
    min-width: unset;
    opacity: 1;
}

.fos-ai-input-suggest--adornment.is-loading svg {
    display: none;
}

.fos-ai-input-suggest--adornment.is-loading::before {
    margin-right: 0;
}

.fos-ai-field-status {
    display: none;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.4;
}

.fos-ai-field-status--error {
    color: #b91c1c;
}

.fos-ai-field-status--ok {
    color: var(--fos-success, #059669);
}

@keyframes fos-ai-input-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fos-ai-input-suggest.is-loading::before {
        animation: none;
    }
}

@media (max-width: 560px) {
    .fos-field-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

.fos-np-section-card .cts-field select.cts-input,
.fos-np-section-card select.cts-input {
    width: 100%;
    max-width: none;
    padding: 8px 12px;
    border-radius: 7px;
    border: 1px solid var(--fos-border-input, #d1d5db);
    background-color: var(--fos-bg-soft, #f8f8f9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--fos-text-sub, #4b5563);
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
    min-height: 0;
    height: auto;
}

.fos-np-section-card .cts-field select.cts-input:focus,
.fos-np-section-card select.cts-input:focus {
    border-color: var(--fos-primary, #6C47FF);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.18);
    outline: none;
}

.fos-np-section-card .cts-field select.cts-input:disabled,
.fos-np-section-card select.cts-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fos-np-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--fos-border);
    background: var(--fos-bg-soft, #f8f8f9);
}

.fos-np-footer-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 11px;
    color: var(--fos-text-dim);
    flex: 1 1 200px;
    line-height: 1.45;
}

.fos-np-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fos-np-btn-cancel.cts-btn--ghost {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    border-color: var(--fos-border-input, #d1d5db);
    color: var(--fos-text-sub);
}

.fos-np-btn-cancel.cts-btn--ghost:hover,
.fos-np-btn-cancel.cts-btn--ghost:focus {
    color: var(--fos-text);
    border-color: #c4c4cc;
    background: var(--fos-bg-soft);
    box-shadow: none;
}

.fos-np-field-row {
    margin-bottom: 14px;
}

.fos-np-field-row:last-child {
    margin-bottom: 0;
}

.fos-np-field-row--full {
    margin-bottom: 14px;
}

.fos-field-hint {
    margin: 0;
    font-size: 11px;
    color: var(--fos-text-dim);
    line-height: 1.45;
}

.fos-np-textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

/* ── Nova Produção: grid de campos ─────────────────────────────────────────── */

.fos-form-row {
    display: grid;
    gap: 14px;
}

.fos-form-row--2 {
    grid-template-columns: 1fr 1fr;
}

.fos-form-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.fos-keyword-language-row {
    align-items: start;
}

.fos-content-language-select {
    position: relative;
}

.fos-content-language-select > img {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 12px;
    width: 24px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    pointer-events: none;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.fos-np-section-card .fos-content-language-select select.cts-input {
    padding-left: 46px;
}

.fos-required {
    color: var(--fos-danger);
}

/* ── Radio group (article type) — grid, sem ícones coloridos ─────────────────── */

.fos-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fos-radio-group.fos-np-article-types {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.fos-radio-option {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.fos-np-article-types .fos-radio-option {
    flex: unset;
    min-width: 0;
}

.fos-radio-option input[type="radio"] {
    display: none;
}

.fos-radio-box {
    border: 1px solid var(--fos-border);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    background: var(--fos-bg-soft, #f8f8f9);
}

.fos-radio-box__name,
.fos-radio-box strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fos-text-sub);
    margin-bottom: 3px;
    transition: color 0.15s;
}

.fos-radio-box__desc,
.fos-radio-box small {
    display: block;
    color: var(--fos-text-dim);
    font-size: 10px;
    line-height: 1.3;
}

/* Compacto igual ao mock / Content Hub */
.fos-np-card .fos-radio-box__name,
.fos-np-card .fos-radio-box strong {
    font-size: 12px;
}

.fos-radio-option input:checked+.fos-radio-box {
    border-color: var(--fos-primary);
    background: var(--fos-primary-light, #eae6ff);
}

.fos-radio-option input:checked+.fos-radio-box .fos-radio-box__name,
.fos-radio-option input:checked+.fos-radio-box strong {
    color: var(--fos-primary);
}

.fos-radio-option input:checked+.fos-radio-box .fos-radio-box__desc,
.fos-radio-option input:checked+.fos-radio-box small {
    color: rgba(108, 71, 255, 0.72);
}

.fos-radio-option:hover .fos-radio-box {
    border-color: rgba(108, 71, 255, 0.35);
    background: #fff;
}

@media (max-width: 1100px) {
    .fos-radio-group.fos-np-article-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .fos-np-links-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .fos-np-links-input {
        flex: none !important;
        width: 100% !important;
        height: 40px !important;
        /* Força a altura correta */
        min-height: 40px !important;
    }

    .fos-np-links-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .fos-np-links-actions .cts-btn {
        flex: 1;
        justify-content: center;
        height: 40px;
    }
}

/* ── Nova Produção: links internos (card claro) ───────────────────────────── */

.fos-np-links-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.fos-np-links-input {
    flex: 1 1 200px;
    min-width: 0;
}

.fos-np-links-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.fos-np-btn-search-wp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    background: rgba(108, 71, 255, 0.08);
    color: var(--fos-primary);
    border: 1px solid rgba(108, 71, 255, 0.25);
}

.fos-np-btn-search-wp:hover:not(:disabled) {
    border: 1px solid rgba(108, 71, 255, 0.35);
    color: var(--fos-primary-dark);
    background: var(--fos-primary-light);
}

/* Loading state */
.fos-search-btn-icon--spinner {
    display: none;
}

.fos-search-btn-label--loading {
    display: none;
}

.fos-np-btn-search-wp--loading {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}

.fos-np-btn-search-wp--loading .fos-search-btn-icon--search {
    display: none;
}

.fos-np-btn-search-wp--loading .fos-search-btn-icon--spinner {
    display: block;
}

.fos-np-btn-search-wp--loading .fos-search-btn-label {
    display: none;
}

.fos-np-btn-search-wp--loading .fos-search-btn-label--loading {
    display: inline;
}

@keyframes fos-spin {
    to {
        transform: rotate(360deg);
    }
}

.fos-search-btn-icon--spinner {
    animation: fos-spin 0.75s linear infinite;
    transform-origin: center;
}

.fos-np-links-status {
    color: var(--fos-success);
    margin: 0 0 10px;
    font-weight: 600;
    font-size: 13px;
}

.fos-np-links-output-label {
    font-size: 11px;
    color: var(--fos-text-dim);
    margin: 0 0 6px;
}

/* Card Nova Produção — spinner não pode usar visibility:hidden (reserva espaço no layout) */
/* pre-line só no conteúdo: no pai, quebras/indentação do HTML entre <span>s viravam linha em branco no topo */
.fos-np-card--links #fos-links-output.fos-links-output {
    background: var(--fos-bg-soft, #f8f8f9);
    border: 1px solid var(--fos-border);
    border-radius: 7px;
    padding: 12px 14px;
    min-height: 36px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: var(--fos-text-dim);
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
    word-break: break-word;
}

.fos-np-card--links #fos-links-content {
    display: block;
    white-space: pre-line;
    word-break: break-word;
}

.fos-np-card--links #fos-links-output .spinner {
    display: none;
    float: none;
    margin: 0;
    vertical-align: middle;
}

.fos-np-card--links #fos-links-output .spinner.is-active {
    display: inline-block;
}

/* M4: Sticky CTA bar em mobile — mantém botão "Iniciar produção" sempre visível */
@media (max-width: 600px) {
    .fos-np-card__footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        border-top: 1px solid var(--fos-border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        z-index: 10;
        flex-direction: column;
        align-items: stretch;
    }

    .fos-np-footer-actions {
        justify-content: stretch;
    }

    .fos-np-footer-actions .fos-np-btn-cancel,
    .fos-np-footer-actions .fos-np-btn-start {
        justify-content: center;
        flex: 1;
    }
}

/* ── Inline notices (fos-prefix — replaces cts-notice in standalone context) ─── */
.fos-notice {
    padding: 10px 14px;
    border-radius: var(--fos-radius-sm);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.fos-notice--info {
    background: rgba(108, 71, 255, 0.08);
    color: var(--fos-text-sub);
    border-color: rgba(108, 71, 255, 0.25);
}

.fos-notice--warn {
    background: #fffbeb;
    color: #78350f;
    border-color: #fde68a;
    border-left: 3px solid var(--fos-warning);
}

.fos-notice--success {
    background: #f0fdf4;
    color: #065f46;
    border-left: 3px solid var(--fos-success);
}

.fos-notice--error {
    background: #fef2f2;
    color: #7f1d1d;
    border-color: #fecaca;
    border-left: 3px solid var(--fos-danger);
}

/* ── Error Notice (inline, above footer) ─────────────────────────────── */
.fos-np-error-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--fos-danger-light);
    border: 1px solid #fecaca;
    border-left: 4px solid var(--fos-danger);
    border-radius: var(--fos-radius);
    margin-bottom: 8px;
}

.fos-np-error-notice__icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--fos-surface);
    border: 1px solid #fecaca;
    border-radius: var(--fos-radius-sm);
    display: grid;
    place-items: center;
}

.fos-np-error-notice__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fos-np-error-notice__title {
    font-size: var(--fos-text-lg);
    font-weight: 700;
    color: var(--fos-danger);
}

.fos-np-error-notice__msg {
    font-size: var(--fos-text-sm);
    color: #991b1b;
    line-height: 1.4;
}

/* ── Danger button variant (retry CTA) ───────────────────────────────── */
.cts-btn--danger {
    background: var(--fos-danger) !important;
    color: #fff !important;
    border-color: var(--fos-danger) !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
}

.cts-btn--danger:hover {
    background: #dc2626 !important;
    transform: translateY(-1px);
}

/* ── Quota Notice (inline, above footer) ────────────────────────────── */
.fos-np-quota-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--fos-primary-faint);
    border: 1px solid var(--fos-primary-border);
    border-left: 4px solid var(--fos-primary);
    border-radius: var(--fos-radius);
    margin-bottom: 8px;
}

.fos-np-quota-notice__icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--fos-surface);
    border: 1px solid var(--fos-primary-border);
    border-radius: var(--fos-radius-sm);
    display: grid;
    place-items: center;
}

.fos-np-quota-notice__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fos-np-quota-notice__title {
    font-size: var(--fos-text-lg);
    font-weight: 700;
    color: var(--fos-primary);
}

.fos-np-quota-notice__msg {
    font-size: var(--fos-text-sm);
    color: var(--fos-text-sub);
    line-height: 1.4;
}


.cts-btn--upgrade {
    background: var(--fos-primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    border-radius: var(--fos-radius-sm) !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(108, 71, 255, 0.25) !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fos-text-md) !important;
}

.cts-btn--upgrade:hover {
    background: var(--fos-primary-dark) !important;
    transform: translateY(-1px);
}

.cts-btn--upgrade-ghost {
    background: transparent !important;
    color: var(--fos-text-dim) !important;
    border: none !important;
    padding: 7px 12px !important;
    font-weight: 500 !important;
    font-size: var(--fos-text-md) !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.15s;
}

.cts-btn--upgrade-ghost:hover {
    color: var(--fos-text-sub) !important;
}


@media (max-width: 782px) {

    .fos-radio-group {
        gap: 6px;
    }

    .fos-form-row--2,
    .fos-form-row--3 {
        grid-template-columns: 1fr;
    }
}

/* ── Referências do artigo: abas ─────────────────────────────────────────────── */

.fos-refs-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.fos-refs-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--fos-border, #e5e7eb);
    background: #fff;
    color: var(--fos-text-sub, #4b5563);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fos-refs-tab:hover {
    color: var(--fos-text, #1f2937);
}

.fos-refs-tab--active {
    background: var(--fos-primary-faint, rgba(108, 71, 255, 0.06));
    color: var(--fos-primary, #6c47ff);
    border-color: var(--fos-primary-border, rgba(108, 71, 255, 0.2));
}

.fos-refs-panel {
    display: none;
}

.fos-refs-panel--active {
    display: block;
}

/* Contador circular de cada aba */
.fos-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    height: 16px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    background: var(--fos-bg-soft, #f8f8f9);
    color: var(--fos-text-dim, #6b7280);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.fos-refs-tab--active .fos-tab-count {
    background: var(--fos-primary, #6c47ff);
    color: #fff;
}

/* ── Filtros de sites e tipos ─────────────────────────────────────────────────── */

.fos-refs-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    min-width: 0;
}

.fos-refs-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fos-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.fos-refs-type-label {
    margin-left: 8px;
}

.fos-refs-site-picker {
    position: relative;
    flex: 0 1 250px;
    min-width: 250px;
    max-width: 300px;
}

.fos-refs-site-picker__toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 9px;
    border: 1px solid var(--fos-border-input);
    background: #fff;
    color: var(--fos-text, #1f2937);
    font-size: 12px;
}

.fos-refs-site-picker__toggle:hover,
.fos-refs-site-picker--open .fos-refs-site-picker__toggle {
    border: 1px solid rgba(108, 71, 255, 0.32);
}

.fos-refs-site-picker__badges {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.fos-refs-site-picker__badges--empty {
    display: none;
}

.fos-refs-site-badge {
    width: 18px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--fos-site-border, rgba(108, 71, 255, 0.3));
    border-radius: 7px;
    background: var(--fos-site-soft, #f0edff);
    color: var(--fos-site-accent, var(--fos-primary, #6c47ff));
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(108, 71, 255, 0.12);
}

.fos-refs-site-badge+.fos-refs-site-badge {
    margin-left: -5px;
}

.fos-refs-site-badge--more {
    background: #fff;
    color: var(--fos-text-dim, #6b7280);
    border-color: var(--fos-border, #e5e7eb);
}

.fos-refs-site-picker__summary {
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fos-text-dim);
    font-weight: 600;
}

.fos-refs-site-picker__chevron {
    position: relative;
    width: 18px;
    margin-left: 2px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0;
    line-height: 1;
    color: var(--fos-text-dim);
    opacity: 0.9;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.fos-refs-site-picker__chevron::before {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
}

.fos-refs-site-picker__toggle:hover .fos-refs-site-picker__chevron,
.fos-refs-site-picker--open .fos-refs-site-picker__chevron {
    color: var(--fos-primary, #6c47ff);
}

.fos-refs-site-picker--open .fos-refs-site-picker__chevron::before {
    transform: translateY(1px) rotate(225deg);
}

.fos-refs-site-picker__menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 120;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--fos-border, #e5e7eb);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.fos-refs-site-picker__tools {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: #fff;
    border-bottom: 1px solid var(--fos-border, #e5e7eb);
    margin-bottom: 0;
}

#fos-refs-card .fos-refs-site-picker__search {
    width: 100%;
    height: 26px;
    padding: 3px 9px;
    border: 1px solid var(--fos-border) !important;
    border-radius: var(--fos-radius-sm) !important;
    background: #fff !important;
    color: var(--fos-text, #1f2937) !important;
    font: inherit;
    font-size: 12px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
}

#fos-refs-card .fos-refs-site-picker__search:focus {
    border-color: var(--fos-border) !important;
    box-shadow: none !important;
    outline: none !important;
}

.fos-refs-site-picker__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 0;
    white-space: nowrap;
}

.fos-refs-site-picker__actions::before {
    content: "";
    width: 1px;
    height: 14px;
    background: var(--fos-border, #e5e7eb);
    order: 2;
}

.fos-refs-site-picker__action {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fos-primary, #6c47ff);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.fos-refs-site-picker__action[data-site-action="none"] {
    color: var(--fos-text-sub, #4b5563);
    order: 3;
}

.fos-refs-site-picker__action[data-site-action="all"] {
    order: 1;
}

.fos-refs-site-picker__action:hover {
    text-decoration: underline;
}

.fos-refs-site-picker__count {
    display: none;
    margin-left: auto;
    color: var(--fos-text-dim, #6b7280);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.fos-refs-site-picker__options {
    max-height: 196px;
    overflow-y: auto;
    padding-right: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 114, 128, 0.45) transparent;
}

.fos-refs-site-picker__options::-webkit-scrollbar {
    width: 6px;
}

.fos-refs-site-picker__options::-webkit-scrollbar-track {
    background: transparent;
}

.fos-refs-site-picker__options::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.35);
    border-radius: 999px;
}

.fos-refs-site-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 0;
    border-bottom: 1px solid var(--fos-border, #e5e7eb);
    color: var(--fos-text, #1f2937);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
}

.fos-refs-site-option:hover {
    background: #fff;
    color: var(--fos-text, #1f2937);
}

.fos-refs-site-option:focus-visible {
    outline: 2px solid rgba(108, 71, 255, 0.35);
    outline-offset: -2px;
    background: #fff;
}

.fos-refs-site-option--active {
    background: #fbfaff;
    color: var(--fos-text, #1f2937);
}

.fos-refs-site-option__check {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(108, 71, 255, 0.45);
    background: #fff;
    flex-shrink: 0;
}

.fos-refs-site-option--active .fos-refs-site-option__check {
    border-color: var(--fos-primary, #6c47ff);
    background: var(--fos-primary, #6c47ff);
    box-shadow: none;
}

.fos-refs-site-option--active .fos-refs-site-option__check::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 1px;
    width: 4px;
    height: 6px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fos-refs-site-option__badge {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--fos-site-border, rgba(108, 71, 255, 0.3));
    border-radius: 6px;
    background: var(--fos-site-soft, #f0edff);
    color: var(--fos-site-accent, var(--fos-primary, #6c47ff));
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.fos-refs-site-option__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fos-refs-site-picker__empty {
    padding: 12px 8px;
    color: var(--fos-text-dim, #6b7280);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 720px) {
    .fos-refs-filter-row {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        column-gap: 10px;
        row-gap: 8px;
    }

    .fos-refs-site-picker {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .fos-refs-type-label {
        margin-left: 0;
    }

    .fos-refs-filter-row>.fos-refs-chips {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .fos-refs-filter-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .fos-refs-filter-label {
        margin-top: 2px;
    }

    .fos-refs-filter-row>.fos-refs-chips {
        width: 100%;
    }

    .fos-refs-site-picker__menu {
        width: 100%;
        min-width: 0;
    }

    .fos-refs-site-picker__tools {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .fos-refs-site-picker__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 380px) {
    .fos-refs-site-picker__toggle {
        gap: 6px;
        padding-inline: 10px;
    }

    .fos-refs-site-badge:nth-child(n+4) {
        display: none;
    }
}

.fos-refs-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fos-refs-check-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--fos-text-sub);
    cursor: pointer;
    user-select: none;
}

.fos-refs-check-label input[type="checkbox"] {
    accent-color: var(--fos-primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.fos-refs-check-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────────── */

.fos-refs-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.fos-refs-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fos-border);
    color: var(--fos-text-dim);
    font-size: 9px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    flex-shrink: 0;
    line-height: 1;
}

.fos-refs-tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    width: 220px;
    white-space: normal;
    z-index: 99;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fos-refs-tooltip-wrap:hover .fos-refs-tooltip-text,
.fos-refs-tooltip-wrap:focus-within .fos-refs-tooltip-text {
    display: block;
}

/* ── Lista de resultados de links internos ───────────────────────────────────── */

.fos-links-empty-msg {
    margin: 8px 0 0;
    color: var(--fos-text-dim);
    font-size: 12px;
}

.fos-links-result-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
}

.fos-links-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid var(--fos-border);
    background: var(--fos-bg-soft, #f8f8f9);
    transition: background 0.12s, border-color 0.12s;
}

.fos-links-result-item:hover {
    background: #fff;
    border-color: rgba(108, 71, 255, 0.25);
}

.fos-links-result-item input[type="checkbox"] {
    accent-color: var(--fos-primary);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
}

.fos-links-result-item__title {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--fos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.fos-links-result-item__title:hover {
    color: var(--fos-primary);
    text-decoration: underline;
}

.fos-links-result-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.fos-links-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.fos-links-badge--site {
    background: rgba(108, 71, 255, 0.08);
    color: var(--fos-primary);
    border: 1px solid rgba(108, 71, 255, 0.2);
}

.fos-links-badge--type {
    background: var(--fos-bg-soft, #f0f0f0);
    color: var(--fos-text-dim);
    border: 1px solid var(--fos-border);
}

.fos-links-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--fos-border);
}

.fos-links-count-label {
    font-size: 11px;
    color: var(--fos-text-dim);
}

.fos-links-toggle-all {
    font-size: 11px;
    padding: 4px 10px;
}

/* ── Links externos ───────────────────────────────────────────────────────────── */

.fos-ext-add-form {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fos-border);
}

.fos-ext-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.fos-ext-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    border: 1px solid var(--fos-border);
    background: var(--fos-bg-soft, #f8f8f9);
}

.fos-ext-item__info {
    flex: 1;
    min-width: 0;
}

.fos-ext-item__url {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fos-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.fos-ext-item__url:hover {
    text-decoration: underline;
}

.fos-ext-item__desc {
    display: block;
    font-size: 11px;
    color: var(--fos-text-dim);
    margin-top: 2px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fos-ext-item__remove {
    background: none;
    border: none;
    color: var(--fos-text-dim);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
}

.fos-ext-item__remove:hover {
    color: var(--fos-danger);
    background: #fef2f2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REFS PREMIUM — Estilos visuais da seção "Referências do artigo"
   Prefixo: .fos-refs- para evitar conflitos
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Card header premium ─────────────────────────────────────────────────── */

#fos-refs-card .fos-refs-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: none;
    /* tabbar provides the bottom separation */
    border-bottom: 1px solid var(--fos-border);
}

.fos-refs-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #EEEDFE;
    border: 1px solid rgba(83, 74, 183, 0.18);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.fos-refs-card__title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    letter-spacing: -0.1px;
    margin: 0;
    line-height: 1.3;
}

.fos-refs-badge-optional {
    font-size: 11px;
    font-weight: 400;
    color: var(--fos-text-dim);
    background: var(--fos-bg-soft);
    border: 1px solid var(--fos-border);
    border-radius: 6px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Contador circular de cada aba */
.fos-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 500;
    margin-left: 6px;
    background: #EEEDFE;
    color: #534AB7;
    transition: background 0.15s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

/* ── Chips de filtro ─────────────────────────────────────────────────────── */

/* Esconder checkboxes nativos, usados apenas como estado */
#fos-refs-card .fos-chip-cb {
    display: none;
}

.fos-refs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fos-refs-chips--legacy-sites {
    flex: 0 1 auto;
    min-width: 0;
}

.fos-refs-chips--legacy-sites .fos-chip {
    background: var(--fos-surface, #ffffff);
    border-color: var(--fos-border-input, #d1d5db);
    color: var(--fos-text-sub, #4b5563);
}

.fos-refs-chips--legacy-sites .fos-chip--active {
    background: var(--fos-primary-light);
    border-color: var(--fos-primary-light);
    color: var(--fos-primary);
}

.fos-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--fos-border-input, #d1d5db);
    font-size: 12px;
    color: var(--fos-text-sub, #4b5563);
    cursor: pointer;
    background: var(--fos-surface, #ffffff);
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
    line-height: 1.4;
}

.fos-chip:hover {
    border: 1px solid var(--fos-border-input);
    color: var(--fos-primary-dark);
}

.fos-chip--active {
    background: var(--fos-primary-light);
    border-color: var(--fos-primary-light);
    color: var(--fos-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-chip--solo {
    cursor: default;
    pointer-events: none;
}

.fos-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.fos-chip--active .fos-chip__dot {
    opacity: 1;
}

/* Tooltip dentro do chip */
#fos-refs-card .fos-chip .fos-refs-tooltip-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--fos-border-input);
    font-size: 9px;
    font-weight: 700;
    color: var(--fos-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: help;
    flex-shrink: 0;
    font-style: normal;
    line-height: 1;
}

/* ── Itens de resultado — checkboxes customizados ────────────────────────── */

.fos-links-result-list {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
    max-height: 280px;
    overflow-y: auto;
}

.fos-links-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.1s;
    background: #ffffff;
}

.fos-links-result-item:last-child {
    border-bottom: none;
}

.fos-links-result-item:hover {
    background: #f9fafb;
}

.fos-links-result-item--selected {
    background: #FAFAFE;
}

.fos-links-result-item--selected:hover {
    background: #f4f3fd;
}

.fos-links-result-item--unselected {
    opacity: 0.45;
}

/* Checkbox customizado */
.fos-result-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    background: #ffffff;
}

.fos-result-checkbox--checked {
    background: var(--fos-primary);
    border-color: var(--fos-primary);
}

.fos-result-check-icon {
    width: 10px;
    height: 8px;
    display: none;
    flex-shrink: 0;
}

.fos-result-checkbox--checked .fos-result-check-icon {
    display: block;
}

/* Badges reformulados — pill sem borda */
#fos-refs-card .fos-links-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    border: none;
    white-space: nowrap;
}

#fos-refs-card .fos-links-badge--site {
    background: #EEEDFE;
    color: #3C3489;
}

#fos-refs-card .fos-links-badge--type {
    background: #f3f4f6;
    color: #6b7280;
}

#fos-refs-card .fos-links-badge--page {
    background: #E1F5EE;
    color: #085041;
}

/* Rodapé dos resultados */
#fos-refs-card .fos-links-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    border-radius: 0 0 8px 8px;
    margin-top: 0;
}

#fos-refs-card .fos-links-count-label strong {
    font-weight: 600;
    color: #534AB7;
}

#fos-refs-card .fos-links-toggle-all {
    font-size: 12px;
    height: 28px;
    padding: 0 10px;
    line-height: 28px;
}

/* ── Aba Links externos — premium ────────────────────────────────────────── */

.fos-refs-field-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 6px;
    line-height: 1.35;
}

.fos-refs-ext-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.fos-refs-ext-add-col {
    padding-bottom: 1px;
}

/* Itens da lista externa — premium */
#fos-refs-card .fos-ext-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    margin-bottom: 6px;
}

.fos-ext-item__icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #E1F5EE;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.fos-ext-item__icon svg {
    width: 14px;
    height: 14px;
}

#fos-refs-card .fos-ext-item__url {
    font-size: 13px;
    font-weight: 500;
    color: #185FA5;
}

#fos-refs-card .fos-ext-item__remove {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--fos-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

#fos-refs-card .fos-ext-item__remove:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Barra de Modo de Publicação ─────────────────────────────────────────── */

.fos-np-publish-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    padding: 16px 24px;
    background: var(--fos-bg-soft, #f9fafb);
    border-top: 1px solid var(--fos-border, #e5e7eb);
    gap: 24px;
}

.fos-np-publish-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-start;
}

.fos-np-publish-divider {
    width: 1px;
    background: var(--fos-border, #e5e7eb);
    margin: 0;
}

.fos-np-publish-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fos-np-publish-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fos-text-sub, #4b5563);
}

.fos-np-publish-pills {
    display: flex;
    align-items: center;
    background: var(--fos-surface, #ffffff);
    border: 1px solid var(--fos-border, #e5e7eb);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.fos-np-publish-pill {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fos-text-dim, #9ca3af);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fos-np-publish-pill:hover {
    color: var(--fos-text, #1f2937);
}

.fos-np-publish-pill.is-active[data-mode="draft"] {
    background: var(--fos-warning-light, #fef3c7);
    color: var(--fos-warning-dark, #b45309);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-np-publish-pill.is-active[data-mode="scheduled"] {
    background: var(--fos-primary-light, #eae6ff);
    color: var(--fos-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-np-publish-pill.is-active[data-mode="published"] {
    background: var(--fos-success-light, #d1fae5);
    color: var(--fos-success-dark, #047857);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-np-exec-pill {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fos-text-dim, #9ca3af);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fos-np-exec-pill:hover {
    color: var(--cts-text, #1f2937);
}

.fos-np-exec-pill.is-active[data-mode="auto"] {
    background: var(--fos-primary-light, #eae6ff);
    color: var(--fos-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-np-exec-pill.is-active[data-mode="manual"] {
    background: var(--fos-warning-light, #fef3c7);
    color: var(--fos-warning-dark, #b45309);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fos-np-publish-bar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fos-np-publish-hint {
    font-size: 12px;
    color: var(--fos-text-dim, #9ca3af);
    transition: all 0.2s ease;
}

.fos-np-publish-hint--warning {
    color: var(--fos-warning-dark, #b45309);
}

.fos-np-publish-date {
    transition: opacity 0.3s ease;
}

.fos-np-date-input {
    border-radius: 7px !important;
    border: 1px solid var(--fos-border, #e5e7eb) !important;
    background: var(--fos-surface, #ffffff) !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--fos-text-sub) !important;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    height: 30px;
    font-family: inherit;
    cursor: pointer;
}

.fos-np-date-input:hover {
    border-color: var(--fos-border-input);
}

.fos-np-date-input:focus {
    border-color: var(--cts-primary, #4f46e5);
    background: #fff;
    box-shadow: 0 0 0 3px var(--cts-primary-light, #e0e7ff);
    outline: none;
}

/* ── Contextos por Tipo de Artigo ────────────────────────────────────────── */

.fos-type-panel {
    display: none;
    padding: 14px 16px;
    background: var(--fos-primary-faint, rgba(108, 71, 255, 0.06));
    border: 1px solid var(--fos-primary-border, rgba(108, 71, 255, 0.2));
    border-radius: 10px;
}

.fos-type-panel--active {
    display: block;
    animation: fos-tab-fade-in 0.2s ease;
}

.fos-type-panel__header-new {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fos-type-panel__header-icon {
    font-size: 14px;
    line-height: 1;
}

.fos-type-panel__header-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--fos-primary, #6c47ff);
    margin: 0;
}

.fos-type-panel__header-words {
    margin-left: auto;
    font-size: 11px;
    color: var(--fos-text-sub, #4b5563);
}

.fos-type-panel__blurb {
    font-size: 11.5px;
    color: var(--fos-text-sub, #4b5563);
    line-height: 1.55;
    margin-bottom: 12px;
}

/* Remove old context panel styles */
.fos-type-panel__header,
.fos-type-panel__body,
.fos-type-info-box {
    display: none;
}

.fos-type-dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fos-type-dynamic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    background: #ffffff;
}

.fos-type-dynamic-item__num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #EEEDFE;
    color: #3C3489;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fos-type-dynamic-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1D9E75;
    flex-shrink: 0;
}

.fos-type-add-btn {
    height: 34px;
    border: 0.5px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    transition: border-color 0.15s, color 0.15s;
}

.fos-type-add-btn:hover {
    border-color: #AFA9EC;
    color: #534AB7;
}

.fos-type-remove-btn {
    background: transparent;
    border: none;
    color: var(--fos-text-dim, #9ca3af);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fos-type-remove-btn:hover {
    color: var(--fos-danger, #ef4444);
}

.fos-type-article-result {
    border: 0.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    background: #FAFAFE;
    border-color: #534AB7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fos-type-article-result__check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #534AB7;
    border: 1.5px solid #534AB7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .fos-np-publish-bar {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fos-np-publish-divider {
        display: none;
    }
}

@media (max-width: 600px) {
    .fos-refs-ext-fields {
        grid-template-columns: 1fr;
    }
}

/* M4: Sticky CTA mobile — botão "Iniciar produção" sempre visível em telas pequenas
   Aplica-se ao wrapper do formulário .fos-np-wrap e ao rodapé .fos-np-footer-bar */
@media (max-width: 782px) {
    .fos-np-footer-bar {
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.95);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--fos-border);
        border-radius: 0;
        margin: 0 -16px;
        padding: 12px 16px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    }

    .fos-np-footer-bar .cts-btn--primary {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* ── Flatpickr Theme Overrides (SaaS Customization) ──────────────────── */
.flatpickr-calendar {
    font-family: var(--fos-font-sans, inherit) !important;
    box-shadow: var(--fos-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.12)) !important;
    border: 1px solid var(--fos-border, #e5e7eb) !important;
    border-radius: 10px !important;
    padding: 6px !important;
    width: 250px !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
    display: none !important;
}

.flatpickr-current-month {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--fos-text, #111827) !important;
    padding-top: 2px !important;
}

.flatpickr-current-month .numInputWrapper {
    width: 6ch;
}

.flatpickr-weekday {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: var(--fos-text-dim, #6b7280) !important;
}

.flatpickr-month {
    margin-bottom: 4px !important;
    height: 28px !important;
}

.flatpickr-innerContainer {
    width: 100% !important;
}

.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

.flatpickr-day {
    border-radius: 4px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 12px !important;
    max-width: 32px !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--fos-primary, #6c47ff) !important;
    border-color: var(--fos-primary, #6c47ff) !important;
    color: #fff !important;
    border-radius: 4px !important;
}

.flatpickr-day:hover {
    background: var(--fos-primary-faint, rgba(108, 71, 255, 0.06)) !important;
    border-color: var(--fos-primary-border, rgba(108, 71, 255, 0.2)) !important;
    color: var(--fos-primary, #6c47ff) !important;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--fos-primary, #6c47ff) !important;
    border-color: var(--fos-primary, #6c47ff) !important;
    color: #fff !important;
}

.flatpickr-time {
    height: 36px !important;
    line-height: 36px !important;
    max-height: 36px !important;
}

.flatpickr-time input {
    font-size: 13px !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--fos-bg-soft, #f9fafb) !important;
}

/* ── Custom Date Input Wrapper ───────────────────────────────────────── */
.fos-date-input-wrap {
    position: relative;
    width: 100%;
}

.fos-date-input-wrap__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--fos-text-dim, #6b7280);
    pointer-events: none;
    z-index: 1;
}

.cts-input.fos-np-date-input--with-icon {
    padding-left: 36px !important;
}
