.auto-tailor-block {
    margin: 14px 10px 20px;
    padding: 16px 20px;
    border: 1px solid rgb(63 63 63 / 18%);
    border-radius: 10px;
    background: linear-gradient(118deg, #eef8f2, #f4f0fb);
    font-family: Urbanist, Hubballi, sans-serif;
}

body.dark .auto-tailor-block {
    background: linear-gradient(118deg, #152019, #211c24);
    border-color: #3f3a46;
    color: #e2e8f0;
}

.auto-tailor-block__head h2 {
    margin: 0 0 6px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-tailor-block__head p {
    margin: 0;
    font-family: Hubballi, sans-serif;
    line-height: 1.45;
    font-size: 0.95rem;
}

.auto-tailor-block__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.auto-tailor-trigger {
    font-weight: 800;
}

.auto-tailor-trigger--list {
    font-size: 0.82rem;
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 6px;
    font-family: Hubballi, Urbanist, sans-serif;
}

.auto-tailor-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 10px;
}

body.dark .auto-tailor-trigger--list {
    color: #eafff2;
}

.auto-tailor-status {
    font-size: 0.85rem;
    color: #64748b;
}

body.dark .auto-tailor-status {
    color: #94a3b8;
}

.auto-tailor-dialog {
    border: none;
    border-radius: 14px;
    padding: 0;
    max-width: min(520px, 94vw);
    width: 100%;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.auto-tailor-dialog--wide {
    max-width: min(960px, 96vw);
}

.auto-tailor-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.auto-tailor-dialog__inner {
    padding: 18px 20px 16px;
    margin: 0;
    border: 0;
    background: #fff;
    color: #0f172a;
}

body.dark .auto-tailor-dialog__inner {
    background: #1a1520;
    color: #f1f5f9;
}

.auto-tailor-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.auto-tailor-dialog__header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.auto-tailor-dialog__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.auto-tailor-dialog__lead {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auto-tailor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.auto-tailor-field textarea,
.auto-tailor-field input[type="file"] {
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    background: #fff;
    color: #0f172a;
    max-width: 100%;
    box-sizing: border-box;
}

body.dark .auto-tailor-field textarea,
body.dark .auto-tailor-field input[type="file"] {
    background: #0f1419;
    border-color: #475569;
    color: #f1f5f9;
}

.auto-tailor-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    text-transform: none;
    font-weight: 600;
}

.auto-tailor-dialog__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.auto-tailor-primary {
    background: #2b3d69 !important;
    color: #eafff2 !important;
}

.auto-tailor-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 720px) {
    .auto-tailor-preview-grid {
        grid-template-columns: 1fr;
    }
}

.auto-tailor-preview-pane {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    min-width: 0;
}

.auto-tailor-preview-pane--highlight {
    border-color: #0b5f36;
    background: #f3fbf6;
}

body.dark .auto-tailor-preview-pane--highlight {
    background: #173524;
    border-color: #3f7d5d;
}

.auto-tailor-preview-pane h3 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.auto-tailor-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    max-height: 280px;
    overflow: auto;
}

.auto-tailor-keywords {
    font-size: 0.85rem;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #e8f8ee;
    color: #0b5f36;
}

body.dark .auto-tailor-keywords {
    background: #173524;
    color: #b9f0cf;
}

.auto-tailor-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
}

.auto-tailor-loading.is-active,
.auto-tailor-loading:not([hidden]) {
    display: flex;
}

.auto-tailor-loading[hidden] {
    display: none !important;
}

.auto-tailor-loading__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.auto-tailor-loading__dismiss {
    margin-left: auto;
    border: 0;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

body.dark .auto-tailor-loading__dismiss {
    background: #334155;
    color: #f1f5f9;
}

body.dark .auto-tailor-loading__card {
    background: #211c24;
    color: #f1f5f9;
}
