.library-page{--library-accent:var(--accent);--library-button:var(--accent);max-width:1480px;margin:auto;padding:24px 28px 80px;color:var(--text,var(--ink));animation:library-enter .3s ease-out}.library-hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:28px;padding:42px;border:1px solid var(--line);border-radius:28px;background:radial-gradient(ellipse at 90% 15%,#4fa37c30,transparent 48%),linear-gradient(120deg,var(--surface,var(--paper)),color-mix(in srgb,var(--surface,var(--paper)) 90%,#1f7a5a));box-shadow:0 16px 48px #123b2e0b}.library-kicker{font-size:11px;font-weight:850;letter-spacing:.18em;color:var(--library-accent);text-transform:uppercase;margin:0 0 14px}.library-hero h1{font-size:clamp(36px,4.6vw,62px);line-height:1.06;letter-spacing:-.05em;margin:0}.library-hero p:last-child{color:var(--muted,var(--ink-soft));max-width:620px;line-height:1.65}.library-primary{background:var(--library-button)!important;color:var(--on-accent)!important;border-color:var(--library-button)!important}.library-tabs{display:flex;gap:8px;overflow:auto;padding:22px 0;border-bottom:1px solid var(--line);margin-bottom:24px}.library-tabs button{border:1px solid transparent;background:transparent;color:var(--muted,var(--ink-soft));font:inherit;font-weight:700;padding:12px 18px;border-radius:13px;white-space:nowrap;cursor:pointer}.library-tabs button[aria-current=page]{background:color-mix(in srgb,var(--surface,var(--paper)) 86%,var(--library-accent));border-color:color-mix(in srgb,var(--line) 60%,var(--library-accent));color:var(--text,var(--ink))}.library-tools{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:22px 0}.library-tools input,.library-tools select{min-height:44px}.library-tools>label{flex:1;min-width:150px}.library-tools label span{display:block;font-size:12px;color:var(--muted,var(--ink-soft));margin-bottom:6px}.library-shelf{--shelf-color:#1f7a5a;position:relative;border:1px solid var(--line);border-radius:24px;margin:22px 0;padding:24px 28px 30px;background:linear-gradient(180deg,var(--surface,var(--paper)) 70%,color-mix(in srgb,var(--surface,var(--paper)) 90%,var(--shelf-color)));overflow:hidden}.library-shelf[data-type=literature]{--shelf-color:#287c61}.library-shelf[data-type=workbook]{--shelf-color:#368767}.library-shelf[data-type=reference]{--shelf-color:#246c50}.library-shelf[data-type=methodical]{--shelf-color:#39785b}.library-shelf-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:28px}.library-shelf-head h2{margin:0;font-size:22px;letter-spacing:-.025em}.library-shelf-head small{color:var(--muted,var(--ink-soft))}.library-books{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));align-items:start;gap:32px 26px;padding:0 8px 20px;border-bottom:9px solid color-mix(in srgb,var(--shelf-color) 50%,var(--surface,var(--paper)));box-shadow:0 12px 14px -13px #123b2e40}.library-book{display:flex;flex-direction:column;align-items:center;text-align:left;gap:14px;min-width:0;max-width:230px;width:100%;background:transparent;border:0;color:inherit;cursor:pointer;font:inherit;padding:0 6px}.library-book-object{position:relative;width:100%;max-width:170px;aspect-ratio:.7;transform:perspective(850px) rotateY(-12deg);transform-origin:left center;transition:transform .25s,filter .25s;filter:drop-shadow(8px 12px 7px #123b2e25)}.library-book:hover .library-book-object,.library-book:focus-visible .library-book-object{transform:perspective(850px) rotateY(-22deg) translateY(-7px);filter:drop-shadow(12px 19px 9px #123b2e35)}.library-book-object:before{content:'';position:absolute;inset:5px -8px 3px 14px;border-radius:2px 5px 5px 2px;background:repeating-linear-gradient(0deg,#f1f6ec 0 2px,#c9d8ca 2px 3px);transform:skewY(2deg)}.library-book-front{position:absolute;inset:0;display:flex;flex-direction:column;gap:10px;padding:20px 16px 16px 24px;border-radius:3px 6px 6px 3px;background:linear-gradient(120deg,color-mix(in srgb,var(--shelf-color) 80%,#fff),var(--shelf-color));color:white;border:1px solid #ffffff30;overflow:hidden;box-shadow:inset 7px 0 6px -4px #0007,inset -2px 0 2px #fff3}.library-book-front:after{content:'';position:absolute;left:10px;top:0;bottom:0;width:2px;background:#0002;box-shadow:2px 0 2px #fff2}.library-book-front img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#f1f6ec}.library-book-front small{font-size:9px;letter-spacing:.1em;text-transform:uppercase}.library-book-front strong{font-size:clamp(14px,1.4vw,20px);line-height:1.25;overflow-wrap:anywhere}.library-book-front em{font-size:11px;font-style:normal;margin-top:auto}.library-book-brand{font-size:11px;font-weight:850;letter-spacing:.12em}.library-book-caption{width:100%;display:grid;gap:5px}.library-book-caption strong{font-size:13px;line-height:1.4}.library-book-caption small{font-size:11px;color:var(--muted,var(--ink-soft));line-height:1.5}.library-empty{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;min-height:130px;border:1px dashed color-mix(in srgb,var(--line) 55%,var(--shelf-color,var(--library-accent)));border-radius:16px;padding:26px;background:color-mix(in srgb,var(--surface,var(--paper)) 97%,var(--library-accent))}.library-empty p{color:var(--muted,var(--ink-soft));font-size:13px;line-height:1.6;margin-bottom:0}.library-dialog{width:min(940px,calc(100vw - 28px));max-height:calc(100dvh - 32px);border:1px solid var(--line);border-radius:24px;background:var(--surface,var(--paper));color:var(--text,var(--ink));padding:28px;box-shadow:0 30px 100px #0005}.library-dialog::backdrop{background:#0a262099;backdrop-filter:blur(8px)}.library-dialog header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.library-dialog h2{margin:0;font-size:26px;letter-spacing:-.035em}.library-dialog header button{font-size:25px;background:none;color:inherit;border:0;cursor:pointer}.library-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.library-field{display:grid;gap:7px;font-size:12px;font-weight:700}.library-field input,.library-field select,.library-field textarea,.library-tools input,.library-tools select{width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:11px;background:var(--surface,var(--paper));color:inherit;font:inherit}.library-field[hidden]{display:none}.library-span{grid-column:1/-1}.library-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}.library-hint{font-size:12px;color:var(--muted,var(--ink-soft));line-height:1.65}.library-tags{display:flex;gap:7px;flex-wrap:wrap;padding:8px;border:1px solid var(--line);border-radius:12px}.library-tags button{border:0;border-radius:7px;padding:6px 8px;background:color-mix(in srgb,var(--surface,var(--paper)) 80%,var(--library-accent));color:inherit;cursor:pointer}.library-tags input{flex:1;min-width:130px;border:0!important}.library-cover-picker{display:flex;align-items:center;justify-content:center;gap:18px;margin:16px 0}.library-cover-picker canvas{max-width:160px;max-height:230px;box-shadow:4px 8px 18px #0002}.library-task{border:1px solid var(--line);border-left:4px solid var(--library-accent);border-radius:16px;padding:20px;margin:12px 0;background:var(--surface,var(--paper))}.library-task h3{margin:0}.library-feedback{color:var(--ink-soft);font-size:13px;line-height:1.6}.library-detail-frame{width:100%;height:60dvh;border:1px solid var(--line);border-radius:14px}.library-test-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.library-test-card{padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface,var(--paper));position:relative}.library-test-card h3{font-size:20px;margin:14px 0}.library-test-card small{color:var(--muted,var(--ink-soft))}.library-error{padding:20px;border-radius:14px;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--ink)}@keyframes library-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@media(max-width:650px){.library-page{padding:16px 14px 60px}.library-hero{padding:26px;display:block}.library-hero .library-actions{margin-top:20px}.library-shelf{padding:20px 16px}.library-books{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 15px}.library-form-grid{grid-template-columns:1fr}.library-dialog{padding:20px}.library-tools{gap:10px}.library-book-object{max-width:150px}}@media(prefers-reduced-motion:reduce){.library-page,.library-book-object{animation:none;transition:none}.library-book:hover .library-book-object{transform:perspective(850px) rotateY(-12deg)}}
.test-editor{width:min(1050px,calc(100vw - 28px))}.test-editor-list{margin-top:24px}.test-editor-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px}.test-editor-head h3{margin-right:auto}.test-editor-answer{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.test-editor-answer .library-field{flex:1}.test-editor-answer input[type=radio],.test-editor-answer input[type=checkbox]{width:20px;height:20px;accent-color:var(--library-accent)}.test-editor-budget{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}.test-editor-question>.library-field{margin:16px 0}.test-editor-question textarea{min-height:80px}.test-editor .library-form-grid{margin:12px 0}.test-formula svg{vertical-align:middle}.test-editor-head select{max-width:210px}
.library-page,.library-dialog{--library-accent:var(--accent);--library-button:var(--accent);--surface:var(--paper-card);--text:var(--ink);--muted:var(--ink-soft);color:var(--ink)}
.library-page .btn--ghost,.library-dialog .btn--ghost{background:var(--surface);color:var(--ink);border-color:var(--line)}
.library-tools{display:grid;grid-template-columns:minmax(220px,2fr) repeat(4,minmax(110px,1fr));align-items:center}
.library-empty{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px}
.library-empty p{margin:6px 0 0}.library-empty .btn{width:auto;flex-shrink:0;margin:0}
.library-book-brand svg{width:30px;height:30px}
/* Акцент библиотеки — акцент кабинета: в тёмной теме он медовый, как везде. */
@media(max-width:950px){.library-tools{grid-template-columns:repeat(3,minmax(0,1fr))}.library-tools input{grid-column:1/-1}}
@media(max-width:650px){.library-empty{display:block}.library-empty .btn{margin-top:14px;width:100%}.library-tools{grid-template-columns:1fr}.library-tools input{grid-column:auto}.test-editor-budget{grid-template-columns:1fr}}

.library-shelf:not(:has(.library-books)){padding:18px 24px}.library-shelf:not(:has(.library-books)) .library-shelf-head{margin-bottom:12px}.library-shelf:not(:has(.library-books)) .library-empty{padding:14px 18px}

.library-book-front:has(img){background:#f1f6ec}.library-shelf:not([data-type=literature]) .library-book-object{aspect-ratio:1 / 1.414214}

.library-primary:hover{background:var(--accent-hover)!important;border-color:var(--accent-hover)!important}.library-page :focus-visible,.library-dialog :focus-visible{outline:2px solid var(--library-accent);outline-offset:3px}
.library-search-scope>span{white-space:nowrap}.library-collections .btn{width:auto;margin:0}
body:has(#view-library:not([hidden])) .message--ok{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.formula-insert{justify-self:start}.test-editor-answer .library-field{grid-template-columns:minmax(0,1fr) auto;align-items:center}.test-editor-answer .library-field input{padding:8px 10px;min-height:36px}.test-editor-answer .formula-insert{margin:0!important}.test-editor-answer{padding:8px 0}.test-editor-answers>.library-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.test-settings{border:1px solid var(--line);border-radius:14px;margin-top:16px;overflow:hidden;background:var(--paper)}.test-settings>summary{padding:14px;font-size:12px;font-weight:700;color:var(--ink);cursor:pointer}.test-settings .test-meta-panel{border:0;border-radius:0;padding-top:0}.test-settings .test-meta-panel>.library-field{grid-column:auto}.test-settings .test-meta-panel>.library-field:nth-child(-n+2),.test-settings .test-meta-panel>.library-field:last-child{grid-column:1/-1}
.library-actions .btn,.library-dialog .btn,.library-test-card>.btn{width:auto;flex:0 1 auto;margin:0;padding:9px 13px;min-height:36px;font-size:13px;line-height:1.4;border-radius:10px}.library-actions{align-items:center}.library-dialog input[type=file]::file-selector-button{border:1px solid var(--library-accent);border-radius:8px;padding:9px 12px;background:var(--library-button);color:#fff;font:inherit;margin-right:12px;cursor:pointer}.test-import-form{display:grid;gap:18px}.test-import-form>.btn{justify-self:start}.test-import-form input{font-size:13px}.test-editor{width:min(1500px,calc(100vw - 32px));height:calc(100dvh - 32px);max-height:none;padding:20px;overflow:hidden;display:flex;flex-direction:column}.test-editor>header{flex-shrink:0;margin:0 0 8px}.test-editor>header h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:25px}.test-editor>p{margin:4px 0 10px}.test-desktop{display:grid;grid-template-columns:340px minmax(0,1fr);gap:22px;flex:1;min-height:0}.test-desktop-sidebar,.test-desktop-main{min-width:0;overflow:auto;padding:10px 8px 14px 0}.test-meta-panel{padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--paper);gap:12px}.test-meta-panel>.library-field:nth-child(-n+3){grid-column:1/-1}.test-desktop-sidebar>h3{font-size:16px;margin:20px 0 10px}.test-outline{display:grid;gap:6px;max-height:280px;overflow:auto;margin-bottom:10px}.test-outline-item{display:grid;grid-template-columns:25px minmax(0,1fr);gap:4px 8px;width:100%;margin:0;padding:10px;border:1px solid var(--line);border-radius:10px;text-align:left;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.test-outline-item strong{grid-row:1/3}.test-outline-item span{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.test-outline-item small{font-size:10px;color:var(--ink-soft)}.test-outline-item[aria-current=true]{border-color:var(--library-accent);background:color-mix(in srgb,var(--surface) 88%,var(--library-accent))}.test-editor-list{margin:0}.test-editor-question{margin:0;padding:16px}.test-editor-question>.library-field{margin:10px 0}.test-editor-question textarea{min-height:62px;max-height:180px}.test-editor-question .library-form-grid{gap:10px;margin:12px 0;grid-template-columns:repeat(3,minmax(0,1fr))}.test-editor-head{gap:7px;margin:0 0 14px}.test-editor-head h3{font-size:18px;margin:0 auto 0 0}.test-editor-head>.btn{min-width:32px;padding:7px 9px}.test-editor-head>.library-field{max-width:210px}.test-editor-answer{gap:8px;padding:10px 0;align-items:center}.test-editor-answer .library-field{min-width:0;gap:5px}.test-editor-answer .library-field>span{display:none}.test-editor-answer .library-field input{min-width:0}.test-editor-answer>.btn{padding:6px 8px;min-width:30px}.test-answer-flag{flex:0 0 74px;width:74px;margin:0;padding:7px 6px;border:1px solid #a8332a;border-radius:8px;background:#a8332a20;color:var(--ink);font:inherit;font-size:11px;cursor:pointer}.test-answer-flag[data-correct=true]{border-color:#1f7a5a;background:#1f7a5a;color:#fff}.formula-insert{align-self:start;width:auto!important;margin:6px 0!important;padding:5px 8px!important;min-height:28px!important;font-size:11px!important}.test-editor-footer{flex-shrink:0;border-top:1px solid var(--line);margin-top:14px;padding-top:14px;gap:8px}.test-editor input[type=number]{appearance:textfield;-moz-appearance:textfield}.test-editor input[type=number]::-webkit-inner-spin-button,.test-editor input[type=number]::-webkit-outer-spin-button{appearance:none;margin:0}.formula-dialog{width:min(660px,calc(100vw - 24px))}.formula-dialog textarea{width:100%;min-height:90px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font:inherit}.formula-live-preview{display:grid;place-items:center;min-height:110px;padding:20px;margin:16px 0;border:1px solid var(--line);border-radius:14px;background:var(--paper);overflow:auto}.formula-live-preview svg{max-width:100%}.test-play-preview{width:min(800px,calc(100vw - 24px))}.test-play-body{display:grid;gap:12px;padding:14px 0}.test-play-prompt{font-size:18px;line-height:1.6;margin:0 0 10px}.test-play-body input,.test-play-body select{padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font:inherit}.test-play-body>.test-play-option{width:100%;text-align:left;padding:12px 14px;border-radius:12px}.test-play-option[aria-pressed=true]{border-color:var(--library-accent);background:color-mix(in srgb,var(--surface) 80%,var(--library-accent))}.answer-correct{border:1px solid #1f7a5a!important;background:#1f7a5a25!important}.answer-wrong{border:1px solid #a8332a!important;background:#a8332a18!important}.test-play-feedback{font-size:15px;font-weight:700}.test-play-feedback[data-correct=true]{color:var(--library-accent)}.test-play-feedback[data-correct=false]{color:#d47770}
@media(max-width:950px){.test-desktop{grid-template-columns:280px minmax(0,1fr)}.test-editor-question .library-form-grid{grid-template-columns:1fr 1fr}.test-editor-answer{flex-wrap:wrap}.test-editor-answer .library-field{flex:1 1 150px}}@media(max-width:700px){.test-editor{width:calc(100vw - 16px);height:calc(100dvh - 16px);padding:14px}.test-desktop{grid-template-columns:1fr;overflow:auto}.test-desktop-sidebar,.test-desktop-main{overflow:visible;padding:0}.test-outline{max-height:150px}.test-editor-footer{gap:6px}.test-editor-footer .btn{font-size:11px;padding:8px}.test-editor-head .library-field{flex:1 1 100%;max-width:none}.test-editor-question{padding:12px}.test-editor>header h2{font-size:21px}}
.library-editor-dialog{width:min(1400px,calc(100vw - 32px));height:calc(100dvh - 32px);overflow:hidden;padding:22px}.library-editor-dialog>header{height:40px;margin-bottom:16px}.library-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(420px,1fr);gap:28px;height:calc(100% - 56px);min-height:0}.library-editor-preview,.library-editor-details{min-width:0;overflow:auto;padding:4px 8px 16px 0}.library-editor-preview h3{margin:0 0 20px;font-size:22px}.library-editor-preview input[type=file]{font-size:13px;overflow:hidden}.library-editor-preview input[type=file]::file-selector-button{margin-right:12px;border:1px solid var(--library-accent);border-radius:8px;padding:9px 12px;background:var(--library-button);color:#fff;font:inherit;cursor:pointer}.library-editor-details>.library-actions .btn{width:auto;margin:0;padding:10px 14px;font-size:13px}.library-editor-preview .library-cover-picker{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;grid-template-areas:'page page page' 'prev label next';align-items:center;gap:14px;margin:20px 0;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--paper)}.library-editor-preview .library-cover-picker[hidden]{display:none}.library-editor-preview .library-cover-picker canvas{grid-area:page;justify-self:center;max-width:100%;max-height:max(100px,calc(100dvh - 450px));width:auto;height:auto}.library-editor-preview .library-cover-picker button{width:40px;height:40px;min-height:0;margin:0;padding:0;border-radius:9px}.library-editor-preview .library-cover-picker button:first-child{grid-area:prev}.library-editor-preview .library-cover-picker button:nth-child(3){grid-area:next}.library-editor-preview .library-cover-picker>span{grid-area:label;text-align:center;white-space:nowrap;font-size:13px}
.library-subject-chips{display:flex;gap:8px;flex-wrap:wrap}.library-subject-chip{width:auto;flex:0 0 auto;margin:0;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.library-subject-chip[aria-pressed=true]{background:var(--library-button);border-color:var(--library-button);color:#fff}.library-year-control{display:flex;gap:6px}.library-year-control input{min-width:0;appearance:textfield;-moz-appearance:textfield}.library-year-control input::-webkit-inner-spin-button,.library-year-control input::-webkit-outer-spin-button{appearance:none;margin:0}.library-year-steps{display:grid;gap:3px;flex:0 0 30px}.library-year-step{width:30px;margin:0;padding:0;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);line-height:1;font-size:18px;cursor:pointer}.library-tags button{display:inline-flex;align-items:center;flex:0 0 auto;width:auto;margin:0;padding:6px 9px;min-height:30px;font-size:12px}.library-tags input{width:auto!important;flex:1 1 130px;margin:0;min-width:100px}.library-tags{align-items:center}
@media(max-width:900px){.library-editor-dialog{height:auto;max-height:calc(100dvh - 20px);overflow:auto;padding:18px}.library-editor-layout{grid-template-columns:1fr;height:auto}.library-editor-preview,.library-editor-details{overflow:visible;padding:0}.library-editor-preview .library-cover-picker canvas{max-height:45dvh}.library-editor-preview .library-cover-picker>span{white-space:normal}}
.library-dialog>header{display:flex;flex-wrap:nowrap;width:100%;align-items:center}.library-dialog>header h2{flex:1;min-width:0;white-space:normal;word-break:normal}.library-dialog>header button{flex:0 0 40px;width:40px;height:40px;margin:0;padding:0;display:grid;place-items:center;line-height:1}
.library-book-dialog{width:min(1480px,calc(100vw - 40px));height:calc(100dvh - 40px);max-height:none;padding:20px;overflow:hidden}.library-book-dialog>header{margin-bottom:16px;height:40px}.library-book-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;height:calc(100% - 56px);min-height:0}.library-book-preview{min-width:0;min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--paper)}.library-book-preview .library-detail-frame{display:block;width:100%;height:100%;border:0;border-radius:0}.library-book-info{min-width:0;overflow:auto;padding:6px 8px 16px 0}.library-book-info h3{font-size:24px;line-height:1.35;margin:0 0 18px;overflow-wrap:anywhere}.library-book-info .library-hint,.library-book-info .library-feedback{font-size:15px;line-height:1.65}.library-book-info .library-actions{gap:8px;margin:20px 0}.library-book-info .library-actions .btn{width:auto;flex:0 1 auto;margin:0;padding:9px 12px;min-height:36px;font-size:13px;line-height:1.4;border-radius:10px}
@media(max-width:1000px){.library-book-layout{grid-template-columns:minmax(0,1fr) 290px;gap:16px}}@media(max-width:760px){.library-book-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);padding:12px;overflow:auto}.library-book-layout{grid-template-columns:1fr;height:auto}.library-book-preview{height:65dvh;min-height:320px}.library-book-info{overflow:visible;padding:0}.library-book-info h3{font-size:22px}}
.library-hero>.library-actions{margin:0;flex-shrink:0;align-self:center}.library-hero>.library-actions .btn{min-width:190px}
.library-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px;margin:26px 0}.library-section-link{display:grid;gap:9px;text-align:left;padding:22px 24px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.library-section-link strong{font-size:19px}.library-section-link span{font-size:12px;line-height:1.6;color:var(--ink-soft)}.library-section-link[aria-current=page]{border-color:var(--library-accent);background:color-mix(in srgb,var(--surface) 91%,var(--library-accent));box-shadow:inset 0 3px var(--library-accent)}.library-section-link:hover{border-color:var(--library-accent)}
.library-area{margin:28px 0 22px;padding:24px;border:1px solid var(--line);border-radius:24px;background:var(--surface)}.library-area-head{display:flex;justify-content:space-between;align-items:center;gap:22px}.library-area-head h2{font-size:24px;margin:0 0 8px}.library-area-head p{font-size:13px;line-height:1.6;color:var(--ink-soft);margin:0}.library-collections{display:flex;flex-wrap:wrap;gap:8px}.library-collections .btn{font-size:13px;white-space:nowrap}.library-collections [aria-pressed=true]{background:color-mix(in srgb,var(--surface) 80%,var(--library-accent));border-color:var(--library-accent)}.library-search-scope{display:flex;align-items:center;gap:12px;margin-top:24px;font-size:12px;color:var(--ink-soft)}.library-search-scope select{padding:10px 12px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--paper);font:inherit}.library-area .library-tools{margin-bottom:0}.library-own-publications{display:flex;justify-content:flex-end;margin-top:-8px}
@media(max-width:950px){.library-area-head{align-items:flex-start;flex-direction:column}.library-hero>.library-actions .btn{min-width:0}}@media(max-width:650px){.library-sections{grid-template-columns:1fr;gap:10px}.library-section-link{padding:18px}.library-area{padding:18px}.library-search-scope{align-items:flex-start;flex-direction:column}.library-search-scope select{width:100%}.library-collections{width:100%}.library-collections .btn{flex:1;white-space:normal}.library-hero>.library-actions{margin-top:20px}.library-hero>.library-actions .btn{width:100%}}

.library-reading-view{position:fixed;inset:0;z-index:2000;background:var(--paper,#14291f)}.library-reading-view iframe{width:100%;height:100%;border:0;display:block}.library-title-warning{color:#ac7b13;font-size:13px;line-height:1.5}.library-title-warning.is-detected{padding:9px;background:#f1c94a20;border:1px solid #dfb636;border-radius:9px}.library-book-object{aspect-ratio:var(--book-ratio,.7071)!important;width:clamp(145px,15vw,205px);max-width:205px!important;border-radius:3px 8px 8px 3px;transform:perspective(900px) rotateY(-12deg)!important;box-shadow:9px 12px 18px #0004}.library-book-object:before{inset:3px -7px 3px 5px!important;border-radius:2px 7px 7px 2px!important;background:repeating-linear-gradient(to bottom,#ecebdd 0 1px,#c9ccbc 1px 2px)!important}.library-book-front{aspect-ratio:var(--book-ratio,.7071)!important;border-radius:3px 6px 6px 3px!important;overflow:hidden}.library-book-front img{width:100%;height:100%;object-fit:cover!important;background:none!important}.library-book-front:after{width:13px!important;background:linear-gradient(90deg,#0004,transparent 65%,#ffffff24)!important;border-right:1px solid #0002!important}.library-book-caption strong{font-size:18px!important;line-height:1.35!important}.library-book-caption small{font-size:15px!important;line-height:1.5!important}.library-book-caption{gap:5px!important;margin-top:18px}.library-book:hover .library-book-object{transform:perspective(900px) rotateY(-20deg) translateY(-5px)!important}@media(max-width:600px){.library-book-object{width:145px}.library-book-caption strong{font-size:16px!important}.library-book-caption small{font-size:14px!important}}

.library-books{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}.library-book-front:after{left:0!important}@media(max-width:650px){.library-books{grid-template-columns:repeat(2,minmax(0,1fr))}.library-book-object{width:min(145px,100%)}}

.library-reading-view[hidden]{display:none!important}

/* Test desk: compact controls and visual formula fields. */
.library-page .library-section-link span,.library-area-head p{font-size:15px;line-height:1.5}.library-tests-area{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:18px 28px;align-items:center}.library-tests-area .library-area-head{grid-column:1}.library-tests-area .library-tools{grid-column:1;margin:0;padding:0;width:100%}.library-tests-area .library-tools input{width:100%;min-width:0}.library-tests-area .library-tests-actions{grid-column:2;grid-row:1/3;display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;margin:0;max-width:460px}.library-tests-actions .btn{font-size:15px;padding:10px 14px}.library-tests-empty{width:min(760px,100%);margin:24px auto;gap:24px;padding:24px}.library-tests-empty strong{font-size:18px}.library-tests-empty p{font-size:15px;line-height:1.5;margin:8px 0 0;color:var(--ink-soft)}.library-tests-empty .btn{font-size:15px;white-space:nowrap}
.test-editor .library-field{font-size:15px;gap:6px;min-width:0}.test-editor .library-hint{font-size:15px;line-height:1.45}.test-editor .library-field input,.test-editor .library-field select,.test-editor .library-field textarea{font-size:16px;padding:10px 12px;min-width:0}.test-editor textarea,.formula-dialog textarea{resize:none;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.5;min-height:46px!important;max-height:260px}.test-editor .test-desktop-sidebar{padding:10px;scrollbar-gutter:stable}.test-editor .test-desktop-main{padding:10px;scrollbar-gutter:stable}.test-editor .test-settings{padding:12px;margin:8px 0 14px}.test-editor .test-settings summary{font-size:16px;line-height:1.45}.test-editor .test-settings .test-meta-panel{margin:12px 0 0;gap:12px;grid-template-columns:1fr 1fr}.test-meta-panel>.library-field:not(:has(input[type=number])){grid-column:1/-1}.test-editor .test-settings .library-subject-chip{font-size:14px;padding:8px 10px}.test-editor .test-editor-question{padding:18px;margin:0;border-radius:16px}.test-editor .test-editor-head{display:flex;flex-wrap:nowrap;gap:12px;margin:0 0 16px;align-items:center}.test-editor .test-editor-head h3{font-size:20px;white-space:nowrap;margin:0 auto 0 0}.test-editor .test-editor-head>.library-field{display:flex;align-items:center;gap:8px}.test-editor .test-editor-head select{width:200px;padding:8px 10px}.test-editor .test-question-delete,.test-editor .test-option-delete,.test-editor .test-editor-close,.formula-dialog .formula-close{display:flex;align-items:center;justify-content:center;width:36px!important;min-width:36px;min-height:36px!important;padding:0!important;background:#8e3030!important;color:#fff!important;border:1px solid #b94545!important;border-radius:9px}.test-editor .test-editor-close,.formula-dialog .formula-close{width:42px!important;min-height:42px!important}.test-editor .test-question-settings{grid-template-columns:110px 150px minmax(150px,1fr);gap:12px;margin:12px 0}.test-editor .library-year-control{display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;gap:5px;width:100%;min-width:0}.test-editor .library-year-steps{display:flex;flex-direction:column;gap:3px;width:30px}.test-editor .library-year-step{display:flex;align-items:center;justify-content:center;width:30px;min-height:21px;height:21px;padding:0!important;font-size:0}.test-editor .library-year-step svg{width:16px;height:16px}.test-editor .library-year-step:hover,.test-outline-move:hover,.formula-insert:hover{background:#f1c94a!important;color:#18392b!important;border-color:#d9aa20!important}.test-outline-row{display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:4px;border-radius:10px;cursor:grab}.test-outline-row.is-drag-over{outline:2px solid #f1c94a;background:#f1c94a20}.test-editor .test-outline-item{width:100%;min-width:0;font-size:15px;padding:9px}.test-editor .test-outline-item small{font-size:13px}.test-outline-controls{display:flex;flex-direction:column;justify-content:center;gap:4px}.test-outline-move{width:30px;height:27px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}.test-outline-move:disabled{opacity:.3;cursor:default}.test-editor .test-answer-flag{width:36px!important;min-width:36px;padding:0;min-height:40px;display:flex;align-items:center;justify-content:center}.test-editor .test-editor-answer{display:grid;grid-template-columns:36px minmax(0,1fr) 36px;gap:8px;padding:9px 0;align-items:center}.test-editor .test-editor-answer>.library-field{display:flex;flex-direction:column;min-width:0;gap:0}.test-editor .test-editor-answer>.library-field>span{display:none}.test-editor .test-editor-answer>input[hidden]{display:none!important}.test-editor .test-editor-question>.library-field{margin:12px 0}.formula-source{display:none!important}.formula-field-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:7px;align-items:center;width:100%;min-width:0}.formula-field-editor{width:100%;min-width:0;min-height:44px;max-height:260px;overflow:auto;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface,var(--paper));color:inherit;font-size:16px;font-weight:500;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;cursor:text}.formula-field-editor:empty:before{content:attr(data-placeholder);color:var(--ink-soft);pointer-events:none}.formula-field-editor:focus{outline:2px solid #72bb94;outline-offset:2px}.test-editor .formula-insert{width:42px!important;min-width:42px;min-height:42px;padding:0!important;font-size:27px!important;line-height:1;font-family:Georgia,serif;display:flex;align-items:center;justify-content:center;margin:0}.formula-atom{display:inline-flex;vertical-align:middle;align-items:center;max-width:100%;padding:3px 6px;margin:0 3px;border-radius:6px;background:color-mix(in srgb,var(--surface,var(--paper)) 82%,#72bb94);user-select:all;cursor:default}.formula-atom svg{max-width:100%;width:auto;min-height:22px}.formula-dialog .formula-quick{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.formula-dialog .formula-quick .btn{font-size:15px;padding:8px 12px}.formula-dialog .library-hint{font-size:15px}.test-editor :is(input,textarea,select):focus{outline-offset:1px}.test-editor :is(.test-desktop-sidebar,.test-desktop-main,.formula-field-editor,textarea),.formula-dialog textarea{scrollbar-width:thin;scrollbar-color:#72bb94 var(--paper)}.test-editor :is(.test-desktop-sidebar,.test-desktop-main,.formula-field-editor,textarea)::-webkit-scrollbar{width:7px;height:7px}.test-editor ::-webkit-scrollbar-thumb{background:#72bb94;border-radius:5px}.test-editor .test-editor-footer .btn{font-size:15px}
@media(max-width:1000px){.library-tests-area{grid-template-columns:1fr}.library-tests-area .library-tests-actions{grid-column:1;grid-row:auto;justify-content:flex-start;max-width:none}.test-editor .test-question-settings{grid-template-columns:110px minmax(140px,1fr)}.test-editor .test-question-settings>.library-field:last-child{grid-column:1/-1}}@media(max-width:650px){.library-tests-empty{flex-direction:column;align-items:flex-start;padding:20px;gap:14px}.test-editor .test-editor-head{flex-wrap:wrap}.test-editor .test-editor-head>.library-field{order:2;width:100%;justify-content:space-between}.test-editor .test-editor-head select{width:calc(100% - 85px)}.test-editor .test-desktop-sidebar,.test-editor .test-desktop-main{padding:7px}.test-editor .test-editor-question{padding:13px}.test-editor .test-settings summary{font-size:15px}}

.test-editor .formula-insert{height:42px!important;min-height:42px!important}.test-editor .test-editor-head h3{margin:0!important}.library-dialog .library-field{min-width:0}.library-dialog :is(input,textarea,select){box-sizing:border-box;min-width:0}

.test-editor .formula-insert{align-self:center!important;margin:0!important;justify-self:stretch}

.test-editor .formula-insert{transform:none!important}

.library-hero{display:grid;grid-template-columns:minmax(0,1fr) 340px;align-items:center;gap:32px}.library-hero .library-sections{display:flex;flex-direction:column;gap:10px;margin:0}.library-hero .library-section-link{padding:14px 18px;border-radius:14px;gap:5px}.library-hero .library-section-link strong{font-size:17px}.library-hero .library-section-link span{font-size:13px;line-height:1.4}.library-area-head>.library-actions{margin:0;flex-shrink:0}.library-test-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:22px}.library-test-tile,.library-test-card.library-test-tile{padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--surface,var(--paper));min-width:0}.library-test-cover{display:block;width:100%;border:0;background:none;padding:0 6px 8px 0;cursor:pointer;color:#163b2b;font:inherit;text-align:left;perspective:800px}.library-test-sheet{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:12px;aspect-ratio:4/5;padding:20px;border-radius:4px 12px 12px 4px;background:linear-gradient(130deg,color-mix(in srgb,var(--test-cover-color) 80%,white),var(--test-cover-color));box-shadow:4px 5px 0 #d3ddce,7px 8px 0 #8aaa95,8px 12px 20px #0002;transition:transform .2s,box-shadow .2s;overflow:hidden}.library-test-sheet:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#0002,transparent 5%,transparent 95%,#ffffff20);border-left:2px solid #ffffff45}.library-test-cover-kind{font-size:11px;letter-spacing:.14em;font-weight:800;color:inherit;opacity:.75}.library-test-cover-title{font-size:clamp(20px,2vw,26px);line-height:1.25;overflow-wrap:anywhere;font-weight:800;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}.library-test-cover-footer{display:flex;flex-direction:column;gap:9px;margin-top:8px}.library-test-cover-footer .library-book-brand{display:flex;align-items:center;gap:7px;font-size:12px;letter-spacing:.06em;color:inherit}.library-test-cover-footer .library-book-brand svg{width:21px;height:21px}.library-test-cover-author{font-size:14px;line-height:1.35;font-weight:650;overflow-wrap:anywhere}.library-test-cover[data-cover-palette="3"],.library-test-cover[data-cover-palette="4"]{color:#f1f6ec}.library-test-cover:hover .library-test-sheet{transform:translateY(-3px) rotate(-1deg);box-shadow:4px 7px 0 #d3ddce,7px 10px 0 #8aaa95,8px 16px 22px #0003}.library-test-tile-info{padding-top:14px}.library-test-summary,.library-test-status{font-size:15px;line-height:1.5;margin:0 0 8px}.library-test-status{color:var(--ink-soft)}.library-test-edited{display:flex;align-items:flex-start;gap:7px;color:var(--ink-soft);font-size:14px;line-height:1.5}.library-test-edited:before{content:'';width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#72bb94;margin-top:7px}.library-test-tile .library-actions{margin-top:14px;gap:8px}.library-test-tile .library-actions .btn{width:auto!important;flex:0 1 auto;padding:8px 11px;font-size:14px;min-height:36px}.library-danger{background:#8e3030!important;color:white!important;border-color:#b94545!important}.library-dialog>header>button[aria-label^="Закрыть"],.library-dialog>header>button[aria-label^="Удалить"],.library-dialog .library-modal-close{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;display:flex;align-items:center;justify-content:center;padding:0!important;font-size:30px!important;line-height:1!important;flex-shrink:0;background:#8e3030!important;color:#fff!important;border:1px solid #b94545!important;border-radius:11px}.library-dialog>header>button[aria-label^="Закрыть"] svg{width:26px!important;height:26px!important}.library-dialog button[aria-label^="Удалить"] svg{width:23px;height:23px}.library-tags button{font-size:15px}.library-hero:has(.library-sections>*:only-child){grid-template-columns:minmax(0,1fr) 300px}@media(max-width:950px){.library-hero,.library-hero:has(.library-sections>*:only-child){grid-template-columns:1fr}.library-hero .library-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.library-area-head>.library-actions{flex-wrap:wrap}}@media(max-width:650px){.library-hero .library-sections{grid-template-columns:1fr}.library-test-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.library-test-tile,.library-test-card.library-test-tile{padding:10px}.library-test-sheet{padding:13px;gap:8px;aspect-ratio:3/4}.library-test-cover-title{font-size:18px;-webkit-line-clamp:4}.library-test-cover-author{font-size:12px}.library-test-cover-kind{font-size:9px;letter-spacing:.07em}.library-test-edited{font-size:12px}.library-test-summary,.library-test-status{font-size:13px}}@media(max-width:380px){.library-test-grid{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){.library-test-sheet{transition:none}.library-test-cover:hover .library-test-sheet{transform:none}}

.library-test-cover[data-cover-palette="3"] .library-test-sheet{background:linear-gradient(130deg,#347354,#205b46)}.library-test-cover[data-cover-palette="4"] .library-test-sheet{background:linear-gradient(130deg,#205b46,#133c2d)}

.library-test-cover-title{flex-shrink:1;min-height:0}.library-test-cover-kind,.library-test-cover-footer{flex-shrink:0}

/* Keep sheet text sharp on hover; let long titles determine card height. */
.library-test-cover,.library-test-cover:hover{transform:none!important;perspective:none}.library-test-sheet{aspect-ratio:auto;min-height:200px;transform:none!important;transition:box-shadow .2s}.library-test-cover-title{display:block;-webkit-line-clamp:unset;overflow:visible;flex-shrink:0}.library-test-cover-footer{margin-top:auto;padding-top:14px}.library-test-cover:hover .library-test-sheet,.library-test-cover:focus-visible .library-test-sheet{transform:none!important;box-shadow:inset 0 0 0 2px #e1ba43,4px 5px 0 #d3ddce,7px 8px 0 #8aaa95,8px 12px 24px #0003}.library-test-grid{align-items:start}@media(max-width:650px){.library-test-sheet{aspect-ratio:auto;min-height:180px}.library-test-cover-title{-webkit-line-clamp:unset}}

/* Tilt remains on the whole sheet; composite its lettering separately. */
.library-test-sheet{transform:translate3d(0,0,0)!important;transform-style:preserve-3d;backface-visibility:hidden;will-change:transform;transition:transform .2s,box-shadow .2s}.library-test-cover:hover .library-test-sheet,.library-test-cover:focus-visible .library-test-sheet{transform:translate3d(0,-3px,0) rotate(-1deg)!important}.library-test-sheet>*,.library-test-cover-footer>*{backface-visibility:hidden;transform:translateZ(.1px);-webkit-font-smoothing:antialiased}.library-test-cover-summary{font-size:14px;line-height:1.5;font-weight:650;margin-top:8px}.library-test-cover-description{font-size:14px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.library-test-tile-info>.library-test-summary{display:none}@media(prefers-reduced-motion:reduce){.library-test-sheet{transition:none}.library-test-cover:hover .library-test-sheet,.library-test-cover:focus-visible .library-test-sheet{transform:none!important}}

/* Reserve room for the label and author; fit the title in the remaining space. */
.library-test-sheet{aspect-ratio:4/5;min-height:260px;overflow:hidden;gap:10px}.library-test-cover-title{line-height:1.22;overflow-wrap:anywhere;word-break:normal;flex-shrink:0}.library-test-cover-summary[hidden],.library-test-cover-description[hidden]{display:none!important}.library-test-cover-footer{margin-top:auto;padding-top:8px}@media(max-width:650px){.library-test-sheet{aspect-ratio:3/4;min-height:260px;gap:8px}}

.library-test-cover-count[hidden]{display:none!important}.library-test-cover-summary{flex-shrink:0;overflow-wrap:anywhere}.library-test-cover-subject{display:inline}

/* Test workspace: aligned controls and neutral close buttons. */
.library-dialog>header>button[aria-label^="Закрыть"],.library-dialog>header>button[aria-label^="Удалить"],.library-dialog .library-modal-close,.test-editor .test-question-delete,.test-editor .test-option-delete,.test-editor .test-editor-close,.formula-dialog .formula-close{background:var(--paper,#1b2c24)!important;color:var(--ink,#edf3eb)!important;border:1px solid var(--line,#35473d)!important;box-shadow:none}
.library-dialog>header>button[aria-label^="Закрыть"]:hover,.library-dialog>header>button[aria-label^="Удалить"]:hover,.library-dialog .library-modal-close:hover,.test-editor .test-question-delete:hover,.test-editor .test-option-delete:hover,.test-editor .test-editor-close:hover,.formula-dialog .formula-close:hover{background:#8e3030!important;color:#fff!important;border-color:#b94545!important}
.test-editor .test-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:nowrap}
.test-editor .test-editor-head h3{margin:0!important;flex-shrink:0;line-height:1.3}
.test-question-controls{display:flex;align-items:center;gap:10px;margin-left:auto;min-width:0}
.test-editor .test-question-controls>.library-field{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;width:auto}
.test-editor .test-question-controls select{width:190px;height:46px;min-height:46px;margin:0}
.test-editor .test-settings>summary{display:flex;align-items:center;gap:7px;font-size:14px;line-height:1.4;white-space:nowrap;min-width:0;list-style:none}
.test-editor .test-settings>summary::before{content:'▸';flex-shrink:0}.test-editor .test-settings[open]>summary::before{content:'▾'}
.test-settings-label,.test-settings-percent{flex-shrink:0}.test-settings-subject{overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}.test-settings-subject:not(:empty)::before{content:'· ';}.test-settings-percent{margin-left:auto}
.test-editor>.test-save-status{font-size:17px;line-height:1.45;margin:4px 0 14px}
.test-editor .test-editor-answer{grid-template-columns:46px minmax(0,1fr) 46px;gap:10px;padding:12px 0}
.test-editor .formula-field-row{grid-template-columns:minmax(0,1fr) 46px;gap:10px}
.test-editor .formula-field-editor{min-height:46px;box-sizing:border-box;border-radius:11px}
.test-editor .formula-insert,.test-editor .test-answer-flag,.test-editor .test-question-delete,.test-editor .test-option-delete{width:46px!important;min-width:46px!important;height:46px!important;min-height:46px!important;padding:0!important;border-radius:11px!important;display:flex;align-items:center;justify-content:center;align-self:center!important;margin:0!important;transform:none!important}
.test-editor .formula-insert{font:inherit!important}.test-editor .formula-insert svg{width:22px;height:22px}
.test-editor .test-answer-flag[data-correct="true"]{background:var(--paper,#1b2c24)!important;border:1px solid #58ab85!important;color:#7dd0a8!important}
.test-editor .test-answer-flag[data-correct="false"]{background:var(--paper,#1b2c24)!important;border:1px solid var(--line,#35473d)!important;color:#e79494!important}
.test-editor .test-answer-flag:hover{background:var(--accent,#f4c442)!important;color:#17271e!important}
.test-editor .test-add-option{margin-top:12px!important;margin-bottom:12px!important}
@media(max-width:650px){.test-editor .test-editor-head{flex-wrap:wrap}.test-question-controls{width:100%;margin-left:0}.test-editor .test-question-controls>.library-field{flex:1;min-width:0}.test-editor .test-question-controls select{width:100%;min-width:0}.test-editor .test-question-controls>.library-field>span{flex-shrink:0}.test-editor .test-settings>summary{font-size:14px}}
.test-editor .test-editor-answer>.library-field{margin:0!important}

.library-lost{color:#8e3030;font-weight:700}
.library-pending{color:#ac7b13;font-weight:700}

/* Часть 0 задачи 6: кнопка уборки пустых черновиков стоит под заголовком полки. */
.library-drafts h2{margin-bottom:10px}
.library-drafts-sweep{margin:0 0 18px;width:auto}

/* Окно «Назначить»: кому → к какому уроку → итог (часть 1 задачи 6). */
.assign-dialog{width:min(560px,calc(100vw - 28px))}
.assign-close{border:0;background:transparent;color:var(--ink-soft);cursor:pointer;display:flex;padding:4px;border-radius:10px}
.assign-close:hover{background:color-mix(in srgb,var(--line) 40%,transparent);color:var(--text,var(--ink))}
.assign-step{margin:18px 0 10px;font-size:13px;letter-spacing:-.01em}
.assign-search{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:var(--surface,var(--paper));color:inherit;font:inherit}
.assign-body{max-height:min(52dvh,430px);overflow-y:auto}
.assign-list,.assign-lessons{display:grid;gap:8px;margin-top:10px}
.assign-row,.assign-lesson{display:grid;gap:3px;justify-items:start;text-align:left;width:100%;min-height:58px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface,var(--paper));color:inherit;cursor:pointer;font:inherit}
.assign-row:hover,.assign-lesson:hover{border-color:var(--library-accent)}
.assign-lesson[aria-pressed='true']{border-color:var(--library-accent);background:color-mix(in srgb,var(--library-accent) 12%,var(--surface,var(--paper)))}
.assign-row strong,.assign-lesson strong{font-size:14px;font-weight:650}
.assign-row span,.assign-lesson span{font-size:12px;color:var(--muted,var(--ink-soft))}
.assign-back,.assign-more{padding:8px 0;border:0;background:transparent;color:var(--library-accent);font:inherit;font-size:13px;cursor:pointer;text-align:left}
.assign-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.assign-summary{margin:0;font-size:13px;color:var(--muted,var(--ink-soft));line-height:1.5}
@media(max-width:650px){.assign-foot{flex-direction:column;align-items:stretch}.assign-foot .btn{width:100%}}

/* ===== Часть 4 задания 06: библиотека изданий ===== */

/* Пустые полки при непустой библиотеке — одной строкой (B-18) */
.library-blank-shelves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }
.library-blank-shelf { padding: 5px 11px !important; min-height: 0 !important; border: 1px dashed var(--line) !important; border-radius: 999px !important; background: transparent !important; color: var(--ink-soft) !important; font-size: 13px !important; }
button.library-blank-shelf:hover { border-style: solid !important; border-color: var(--accent) !important; color: var(--ink) !important; }

/* Форма издания: прокручивается вся форма, а не одна колонка (B-13) */
.library-editor-dialog { display: flex; flex-direction: column; }
.library-editor-dialog .library-editor-layout { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; align-items: start; }
.library-editor-dialog .library-editor-preview,
.library-editor-dialog .library-editor-details { overflow: visible; max-height: none; }

/* Зона перетаскивания и прогресс (B-15) */
.library-drop { display: grid; justify-items: center; gap: 8px; padding: 20px 16px; border: 2px dashed var(--line); border-radius: 16px; background: color-mix(in srgb, var(--ink) 3%, transparent); text-align: center; }
.library-drop.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.library-drop.is-bad { border-color: var(--danger, #c0392b); }
.library-drop-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.library-drop strong { overflow-wrap: anywhere; font-size: 15px; }
.library-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.library-drop-pick { cursor: pointer; }
.library-progress { width: 100%; height: 8px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); accent-color: var(--accent); }

/* Название из имени файла — подсказкой с кнопкой (B-15) */
.library-title-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.library-title-suggest button { padding: 4px 10px !important; min-height: 0 !important; border-radius: 999px !important; font-size: 13px !important; }

/* «Класс укажите отдельно» — подсказка, а не ошибка (B-14) */
.library-title-warning { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

/* Вид издания и библиотека — сегменты (B-16) */
.library-segments { display: flex; flex-wrap: wrap; gap: 6px; }
.library-segment { padding: 8px 13px !important; min-height: 0 !important; height: auto !important; border: 1px solid var(--line) !important; border-radius: 10px !important; background: var(--paper) !important; color: var(--ink) !important; font-size: 14px !important; }
.library-segment[aria-pressed="true"] { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 14%, transparent) !important; }

/* Окно выбора издания для домашки (C-1) */
.library-pick-dialog { width: min(860px, calc(100vw - 28px)); }
.library-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 58dvh; overflow: auto; padding: 2px; }
.library-pick-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 10px !important; border: 1px solid var(--line) !important; border-radius: 14px !important; background: var(--paper) !important; color: var(--ink) !important; text-align: left; }
.library-pick-card:hover { border-color: var(--accent) !important; }
.library-pick-card img { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.library-pick-card > span { display: grid; gap: 3px; min-width: 0; }
.library-pick-card strong { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.library-pick-card small { color: var(--ink-soft); font-size: 12px; }

/* Поля в сетке формы не растягиваются под высоту соседа: под «Названием»
   живёт подсказка с именем файла, и «Автор» раздувался ей в такт. */
.library-editor-dialog .library-form-grid > .library-field { align-content: start; }
.library-editor-dialog .library-form-grid > .library-field > input,
.library-editor-dialog .library-form-grid > .library-field > select { align-self: start; }
