/* ── Settings modal ── */
#settings-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
#settings-modal-overlay.modal-open { display: flex; }
#settings-modal-overlay.modal-closing { display: flex; }
#settings-modal {
    background: var(--bg-container);
    color: var(--text-main);
    border: 1px solid var(--border-main);   /* .app-modal's hairline (desktop #modalShell parity) */
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    width: 620px;
    max-width: calc(100vw - 40px);
    max-height: min(82vh, 760px);   /* the absolute cap the desktop shell also stops at (modalChrome sizeModalTall) */
    container: modal / inline-size;   /* .app-modal's: the content follows the window's width */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-main);
    /* The body is the only elastic row. */
    flex: 0 0 auto;
}
.settings-header h2 { margin: 0; font-size: 16px; font-weight: bold; }
#settings-close {
    background: transparent;
    border: 1px solid var(--border-main) !important;
    color: var(--text-main);
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
}
#settings-close:hover { background: var(--bg-info); }
.settings-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
    /* The scrollbar slot is reserved up front (as #coord-body does): else the body lays out one
       bar wider until the rows overflow, and the dust flight mismatches the window (user report). */
    scrollbar-gutter: stable;
}
/* The hotkey table's sticky header pins flush to the body top, or scrolled rows show above it. */
#settings-modal .settings-body { padding-top: 0; }
/* List dialogs keep one height while a filter thins their rows (desktop parity: sizeModalTall's
   82% share): the floor equals the ceiling, so the body scrolls instead of resizing. */
#settings-modal-overlay:not(.modal-popover) #settings-modal,
#info-modal-overlay:not(.modal-popover) .app-modal,
#visuals-modal-overlay:not(.modal-popover) .app-modal { min-height: min(82vh, 760px); }
.modal-search-bar { padding: 12px 18px 6px; }
.modal-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    background-color: var(--input-bg);   /* not the shorthand — keeps the hover sweep sizing */
    color: var(--input-text);
    font-size: 13px;
}
.settings-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-main);
    flex: 0 0 auto;
    display: flex;
    /* The basis is the hint's floor: the buttons keep their row (desktop parity) and the hint wraps
       beside them; `:not(:empty)` spares the confirm dialogs' spacer hint. */
    flex-wrap: wrap;
    /* flex-end keeps the buttons right on a shared row and once stacked (desktop FooterWrap parity). */
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}
.settings-footer .footer-hint:not(:empty) { flex: 1 1 110px; text-align: left; }
/* 10px sides, not .btn-icon-text's 12: at full padding three actions squeezed the hint into a
   column of two-word lines; this matches the desktop dialog's wrap. */
.settings-footer button { padding-left: 10px; padding-right: 10px; }
/* Composer overflow: only Send stays inline; the menu floats above the composer, anchored to its trigger. */
.chat-more-wrap { position: relative; display: inline-flex; }
