/* ═══════════════════════════════════════════════════════════════════════════
   The one header bar — docs/MODAL_HEADER_DESIGN.md (owner rulings 2026-09-17)

   Every one of the eleven windows wears these classes and nothing of its
   own about the bar. Change the bar here; it changes everywhere.

   Wearers: Study Console, Atlas, Theology Library, Encyclopedia, Harmony,
   Verse Trail, Lexicon Study Center, Language Practice, Introductions,
   Settings, My Account. A NEW WINDOW WEARS THIS TOO — never write its own
   bar. Grammar (five elements, in this order):
     .modal-shell > .modal-header > .modal-mark  (the launcher's icon, verbatim)
                                    .modal-title (one line)
                                    .modal-ctls  > .modal-ctl* (its buttons, in order)
                                                   .modal-close (the one ×, last)
   Shell width, height, background, shadow and every body stay in the
   window's own sheet. Phone full-screen rules in those sheets still win.
   ═══════════════════════════════════════════════════════════════════════ */

.modal-shell {
    border-radius: 10px;
}

.modal-header {
    box-sizing: border-box;
    height: 48px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    background: var(--surface);
    border-top: 2px solid var(--primary);
    border-bottom: 1px solid var(--border);
}

/* The launcher's icon, verbatim — the one permitted difference */
.modal-mark {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--primary);
    font-size: 14px;   /* an emoji launcher icon (Verse Trail 👣) */
    line-height: 1;
}
.modal-mark svg { width: 15px; height: 15px; }

.modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-title input {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    min-width: 160px;
}
.modal-title input:focus {
    outline: none;
    border-color: var(--border);
    background: var(--background);
}

.modal-ctls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.modal-ctl,
.modal-close {
    box-sizing: border-box;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    padding: 0;
    transition: background 0.13s;
}
.modal-ctl { padding: 0 0.6rem; }
.modal-ctl svg { width: 13px; height: 13px; }
.modal-ctl.is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.modal-close {
    width: 26px;
    color: var(--text-secondary);
    font-size: 1rem;
}
.modal-ctl:hover,
.modal-close:hover { background: var(--highlight); }
.modal-close:hover { color: var(--text-primary); }
.modal-ctl:focus-visible,
.modal-close:focus-visible,
.modal-title input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
