/* Think Tank configuration page (Story 2433).
   Pinned chrome: the shell never scrolls, only .tt-body does, so the Leonardo
   Main Menu Tool Bar Strip and the header stay put. 100dvh is the load-bearing
   line -- 100vh alone lets the band scroll off on a phone. */

.page-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

#lwIconBand,
.ct-header,
.tt-tabs { flex: 0 0 auto; }

.ct-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #3C3C3C;
    color: #fff;
    padding: 10px 14px;
}
.ct-header h1 { font-size: 20px; margin: 0; flex: 1 1 auto; }
.ct-header button {
    background: #555;
    color: #fff;
    border: 1px solid #777;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}

.tt-tabs {
    display: flex;
    gap: 4px;
    background: #2f2f2f;
    padding: 6px 8px;
    overflow-x: auto;
}
.tt-tab {
    background: #444;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 6px 6px 0 0;
    padding: 7px 12px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}
.tt-tab-on { background: #f6f6f6; color: #222; border-bottom-color: #f6f6f6; font-weight: 600; }

.tt-body {
    flex: 1 1 auto;
    overflow-y: auto;
    background: #f2f2f2;
    padding: 12px;
}

.tt-columns { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.tt-col { flex: 1 1 380px; min-width: 0; }
.tt-col-preview { position: sticky; top: 0; }

.tt-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.tt-card h2 { margin: 0 0 10px; font-size: 17px; }
.tt-card h3 { margin: 0 0 6px; font-size: 15px; }
.tt-hint { margin: 0 0 10px; color: #666; font-size: 13px; line-height: 1.45; }

/* Fields -- a single input on a row fills the row (phone first). */
.tt-field { display: block; margin-bottom: 12px; }
.tt-field > span { display: block; font-size: 13px; color: #444; margin-bottom: 4px; }
.tt-field input[type="text"],
.tt-field textarea,
.tt-field select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 15px;
    font-family: inherit;
}
.tt-field .voice-mic-wrap { display: block; }
.tt-field-narrow input[type="number"],
.tt-field-narrow select { width: auto; min-width: 120px; }
.tt-field input[type="number"] {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 15px;
    box-sizing: border-box;
}
.tt-field:last-child { margin-bottom: 0; }

.tt-format-note {
    background: #eef3f8;
    border-left: 4px solid #4a7fb5;
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #24405c;
}

.tt-bank { border: 1px dashed #c9b48a; background: #fdf9f0; border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.tt-bank-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-bank-grid .tt-field { margin-bottom: 0; }

/* Persona picker + persona cards */
.tt-persona-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-pick {
    flex: 1 1 220px;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fafafa;
    cursor: pointer;
}
.tt-pick-on { border-color: #4a7fb5; background: #eef3f8; box-shadow: inset 0 0 0 1px #4a7fb5; }
.tt-pick-name { font-weight: 600; font-size: 14px; }
.tt-pick-epithet { color: #777; font-weight: 400; }
.tt-pick-from { font-size: 12px; color: #555; margin-top: 2px; line-height: 1.4; }
.tt-side { display: flex; gap: 4px; margin-top: 6px; }
.tt-side button {
    flex: 1 1 auto;
    border: 1px solid #bbb;
    background: #fff;
    border-radius: 5px;
    font-size: 12px;
    padding: 3px 4px;
    cursor: pointer;
}
.tt-side button.tt-side-on { background: #4a7fb5; color: #fff; border-color: #3a668f; }

.tt-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-chip {
    border: 1px solid #bbb;
    background: #f4f4f4;
    border-radius: 14px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
}
.tt-chip-on { background: #4a7fb5; border-color: #3a668f; color: #fff; }

.tt-persona-card { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.tt-persona-card h3 { margin: 0 0 2px; font-size: 16px; }
.tt-persona-card .tt-from { font-size: 13px; color: #555; margin: 0 0 6px; }
.tt-persona-card .tt-point { font-size: 14px; margin: 0; }
.tt-group-head { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: #666; }

/* Preview */
.tt-preview .tt-line { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.tt-preview .tt-strong { font-weight: 600; }
.tt-timeline { list-style: none; margin: 10px 0; padding: 0; }
.tt-timeline li {
    border-left: 3px solid #4a7fb5;
    padding: 4px 0 6px 10px;
    margin-bottom: 6px;
}
.tt-timeline .tt-round-label { font-weight: 600; font-size: 14px; }
.tt-timeline .tt-round-tag { font-size: 11px; color: #fff; background: #7a8b99; border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.tt-timeline .tt-round-purpose { font-size: 13px; color: #555; line-height: 1.45; }
.tt-warn {
    background: #fdf1f1;
    border-left: 4px solid #b54a4a;
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    margin: 0 0 8px;
    font-size: 13px;
    color: #6d2323;
}
.tt-preview textarea,
#brief {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: Consolas, Menlo, monospace;
    font-size: 12.5px;
    line-height: 1.5;
}

.tt-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tt-spacer { flex: 1 1 auto; }
.tt-btn {
    border: 1px solid #bbb;
    background: #f4f4f4;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}
.tt-btn-save { background: #4a7fb5; border-color: #3a668f; color: #fff; }
.tt-btn-danger { background: #b54a4a; border-color: #8f3a3a; color: #fff; }
.tt-msg { font-size: 13px; color: #2b6a2b; margin-top: 8px; min-height: 0; }
.tt-msg:empty { display: none; }

/* Saved setups */
.tt-saved-row { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.tt-saved-row h3 { margin: 0 0 2px; font-size: 16px; }
.tt-saved-meta { font-size: 13px; color: #666; margin: 0 0 4px; }
.tt-saved-motion { font-size: 14px; margin: 0 0 8px; }
.tt-empty { color: #777; font-size: 14px; padding: 8px 2px; }

/* Confirm modal */
.tt-modal-back {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 60;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tt-modal-back.tt-open { display: flex; }
.tt-modal {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    max-width: 420px;
    width: 100%;
    box-sizing: border-box;
}
.tt-modal h2 { margin: 0 0 8px; font-size: 17px; }
.tt-modal p { font-size: 14px; margin: 0 0 6px; }

@media (max-width: 720px) {
    .tt-col-preview { position: static; }
}

/* Folds (Story 5757): every section and card folds to its head line, remembered in
   the database (PicassoGroupState over PicassoViewState). The persona groups are
   bands; the tab bar's Fold All steps through the chosen tab. */
.tt-fold-head { cursor: pointer; user-select: none; }
.tt-fold-head:focus-visible, .tt-band-head:focus-visible { outline: 2px solid #4a7fb5; outline-offset: 2px; }
.tt-caret { display: inline-block; width: 14px; color: #888; font-size: 12px; }
.tt-caret::before { content: "\25BE"; }
.tt-fold.collapsed > .tt-fold-head .tt-caret::before,
.tt-band.collapsed > .tt-band-head .tt-caret::before { content: "\25B8"; }
.tt-band > .tt-band-head .tt-caret::before { content: "\25BE"; }
.tt-fold.collapsed > .tt-fold-body,
.tt-band.collapsed > .tt-band-body { display: none; }
.tt-fold.collapsed > .tt-fold-head { margin-bottom: 0; }
.tt-band-head { cursor: pointer; user-select: none; }
.tt-band-n { font-size: 12px; color: #888; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.tt-tabs-spacer { flex: 1 1 auto; }
.tt-foldall {
    background: #444; color: #ddd; border: 1px solid #555; border-radius: 6px;
    padding: 5px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tt-foldall[hidden] { display: none; }
