/* Tests use one layout on desktop, tablet, mobile browser and the Android WebView. */
body.teacher-mode:has(#page-teacher-tests:not(.hidden)) .workspace>header { display:none; }
#teacher-tests-app { color:#101c46; min-width:0; }
.tests-workspace { display:grid;grid-template-columns:minmax(0,1.74fr) minmax(0,1fr);grid-template-rows:min-content min-content;gap:16px;align-items:start; }
.tests-workspace * { box-sizing:border-box;min-width:0; }
.tests-panel { background:#fff;border-radius:18px;padding:22px;box-shadow:0 8px 30px #233a6210; }
.tests-panel h3 { color:#101c46;font-size:23px;line-height:1.2;margin:0 0 20px;font-weight:750; }
.test-create-panel { grid-column:1;grid-row:1; }
.test-library-panel { grid-column:2;grid-row:1 / span 2; }
.test-question-panel { grid-column:1;display:grid;grid-template-columns:175px minmax(0,1fr);gap:22px;padding:12px 18px; }
.test-mode-tabs { display:flex;gap:0;border-bottom:1px solid #d8e2f5;margin-bottom:18px; }
.tests-workspace button { cursor:pointer;font:inherit;transition:background .18s,border-color .18s,color .18s; }
.test-mode-tabs button { flex:0 1 240px;padding:12px 18px;border:1px solid #e5ebf6;border-radius:11px 11px 0 0;background:#f5f7fc;color:#687ca7;font-weight:650;display:flex;gap:12px;justify-content:center;align-items:center;white-space:nowrap; }
.test-mode-tabs button span { font-size:24px;line-height:1; }
.test-mode-tabs button svg { width:23px;height:25px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.test-mode-tabs button.active { border-color:#00bc70;border-bottom-color:#fff;background:#fff;color:#00ad64; }
.test-pdf-drop { border:1px dashed #7bdbd0;border-radius:10px;background:#f4fcfa;display:flex;align-items:center;flex-direction:column;padding:15px 10px;gap:12px; }
.test-pdf-drop.drag-over { background:#e8f9f1;border-color:#009e60; }
.test-pdf-drop>svg { width:28px;height:34px;fill:none;stroke:#00b764;stroke-width:2.5; }
.test-pdf-drop>b { font-size:18px; }
.test-file-choose { display:block!important;position:relative;overflow:hidden;border:1px solid #d8e2f5;background:white;border-radius:10px;padding:11px 22px;font-weight:650;cursor:pointer; }
.test-file-choose input,.test-asset-upload input { position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer; }
#test-pdf-selected { width:100%; }
#test-pdf-selected:empty,#test-import-status:empty,#test-error:empty { display:none; }
.test-selected-file { display:flex;gap:16px;align-items:center;width:100%;padding:12px;border:1px solid #d8e2f5;border-radius:10px;background:#fff; }
.test-selected-file>span:nth-child(2) { flex:1;overflow:hidden; }
.test-selected-file b,.test-selected-file small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.test-selected-file b { font-weight:500; }
.test-selected-file small { color:#687ca7;margin-top:4px; }
.test-selected-file a { color:inherit;text-decoration:none; }
.test-selected-file small { white-space:normal;overflow:visible;overflow-wrap:anywhere; }
.test-selected-file button { background:none;border:0;font-size:26px;color:#101c46; }
.test-pdf-icon { border:2px solid red;border-radius:3px;color:red;font-size:9px;padding:9px 3px;font-weight:bold; }
.test-basics { display:grid;grid-template-columns:minmax(0,1.8fr) repeat(2,minmax(0,1fr));gap:12px;margin-top:22px; }
.tests-workspace label { display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:500;color:#101c46; }
.tests-workspace input:not([type=checkbox]),.tests-workspace select,.tests-workspace textarea { width:100%;max-width:100%;border:1px solid #d8e2f5;background:white;color:#101c46;border-radius:10px;padding:12px;font:inherit;font-weight:400;outline:none;min-height:44px; }
.tests-workspace input:focus,.tests-workspace textarea:focus,.tests-workspace select:focus,.test-condition:focus { border-color:#00b66c;box-shadow:0 0 0 2px #00b66c15; }
.tests-workspace textarea { resize:vertical; }
.tests-workspace input::placeholder,.tests-workspace textarea::placeholder { color:#7889af; }
.test-create-actions { display:flex;gap:10px;justify-content:flex-end;margin-top:18px;align-items:center;flex-wrap:wrap; }
.test-primary { background:linear-gradient(120deg,#00b668,#009e60);border:0;border-radius:10px;color:white;padding:14px 24px;font-weight:650!important;display:flex;gap:22px;justify-content:center;box-shadow:0 5px 12px #009e6015; }
.test-primary:disabled { opacity:.6;cursor:wait; }
.test-save-draft,.test-cancel-edit { background:none;border:0;color:#687ca7;padding:8px;font-size:12px!important; }
.test-extra-settings,.test-question-settings { font-size:12px;margin-top:14px;color:#687ca7; }
.test-extra-settings summary,.test-question-settings summary { cursor:pointer; }
.test-extra-settings[open]>label,.test-question-settings[open]>label { margin-top:12px; }
.test-library-groups { display:flex;overflow-x:auto;gap:12px;padding-bottom:14px;scrollbar-width:thin; }
.test-library-heading { display:flex;justify-content:space-between;gap:8px;align-items:start; }
.test-library-heading>button { color:#687ca7;font-size:11px!important;border:0;background:none;padding:4px 0; }
.test-library-groups button { flex:0 0 auto;white-space:nowrap;border:1px solid #d8e2f5;border-radius:10px;color:#101c46;background:#fafbff;padding:12px 20px; }
.test-library-groups button.active { border-color:#00b96e;color:#00ad64;background:#fff; }
.test-library-cards { display:flex;flex-direction:column;gap:12px;max-height:950px;overflow-y:auto;padding:4px 3px 8px 0;scrollbar-width:thin;scrollbar-color:#c2cfe5 #f1f4fa; }
.test-library-card { position:relative;background:#f6f8fc;border-radius:14px;flex-shrink:0; }
.test-library-card.recent { background:linear-gradient(105deg,#f1fbf7,#f3fbf9); }
.test-card-open { border:0;background:none;display:flex;flex-direction:column;text-align:left;width:100%;padding:20px 40px 20px 16px;color:#101c46;gap:7px; }
.test-card-date { display:flex;align-items:center;gap:12px;font-size:14px;margin-bottom:4px; }
.test-card-date i { height:12px;width:12px;border-radius:50%;background:#687bb7;flex-shrink:0; }
.recent .test-card-date i { background:#00b966; }
.test-card-date small { padding:7px 10px;margin-left:auto;white-space:nowrap;border-radius:8px;background:#eaf3ff;color:#2789e9; }
.recent .test-card-date small { background:#ddfaec;color:#00aa63; }
.test-card-open>b { font-size:18px;line-height:1.25;overflow-wrap:anywhere; }
.test-card-open>span:not(.test-card-date) { color:#7889af;overflow-wrap:anywhere; }
.test-card-open em { color:#a67421;font-style:normal;font-size:12px; }
.test-card-menu { position:absolute;right:10px;top:44%;z-index:2;border:0;background:none;font-size:25px!important;color:#101c46;padding:4px 7px; }
.test-card-menu[open] { z-index:5; }
.test-card-menu summary { font-size:25px;list-style:none;cursor:pointer;padding:4px 7px; }
.test-card-menu summary::-webkit-details-marker { display:none; }
.test-card-menu>div { position:absolute;right:0;top:100%;width:175px;display:flex;flex-direction:column;background:#fff;box-shadow:0 4px 24px #101c4630;border:1px solid #d8e2f5;border-radius:10px;padding:5px; }
.test-card-menu button { text-align:left;border:0;background:white;padding:9px;border-radius:5px;font-size:13px; }
.test-card-menu button:hover { background:#e8f9f1; }
.test-library-empty,.test-editor-empty { color:#7889af;padding:28px 10px;text-align:center; }
.test-question-nav { display:flex;flex-direction:column;gap:5px;border-right:1px solid #f0f3fa;padding-right:12px;align-self:start;max-height:620px;overflow-y:auto; }
.test-question-nav button { display:flex;align-items:center;gap:12px;flex-shrink:0;border:1px solid #e5ebf6;border-radius:10px;background:white;color:#243566;text-align:left;padding:3px 7px;font-size:13px;white-space:nowrap;min-height:35px; }
.test-question-nav button>b { height:27px;min-width:27px;display:grid;place-items:center;border-radius:50%;background:#f1f4fa;color:#101c46;font-size:16px; }
.test-question-nav button.active { color:#00a761;background:#d9f8e8;border-color:#a1edc8; }
.test-question-nav button.needs-review i { color:#d17d00;font-style:normal;font-weight:bold; }
.test-question-nav small { margin-left:3px; }
.test-question-nav button>span { white-space:normal;overflow-wrap:anywhere; }
.test-question-nav .test-add-question { justify-content:center;color:#009e60;font-size:12px; }
.test-question-detail { padding:10px 0 8px;overflow-wrap:anywhere; }
.test-question-heading { display:flex;align-items:center;gap:14px;border-bottom:1px solid #d8e2f5;margin-bottom:9px;padding-bottom:10px;flex-wrap:wrap; }
.test-question-heading h3 { margin:0;font-size:21px; }
.test-question-heading>span { background:#eaf3ff;color:#198eff;padding:8px 12px;border-radius:8px;font-size:14px; }
.test-condition { white-space:pre-wrap;line-height:1.5;font-size:15px;outline:none;border:1px solid transparent;border-radius:7px;padding:2px;min-height:55px;overflow-wrap:anywhere; }
.test-condition:empty::before { content:'Введите условие задания';color:#7889af; }
.test-read-more { display:none;border:0;background:none;color:#198eff;padding:0; }
.test-assets { margin-top:20px; }
.test-assets h4 { margin:0 0 7px;font-size:15px; }
.test-no-assets { min-height:90px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f5f7fc;border:1px solid #e5ebf6;border-radius:10px;color:#7889af;gap:5px; }
.test-no-assets svg { width:30px;height:30px;stroke:#101c46;stroke-width:2.5;fill:none; }
.test-source-figure,.test-table-figure { margin:10px 0;background:#fbfcfe;border:1px solid #e5ebf6;border-radius:10px;overflow:hidden; }
.test-source-figure img { display:block;width:100%;height:auto; }
.test-source-figure figcaption,.test-table-figure figcaption { color:#7889af;font-size:11px;padding:5px 8px; }
.test-source-figure button,.test-table-figure button { font-size:11px;color:#ac283b;border:0;background:none; }
.test-table-scroll { overflow-x:auto;max-width:100%; }
.test-table-scroll table { border-collapse:collapse;min-width:100%;font-size:12px; }
.test-table-scroll td { border:1px solid #d8e2f5;padding:7px;white-space:pre-wrap; }
.test-answer-grid { display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:14px;margin-top:14px; }
.test-answer-grid label { background:#f6f8fc;border-radius:10px;padding:12px; }
.test-answer-grid small { color:#7889af;font-weight:400; }
.test-explanation-field textarea { min-height:75px; }
.test-warnings { font-size:12px;color:#956212;background:#fff9eb;border:1px solid #ffe1a3;padding:10px;border-radius:8px;margin-top:12px; }
.test-warnings p { margin:0 0 6px; }
.test-warnings label { flex-direction:row;align-items:center;margin-top:8px; }
.test-warnings input { width:auto; }
.test-shared-material { margin-bottom:12px;font-size:13px; }
.test-shared-material pre { white-space:pre-wrap;overflow-wrap:anywhere; }
.test-asset-upload { position:relative;display:inline-block!important;overflow:hidden;max-width:180px;padding:10px;border:1px solid #d8e2f5;border-radius:8px;color:#009e60!important; }
.test-remove-question { display:block;border:0;background:none;color:#bc3545;margin-top:10px;padding:8px 0; }
.test-results-dialog { width:min(900px,calc(100vw - 24px));max-height:85vh;overflow:auto;border:1px solid #d8e2f5;border-radius:16px;color:#101c46;padding:24px; }
.test-results-dialog::backdrop { background:#101c4670; }
.test-actions-dialog { width:min(300px,calc(100vw - 28px));border:1px solid #d8e2f5;border-radius:14px;padding:8px;color:#101c46; }
.test-actions-dialog::backdrop { background:#101c4640; }
.test-actions-dialog button { display:block;width:100%;background:white;border:0;border-radius:8px;color:#101c46;font:inherit;text-align:left;padding:13px;cursor:pointer; }
.test-actions-dialog button:hover { background:#e8f9f1; }
.test-image-error { color:#ac283b;font-size:12px;padding:8px; }
.test-dialog-close { float:right;border:0;background:none;font-size:25px; }
.test-results-dialog details { border-bottom:1px solid #d8e2f5;padding:14px 0; }
.test-results-dialog summary { cursor:pointer; }
.test-results-dialog pre { white-space:pre-wrap;overflow-wrap:anywhere;background:#f7fafd;padding:12px; }
@media(max-width:1279px) {
  .tests-workspace { grid-template-columns:minmax(0,1fr); }
  .test-library-panel { grid-column:1;grid-row:1; }
  .test-create-panel { grid-column:1;grid-row:2; }
  .test-question-panel { grid-column:1;grid-row:3; }
  .test-library-cards { flex-direction:row;overflow-x:auto;overflow-y:hidden;max-height:none;scroll-snap-type:x proximity;gap:12px;padding-bottom:12px; }
  .test-library-card { flex:0 0 260px;scroll-snap-align:start; }
  .test-card-open { padding:18px 30px 17px 14px; }
  .test-card-date { gap:10px;font-size:13px; }
  .test-card-date small { padding:6px 8px;font-size:12px; }
  .test-card-open>b { font-size:17px; }
  .test-basics { grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px; }
}
@media(max-width:600px) {
  .tests-workspace { gap:12px; }
  .tests-panel { padding:15px 12px;border-radius:16px; }
  .tests-panel h3 { font-size:22px;margin-bottom:14px; }
  .test-library-groups { gap:8px;padding-bottom:11px; }
  .test-library-groups button { padding:10px 14px;font-size:14px; }
  .test-library-card { flex-basis:235px; }
  .test-mode-tabs { margin-bottom:12px; }
  .test-mode-tabs button { flex:1;padding:12px 6px;font-size:13px;gap:7px; }
  .test-mode-tabs button span { font-size:21px; }
  .test-pdf-drop { gap:10px;padding:12px 8px; }
  .test-pdf-drop>b { font-size:16px; }
  .test-file-choose { padding:10px 15px;font-size:14px!important; }
  .test-selected-file { padding:8px;gap:10px;font-size:13px; }
  .test-selected-file small { font-size:11px; }
  .test-basics { gap:12px;margin-top:16px; }
  .tests-workspace label { font-size:13px; }
  .tests-workspace input:not([type=checkbox]),.tests-workspace select,.tests-workspace textarea { min-height:42px;padding:10px;font-size:14px; }
  .test-create-actions { gap:6px;margin-top:12px; }
  .test-primary { width:100%;padding:14px;order:-1; }
  .test-save-draft { margin-left:auto; }
  .test-extra-settings { margin-top:10px; }
  .test-question-panel { display:block; }
  .test-question-nav { flex-direction:row;overflow-x:auto;border:0;padding:2px 0 8px;margin-bottom:8px;gap:7px;max-height:none; }
  .test-question-nav button { padding:4px 8px;font-size:13px;min-height:39px; }
  .test-question-nav small { display:none; }
  .test-question-heading { border-bottom:0;gap:10px;padding-bottom:4px; }
  .test-question-heading h3 { margin:0;font-size:20px; }
  .test-question-heading>span { font-size:12px;padding:8px; }
  .test-condition { font-size:15px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden; }
  .test-condition.expanded,.test-condition:focus { display:block; }
  .test-read-more { display:block;font-size:13px;margin-top:4px; }
  .test-assets { margin-top:12px; }
  .test-assets h4 { display:none; }
  .test-no-assets { min-height:82px;font-size:14px; }
  .test-answer-grid { grid-template-columns:1fr;gap:12px; }
  .test-answer-grid label { padding:0;background:none; }
  .test-warnings { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) { .tests-workspace * { transition:none!important;scroll-behavior:auto!important; } }
.student-universal-test { max-width:100%;min-width:0;color:#101c46; }
.student-test-nav { display:flex;overflow-x:auto;gap:8px;margin:18px 0; }
.student-test-nav button { flex:0 0 40px;min-height:40px;border:1px solid #d8e2f5;border-radius:10px;background:white;color:#101c46; }
.student-test-nav .answered { background:#e8f9f1;color:#009e60; }
.student-test-nav .active { border:2px solid #009e60; }
.student-test-question { background:white;border-radius:16px;padding:20px;min-width:0; }
.student-test-question h2 { font-size:22px;margin:0 0 12px; }
.student-test-source { color:#198eff;background:#eaf3ff;border-radius:8px;padding:6px 12px;display:inline-block;margin-bottom:12px; }
.student-test-condition { white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55; }
.student-test-input { margin-top:20px; }
.student-test-input label { display:flex;flex-direction:column;gap:8px; }
.student-test-input input:not([type=radio]):not([type=checkbox]),.student-test-input textarea { width:100%;max-width:100%;min-height:44px;border:1px solid #d8e2f5;border-radius:10px;padding:12px;font:inherit;background:#fff;color:#101c46;box-sizing:border-box; }
.student-test-input .student-test-option { flex-direction:row;align-items:center;padding:12px;border:1px solid #d8e2f5;border-radius:10px;margin-bottom:8px; }
.student-test-input .student-code-answer { font-family:monospace;white-space:pre;overflow:auto;tab-size:4; }
.student-test-answer-table { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
.student-test-actions { display:flex;gap:12px;justify-content:space-between;margin:18px 0; }
.student-test-actions button { background:#e8f9f1;color:#009e60;border:1px solid #d8e2f5;border-radius:10px;padding:12px;cursor:pointer; }
.student-test-actions button:disabled { opacity:.45; }
#student-test-status { color:#687ca7;font-size:12px; }
#student-test-error { color:#b22b35; }
.student-test-theory p { white-space:pre-wrap; }
.student-universal-test pre { white-space:pre-wrap;overflow-wrap:anywhere; }
@media(max-width:600px) { .student-test-question { padding:14px; } .student-test-condition { font-size:15px; } }
.question-content { min-width:0;max-width:100%; }
.content-text { white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55; }
.content-code { white-space:pre;overflow:auto;max-width:100%;font-family:monospace;tab-size:4; }
.content-math { overflow-x:auto;max-width:100%;padding:10px 0;font-size:1.15em; }
.question-content .content-media { margin:12px 0;max-width:100%; }
.question-content .content-media img { display:block;width:auto;height:auto;max-width:100%;margin:auto;border:1px solid #edf0f7;border-radius:6px; }
.question-content .content-media figcaption { color:#657399;font-size:12px;margin-top:5px; }
.test-reference-answer { margin:14px 0;border:1px solid #cee9dd;border-radius:12px;background:#f3fcf7;padding:14px; }
.test-reference-answer h4 { margin:0 0 8px; }
math-field { display:block;width:100%;box-sizing:border-box;min-height:48px;border:1px solid #d8e2f5;border-radius:10px;padding:8px;background:white;font-size:20px;--keyboard-zindex:10020; }
.student-test-solution textarea { min-height:180px; }
.student-solution-files { display:flex;flex-direction:column;gap:8px;margin:12px 0; }
.student-solution-files button { padding:8px;border:1px solid #d8e2f5;background:#f4f9ff;border-radius:8px; }
.test-content-editors textarea { min-height:90px;width:100%; }
.content-image-dialog { width:min(1100px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:95dvh;padding:14px;box-sizing:border-box;border:1px solid #d8e2f5;border-radius:16px;color:#101c46; }
.content-image-dialog::backdrop { background:#101c46a6; }
.content-image-dialog header { display:flex;gap:8px;align-items:center;margin-bottom:12px; }
.content-image-dialog header b { flex:1; }
.content-image-dialog button { min-width:40px;min-height:40px;border:1px solid #d8e2f5;border-radius:8px;background:#f3fcf7;color:#101c46; }
.content-image-zoom { overflow:auto;max-height:70dvh;overscroll-behavior:contain; }
.content-image-zoom img { display:block;max-width:none;height:auto; }
.content-image-dialog p { margin:10px 0 0;font-size:12px;color:#657399; }
@media(max-width:600px) { .content-math { font-size:1em; } .student-test-solution textarea { min-height:160px; } .test-reference-answer { padding:10px; } }
