/* Settings: levels, "New", the provider's settings and the search (static/js/settings-levels.js). Both skins
   and a phone's width: only the shared theme variables, and nothing wider than its container. */

/* A setting hidden by its level or folded into the provider's list, and a container left with none showing. */
#settings-section .setting-level-hidden,
#settings-section .setting-folded,
#settings-section .setting-group-hidden { display: none !important; }

/* A checkbox wrapped as a setting keeps its help at the card's width, as it had before the wrapper. */
.settings-tab-content .p-lg > div[data-setting]:not([class]) > p { max-width: none; }

.setting-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.setting-chip {
    display: inline-block; padding: 1px 7px; border-radius: 999px; line-height: 1.4;
    font-size: .68rem; font-weight: 600; letter-spacing: .02em; text-transform: none;
    border: 1px solid transparent; white-space: nowrap;
}
.setting-chip-new {
    color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent);
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
}
.setting-chip-advanced {
    color: var(--text-secondary); background: color-mix(in srgb, var(--text-tertiary) 12%, transparent);
    border-color: color-mix(in srgb, var(--text-tertiary) 30%, transparent);
}

/* What the marks say, for assistive technology only (each of the setting's fields names it as its description). */
.setting-marks-note {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* "Show advanced settings (N)" at the top of a page. */
.settings-level-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px;
    margin-bottom: var(--space-md);
}
.settings-level-bar[hidden] { display: none; }
.settings-level-note { margin: 0; flex: 1 1 14rem; max-width: none; text-align: left; }

/* "Set by your provider (N)" at the foot of a page. */
.settings-provider-fold { padding: 0; }
.settings-provider-fold[hidden] { display: none; }
.settings-provider-summary {
    cursor: pointer; padding: var(--space-md); font-weight: 600; list-style-position: inside;
    overflow-wrap: anywhere;
}
.settings-provider-fold .p-lg { padding-top: 0; }
.settings-provider-list { list-style: none; margin: 0; padding: 0; }
.settings-provider-item { padding: .6rem 0; border-top: 1px solid var(--surface-3); min-width: 0; }
.settings-provider-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.settings-provider-value { color: var(--text-secondary); overflow-wrap: anywhere; }
.settings-provider-item p { margin: .25rem 0 0; max-width: none; overflow-wrap: anywhere; }

/* The search above the tabs. */
.settings-search { position: relative; margin-bottom: var(--space-md); max-width: 32rem; }
.settings-search-input { width: 100%; }
.settings-search-results {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
    max-height: 60vh; overflow-y: auto; padding: 4px;
    background: var(--surface-1); border: 1px solid var(--surface-3); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.settings-search-results[hidden] { display: none; }
.settings-search-hit {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
    padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary);
    text-align: left; cursor: pointer; font: inherit;
}
.settings-search-hit:hover, .settings-search-hit:focus-visible { background: var(--surface-2); outline: none; }
.settings-search-hit:focus-visible { box-shadow: var(--focus-ring); }
.settings-search-label { font-weight: 600; overflow-wrap: anywhere; }
.settings-search-none, .settings-search-more { margin: 6px 10px; }

/* Where the search went: a moment's outline around the setting. */
#settings-section .setting-found {
    outline: 2px solid var(--brand-primary, var(--info)); outline-offset: 4px; border-radius: var(--radius-sm);
    transition: outline-color .6s ease;
}

@media (max-width: 640px) {
    .settings-search { max-width: none; }
    .settings-level-bar { justify-content: stretch; }
    .settings-level-bar .settings-advanced-toggle { flex: 1 1 auto; }
}
