#testing-view { min-width:0; }
.testing-status { min-height:1.4em; margin:10px 0 18px; color:var(--text-secondary); font-size:.84rem; }
.testing-status.error,.testing-feedback { color:var(--theme-danger); }
.testing-home { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.testing-panel,.testing-detail,.testing-editor,.testing-attempt { padding:24px; }
.testing-panel h2,.testing-detail h2,.testing-editor h2,.testing-attempt h2 { margin:0 0 18px; }
.testing-panel-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.testing-panel-heading h2,.testing-panel-heading h3 { margin:0; }
.testing-list-item { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-top:1px solid var(--border); }
.testing-list-item:first-child { border-top:0; }
.testing-list-item>div { display:grid; gap:5px; min-width:0; }
.testing-list-item strong { overflow-wrap:anywhere; }
.testing-list-item small,.testing-personal-link { font-size:.76rem; }
.testing-personal-link { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.testing-list-item button { flex:0 0 auto; }
#testing-focus>button { margin-bottom:18px; }
.testing-editor { display:grid; gap:18px; max-width:980px; }
.testing-editor label,.testing-answer-form label { margin:0; }
.testing-editor>label,.testing-time-fields label,.testing-question-editor>label { display:grid; gap:8px; font-size:.86rem; font-weight:600; }
.testing-editor :is(input,textarea,select) { width:100%; margin:0; }
.testing-time-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.testing-departments,.testing-question-editor { min-width:0; border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px; align-content:start; }
.testing-departments legend,.testing-question-editor legend { padding:0 6px; font-weight:650; }
.testing-departments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-rows:min-content; gap:10px; }
.testing-departments label { display:flex; align-items:center; gap:9px; font-size:.85rem; }
.testing-departments input { width:auto; flex:0 0 auto; }
.testing-question-list { display:grid; gap:18px; }
.testing-question-editor { display:grid; gap:14px; }
.testing-options { display:grid; gap:10px; }
.testing-option-row { display:flex; gap:10px; align-items:center; }
.testing-option-row input[type="radio"] { width:auto; flex:0 0 auto; }
.testing-remove-question { justify-self:start; color:var(--theme-danger); }
.testing-add-option { justify-self:start; }
.testing-editor>button[type="submit"] { justify-self:start; }
.testing-feedback { min-height:1.2em; margin:0; font-size:.82rem; }
.testing-detail { max-width:980px; }
.testing-detail h3 { margin:24px 0 12px; }
.testing-detail-meta { color:var(--text-secondary); font-size:.82rem; }
.testing-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:16px 0; }
.testing-question-preview { display:grid; gap:5px; padding:12px 0; border-top:1px solid var(--border); }
.testing-question-preview small { font-size:.74rem; }
.testing-review-item { display:grid; gap:8px; padding:18px 0; border-top:1px solid var(--border); }
.testing-review-item p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.testing-review-item small { font-size:.76rem; }
.testing-review-item .testing-actions { margin:4px 0 0; }
.testing-attempt { max-width:760px; }
.testing-attempt h2 { overflow-wrap:anywhere; }
.testing-answer-form { display:grid; gap:12px; }
.testing-answer-form h3 { margin:10px 0; font-size:1.18rem; line-height:1.45; }
.testing-question-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--text-secondary); font-size:.82rem; }
.testing-timer { display:inline-flex; align-items:center; justify-content:center; min-width:62px; padding:8px 12px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-variant-numeric:tabular-nums; }
.testing-timer.urgent { color:var(--theme-danger); background:var(--theme-danger-bg); }
.testing-answer-option { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-md); cursor:pointer; }
.testing-answer-option:has(input:checked) { border-color:var(--accent); background:var(--accent-soft); }
.testing-answer-option input { flex:0 0 auto; }
.testing-answer-option input[type="radio"] { width:20px; height:20px; margin:0; }
.testing-answer-option span { min-width:0; flex:1; overflow-wrap:anywhere; }
.testing-answer-text { width:100%; }
.testing-complete { padding:16px; border-radius:var(--radius-md); background:var(--theme-success-bg); color:var(--theme-success); }
@media(max-width:820px) { .testing-home { grid-template-columns:1fr; } .testing-departments { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .testing-panel,.testing-detail,.testing-editor,.testing-attempt { padding:18px; } .testing-departments,.testing-time-fields { grid-template-columns:1fr; } .testing-list-item { align-items:flex-start; flex-direction:column; } .testing-list-item button { width:100%; } .testing-panel-heading button { width:100%; } }

/* Task-like test index */
.testing-home { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
.testing-heading-actions { display:flex; justify-content:flex-start; gap:12px; flex-wrap:wrap; }
.testing-heading-actions button { min-height:46px; }
.testing-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.testing-search { display:flex; align-items:center; gap:10px; flex:1 1 320px; min-width:0; padding:0 16px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface,#fff); color:var(--text-secondary); }
.testing-search-icon { display:block; width:20px; height:20px; flex:0 0 20px; }
.testing-search input { width:100%; border:0; background:transparent; box-shadow:none; min-height:50px; margin:0; padding:0; }
.testing-search input:focus { outline:none; box-shadow:none; }
#testing-view .testing-search input[type="search"] { border:0; box-shadow:none; outline:0; background:transparent; }
#testing-focus:not(.testing-detail-open):not(.testing-attempt-open) { width:100%; min-width:0; margin:0; }
.testing-panel { padding:20px 24px; }
.testing-panel h2 { margin:0; }
.testing-panel-heading { margin:0 0 10px; }
.testing-managed-item { display:grid; grid-template-columns:minmax(0,1fr) 120px minmax(0,1fr) 18px; gap:18px; align-items:center; width:100%; min-height:76px; padding:12px 4px; border:0; border-top:1px solid var(--border); border-radius:0; background:transparent; color:var(--text-primary); text-align:left; box-shadow:none; }
.testing-managed-item:hover,.testing-managed-item:focus-visible { background:var(--accent-soft); outline:none; }
.testing-managed-main,.testing-managed-progress,.testing-managed-result { display:grid; gap:3px; min-width:0; }
.testing-managed-main strong { font-size:.98rem; overflow-wrap:anywhere; }
.testing-managed-item small { font-size:.76rem; line-height:1.35; }
.testing-managed-progress strong,.testing-managed-result strong { font-size:.92rem; }
.testing-managed-result { overflow-wrap:anywhere; }
.testing-managed-progress strong { font-variant-numeric:tabular-nums; }
.testing-list-item>div { min-width:0; overflow-wrap:anywhere; }
.testing-list-item>button { flex-shrink:0; }
.testing-card-chevron { color:var(--accent); font-size:1.8rem; line-height:1; }
#testing-managed:empty,#testing-mine:empty { padding:14px 0; }
.testing-empty { position:relative; isolation:isolate; min-height:250px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:5px; padding:178px 16px 18px; text-align:center; background:radial-gradient(ellipse at 50% 36%,var(--theme-soft),transparent 72%); }
.testing-empty::before { content:''; position:absolute; z-index:-1; top:0; left:50%; width:190px; height:178px; transform:translateX(-50%); background:var(--character-empty,url('/assets/calendar-sad-khinkali.png')) center / contain no-repeat; opacity:.8; pointer-events:none; }
.testing-empty strong { color:var(--text-primary); font-size:1rem; }
.testing-empty span { color:var(--text-secondary); font-size:.83rem; }
html:root[data-artwork="none"] .testing-empty { min-height:140px; padding:24px 16px; justify-content:center; }

/* News-composer inspired authoring form */
.testing-editor { width:100%; max-width:none; margin:0 0 40px; gap:22px; }
.testing-editor h2 { margin:0; }
.testing-editor-intro { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,300px); gap:22px; align-items:start; }
.testing-editor-fields { display:grid; gap:16px; }
.testing-editor-intro>* { min-width:0; }
.testing-editor-fields>label { display:grid; gap:7px; font-weight:600; font-size:.86rem; }
.testing-editor-fields textarea { min-height:78px; resize:vertical; }
.testing-editor-audience { padding:16px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--accent-soft); }
.testing-editor-audience h3 { margin:0 0 4px; font-size:1rem; }
.testing-editor-audience p { margin:0 0 12px; }
.testing-departments { display:block; position:relative; padding:0; border:0; border-radius:0; }
.testing-departments summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface,#fff); cursor:pointer; font-size:.86rem; font-weight:600; list-style:none; }
.testing-departments summary::-webkit-details-marker { display:none; }
.testing-departments summary::after { content:'⌄'; color:var(--accent); font-size:1.15rem; }
.testing-department-options { position:absolute; top:calc(100% + 5px); right:0; left:0; z-index:30; display:grid; gap:0; max-height:290px; overflow-y:auto; padding:6px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface,#fff); box-shadow:0 16px 35px #1d36552b; }
.testing-department-options label { display:flex; align-items:center; gap:9px; padding:8px; border-radius:8px; font-size:.83rem; font-weight:500; }
.testing-department-options label:hover { background:var(--accent-soft); }
.testing-department-options input { width:auto!important; margin:0; }
.testing-time-fields { gap:12px; }
.testing-question-list { gap:14px; }
.testing-question-editor { display:block; margin:0; padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface,#fff); }
.testing-question-editor summary { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--accent); font-size:.9rem; font-weight:700; cursor:pointer; list-style:none; overflow-wrap:anywhere; }
.testing-question-editor summary::-webkit-details-marker { display:none; }
.testing-question-editor summary::after { content:'⌄'; flex:0 0 auto; font-size:1.2rem; transition:transform .24s cubic-bezier(.22,1,.36,1); }
.testing-question-editor[open] summary::after { transform:rotate(180deg); }
.testing-question-fields { display:grid; gap:12px; margin-top:14px; }
@media (prefers-reduced-motion:reduce) { .testing-question-editor summary::after { transition:none; } }
.testing-question-fields>label { display:grid; gap:5px; font-size:.86rem; font-weight:600; }
.testing-correct-help { margin:0; color:var(--text-secondary); font-size:.8rem; line-height:1.45; }
.testing-question-prompt { min-height:90px; resize:vertical; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; font-size:1rem; line-height:1.5; }
.testing-question-prompt:focus { outline:0; border-color:var(--accent); box-shadow:none; }
.testing-question-image { display:flex; align-items:start; gap:12px; flex-wrap:wrap; }
.testing-question-image[hidden],.testing-question-editor input[type="file"][hidden] { display:none; }
.testing-question-image img,.testing-answer-image { display:block; max-width:min(100%,360px); max-height:230px; object-fit:contain; border:1px solid var(--border); border-radius:12px; }
.testing-question-image-tools { display:flex; gap:6px; }
.testing-image-add,.testing-add-option,.testing-remove-question { justify-self:start; min-height:36px; font-size:.82rem; }
.testing-image-feedback { min-height:1em; color:var(--text-secondary); }
.testing-option-row input[type="text"] { min-width:0; }
.testing-option-row input[type="radio"] { width:20px!important; height:20px; margin:0; }
.testing-add-question { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border-radius:50%; font-size:1.4rem; line-height:1; }
.testing-panel-heading .testing-add-question { width:36px; }
.testing-editor>button[type="submit"] { min-width:180px; }

/* Compact detail window */
#testing-focus.testing-detail-open { position:fixed; inset:0; z-index:5000; display:grid; place-items:center; padding:22px; background:#18294791; backdrop-filter:blur(3px); }
.testing-detail-open .testing-detail { width:min(720px,100%); max-width:none; max-height:calc(100vh - 44px); overflow-y:auto; padding:20px 24px; box-shadow:0 22px 65px #15234145; }
#testing-focus.testing-attempt-open { position:fixed; inset:0; z-index:5000; display:grid; place-items:center; padding:22px; background:#18294791; backdrop-filter:blur(3px); overscroll-behavior:contain; }
.testing-attempt-open .testing-attempt { width:min(760px,100%); max-width:none; min-width:0; max-height:calc(100dvh - 44px); overflow-y:auto; overscroll-behavior:contain; box-shadow:0 22px 65px #15234145; }
.testing-attempt-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.testing-attempt-head h2 { margin:0 0 18px; }
.testing-detail-head { display:flex; align-items:start; justify-content:space-between; gap:14px; }
.testing-detail-head .eyebrow { margin:0 0 5px; }
.testing-detail-head h2 { margin:0; line-height:1.25; overflow-wrap:anywhere; }
.testing-detail-meta { margin:10px 0 0; }
.testing-detail h3 { margin:20px 0 10px; font-size:1rem; }
.testing-icon-button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-width:32px; min-height:32px; padding:0; border-radius:9px; font-size:1.05rem; line-height:1; }
.testing-detail-head>.testing-icon-button { font-size:1.4rem; }
.testing-department-detail { margin:8px 0; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.testing-department-detail-head { display:flex; align-items:center; gap:9px; padding:10px 12px; background:var(--accent-soft); }
.testing-department-detail-head strong { margin-right:auto; }
.testing-participant { display:flex; align-items:flex-start; gap:8px; padding:8px 12px; border-top:1px solid var(--border); }
.testing-participant>span { display:grid; gap:2px; min-width:0; flex:1; overflow-wrap:anywhere; }
.testing-participant strong { font-size:.85rem; }
.testing-participant small { font-size:.72rem; }
.testing-question-summary { margin-top:16px; border-top:1px solid var(--border); padding-top:12px; }
.testing-question-summary summary { cursor:pointer; font-weight:650; }
.testing-question-preview img { max-width:220px; max-height:130px; object-fit:contain; border-radius:8px; }
.chat-test-invitation { display:inline-flex; margin:4px 0 6px; padding:7px 11px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-weight:650; text-decoration:none; }
.chat-test-invitation:hover { text-decoration:underline; }
.crm-bot-settings { display:flex; gap:22px; align-items:flex-start; max-width:780px; }
.crm-bot-settings>img { width:94px; height:94px; object-fit:cover; border-radius:24px; background:var(--accent-soft); border:1px solid var(--border); }
.crm-bot-settings-fields { display:grid; gap:12px; flex:1; }
.crm-bot-settings-fields h3 { margin:0; }
.crm-bot-settings-fields label { display:grid; gap:6px; }
.crm-bot-upload { justify-items:start; cursor:pointer; }
.crm-bot-upload span { display:inline-flex; align-items:center; min-height:40px; padding:0 15px; border:1px solid var(--border); border-radius:var(--radius-md); color:var(--accent); background:var(--surface,#fff); font-weight:600; }
.crm-bot-upload:hover span,.crm-bot-upload:focus-within span { border-color:var(--accent); background:var(--accent-soft); }
.crm-bot-actions { display:flex; gap:10px; flex-wrap:wrap; }
.crm-bot-settings-fields p { margin:0; }
@media(max-width:720px) {
  .testing-managed-item { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .testing-managed-progress,.testing-managed-result { grid-row:2; }
  .testing-card-chevron { grid-column:2; grid-row:1; }
  .testing-editor-intro { grid-template-columns:1fr; }
  .testing-detail-open .testing-detail { max-height:calc(100vh - 20px); }
  #testing-focus.testing-attempt-open { padding:10px; }
  .testing-attempt-open .testing-attempt { max-height:calc(100dvh - 20px); }
}
@media(max-width:560px) {
  .testing-heading-actions button { width:100%; }
  .testing-panel { padding:16px; }
  .testing-managed-item { grid-template-columns:minmax(0,1fr) 18px; }
  .testing-managed-main { grid-column:1; grid-row:1; }
  .testing-managed-progress { grid-column:1; grid-row:2; }
  .testing-managed-result { grid-column:1; grid-row:3; }
  .testing-card-chevron { grid-column:2; grid-row:1; }
  #testing-focus.testing-detail-open { padding:10px; }
  .crm-bot-settings { display:grid; }
}

.testing-archive-panel{width:min(1120px,100%);max-width:1120px;}
.testing-archive-panel>.testing-panel{padding:20px 0;}
.testing-delete-confirm{padding:14px;border:1px solid var(--theme-danger);border-radius:12px;margin-bottom:16px;}
.testing-delete-confirm button{margin-right:10px;}
.testing-archive-panel>input{width:100%;min-width:0;}

#testing-focus.testing-detail-open .testing-archive-panel{width:min(1120px,100%);}
#testing-focus .testing-detail-head{position:sticky;top:-20px;z-index:2;background:var(--surface);padding:8px 0;}

#testing-focus.testing-detail-open .testing-archive-panel{max-height:min(820px,calc(100dvh - 40px));}

.testing-managed-row { display:flex; align-items:center; gap:12px; min-width:0; border-top:1px solid var(--border); }
.testing-managed-row > .testing-managed-item { flex:1; min-width:0; border-top:0; }
.testing-row-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
html:root .testing-archive-button { flex-shrink:0; width:36px; min-width:36px; height:36px; min-height:36px; padding:0; }
@media (max-width:700px), (pointer:coarse) {
  html:root .testing-archive-button { width:44px; min-width:44px; height:44px; min-height:44px; }
}
@media (max-width:560px) {
  .testing-row-actions { flex-direction:column; align-items:flex-end; }
  .testing-managed-row { gap:8px; }
}
