/* AI-CLO PTITHCM V12.6.42 — canonical Question Bank tabs, scope chooser, compact table and hover preview. */

/* Bank tabs */
.v105-bank-tabs{display:flex;justify-content:flex-start;align-items:center;gap:6px;margin:0 0 18px;padding:5px;border:1px solid var(--line);border-radius:12px;background:#eef1f5;width:max-content;max-width:100%;overflow:auto}
.v105-bank-tab{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:#596273;padding:10px 16px;border-radius:8px;font-weight:800;white-space:nowrap}
.v105-bank-tab b{min-width:26px;padding:3px 7px;border-radius:999px;background:#e8edf5;color:#475467;font-size:12px}
.v105-bank-tab.active,.v105-bank-tab.secure.active{background:#fff;color:var(--red);box-shadow:0 2px 8px #1112}
.v105-bank-tab.active b,.v105-bank-tab.secure.active b{background:var(--red);color:#fff}
.v105-bank-note{display:flex;align-items:center;gap:10px;padding:10px 13px;margin-bottom:14px;border-radius:11px;background:#f7f9fc;color:#475467;font-size:13px;line-height:1.45}
.v105-bank-note b{color:#253858;white-space:nowrap}.v105-bank-note strong{color:var(--red)}

/* Legacy source filters remain usable before bank-layout.js enhances the view. */
.v105-question-tools{grid-template-columns:minmax(230px,1.1fr) repeat(5,minmax(145px,1fr))}
.v105-classification{grid-template-columns:minmax(220px,1fr) minmax(200px,1fr) auto}

/* Question destination / bank scope chooser. */
.v105-scope-chooser{border:0;padding:0;margin:2px 0 8px;min-width:0}.v105-scope-chooser legend{font-weight:800;margin-bottom:8px}
.v105-scope-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.v105-scope-option{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #d7dee8;border-radius:11px;background:#fff;cursor:pointer}
.v105-scope-option:has(input:checked){border-color:#315f9e;background:#f3f7fd;box-shadow:0 0 0 2px #315f9e15}.v105-scope-option.secure:has(input:checked){border-color:#c51f36;background:#fff5f6;box-shadow:0 0 0 2px #c51f3614}
.v105-scope-option input{margin-top:3px;accent-color:#b71f32}.v105-scope-option span{display:grid;gap:3px}.v105-scope-option small{font-weight:500;color:var(--muted);line-height:1.35}
.badge.both-bank{background:#eef3ff;color:#315a9b}

/* Pre-enhancement action toolbar fallback. bank-layout.js later replaces/hides this toolbar. */
.bank-actions{display:grid;grid-template-columns:repeat(6,max-content);justify-content:end;align-items:center;gap:10px}
.bank-actions>#questionCount{grid-column:1/-1;grid-row:1;justify-self:start;margin:0 0 4px;white-space:nowrap}.bank-actions>button{grid-row:2;margin:0;white-space:nowrap}

/* Desktop question table. Auto layout prevents leftover width from inflating the code column. */
.v105-question-table{overflow-x:hidden}
.v105-question-table table{min-width:0;width:100%;table-layout:auto}
.v105-question-table th,.v105-question-table td{padding-left:8px;padding-right:8px}
.v105-question-table:not(.selection-mode) th.select-col,.v105-question-table:not(.selection-mode) td.select-col{width:0!important;min-width:0!important;max-width:0!important;padding:0!important}
.v105-question-table th:nth-child(1),.v105-question-table td:nth-child(1){width:34px}
.v105-question-table th:nth-child(2),.v105-question-table td:nth-child(2){width:112px;min-width:112px;max-width:112px}
.v105-question-table th:nth-child(3),.v105-question-table td:nth-child(3){width:auto}
.v105-question-table th:nth-child(4),.v105-question-table td:nth-child(4){width:22%}
.v105-question-table th:nth-child(5),.v105-question-table td:nth-child(5){width:150px;min-width:150px;max-width:150px}
.v105-question-table th:nth-child(6),.v105-question-table td:nth-child(6){width:118px;min-width:118px;max-width:118px}
.v105-question-table .q-code-cell{word-break:break-word;padding-right:2px}.v105-question-table .q-content-cell{padding-left:2px}.v105-question-table .question-code{padding:4px 5px;font-size:12px}
.v105-question-table .question-summary{width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.v105-question-table .q-structure-cell b,.v105-question-table .q-structure-cell small{display:block;line-height:1.3;word-break:normal;overflow-wrap:break-word}
.v105-question-table .q-structure-cell small{margin-top:4px;color:#526071}
.v105-question-table .q-class-cell .badge{white-space:normal;line-height:1.2;text-align:center;padding:5px 4px}
.v105-question-table .row-actions{display:grid;grid-template-columns:1fr;gap:5px;align-content:start}
.v105-question-table .row-actions button{width:100%;min-width:0;padding:6px 5px;white-space:normal;line-height:1.15}
.bulk-question-bar{flex-wrap:wrap}#bulkDeleteQuestions{margin-left:auto}

/* Desktop hover preview: lazy-loads A–D only when the pointer rests on question content. */
.question-hover-preview{position:fixed;z-index:1600;box-sizing:border-box;max-height:min(560px,calc(100vh - 24px));overflow:auto;padding:14px 16px;border:1px solid #d6dde8;border-radius:13px;background:#fff;color:var(--ink);box-shadow:0 16px 42px #10182826;font-size:13px;line-height:1.5}
.question-hover-preview[hidden]{display:none!important}
.question-hover-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:9px;margin-bottom:9px;border-bottom:1px solid #edf0f4}
.question-hover-preview-head b{color:var(--red);font-size:13px}.question-hover-preview-head span{color:var(--muted);font-size:11px;font-weight:700}
.question-hover-preview-content{font-weight:650;overflow-wrap:anywhere}
.question-hover-preview-options{display:grid;gap:7px;margin-top:11px}
.question-hover-preview-options>div{display:grid;grid-template-columns:22px minmax(0,1fr);gap:6px;align-items:start;padding:7px 9px;border-radius:8px;background:#f7f9fc}
.question-hover-preview-options b{color:#344054}.question-hover-preview-options span{min-width:0;overflow-wrap:anywhere}

@media(max-width:1200px){
 .v105-question-tools{grid-template-columns:repeat(3,minmax(155px,1fr))}
 .v105-scope-options{grid-template-columns:1fr}.v105-bank-note{align-items:flex-start;flex-direction:column;gap:3px}
 .v105-question-table th,.v105-question-table td{padding-left:6px;padding-right:6px}
 .v105-question-table th:nth-child(2),.v105-question-table td:nth-child(2){width:102px;min-width:102px;max-width:102px}
 .v105-question-table th:nth-child(3),.v105-question-table td:nth-child(3){width:auto}
 .v105-question-table th:nth-child(4),.v105-question-table td:nth-child(4){width:20%}
 .v105-question-table th:nth-child(5),.v105-question-table td:nth-child(5){width:142px;min-width:142px;max-width:142px}
 .v105-question-table th:nth-child(6),.v105-question-table td:nth-child(6){width:108px;min-width:108px;max-width:108px}
 .v105-question-table .q-code-cell{padding-right:2px}.v105-question-table .q-content-cell{padding-left:2px}
}
@media(max-width:1100px){.bank-actions{grid-template-columns:repeat(3,max-content)}.bank-actions>button{grid-row:auto}.bank-actions>#questionCount{grid-column:1/-1}}
@media(max-width:900px){.v105-question-table{overflow-x:auto}.v105-question-table table{min-width:760px}}
@media(max-width:700px){.v105-question-tools{grid-template-columns:1fr 1fr}.v105-question-tools input{grid-column:1/-1}.v105-bank-tabs{width:100%}.v105-bank-tab{flex:1;justify-content:center}.v105-bank-note{font-size:12px}.v105-classification{grid-template-columns:1fr}}
@media(max-width:620px){.bank-actions{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.bank-actions>button{width:100%;padding-left:8px;padding-right:8px}.bank-actions>#questionCount{grid-column:1/-1}}
@media(max-width:460px){.v105-question-tools{grid-template-columns:1fr}.v105-bank-tabs{display:grid}.v105-bank-tab{width:100%}}
@media(hover:none),(pointer:coarse){.question-hover-preview{display:none!important}}

/* Phone: render each question row as a card; no horizontal table scroll. */
@media(max-width:760px){
 .v105-question-table{overflow:visible;padding:0;border:0;background:transparent;box-shadow:none}
 .v105-question-table table,.v105-question-table tbody{display:block;width:100%;min-width:0;max-width:100%}
 .v105-question-table thead{display:none}
 .v105-question-table tr{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 10px;width:100%;min-width:0;max-width:100%;margin:0 0 10px;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fff;box-sizing:border-box}
 .v105-question-table td{display:block;width:auto;max-width:none;min-width:0;padding:0;border:0}
 .v105-question-table tr>td:nth-child(1),.v105-question-table tr>td:nth-child(2),.v105-question-table tr>td:nth-child(3),.v105-question-table tr>td:nth-child(4),.v105-question-table tr>td:nth-child(5),.v105-question-table tr>td:nth-child(6){width:100%;max-width:none;min-width:0;box-sizing:border-box}
 .v105-question-table td.select-col{grid-column:1;grid-row:1;align-self:start;width:auto;max-width:none;padding-top:4px}
 .v105-question-table td.q-code-cell{grid-column:2;grid-row:1;display:flex;align-items:center;gap:7px;flex-wrap:wrap;word-break:normal;justify-self:stretch;align-self:stretch;padding-right:0}
 .v105-question-table td.q-content-cell{grid-column:1/-1;grid-row:2;padding:2px 0 0;justify-self:stretch;align-self:stretch}
 .v105-question-table td.q-structure-cell{grid-column:1/-1;grid-row:3;padding:8px 0;border-top:1px solid #edf0f4;color:#475467;justify-self:stretch;align-self:stretch}
 .v105-question-table td.q-class-cell{grid-column:1/-1;grid-row:4;display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-self:stretch;align-self:stretch}
 .v105-question-table td.row-actions{grid-column:1/-1;grid-row:5;display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:2px;width:100%;justify-self:stretch;align-self:stretch}
 .v105-question-table .question-code{width:auto;max-width:100%;text-align:left;padding:5px 7px}
 .v105-question-table .question-summary{display:block;width:100%;max-width:none;text-align:left;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
 .v105-question-table .q-structure-cell b,.v105-question-table .q-structure-cell small{width:100%;max-width:none}.v105-question-table .q-structure-cell b{font-size:13px}.v105-question-table .q-structure-cell small{font-size:12px;margin-top:2px}
 .v105-question-table .q-class-cell .badge{width:auto;max-width:100%;padding:5px 8px;white-space:normal}.v105-question-table .q-class-cell br{display:none}
 .v105-question-table .row-actions button{min-height:36px;padding:7px 8px;white-space:nowrap}
 .v105-question-table tr:has(.empty){display:block;text-align:center}.v105-question-table .empty{padding:18px}
}
