/* settings-page.css — General Settings & Global Settings pages */

/* Single-column width comes from the base .dlg-page scheme. */

/* ── Settings group (details/summary) ──────────────────────── */

.st-page .st-group {
    margin-top: 0;
    margin-bottom: 6px;
}

.st-page .st-group summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 22px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    color: var(--dlg-color-text);
    margin-bottom: 0;
}

.st-group summary::-webkit-details-marker {
    display: none;
}

.st-group summary::before {
    content: "\25B6";
    font-size: 10px;
    transition: transform 0.15s ease;
}

.st-group[open] summary::before {
    transform: rotate(90deg);
}

.st-group__body {
    padding: 0 0 4px 0;
}

/* ── Settings card (non-collapsible, for Global Settings) ──── */

.st-card {
    border: 1px solid var(--dlg-color-border);
    border-radius: var(--dlg-radius);
    margin-bottom: 10px;
    background: var(--dlg-color-bg);
    padding: 12px 16px;
}

.st-card__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    margin: 0 0 12px 0;
}

/* ── Sub-group separator ───────────────────────────────────── */

.st-subgroup {
    padding-top: 8px;
    margin-top: 8px;
}

.st-subgroup:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.st-subgroup + .st-subgroup {
    border-top: 1px solid var(--dlg-color-border-light);
}

/* ── Field row ─────────────────────────────────────────────── */

.st-page .st-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    margin: 0;
}

.st-page .st-field:has(textarea) {
    align-items: flex-start;
}

/* 220px, not 200: the longest labels here ran the full 200 and left no room
 * for the description marker, which then wrapped to its own line. The inputs
 * take the difference off their flexible width. */
.st-page .st-field__label {
    min-width: 220px;
    width: 220px;
    flex-shrink: 0;
    color: var(--dlg-color-text-secondary);
    font-weight: 600;
}

.st-page .st-field__input {
    flex: 1;
    min-width: 0;
}

/* Override shared dlg-page input sizing */
.st-page .st-field__input input[type=text],
.st-page .st-field__input select {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

/*
 * Deliberately monospace, not a leftover browser default: the only multiline
 * field on this page is PipeConditions, whose content is `pipe: tellem-script`
 * lines — code. The frame matches the Setup & Run form inputs.
 */
.st-page .st-field__input textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--dlg-font-mono, monospace);
    font-size: 13px;
    line-height: 1.5;
    padding: 9px 12px;
    border: 1px solid var(--dlg-color-border);
    border-radius: 8px;
    background: var(--dlg-color-bg);
    color: var(--dlg-color-text);
    resize: vertical;
}

.st-page .st-field__input input:focus,
.st-page .st-field__input select:focus,
.st-page .st-field__input textarea:focus {
    outline: 2px solid var(--app-focus-ring, rgba(20, 27, 155, 0.6));
    outline-offset: -2px;
}

.st-page input[type="checkbox"] {
    accent-color: var(--app-action-primary, #212121);
}

/* ── Checkboxes (multi-select) ─────────────────────────────── */

.st-checks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* ── Tri-state rows (OptionList.Type.TriState) ─────────────── */

.st-tristate {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-tristate__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
}

.st-tristate__label {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--dlg-color-text);
}

.st-tristate__select {
    flex: 0 0 180px;
}

/* Save feedback uses the shared .dlg-status pill (dlg.flashStatus). */

/* ── Conditional visibility ────────────────────────────────── */

.st-page .st-field--hidden {
    display: none;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
    .st-page .st-field {
        flex-direction: column;
        gap: 4px;
    }

    .st-page .st-field__label {
        min-width: auto;
        width: auto;
    }
}
