*{box-sizing:border-box}body{background:#f3f6fb;color:#1b2b45;font-family:Segoe UI,Arial,sans-serif}.topbar{background:#112a50;color:white;padding:18px 28px;display:flex;align-items:center;gap:28px;flex-wrap:wrap}.brand{font-size:22px;font-weight:800;color:white;text-decoration:none}.brand span{font-size:15px;margin-left:12px;font-weight:500}nav{display:flex;gap:20px;flex:1;flex-wrap:wrap}nav a{color:#d8e6fc;text-decoration:none;font-size:14px}.shell{max-width:1440px;margin:30px auto;padding:0 24px}h1{font-size:30px;font-weight:750}h2{font-size:21px}h3{font-size:17px}.eyebrow{color:#4773ad;text-transform:uppercase;letter-spacing:2px;font-size:12px;font-weight:700}.panel,.qcard{background:white;border:1px solid #dee6f1;border-radius:12px;padding:24px;margin-bottom:18px;box-shadow:0 3px 9px #1e375007}.muted{color:#64748b}.notice{background:#e3eefc;border-left:4px solid #376cc5;padding:14px;margin-bottom:15px}.error{color:#a32929}.button,button{border:0;border-radius:7px;background:#215cc3;color:white;padding:10px 16px;text-decoration:none;display:inline-block;cursor:pointer}button:disabled{opacity:.5;cursor:default}.secondary{background:#e7eef8;color:#234b81}.danger{background:#a83c47}.linkbutton{background:none;padding:0;color:white}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:18px 0}label{font-weight:600;font-size:13px;display:block;margin-bottom:5px}input:not([type=checkbox]),select,textarea{border:1px solid #cbd7e7;border-radius:7px;padding:9px 11px;max-width:100%;width:100%;background:white;color:#1b2b45}input[type=checkbox]{width:18px;height:18px}form p{margin-bottom:16px}textarea{font-family:inherit}.filters{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.builder{display:grid;grid-template-columns:280px 1fr;gap:22px;align-items:start}.summary-panel{position:sticky;top:20px;max-height:90vh;overflow:auto}.qcard .select-line{display:flex;gap:12px;align-items:start}.option{margin:8px 0 0 30px}.question-image{display:block;max-width:100%;max-height:280px;margin:14px 0}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.stat{font-size:34px;font-weight:700;color:#215cc3}.tag{border-radius:5px;background:#e9f0fb;color:#2c5b95;font-size:12px;padding:4px 8px;display:inline-block}.two{display:grid;grid-template-columns:1fr 1fr;gap:22px}pre{white-space:pre-wrap;overflow-wrap:anywhere}.login{max-width:440px;margin:70px auto}.tiny{padding:3px 8px;margin:2px;font-size:12px}table{width:100%}th,td{padding:12px;border-bottom:1px solid #e1e8f0;text-align:left}td a{margin-right:9px}.selected-item{padding:8px 0;border-bottom:1px solid #edf1f7;font-size:13px}.summary-total{font-size:20px;font-weight:700}.empty{text-align:center;padding:50px;color:#718099}details summary{cursor:pointer;font-weight:600}@media(max-width:850px){.filters{grid-template-columns:repeat(2,1fr)}.builder,.two{grid-template-columns:1fr}.summary-panel{position:static}.topbar{padding:15px}.stats{grid-template-columns:1fr}.shell{padding:0 12px}}

.equation-image{display:inline!important;vertical-align:middle;max-height:2em;max-width:18em;width:auto;height:auto;margin:0 .12em}

.mixed-editor{min-height:90px;border:1px solid #aab7c5;border-radius:6px;padding:12px;white-space:pre-wrap;background:white}.mixed-editor:focus{outline:2px solid #2563eb}

.subscription-warning{background:#fff3cd;border-color:#e6ac00}.subscription-strong{background:#ffe1b3;border-color:#d66a00;font-weight:600}.subscription-danger{background:#fde2e2;border-color:#c21c1c;color:#8b1010;font-weight:700}

.subscription-summary{margin-bottom:20px;border-left:4px solid #245bc2;font-size:14px}.subscription-summary strong{display:inline-block;margin-right:12px}.subscription-summary .notice{margin-bottom:0}

.report-dialog{width:min(540px,90vw);border:1px solid #cbd5e1;border-radius:16px;padding:26px;box-shadow:0 20px 70px #132d5555}.report-dialog::backdrop{background:#10254566}.report-inline{margin-left:12px;padding:4px 12px!important;font-size:13px}.qid-search{display:flex;align-items:end;gap:12px}.qid-search label{flex:1}.report-card{border-left:3px solid #3468c7;padding:18px;margin:16px 0;background:#f7faff}.report-filters{display:flex;flex-wrap:wrap;gap:12px}.report-filters label{min-width:150px;flex:1}

.subject-summary{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:14px 0;border-bottom:1px solid #dce5ef}.subject-summary strong{flex:1}.selected-dialog{width:min(1100px,94vw);max-height:90vh;overflow:auto;border:1px solid #cbd5e1;border-radius:16px;padding:24px;color:#102442}.selected-dialog::backdrop{background:#10244299}.selected-dialog .toolbar{justify-content:space-between}.selected-review{border-top:1px solid #dce5ef;padding:20px 0}.instruction-editor{padding:12px;background:#eff6ff;border-radius:8px;margin:10px 0}.instruction-editor label{display:block;margin:10px 0}.multi-filter{position:relative;background:white;border:1px solid #cbd5e1;border-radius:6px;min-height:40px}.multi-filter summary{padding:8px 12px;cursor:pointer;max-width:100%;overflow-wrap:anywhere}.multi-options{position:absolute;z-index:20;top:100%;left:0;min-width:100%;width:290px;max-height:280px;overflow:auto;padding:12px;background:white;border:1px solid #cbd5e1;box-shadow:0 6px 20px #10244222;border-radius:8px}.multi-options label{display:flex;gap:8px;align-items:center;padding:6px}.multi-options input{width:auto}.selected-review .qcard{margin-top:10px}

.question-number-nav{position:sticky;top:0;background:white;padding:10px 0;z-index:2}.number-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:8px 0}.number-group strong{min-width:155px}.question-number-button{padding:5px 10px;min-width:36px;background:#edf4ff;color:#174ea6;border:1px solid #b9cdeb;border-radius:4px}.question-number-button.active{background:#205bbd;color:white}.selected-review details>summary{cursor:pointer;color:#174ea6}.selected-dialog .toolbar{position:sticky;top:0;background:white;z-index:3}.selected-dialog{scroll-padding-top:60px}.selected-review .qcard details>summary{display:inline-block;padding:6px 12px;background:#edf4ff;border:1px solid #b9cdeb;border-radius:4px}


.rich-editor-wrap{border:1px solid #b7c8dc;border-radius:8px;overflow:hidden;margin:6px 0 16px;background:white}.editor-toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:7px;background:#edf3fa;border-bottom:1px solid #ccd9e7}.editor-toolbar button{font-size:12px;padding:4px 8px}.rich-editor-wrap .mixed-editor{border:0;border-radius:0;min-height:100px;max-height:420px;overflow:auto;white-space:pre-wrap}.mixed-editor .question-image{max-width:100%;max-height:200px}.mixed-editor .equation-image{max-height:2em;width:auto}.editor-selected{outline:2px solid #2563eb!important}.editor-status{display:block;min-height:18px;padding:4px 10px;color:#48627f}.mixed-editor:focus{outline:2px solid #2563eb;outline-offset:-2px}



/* The document scrolls naturally; controls dock only after reaching the top. */
.paper-builder-page .shell{max-width:none;margin:0 auto;padding:12px 16px 0;background:#075ba5}
.paper-builder-page .eyebrow{display:none}
.paper-builder-page h1{color:white;font-size:22px;margin:8px 0 12px}
.paper-builder-page .subscription-summary{padding:10px 14px;font-size:12px;margin-bottom:10px}
.paper-builder-page .builder-controls{position:sticky;top:0;z-index:25;background:#075ba5;border:0;border-radius:0;padding:12px 0;margin:0 0 12px;box-shadow:none}
.paper-builder-page .filters{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px 12px}
.paper-builder-page .filters label{color:white;font-size:12px;margin-bottom:4px}
.paper-builder-page .filters input,.paper-builder-page .filters select{padding:7px 9px;font-size:13px;min-height:36px}
.paper-builder-page .multi-filter{font-size:13px;min-height:36px}
.paper-builder-page .multi-filter summary{padding:7px 9px;max-height:50px;overflow:auto}
.paper-builder-page .multi-options label{color:#1b2b45}
.paper-builder-page .multi-options{max-width:90vw}
.paper-builder-page .filters>div:nth-last-child(-n+2) .multi-options{left:auto;right:0}
.paper-builder-page .mb-3{margin-bottom:10px!important}
.paper-builder-page .builder{grid-template-columns:270px minmax(0,1fr);grid-template-rows:auto 1fr;grid-template-areas:"summary questions" "actions questions";gap:16px;align-items:start}
.paper-builder-page .summary-panel{grid-area:summary;position:static;max-height:45vh;overflow:auto;background:#e7f1f8;padding:20px;margin:0}
.paper-builder-page .builder-actions{grid-area:actions}
.paper-builder-page #generate{width:100%;background:#12aa51;font-weight:700;font-size:17px;padding:18px;border:1px solid #b0edc7}
.paper-builder-page #save-error{background:#fff0f0;border-radius:6px;padding:10px;margin:0 0 10px}
.paper-builder-page #save-error:empty{display:none}
.paper-builder-page .builder-questions{grid-area:questions;min-width:0;height:calc(100dvh - var(--builder-controls-height,240px) - 20px);min-height:300px;overflow:auto;background:#f1f6fa;border:1px solid #d7e3ef;border-radius:12px;padding:12px;overscroll-behavior:auto}
.paper-builder-page .qcard{padding:20px;margin-bottom:12px}
.builder-contact{display:flex;justify-content:center;align-items:center;gap:28px;flex-wrap:wrap;background:#102b4b;padding:16px;margin:18px -16px 0;color:white}
.builder-contact a{display:inline-flex;gap:9px;align-items:center;color:white;text-decoration:none;font-size:14px}
.builder-contact a:hover{text-decoration:underline}
@media(max-width:1100px) and (min-width:701px){.paper-builder-page .filters{grid-template-columns:repeat(4,minmax(0,1fr))}.paper-builder-page .builder{grid-template-columns:230px minmax(0,1fr)}}
@media(max-width:700px){.paper-builder-page .shell{padding:10px 10px 0}.paper-builder-page .builder-controls{position:relative;padding-top:4px}.paper-builder-page .filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.paper-builder-page .builder{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;grid-template-areas:"summary" "questions" "actions";gap:12px}.paper-builder-page .summary-panel{max-height:220px;padding:14px}.paper-builder-page .builder-questions{height:65dvh;min-height:320px;padding:8px}.paper-builder-page .qcard{padding:14px}.builder-contact{margin:16px -10px 0;gap:12px;padding:16px 8px}.builder-contact a{font-size:13px}.paper-builder-page .multi-options{width:260px}.paper-builder-page .filters>div:nth-child(even) .multi-options{left:auto;right:0}}

.subscription-tab{position:relative;color:#d8e6fc;font-size:14px}
.subscription-tab>summary{cursor:pointer;font-weight:400;list-style:none}
.subscription-tab>summary::-webkit-details-marker{display:none}
.subscription-tab[open]>summary{color:white;text-decoration:underline;text-underline-offset:5px}
.subscription-popover{position:absolute;right:0;top:calc(100% + 14px);z-index:100;width:310px;max-width:90vw;padding:20px;background:white;color:#1b2b45;border:1px solid #d7e3ef;border-radius:12px;box-shadow:0 12px 36px #102b4b33}
.subscription-popover dl{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0 0}.subscription-popover dd{margin:0;text-align:right}.subscription-popover .notice{margin:14px 0 0}
.paper-builder-page .shell{padding-top:0}
.paper-builder-page .builder{grid-template-columns:250px minmax(0,1fr)}
.paper-builder-page .builder-questions{height:calc(100dvh - var(--builder-controls-height,240px) - 8px)}
@media(max-width:700px){.paper-builder-page .builder{grid-template-columns:minmax(0,1fr)}.paper-builder-page .builder-questions{height:72dvh}.subscription-popover{position:fixed;left:5vw;right:auto;top:auto;margin-top:12px}}

/* Compact controls and a larger reading area for test selection. */
.paper-builder-page .builder-controls>.filters:first-child{grid-template-columns:repeat(6,minmax(0,1fr))}
.paper-builder-page #filters{grid-template-columns:repeat(8,minmax(0,1fr))}
.paper-builder-page .builder{grid-template-columns:320px minmax(0,1fr)}
.builder-template{margin-bottom:18px}.builder-template>label{color:white}
.paper-builder-page .builder-questions{height:calc(200dvh - var(--builder-controls-height,240px) * 2 - 16px)}
.paper-builder-page .qcard{font-size:14px;line-height:1.5;cursor:pointer}
.paper-builder-page .qcard .select-line>div{min-width:0;flex:1}
.paper-builder-page .qcard .tag{font-size:10px;padding:3px 6px}
.paper-builder-page .qcard .option{margin:6px 0 0}
.paper-builder-page .question-solution{margin-top:12px;cursor:default}
.paper-builder-page .question-solution>summary{display:inline-block;list-style:none;background:#12aa51;color:white;border-radius:6px;padding:7px 13px;font-size:13px}
.paper-builder-page .question-solution>summary::-webkit-details-marker{display:none}
.paper-builder-page .question-solution[open]>summary{background:#087e38}
.paper-builder-page .qb-solution-box{margin-top:10px;padding:14px;background:#e5faed;border:1px solid #c7ecd5;border-radius:7px;font-size:13px;color:#17562e;overflow-wrap:anywhere}
@media(max-width:1100px){.paper-builder-page .builder-controls>.filters:first-child,.paper-builder-page #filters{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){.paper-builder-page .builder{grid-template-columns:minmax(0,1fr)}.paper-builder-page .builder-controls>.filters:first-child,.paper-builder-page #filters{grid-template-columns:repeat(2,minmax(0,1fr))}.paper-builder-page .builder-questions{height:144dvh}.builder-template{margin-top:0}}

.summary-panel .builder-template>label{color:#1b2b45}.summary-panel .builder-template{margin:18px 0 0}

.question-card-actions{display:grid;grid-template-columns:max-content max-content minmax(0,1fr);gap:10px;align-items:start;margin-top:12px}
.question-card-actions .question-solution{display:contents}
.question-card-actions .question-solution>summary{grid-column:1;grid-row:1}
.question-card-actions .qb-solution-box{grid-column:1/-1;grid-row:2;margin-top:0}
.question-card-actions .report-inline{grid-column:2;grid-row:1;margin:0;background:#fff1b8;color:#745300;padding:7px 13px!important;font-size:13px;line-height:1.5}
.question-card-actions .report-inline:hover{background:#ffe58a}
.paper-builder-page .qcard .question-card-meta{display:block;width:fit-content;max-width:100%;margin:12px 0 0 auto;text-align:right;background:transparent;color:#64748b;font-size:10px;padding:0}
.question-card-text{margin-top:0}

/* Answers occupy their own full-width row, independent of button layout. */
.paper-builder-page .qb-solution-box{width:100%;min-width:0;margin-top:12px;background:#faf9f6;border-color:#e6e3dc;color:#1b2b45}
.qb-solution-box[hidden]{display:none!important}
.question-card-actions .question-solution{display:block;margin:0}

.paper-builder-page .builder{grid-template-rows:auto auto 1fr;grid-template-areas:"summary questions" "template questions" "actions questions"}
.paper-builder-page .builder>.builder-template{grid-area:template;margin:0}
.template-picker{display:flex;align-items:center;gap:7px}.template-picker select{min-width:0;flex:1}
.template-add,.template-edit{display:flex;align-items:center;justify-content:center;flex:0 0 36px;height:38px;border-radius:6px;color:white!important;text-decoration:none!important;font-size:23px;font-weight:700;background:#13b5a6}
.template-edit{background:#eab308;font-size:21px}.template-edit[aria-disabled=true]{opacity:.45;cursor:not-allowed}
.filter-label-icon{display:inline-block;width:18px;margin-right:5px;text-align:center;font-size:14px}
.paper-builder-page .summary-panel h2{font-size:18px;margin:0 0 14px}.paper-builder-page .summary-panel .subject-summary{font-size:13px;padding:9px 0}.paper-builder-page .summary-total{font-size:15px;margin:12px 0 0}
.paper-builder-page .multi-options label{padding:2px 4px;margin:0;font-size:12px;line-height:1.25;min-height:26px}.paper-builder-page .multi-options input[type=checkbox]{margin:0;flex-shrink:0}
@media(max-width:700px){.paper-builder-page .builder{grid-template-rows:auto auto auto auto;grid-template-areas:"summary" "template" "questions" "actions"}}

.filter-warning{font-size:12px;color:#713f12;background:#fff3cd;border:1px solid #f0ce72;border-radius:5px;padding:6px 9px;margin-top:5px}


.download-progress{width:min(520px,90vw);border:0;border-radius:16px;padding:30px;background:#082b50;color:white;text-align:center}.download-progress::backdrop{background:#0009}.download-progress progress{width:100%;height:26px;accent-color:#2588ff}

.test-list-page{max-width:1260px;margin:45px auto}.test-list-title{text-align:center;font-size:30px;margin-bottom:28px}.test-list-title span{color:#6740d9;margin-right:10px}.test-create{display:inline-flex;align-items:center;gap:12px;background:linear-gradient(110deg,#2563eb,#4931cf);font-size:14px;font-weight:600;padding:13px 24px;margin-bottom:26px;box-shadow:0 4px 10px #253b6320}.test-create svg{width:18px;height:18px}.test-table-wrap{border:1px solid #e3e5ed;border-radius:13px;overflow-x:auto;box-shadow:0 12px 40px #21344e12;background:white}.test-table{border-collapse:collapse;font-size:14px}.test-table thead{background:linear-gradient(110deg,#4536cc,#851ace);color:white}.test-table th{padding:23px 22px;border:0;white-space:nowrap}.test-table td{padding:24px 22px;vertical-align:middle}.test-table tbody tr:nth-child(even){background:#f8f9fc}.test-table small{display:block;font-size:11px;color:#718096;margin-top:6px}.test-table strong{font-weight:600}.test-paper-id{color:#6534e8}.test-date{color:#c92c52;white-space:nowrap}.test-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:510px}.test-actions form{margin:0}.test-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;border-radius:6px;padding:8px 11px;font-size:12px;font-weight:600;line-height:1.1;color:white!important;text-decoration:none!important;margin:0!important;box-shadow:0 4px 12px #15264418}.test-action svg{width:14px;height:14px;flex-shrink:0}.test-action:hover{filter:brightness(.93)}.action-paper{background:#2860ed}.action-key{background:#119c48}.action-solution{background:#0aaa68}.action-edit{background:#c58f00}.action-marking{background:#9231e4}.action-delete{background:#e3222c}.test-pagination{justify-content:center;align-items:center;gap:20px;margin-top:24px;font-size:14px}.test-pagination a{color:#5035cf}@media(max-width:700px){.test-list-page{margin:20px auto}.test-table th,.test-table td{padding:16px 12px}.test-list-title{font-size:25px}.test-actions{min-width:260px}.test-create{margin-bottom:18px}}

/* Allow filters to leave the viewport so questions can use the full screen. */
.paper-builder-page .builder-controls{position:relative;top:auto}
.paper-builder-page .builder-questions{height:100dvh;min-height:320px}
