.llms-builder {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.llms-builder__header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
}

.llms-builder__header p {
    color: #666;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.llms-builder__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .llms-builder__grid {
        grid-template-columns: 1fr;
    }
}

/* Поля формы */
.llms-field {
    margin-bottom: 1.25rem;
}

.llms-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #333;
}

.llms-field__hint {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.llms-field input[type="text"],
.llms-field input[type="url"],
.llms-field textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.llms-field input:focus,
.llms-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.llms-field--optional summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2563eb;
    margin-bottom: 0.75rem;
}

/* Кнопки */
.llms-btn {
    padding: 0.55rem 1.1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #333;
}

.llms-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.llms-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.llms-btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.llms-btn--primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.llms-btn--add {
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
    border-style: dashed;
}

.llms-btn--small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.llms-btn--remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 0.3rem;
    flex-shrink: 0;
}

.llms-btn--remove:hover {
    color: #b91c1c;
}

/* Секции */
.llms-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.llms-section__header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.llms-section__header input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Ссылки */
.llms-link-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.llms-link-row input {
    padding: 0.45rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .llms-link-row {
        grid-template-columns: 1fr;
    }
    .llms-link-row .llms-btn--remove {
        justify-self: start;
    }
}

/* Кнопки действий */
.llms-builder__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Валидация */
.llms-validation {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #92400e;
    display: none;
}

.llms-validation ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.2rem;
}

/* Предпросмотр */
.llms-builder__preview {
    position: sticky;
    top: 1rem;
}

.llms-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #1e293b;
    border-radius: 8px 8px 0 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

.llms-preview__tabs {
    display: flex;
    gap: 0.25rem;
}

.llms-tab {
    padding: 0.3rem 0.8rem;
    border: 1px solid #475569;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.llms-tab--active {
    background: #334155;
    color: #e2e8f0;
    border-color: #64748b;
}

.llms-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.llms-preview__hint {
    background: #334155;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.llms-preview__code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 0 0 8px 8px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.llms-preview__code--error {
    color: #f87171;
}
