/* Spreads preview of the v3 layout (pilot). Uses the cabinet palette from studio.css. */
.spreads-style h2{font:var(--fs-4) var(--sans);letter-spacing:0;margin:0 0 12px}
.style-list,.palette-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.style-choice,.palette-choice{display:flex;align-items:center;gap:8px;min-height:40px;padding:7px 12px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface-sunken);font-size:var(--fs-1)}
.palette-choice{min-height:34px;font-size:var(--fs-1)}
.style-choice[aria-pressed=true],.palette-choice[aria-pressed=true]{border-color:var(--green);background:var(--green-soft);font-weight:600}
.swatch{display:flex}.swatch i{display:block;width:12px;height:18px;border:1px solid var(--line)}.swatch i:first-child{border-radius:var(--r-1) 0 0 var(--r-1)}.swatch i:last-child{border-radius:0 var(--r-1) var(--r-1) 0}
.brand-fields{display:flex;flex-wrap:wrap;gap:12px 20px;margin:6px 0 12px;font-size:var(--fs-1)}.brand-fields label{display:grid;gap:6px}
.brand-colors{display:flex;gap:6px;align-items:center}.brand-colors input{width:44px;height:34px;border:1px solid var(--line);border-radius:var(--r-1);padding:2px;background:var(--surface)}
.brand-fields select{min-height:34px;border:1px solid var(--line);border-radius:var(--r-1);background:var(--surface-sunken);padding:5px 8px;max-width:280px}
.style-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}#style-state{font-size:var(--fs-1);color:var(--muted)}
.spreads-notice{border:1px solid var(--accent-line);border-radius:var(--r-2);background:var(--accent-soft);padding:14px 20px;margin:0 0 20px;font-size:var(--fs-2);color:var(--accent-strong)}
.spreads-report{border:1px solid var(--line);border-radius:var(--r-3);background:var(--surface);padding:18px 22px;margin-bottom:28px}
.spreads-report h2{font:var(--fs-5) var(--sans);letter-spacing:0;margin:0 0 10px}.spreads-report h3{font-size:var(--fs-2);margin:16px 0 8px}
.spreads-report ul{margin:0;padding-left:18px;font-size:var(--fs-1);line-height:1.8}.issue-error{color:var(--danger)}.issue-warning{color:var(--warning)}.issue-ok{color:var(--muted);list-style:none;margin-left:-18px}
/* Where every material is, and what is left before printing («Статус каждого материала») */
.readiness{margin-bottom:18px}
/* The check before print (BK-137): one line of state, then cards — each of one place, with one way to it. */
.check-status{margin:0 0 14px;padding:10px 12px;border-radius:var(--r-2);background:var(--bg);font-size:var(--fs-3);font-weight:600;color:var(--ink)}.check-status.has-errors{background:var(--danger-soft);color:var(--danger)}
.check-group{margin:0 0 18px}.check-group h3{font-size:var(--fs-3);margin:0 0 4px}.check-group>.quiet{font-size:var(--fs-2);margin:0 0 8px}
.check-cards{list-style:none;margin:0;padding:0!important;display:grid;gap:8px}
.check-card{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface)}
.check-card.is-blocking{border-color:var(--danger-line);background:var(--warning-soft)}.check-card.is-seen{background:var(--surface-sunken);color:var(--muted)}
.check-mark{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1px solid var(--decor);font-size:var(--fs-1);line-height:1;color:var(--muted)}
.is-blocking .check-mark{background:var(--danger);border-color:var(--danger);color:var(--on-accent);font-weight:700}.is-seen .check-mark{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.check-title{display:block;font-size:var(--fs-3);margin-bottom:2px}
.check-line{margin:0;font-size:var(--fs-3);line-height:1.45}.check-lines{margin:0;padding-left:16px!important;font-size:var(--fs-3);line-height:1.45}
.check-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.check-go{min-height:36px;padding:6px 12px;font-size:var(--fs-3);text-decoration:none}
.check-player{display:block;width:100%;margin-top:8px}
.seen-line{font-size:var(--fs-3);margin:0 0 10px;color:var(--ink)}
.dropped{border:1px solid var(--danger-line);border-radius:var(--r-2);background:var(--warning-soft);padding:12px 14px;margin-bottom:14px;font-size:var(--fs-1)}.dropped-title{margin:0 0 6px;font-weight:600;color:var(--danger)}
.materials h3{margin-top:18px}.material-group{margin:6px 0}.material-group summary{cursor:pointer;font-size:var(--fs-3);font-weight:600;padding:4px 0}
.material-list{list-style:none;padding:0!important;margin:6px 0!important;display:grid;gap:8px}
.material{display:flex;gap:10px;align-items:center;font-size:var(--fs-1);line-height:1.4}.material img,.material-icon{width:48px;height:48px;object-fit:cover;border-radius:var(--r-1);flex-shrink:0;background:var(--bg)}
.material-icon{display:grid;place-items:center;font-size:var(--fs-4);color:var(--muted)}.material-text{display:grid;flex:1;min-width:0}.material-text strong{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.material-notPlaced .material-text span,.material-lost .material-text span{color:var(--danger)}.material-waiting .material-text span{color:var(--warning)}
.print-for label{display:grid;gap:4px;max-width:420px}.print-for select{width:100%}
.print-files progress{width:min(420px,100%);height:7px;accent-color:var(--green);margin:12px 0}.print-jobs{list-style:none;padding:0!important;margin-top:12px!important}.print-jobs li{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}.print-jobs a{font-weight:600}.print-jobs ul{flex-basis:100%;margin:0}
.spread-tools{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;margin-top:10px;font-size:var(--fs-1)}
.chapter-photo{display:flex;gap:8px;align-items:center}.chapter-photo select{min-height:36px;border:1px solid var(--line);border-radius:var(--r-1);background:var(--surface-sunken);padding:5px 8px;max-width:260px}
.focus-dialog{max-width:min(720px,calc(100% - 32px))}.focus-dialog p{font-size:var(--fs-2)}
.approval-done{font-weight:600;color:var(--green)}.accept-row{display:flex;gap:8px;align-items:center;font-size:var(--fs-1);margin:0 0 12px;cursor:pointer}#approval-state{font-size:var(--fs-1);color:var(--muted);margin:10px 0 0}#approval-state:empty{display:none}

/* ---- The book screen: bar on top; navigation · stage · properties ---- */
.spreads-body{background:var(--paper)}
/* The header of the layout (BK-145): «← Материалы» and the name; the state of the book; the save indicator in a block of
   its own width; ↶ ↷; the rest under «⋯». One row down to 1180 px. */
.book-bar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:8px 18px;padding:10px clamp(16px,2.4vw,32px);border-bottom:1px solid var(--line);background:var(--surface-tint)}
.back-link{white-space:nowrap}
.book-bar-title{min-width:0}.book-bar-title h1{font-size:var(--fs-4);line-height:1.2;margin:0 0 2px;letter-spacing:-.3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.spreads-summary{font-size:var(--fs-3);color:var(--muted);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.book-bar-actions{display:flex;align-items:center;gap:8px}
/* «Предпросмотр» and «Проверить книгу» in the header (BK-262, DS-10): the check is the main button, its red number is what
   must be decided before the approval. */
.preview-toggle{white-space:nowrap}
.check-book{white-space:nowrap}.check-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;margin-left:8px;padding:0 6px;box-sizing:border-box;border-radius:var(--r-round);background:var(--danger);color:var(--on-accent);font-size:var(--fs-1);font-weight:700;line-height:1}.check-count[hidden]{display:none}


.book-bar .save-state{margin:0;font-size:var(--fs-3);flex:none;width:200px}
.book-bar-title{flex:1}
.back-link{white-space:nowrap}
/* «⋯»: the PDF for reading and «Сбросить» (dangerous, apart) */
.bar-more{position:relative}.bar-more>summary{list-style:none}.bar-more>summary::-webkit-details-marker{display:none}
.bar-more-list{position:absolute;right:0;top:calc(100% + 6px);z-index:20;min-width:210px;padding:6px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 8px 24px var(--shadow-2);display:grid;gap:2px}

.bar-more-list #reset-edits{margin-top:4px;border-top:1px solid var(--line);border-radius:0 0 var(--r-2) var(--r-2)}
/* Messages about actions (BK-261, DS-10): one kind — a dark plate at the bottom of the screen, the text and the action
   on the right («Вернуть», «Отменить»). They never move the buttons of the page; the plate lets clicks through to what is
   under it, only its buttons take them. */
.edits-state{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:45;display:flex;align-items:center;gap:8px 24px;width:max-content;max-width:min(640px,calc(100vw - 32px));box-sizing:border-box;padding:12px 18px;border-radius:var(--r-2);background:var(--dark);color:var(--on-accent);box-shadow:0 8px 24px var(--shadow-3);font-size:var(--fs-3);line-height:1.4;pointer-events:none}.edits-state:empty{display:none}
.edits-state .note-text{min-width:0}
.edits-state .note-action,#changes .note-action{flex:none;pointer-events:auto;min-height:0;padding:6px 8px;margin:-6px -8px;border:0;border-radius:var(--r-1);background:none;color:var(--accent-bright);font:inherit;font-weight:600;cursor:pointer}
.edits-state .note-text+.note-action{margin-left:auto}
.edits-state .note-action:hover,#changes .note-action:hover{text-decoration:underline}.edits-state .note-action:focus-visible,#changes .note-action:focus-visible{outline:2px solid var(--accent-bright);outline-offset:2px}
.edits-state .note-action:disabled{opacity:.6;cursor:default;text-decoration:none}
@media (pointer:coarse){.edits-state .note-action,#changes .note-action{padding:12px 10px;margin:-12px -10px}}
@media(max-width:1180px){.book-bar .save-state{width:150px}}
.approval-badge{min-height:30px;padding:4px 11px;border-radius:var(--r-4);font-size:var(--fs-1);font-weight:600;border:1px solid var(--line);background:var(--surface-sunken)}.approval-badge.is-approved{background:var(--green-soft);border-color:var(--green);color:var(--green)}.approval-badge.has-errors{background:var(--danger-soft);border-color:var(--danger-line);color:var(--danger)}
.spreads-notice{margin:14px clamp(16px,2.4vw,32px)}
.book-layout{display:grid;grid-template-columns:248px minmax(0,1fr) 330px;min-height:calc(100vh - 70px)}
.book-nav{font-size:var(--fs-1);border-right:1px solid var(--line);padding:14px 10px;overflow:auto;max-height:calc(100vh - 70px);position:sticky;top:70px}
.book-nav summary{font:var(--fs-3) var(--sans);padding:4px 8px 10px;cursor:pointer}
.nav-list{list-style:none;margin:0;padding:0}.nav-item{font:inherit;justify-content:flex-start;display:flex;gap:8px;align-items:baseline;width:100%;text-align:left;padding:7px 8px;border-radius:var(--r-2);font-size:var(--fs-1);line-height:1.35}.nav-item:hover{background:var(--hover)}.nav-item[aria-current=true]{background:var(--surface);box-shadow:inset 3px 0 0 var(--green);font-weight:600}
.nav-number{color:var(--muted);font-size:var(--fs-1);min-width:18px}.nav-name{flex:1;min-width:0;overflow-wrap:anywhere}.nav-issue{font-size:var(--fs-1)}.nav-chapter{margin-top:8px}.nav-chapter .nav-name{font-family:var(--sans);font-size:var(--fs-3)}
.book-stage{min-width:0;display:flex;flex-direction:column;padding:12px clamp(12px,2vw,24px) 20px}
.view-modes,.zoom{display:flex;border:1px solid var(--line);border-radius:var(--r-2);overflow:hidden}.view-modes button,.zoom button{min-height:34px;padding:5px 12px;font-size:var(--fs-3);background:var(--surface-sunken);border-right:1px solid var(--line)}.view-modes button:last-child,.zoom button:last-child{border-right:0}.view-modes [aria-pressed=true],.zoom [aria-pressed=true]{background:var(--green);color:var(--on-accent)}
.zoom button{min-width:38px}#zoom-fit{min-width:96px}
.stage-nav{display:flex;align-items:center;gap:8px;font-size:var(--fs-1);color:var(--muted)}.zoom button:disabled{opacity:.4}
.guides-toggle{display:flex;gap:6px;align-items:center;font-size:var(--fs-3);cursor:pointer}
/* «Показать поля и сетку» lives in «⋯» (BK-262): its checkbox stays for the menu to press. */
.guides-only{display:none}
/* The bar of the page floats under the stage, never over the page (BK-262, DS-10): ‹ 3 из 8 ›, «Разворот / Страница / Все страницы»,
   −, «По экрану», +, «Как на бумаге», «Править расположение». It stays in sight while the stage scrolls. */
#main{position:relative}
.stage-float{position:sticky;bottom:16px;z-index:4;align-self:center;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 10px;max-width:calc(100% - 8px);margin-top:8px;padding:6px 8px;box-sizing:border-box;border:1px solid var(--line);border-radius:var(--r-3);background:var(--surface);box-shadow:0 6px 20px var(--shadow-2)}
.stage-float::-webkit-scrollbar{display:none}.stage-float>*{flex:none}
.stage-float .view-modes button,.stage-float .zoom button{min-height:32px;padding:4px 9px;font-size:var(--fs-2)}.stage-float .zoom button{min-width:32px}.stage-float .stage-nav .button-icon{min-width:32px;min-height:32px}.stage-float #zoom-fit{min-width:0}.stage-float .grid-toggle{font-size:var(--fs-2)}
.spread-caption{font-size:var(--fs-1);color:var(--muted);margin:0 0 8px}
@media(max-width:900px){#zoom-paper{display:none}}
.stage{flex:1;min-height:320px;height:calc(100vh - 205px);overflow:auto;display:flex;align-items:flex-start;justify-content:center;background:var(--stage);border-radius:var(--r-3);padding:12px;outline:0}
.stage .sheet{position:relative;overflow:hidden;flex-shrink:0;box-shadow:0 4px 18px var(--shadow-3);margin:auto}
/* An empty page of the owner's spread (BK-261, BK-306, Figma M1): a zone over the page inside its margins, a dashed line
   round it; what to put on it in the middle, at the screen's own size. */
.empty-page{position:absolute;display:flex;align-items:center;justify-content:center;pointer-events:none;padding:12px;box-sizing:border-box;border:1.5px dashed color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:var(--r-2)}
.empty-page-card{pointer-events:auto;display:grid;gap:4px;justify-items:center;text-align:center;max-width:100%;padding:8px;font-size:var(--fs-2);color:var(--muted)}
.empty-page-card strong{color:var(--ink);font-size:var(--fs-4)}
.empty-page-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}
.stage.mode-all{height:auto;min-height:0;background:transparent;padding:0;overflow:visible}
/* The layout is the window (BK-291, DS-10, Figma 1440×900): the header, the list of spreads, the stage and the panel stand
   still, each column scrolls inside; the page itself never scrolls. The messages — «Что изменилось», «ИИ разобрал фото» and
   the dark plate of an action — stand over the bottom of the stage, just above its bar, and never move the spread. */
@media screen and (min-width:901px){
 body.spreads-body{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
 body.spreads-body>.book-bar{position:relative;flex:none}
 body.spreads-body>.spreads-notice{flex:none}
 .book-layout{flex:1 1 auto;min-height:0;grid-template-rows:minmax(0,1fr)}
 .book-layout>.book-nav,.book-layout>.book-panel{position:relative;top:auto;max-height:none;min-height:0;box-sizing:border-box}
 .book-stage{min-height:0;overflow:hidden}
 /* The grip stays inside the stage, which clips what goes past its edge. */
 #main>.panel-resizer{right:0;width:8px}#main>.panel-resizer::after{left:auto;right:0}
 .stage,.stage.mode-all{flex:1 1 0;height:auto;min-height:0}
 .stage.mode-all{overflow:auto}
 .stage-messages{position:absolute;left:0;right:0;bottom:calc(var(--float-h,46px) + 28px);z-index:46;display:flex;flex-direction:column;align-items:center;gap:8px;padding:0 16px;pointer-events:none}
 /* Clicks go through the plates to the spread under them: only their buttons take them (as the plate of an action). */
 .stage-messages>#changes{pointer-events:none;max-width:min(640px,100%);max-height:40vh;overflow:auto;box-sizing:border-box;margin:0}
 .stage-messages>#changes :is(button,summary,a){pointer-events:auto}
 .stage-messages>.edits-state{position:static;transform:none}
 /* The bar of the stage stands under the stage: the column does not scroll, so it needs no «sticky». */
 /* One row beside the rail of sections (BK-290, Figma A1): the buttons a little tighter. */
 .stage-float{position:relative;bottom:auto;gap:6px}
 .stage-float .view-modes button,.stage-float .zoom button{padding-inline:7px}
}
/* On a phone the messages stay where they were: the cards over the page, the plate fixed above the bottom strip. */
@media not screen,(max-width:900px){.stage-messages{display:contents}}
.spread-photo{cursor:pointer}.spread-photo.selected::after,.spread-photo:focus-visible::after{content:'';position:absolute;inset:0;border:1.6mm solid var(--accent-bright);pointer-events:none}.spread-photo:focus-visible{outline:0}.spread-photo:focus-visible::after{border-color:var(--green)}
.all-pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:18px;width:100%}
.thumb{display:grid;gap:7px;justify-items:start;text-align:left;padding:5px;border-radius:var(--r-2)}.thumb:hover{background:var(--hover)}.thumb-sheet{position:relative;overflow:hidden;box-shadow:0 2px 8px var(--shadow-2)}.thumb-caption{font-size:var(--fs-1);color:var(--muted);line-height:1.4}.thumb-error .thumb-sheet{outline:2px solid var(--danger)}.thumb-warning .thumb-sheet{outline:2px solid var(--warning-line)}
.book-panel{border-left:1px solid var(--line);padding:12px 16px 30px;overflow:auto;max-height:calc(100vh - 70px);position:sticky;top:70px;background:var(--bg)}
#panel-templates .template-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.typo-actions{display:grid;gap:8px;margin-bottom:12px}#panel-typo .typo-actions .button-outline{justify-content:flex-start;text-align:left}
/* «Проверка» opens from «Проверить книгу» in the header (BK-262): its tab is not in the row. */
.panel-tabs .tab-in-header{display:none}
.panel-tabs{display:flex;flex-wrap:wrap;overflow-x:auto;scrollbar-width:thin;gap:2px;margin-bottom:14px}.panel-tabs button{flex:none;min-height:34px;padding:5px 8px;border-radius:var(--r-2);font-size:var(--fs-3)}.panel-tabs [aria-selected=true]{background:var(--surface);box-shadow:inset 0 -2px 0 var(--green);font-weight:600}.panel-tabs .has-errors{color:var(--danger)}
.panel h2{font:var(--fs-4) var(--sans);letter-spacing:0;margin:0 0 10px}.panel h3{font-size:var(--fs-2);margin:16px 0 8px}
.panel .spread-tools{display:grid;gap:10px;margin:0}
.report ul,.approval-panel ul{margin:0;padding-left:18px;font-size:var(--fs-1);line-height:1.8}.report{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
@media(max-width:1180px){.book-layout{grid-template-columns:228px minmax(0,1fr) 290px}}
@media(max-width:900px){
 .book-layout{grid-template-columns:1fr;min-height:0}
 .book-nav,.book-panel{position:static;max-height:none;border:0;border-bottom:1px solid var(--line)}
 .book-panel{border-top:1px solid var(--line)}
 .stage{height:auto;min-height:0;padding:8px}
 .guides-toggle{margin-left:0}
 .book-bar{position:static}
}
.place-row{display:flex;flex-wrap:wrap;gap:6px}
/* «PDF для просмотра»: only the spreads are printed, one per sheet at their real size. */
.print-sheet{display:none}
@media print{
 body.spreads-body>*:not(.print-sheet){display:none!important}
 .print-sheet{display:block}
 .print-spread{break-after:page;page-break-after:always;overflow:hidden}
 .print-spread:last-child{break-after:auto}
 .print-spread .spread{box-shadow:none}
 .print-sheet:empty::before{content:attr(data-blocked);display:block;padding:40mm 20mm;font:var(--fs-4)/1.5 var(--sans);color:var(--ink)}
}
/* Cover (TZ «Обложка»): form in «Свойства», photo choice, provisional sizes */
.nav-cover .nav-name{font-weight:600}
.cover-form{display:grid;gap:14px}
.cover-provisional{margin:0;padding:8px 10px;border-radius:var(--r-2);background:var(--warning-soft);color:var(--warning);font-size:var(--fs-1);line-height:1.45}
.cover-field-row,.cover-text{display:grid;gap:6px}.cover-label{font-size:var(--fs-1);font-weight:600;color:var(--ink)}
.cover-text input,.cover-text textarea{font:inherit;font-size:var(--fs-2);padding:7px 9px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);width:100%;box-sizing:border-box}
.cover-check{display:flex;gap:6px;align-items:center;font-size:var(--fs-1);cursor:pointer}.cover-spine{display:grid;gap:8px}
.cover-photos{display:grid;gap:6px}.cover-photos p{margin:0;font-size:var(--fs-1)}
.cover-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}
.cover-photo{position:relative;padding:0;border:2px solid transparent;border-radius:var(--r-2);background:none;aspect-ratio:1;overflow:hidden;cursor:pointer}
.cover-photo img{width:100%;height:100%;object-fit:cover;display:block}
.cover-photo[aria-pressed=true]{border-color:var(--green)}
.cover-photo-tag{position:absolute;left:3px;bottom:3px;padding:1px 5px;border-radius:var(--r-1);background:var(--surface);color:var(--green);font-size:var(--fs-1);font-weight:600}
.cover-status{list-style:none;margin:0;padding:0;display:grid;gap:4px;font-size:var(--fs-1)}.cover-status:empty{display:none}
/* Start and end of the book */
.nav-part{margin:12px 8px 4px;font-size:var(--fs-1);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.edge-tools{padding:12px;border:1px solid var(--line);border-radius:var(--r-3);background:var(--surface);margin-bottom:12px}.edge-title{margin:0;font-size:var(--fs-3)}.edge-tools .cover-text select{font:inherit;font-size:var(--fs-3);padding:7px 9px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface)}
/* Photo editing: drag to swap, crop dialog */
.stage .spread-photo{cursor:grab;touch-action:none}
/* With a finger a photo fills most of the phone's screen: a swipe up or down over it scrolls the page, a sideways
   drag still swaps photos (BK-175). */
@media (pointer:coarse){.stage .spread-photo{touch-action:pan-y pinch-zoom}}.stage .dragging .spread-photo{cursor:grabbing}.stage .spread-photo.drop-target{outline:1mm solid var(--accent-bright);outline-offset:-1mm}
/* Text and order of a story on the spread */
.story-text-tools{border:1px solid var(--line);border-radius:var(--r-3);background:var(--surface);padding:8px 12px}.story-text-tools summary{cursor:pointer;font-weight:600;font-size:var(--fs-3);padding:4px 0}.story-text-tools[open]{display:grid;gap:10px}
.story-text-tools textarea{min-height:180px;line-height:1.5}.stage .spread-text{cursor:text}
.story-place{display:grid;gap:6px}.story-place select,.story-place .story-name{font:inherit;font-size:var(--fs-3);padding:7px 9px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface)}
.story-name-field{display:grid;gap:4px;margin-top:4px}.story-place .story-name{width:100%;box-sizing:border-box}
.photo-caption{flex:1 1 100%;font:inherit;font-size:var(--fs-1);padding:6px 8px;border:1px solid var(--line);border-radius:var(--r-2)}
.caption-parts{flex:1 1 100%;display:grid;gap:4px;margin:0;padding:6px 8px 8px;border:1px solid var(--line);border-radius:var(--r-2);min-width:0}.caption-parts legend{font-size:var(--fs-1);padding:0 4px}
.photo-tool .caption-part{display:grid;grid-template-columns:52px minmax(0,1fr);gap:6px;align-items:center;cursor:auto;font-size:var(--fs-1)}.caption-part input{font:inherit;font-size:var(--fs-1);padding:5px 7px;border:1px solid var(--line);border-radius:var(--r-2);min-width:0}
.caption-hint{margin:0 0 0 58px;font-size:var(--fs-1)}.caption-hint:empty{display:none}
/* Помощник */
.assistant{border:1px solid var(--decor);border-radius:var(--r-3);background:var(--surface-sunken);padding:8px 12px;margin-bottom:12px}.assistant summary{cursor:pointer;font-weight:600;font-size:var(--fs-3);padding:4px 0}.assistant[open]{display:grid;gap:10px}
.assistant-commands{display:flex;flex-wrap:wrap;gap:6px}
.assistant-ask{display:flex;gap:6px}.assistant-ask input{flex:1;min-width:0;font:inherit;font-size:var(--fs-1);padding:6px 8px;border:1px solid var(--line);border-radius:var(--r-2)}
.assistant-answer{display:grid;gap:8px;padding:10px;border-radius:var(--r-2);background:var(--surface);border:1px solid var(--line)}.assistant-answer p{margin:0;font-size:var(--fs-1);line-height:1.5}
.assistant-answer .thumb-sheet{position:relative;overflow:hidden;box-shadow:0 1px 4px var(--shadow-2)}
.advice{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:var(--fs-1)}
.assistant-diff p{white-space:pre-wrap;max-height:160px;overflow:auto}
.nav-pin{font-size:var(--fs-1)}

.logo-upload input{font-size:var(--fs-1);max-width:260px}
#nav-list .nav-item.can-drop{outline:1px dashed var(--decor);outline-offset:-2px}#nav-list .nav-item.drop-target{background:var(--accent-soft);outline:2px solid var(--accent)}
.spread-text-tool textarea{width:100%;min-height:80px}.spread-text-tool .over{color:var(--danger)}
/* «Двигать по сетке» (BK-77): modules of the page and the blocks of the spread on top of it. */
.layout-layer{position:absolute;inset:0;pointer-events:none}
.layout-module{position:absolute;background:var(--shadow-1);outline:.25mm dashed var(--line)}
.layout-item{position:absolute;pointer-events:auto;outline:.6mm solid var(--accent-veil);background:var(--accent-tint);cursor:move;touch-action:none;box-sizing:border-box}
.layout-item:focus-visible,.layout-item.selected{outline:1mm solid var(--accent);background:var(--accent-tint-2);z-index:1}
.layout-item.dragging{opacity:.75;z-index:2}
/* No grid mode on a wide screen (BK-367): the blocks show when pointed at or chosen; the spread looks as it prints. */
.quiet-blocks .layout-item:not(.selected,.dragging,:hover,:focus-visible){outline-color:transparent;background:transparent}
.layout-label{position:absolute;left:-.6mm;bottom:100%;margin-bottom:.8mm;white-space:nowrap;padding:.6mm 1.6mm;border-radius:1mm;background:var(--accent);color:var(--on-accent);font:600 3.6mm/1.2 sans-serif;pointer-events:none}
/* Block names (BK-261): only at the block chosen, dragged, pointed at or in focus — the spread is not covered with them. */
.layout-label{display:none}.layout-item:is(.selected,.dragging,:hover,:focus-visible) .layout-label{display:block}
.layout-grip{position:absolute;right:-2.5mm;bottom:-2.5mm;width:7mm;height:7mm;border-radius:50%;background:var(--accent);border:.8mm solid var(--surface);cursor:nwse-resize;touch-action:none}
.layout-tools{display:grid;gap:8px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--line-soft)}
.layout-tools h3{margin:0;font-size:var(--fs-3)}
.grid-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.grid-row-label{flex:1 1 100%;font-size:var(--fs-1);color:var(--muted)}
.grid-own{display:inline-flex;gap:4px;align-items:center}.grid-own input{width:56px}
.layout-pad{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.layout-pad .layout-selected{grid-column:1/-1;margin:0;font-weight:600;font-size:var(--fs-2)}
/* The AI tools of a text take the whole width of the panel, under its buttons. */

.layout-pad button:nth-child(n+6){grid-column:span 2}
/* Заказ печати (BK-1) */
.print-request{margin-top:14px;padding-top:12px;border-top:1px solid var(--line-soft);display:grid;gap:8px}
.print-request h3{margin:0;font-size:var(--fs-3)}
.print-request-form{display:grid;gap:8px}
.print-field{display:grid;gap:4px;font-size:var(--fs-2)}.print-field input,.print-field textarea{width:100%;box-sizing:border-box;font:inherit;padding:8px;border:1px solid var(--line);border-radius:var(--r-2)}
.print-pickup{display:flex;gap:8px;align-items:center;font-size:var(--fs-2)}
.print-request-done{margin:0;padding:10px 12px;border-radius:var(--r-2);background:var(--surface-tint);font-size:var(--fs-2)}
.print-request-state{margin:0;font-size:var(--fs-2)}
.layout-empty{position:absolute;left:3mm;right:3mm;top:50%;transform:translateY(-50%);text-align:center;color:var(--accent-strong);font:500 3.8mm/1.35 sans-serif;pointer-events:none}
.layout-note{width:100%;box-sizing:border-box;font:inherit;padding:8px;border:1px solid var(--line);border-radius:var(--r-2);grid-column:1/-1}
.layout-note-count{grid-column:1/-1;font-size:var(--fs-1)}
.move-confirm{max-width:min(460px,calc(100% - 32px))}.move-confirm p{font-size:var(--fs-3);line-height:1.45}.move-warning{color:var(--warning);background:var(--warning-soft);border-radius:var(--r-2);padding:8px 10px}
.layout-item.auto{border-style:dashed}
/* The own look of a text block (BK-268): the alignment, the line spacing, Ж К Ч. */
.layout-pad .text-look{grid-column:1/-1;display:grid;gap:8px;margin:4px 0}.text-look .segmented{width:100%}.text-look .segment{flex:1 1 0;padding-inline:4px;font-size:var(--fs-1)}
.text-stepper,.text-marks{display:flex;align-items:center;gap:6px}.text-mark{min-width:40px;font-weight:700}.text-mark-italic{font-style:italic;font-weight:400}.text-mark-underline{text-decoration:underline;font-weight:400}
.layout-pad .layout-style{grid-column:1/-1;display:flex;flex-direction:column;gap:4px;margin:4px 0}
/* The styles as tiles, three in a row, «Аа» in each style's face (BK-268, DS-23); the fonts in their own faces, with the
   Kazakh letters or without them (Figma C8). */
.style-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.layout-pad .style-tiles>.style-tile,.layout-pad .font-list .font-choice{grid-column:auto}
.style-tile,.font-choice{border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.style-tile{display:grid;place-items:center;gap:2px;min-height:68px;padding:6px 1px}.style-tile:hover,.font-choice:hover{border-color:var(--accent)}
.style-tile[aria-pressed=true],.font-choice[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft)}
.style-sample{line-height:1.15}.style-tile.is-accent .style-sample{color:var(--accent)}.style-name{max-width:100%;font-size:var(--fs-1);letter-spacing:-.02em;color:var(--muted);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.font-list{display:grid;gap:4px}.font-choice{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:4px 10px;text-align:left}
.font-name{font-size:var(--fs-4);line-height:1.2}.font-letters{font-size:var(--fs-1);color:var(--muted);white-space:nowrap}
.font-choice.is-missing .font-letters{color:var(--danger)}.font-choice.is-missing[aria-pressed=true]{border-color:var(--danger);background:var(--danger-soft)}
.layout-hint.is-danger{color:var(--danger)}
/* The colour of a text (BK-269, DS-24, Figma D1–D3): the design's colours in a row and «Все ▸»; the window «Все цвета»
   with the design's, the recent and the neutral colours and one of the owner's own — a square of shade, a strip of hue. */
.color-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px}.color-row .color-swatch{width:26px;height:26px}.color-swatches{display:flex;flex-wrap:wrap;gap:8px}
.color-swatch{width:28px;height:28px;padding:0;border:1px solid var(--border-strong);border-radius:var(--r-round);background:var(--swatch,transparent);cursor:pointer}
.color-swatch[aria-pressed=true]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.color-swatch.color-none{background:linear-gradient(to top right,transparent calc(50% - 1px),var(--danger) calc(50% - 1px),var(--danger) calc(50% + 1px),transparent calc(50% + 1px)),var(--surface)}
/* The frame of a text (BK-270, DS-25): the frames in one row, each drawn as it looks; columns as three icons. */
.text-frame-tools,.layout-pad>.text-cols-field{display:grid;gap:8px;grid-column:1/-1;margin:4px 0}.frame-tiles{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.layout-pad .frame-tiles>.frame-tile{grid-column:auto}
.frame-tile{display:grid;place-items:center;min-height:40px;padding:3px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink);cursor:pointer}
.frame-tile:hover{border-color:var(--accent)}.frame-tile[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-strong)}.frame-tile svg{width:100%;max-width:56px;height:auto}
.text-cols{width:100%}.text-cols .segment{flex:1 1 0}
/* The settings of a text in the order of Figma A4 (BK-295): groups with their names in small capitals — «Стиль текста»,
   «Шрифт и размер» (the font as a line that opens the list, the size and the spacing side by side, Ж К Ч and the alignment
   in one row), «Цвет текста», «Колонки», «Рамка» (the name of the chosen one under the tiles), «Заливка»; then «Ещё» (F1). */
.layout-pad>.text-group,.layout-pad>.text-more,.layout-pad .text-look>.text-group{grid-column:1/-1}
.text-group{display:grid;gap:8px;margin:6px 0 4px}.text-group-label,.font-group-name{font-size:var(--fs-1);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.layout-pad .text-look{gap:12px}
.font-pick{min-width:0}.font-pick>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:4px 12px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);font-size:var(--fs-4);cursor:pointer}
.font-pick>summary::-webkit-details-marker{display:none}.font-pick>summary:hover{border-color:var(--accent)}.font-pick[open]>summary{border-color:var(--accent)}
.font-pick[open]>summary::after{transform:rotate(180deg)}.font-pick>.font-list{margin-top:6px;max-height:min(420px,55vh);overflow:auto;overscroll-behavior:contain}
/* The list «Шрифт» (BK-307): a search over the names, the groups; a name off the screen is not drawn, so its font loads when it comes into sight. */
.font-search{position:sticky;top:0;z-index:1;width:100%;min-height:40px;padding:6px 10px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink)}
.font-group{display:grid;gap:4px;margin-top:6px}.font-choice{content-visibility:auto;contain-intrinsic-size:auto 44px}.font-none{margin:6px 2px}
.text-sizes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.text-sizes .text-stepper{gap:4px}.text-sizes .object-size{flex:1;min-width:2.4em;text-align:center}
.text-sizes .button-icon.button-small,.text-kinds .button-small{min-width:30px;min-height:32px;padding-inline:0}
.text-kinds{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}.text-kinds .text-marks{gap:4px}.text-kinds .text-mark{min-width:30px}
.text-align{display:flex;gap:4px}
/* A chosen text has its settings straight in «Текст», without a card of its own (Figma A4). */
.block-chosen:has(.text-look){padding:0;border:0;box-shadow:none;background:none}.text-align-button[aria-pressed=true],.valign-button[aria-pressed=true]{border-color:var(--ink);background:var(--accent-soft)}
.frame-chosen{font-size:var(--fs-1);color:var(--muted)}
/* «Толщина, цвет, скругление ›» (BK-297, Figma E9): a link-like line under the frames; opened — the line and the corners side
   by side, the colour, «Отступ от текста» in three steps. */
.frame-look[open]{display:grid;gap:10px}
.frame-look>summary{list-style:none;display:inline-flex;align-items:center;gap:4px;width:max-content;color:var(--accent-text);font-size:var(--fs-2);font-weight:600;cursor:pointer}
.frame-look>summary::-webkit-details-marker{display:none}.frame-look[open]>summary::after{transform:rotate(90deg)}
.frame-pad{width:100%}.frame-pad .segment{flex:1 1 0}
.text-more{border-top:1px solid var(--line-soft);padding-top:6px}
.text-more>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;font-size:var(--fs-3);font-weight:700;cursor:pointer}
.text-more>summary::-webkit-details-marker{display:none}.text-more>summary::after{transition:transform .15s}.text-more[open]>summary::after{transform:rotate(90deg)}
.text-more-body{display:grid;gap:10px;padding:4px 0 6px}
.text-valign{display:flex;gap:6px}.text-valign .valign-button{flex:1 1 0;min-height:36px}
.text-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;font-size:var(--fs-3);cursor:pointer}
.text-more-body>.layout-pad-fold{margin-top:2px}
/* «Размер и положение ›» at the end of «Ещё» (F1): a link-like line; opened, its buttons under it. */
.text-more .layout-pad-fold>summary{list-style:none;display:inline-flex;align-items:center;gap:4px;color:var(--accent-text);font-weight:600}
.text-more .layout-pad-fold>summary::-webkit-details-marker{display:none}.text-more .layout-pad-fold[open]>summary::after{transform:rotate(90deg)}
.layout-pad.layout-text>button.button-small{grid-column:1/-1;justify-self:start}
.color-dialog{width:min(420px,calc(100% - 32px))}.color-dialog-title{margin:0 0 12px;font-size:var(--fs-5)}
.color-group{margin:0 0 14px}.color-group-name{margin:0 0 6px;font-size:var(--fs-2);font-weight:600;color:var(--text-2)}
.color-square{position:relative;width:100%;aspect-ratio:8/5;border-radius:var(--r-2);overflow:hidden;cursor:crosshair;touch-action:none}.color-square canvas{display:block;width:100%;height:100%}
.color-square:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.color-dot{position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border:2px solid var(--surface);border-radius:var(--r-round);box-shadow:0 0 0 1px var(--ink);pointer-events:none}
.color-strip{position:relative;height:28px;margin:10px 0}.color-strip canvas{position:absolute;left:0;top:8px;width:100%;height:12px;border-radius:var(--r-round)}
.color-strip input{position:absolute;inset:0;width:100%;height:100%;margin:0;background:none;-webkit-appearance:none;appearance:none;cursor:pointer}
.color-strip input::-webkit-slider-runnable-track{background:none}.color-strip input::-moz-range-track{background:none}
.color-strip input::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border:2px solid var(--surface);border-radius:var(--r-round);background:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.color-strip input::-moz-range-thumb{width:16px;height:16px;border:2px solid var(--surface);border-radius:var(--r-round);background:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.color-own-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.color-own-foot>button{width:auto;flex:none}.color-preview{width:32px;height:32px;border:1px solid var(--border-strong);border-radius:var(--r-1);background:var(--swatch,transparent)}
.color-hint{font-size:var(--fs-1)}.color-dialog-foot{display:flex;justify-content:flex-end;margin-top:4px}
@media(max-width:900px){.color-swatch,.color-row .color-swatch{width:36px;height:36px}}.layout-pad .layout-style select{min-height:40px;font-size:var(--fs-3)}
.page-elements{margin-top:18px;border-top:1px solid var(--line-soft);padding-top:12px}.page-elements h3{font-size:var(--fs-3);margin:0 0 4px}.page-element{margin:10px 0}.page-element-head{display:flex;gap:8px;align-items:center;font-weight:600;font-size:var(--fs-3)}.page-element-body{display:flex;flex-direction:column;gap:6px;margin:6px 0 0 24px}.page-element select,.page-element input[type=text]{min-height:38px;font-size:var(--fs-3);max-width:100%}.page-plain{margin-top:12px}
/* Writing in a text block (BK-264): the card beside the block, 300 px; the block is pinned meanwhile. */
.write-card{position:fixed;z-index:60;width:min(300px,calc(100vw - 16px));box-sizing:border-box;display:grid;gap:6px;padding:8px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 10px 28px var(--shadow-3)}
.write-head{display:flex;align-items:center;gap:4px;cursor:move;touch-action:none}.write-pinned{flex:1;font-size:var(--fs-1);color:var(--muted)}
.write-text{width:100%;box-sizing:border-box;min-height:96px;max-height:40vh;padding:8px;border:1px solid var(--line);border-radius:var(--r-1);font:inherit;font-size:var(--fs-3);line-height:1.45;resize:vertical;white-space:pre-wrap}
.write-text:focus-visible,.big-text:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
.write-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;font-size:var(--fs-1);color:var(--muted)}.write-esc{margin-left:auto}@media (pointer:coarse){.write-esc{display:none}}.write-fit.is-cut{color:var(--danger);font-weight:600}
.write-note{margin:0;font-size:var(--fs-1);color:var(--warning)}
.layout-item.pinned{cursor:text}
.big-writer{width:min(760px,calc(100% - 24px))}.big-text{width:100%;box-sizing:border-box;min-height:50vh;padding:10px;border:1px solid var(--line);border-radius:var(--r-2);font:inherit;font-size:var(--fs-phone);line-height:1.5;resize:vertical}
.layout-overflow{position:absolute;z-index:61;transform:translate(-100%,-100%);background:var(--danger);color:var(--on-accent);font:600 var(--fs-1)/1.3 system-ui,sans-serif;padding:2px 6px;border-radius:var(--r-3);white-space:nowrap;pointer-events:none}.layout-overflow{right:2px;bottom:2px;transform:none}
.layout-hint{color:var(--warning)}
.layout-pad>p.quiet,.layout-pad>textarea,.layout-pad>.layout-note-count{grid-column:1/-1}
.add-text{width:100%;margin:8px 0 4px}
/* Stories dragged in the list (BK-202): the dragged one grey, one line where it goes */
.nav-story{position:relative}
/* «⋯» of the owner's spread in the list (BK-261): «Удалить разворот». With a mouse — a small button in the corner by the
   pages, shown on the spread pointed at, the open one and in focus; the names keep the whole width. By touch — always
   there, full size, beside the text. */
.nav-list .has-more{position:relative}
.nav-more{position:absolute;right:4px;bottom:4px}.nav-more>summary{list-style:none;color:var(--muted)}.nav-more>summary::-webkit-details-marker{display:none}
.book-nav .nav-more>summary{min-width:24px;min-height:24px;width:24px;height:24px}.book-nav .nav-more>summary[data-icon]::before{width:16px;height:16px}
@media (pointer:fine){.nav-more:not([open]){opacity:0}.has-more:is(:hover,:focus-within) .nav-more,.has-more:has(.nav-item[aria-current=true]) .nav-more{opacity:1}}
@media (pointer:coarse){.nav-more{bottom:auto;top:50%;transform:translateY(-50%)}.book-nav .nav-more>summary{width:44px;height:44px}.nav-list .has-more>.nav-item{padding-right:52px}}
.nav-more[open]{z-index:20}.nav-more[open]>summary{background:var(--stage);color:var(--ink)}
.nav-more-list{position:absolute;right:0;top:calc(100% + 4px);min-width:200px;padding:6px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 8px 24px var(--shadow-2);display:grid;gap:2px}
.nav-story[draggable=true] .nav-item{cursor:grab}.nav-story.is-dragged{opacity:.45}
.nav-story.drop-before::before,.nav-story.drop-after::after{content:'';position:absolute;left:4px;right:4px;height:3px;border-radius:var(--r-1);background:var(--accent);pointer-events:none}.nav-story.drop-before::before{top:-2px}.nav-story.drop-after::after{bottom:-2px}
/* Texts of the story not on a spread yet («Текст 4»): one tap puts a text on this spread. */
.layout-loose{display:grid;gap:4px;margin-top:10px;justify-items:start}.layout-loose p{margin:0}
/* The chapter's introduction («Текст 4б»), typed in the chapter's props. */
.chapter-intro{display:grid;gap:6px;margin:10px 0}.chapter-intro .layout-title{margin:0}.chapter-intro p{margin:0}
/* AI for one text on the spread («Текст 4в»). */
.is-held{outline:2px dashed var(--warning);outline-offset:2px}.held-mark{position:absolute;left:4px;top:4px;z-index:3;max-width:calc(100% - 8px);padding:2px 6px;border-radius:var(--r-1);background:var(--surface);color:var(--ink);font-family:var(--sans);font-size:var(--fs-1);font-weight:600;line-height:1.3;box-shadow:var(--shadow-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
/* «Примерка» of an AI edit (BK-275): the block shows the proposed words, marked as not taken yet. */
/* «Улучшить текст» at the block (BK-292, Figma B1–B3, L2, L3): the list under the button, the answer over and under the block. */
.text-ai-menu .menu-head{padding:6px 10px 2px;font-size:var(--fs-1);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.text-ai-menu .text-ai-ask{display:grid;gap:6px;padding:4px 10px 8px}.text-ai-ask textarea{width:100%;font:inherit;resize:vertical}.text-ai-ask .quiet{margin:0;font-size:var(--fs-1)}.text-ai-ask button{justify-self:start}
.text-ai-left{margin:0;padding:4px 10px;font-size:var(--fs-1)}
.ai-label{position:absolute;z-index:7;max-width:calc(100% - 8px);padding:3px 8px;border-radius:var(--r-1) var(--r-1) 0 0;background:var(--accent);color:var(--on-accent);font-family:var(--sans);font-size:var(--fs-1);font-weight:600;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.ai-chip{position:absolute;z-index:7;display:flex;gap:6px;align-items:center;padding:4px 10px;border:1px solid var(--line);border-radius:var(--r-round);background:var(--surface);color:var(--text-2);font-family:var(--sans);font-size:var(--fs-1);line-height:1.3;box-shadow:0 1px 4px var(--shadow-2);pointer-events:none}
.ai-chip.is-under{position:static;display:inline-flex;margin-bottom:4px;box-shadow:none}.ai-chip[data-icon]::before{color:var(--accent)}.ai-chip.is-warn{border-color:var(--warning);color:var(--ink)}.ai-chip.is-warn[data-icon]::before{color:var(--warning)}
.ai-bar{position:absolute;z-index:8;display:flex;flex-wrap:wrap;gap:6px;align-items:center;max-width:calc(100% - 8px);padding:6px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 6px 18px var(--shadow-3);font-family:var(--sans)}
.ai-bar .ai-views .segment{min-height:32px;padding:4px 12px}.ai-bar .ai-apply{min-width:110px}
.ai-bar.is-busy{padding:6px 6px 6px 12px;font-size:var(--fs-2);color:var(--text-2)}.ai-bar-state::before{content:'';display:inline-block;width:12px;height:12px;margin-right:8px;vertical-align:-1px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:var(--r-round);animation:button-spin 1s linear infinite}
.ai-hint{position:absolute;z-index:7;max-width:min(420px,calc(100% - 8px));font-family:var(--sans);font-size:var(--fs-1)}.ai-hint>.quiet{margin:0}.ai-hint .proposal-facts,.ai-hint .proposal-words{margin:6px 0 0;padding:8px 10px;border-radius:var(--r-2);background:var(--surface)}
.text-delete{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}.text-delete p{margin:0;flex-basis:100%}
/* «Что изменилось» after an operation, and the two levels of «Закрепить» */
.changes{border:1px solid var(--warning-line);border-radius:var(--r-2);background:var(--warning-soft);padding:10px 14px;margin:0 0 10px;font-size:var(--fs-1)}.changes ul{display:grid;gap:2px}.changes-title{margin:0 0 6px;font-weight:600}
.changes ul{margin:0 0 6px;padding-left:18px;line-height:1.8}
/* «Что изменилось» (BK-291, DS-10 «Сообщения внизу экрана», Figma L11): the dark plate of the messages — what changed and the
   actions on the right, the list under «Подробнее». */
#changes{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 24px;padding:12px 18px;border:0;border-radius:var(--r-2);background:var(--dark);color:var(--on-accent);box-shadow:0 8px 24px var(--shadow-3);font-size:var(--fs-3);line-height:1.4}
#changes>.changes-title{margin:0;font-weight:600}#changes>.changes-actions{display:flex;gap:20px;margin:0}#changes>.changes-more{grid-column:1/-1;order:3}
#changes .changes-more>summary{width:max-content;cursor:pointer;color:var(--accent-bright);font-weight:600;font-size:var(--fs-1)}#changes .changes-more[open]>summary{margin-bottom:4px}
#changes ul{margin:0 0 4px;padding-left:18px;line-height:1.6;font-size:var(--fs-1)}#changes .changes-link{display:inline;min-height:0;padding:0;border:0;background:none;font:inherit;font-weight:600;color:var(--accent-bright);text-decoration:underline;cursor:pointer}#changes .quiet{margin:0;font-size:var(--fs-1);color:inherit;opacity:.8}.changes-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:6px}
.ai-held{border-color:var(--line-soft);background:var(--accent-soft)}.gallery .ai-held{margin:8px 0 10px}
/* The analysis waits in «Фото» (BK-368): a mark on its tab. */
#nav-tab-photos.has-advice:not(.is-uploading,.has-failed)::after{content:'';position:absolute;top:8px;right:10px;width:8px;height:8px;border-radius:var(--r-round);background:var(--accent);pointer-events:none}.material .material-text .material-ai{color:var(--muted)}
.pin-row{display:flex;flex-wrap:wrap;gap:8px}
.material-similar-to{width:36px;height:36px;object-fit:cover;border-radius:var(--r-1);margin-top:4px;outline:2px solid var(--green)}
/* A similar shot (BK-146): half-transparent and marked, the kept shot beside it in full colour */
.material-similar>img{opacity:.5}.material-similar .similar-mark{display:inline-block;width:max-content;font-size:var(--fs-1);font-weight:600;color:var(--warning);background:var(--highlight);border-radius:var(--r-1);padding:1px 6px}
/* The helper (BK-150): what a command changes, «сейчас / станет», and the request that stays inside the panel. */
.assistant{min-width:0}.assistant-ask{flex-wrap:wrap}.assistant-ask input{flex:1 1 160px}.assistant-ask .button-primary{flex:none}
.assistant-scope{margin:0;padding:6px 10px;border-left:3px solid var(--accent);background:var(--surface-tint);font-size:var(--fs-1);line-height:1.45}
.assistant-hint{margin:0;font-size:var(--fs-1)}
.assistant-more>summary{cursor:pointer;font-size:var(--fs-3);color:var(--muted);padding:2px 0}.assistant-more[open]>summary{margin-bottom:6px}
.assistant-pair{display:flex;gap:10px;flex-wrap:wrap}.assistant-pair figure{margin:0;display:grid;gap:4px}
.assistant-diff ins{background:var(--success-soft);text-decoration:none}.assistant-diff del{background:var(--danger-soft);color:var(--danger)}
.assistant-other{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline;font-size:var(--fs-1)}
.assistant-stale{padding:6px 10px;border-radius:var(--r-2);background:var(--warning-soft);color:var(--warning)}
/* «К развороту» (BK-141): hidden until Tab reaches it, then the first thing on the page. */
.skip-link{position:absolute;left:12px;top:-60px;z-index:50;padding:10px 14px;background:var(--surface);color:var(--accent-strong);border:2px solid var(--accent);border-radius:var(--r-2);font-weight:600;text-decoration:none}
.skip-link:focus{top:12px}
/* The list of spreads (BK-162): a small picture, the pages and the problems in words. */
.nav-item{align-items:center}
/* The list of spreads by pictures (BK-262, DS-10): the spread small, under it its number, name and pages. */
.nav-list>li:has(>.nav-shot){margin-top:8px}
.nav-shot{position:relative;overflow:hidden;margin:0 8px 4px;border-radius:var(--r-1);box-shadow:0 1px 4px var(--shadow-2);background:var(--surface);cursor:pointer}
.nav-shot *{pointer-events:none}
.nav-list>li:has(>.nav-item[aria-current=true])>.nav-shot{outline:2px solid var(--green);outline-offset:2px}
.nav-line{display:flex;gap:8px;align-items:baseline;min-width:0}
.nav-lock{flex:none;width:14px;height:14px;color:var(--muted);align-self:center}
.nav-add{margin-top:10px;padding:0 8px}.nav-add .button-outline{width:100%}
.nav-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.nav-text .nav-name{overflow-wrap:break-word}
.nav-meta{color:var(--muted);font-size:var(--fs-1);font-weight:400}
.nav-issue{font-size:var(--fs-1);white-space:nowrap}
/* Reading the text of a spread: the size is the page's, not the book's zoom. */
.read-dialog{width:min(680px,calc(100vw - 32px));max-height:calc(100vh - 48px);padding:0;border:1px solid var(--line);border-radius:var(--r-3)}
.read-dialog::backdrop{background:var(--scrim)}
.read-head{position:sticky;top:0;display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 20px;background:var(--surface);border-bottom:1px solid var(--line)}
.read-head h2{margin:0;font:600 var(--fs-3)/1.35 var(--sans)}
.read-body{padding:16px 20px 24px;font-size:var(--fs-4);line-height:1.6}
.read-body h3{font:600 var(--fs-5)/1.35 var(--sans);margin:12px 0 8px}.read-body p{margin:0 0 .8em}.read-body .read-caption{font-size:var(--fs-3);color:var(--muted);font-style:italic}
.thumb-issue{display:block;font-size:var(--fs-1);margin-top:2px}
/* «Оформление»: sections, one model of saving (BK-161) */
.style-section{font-size:var(--fs-3);margin:18px 0 8px}.style-section:first-of-type{margin-top:10px}.style-state{min-height:20px;font-size:var(--fs-2);color:var(--muted);margin:8px 0}
/* Three states of readiness; what changed since the approved version (BK-153) */
.readiness-states{list-style:none;padding:0;margin:8px 0 12px;display:grid;gap:6px;font-size:var(--fs-3)}.readiness-states li{display:flex;gap:8px;align-items:center}.state-mark{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1px solid var(--decor);font-size:var(--fs-1);color:var(--muted)}.state-done .state-mark{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.state-done{color:var(--ink)}.state-open{color:var(--muted)}
.since-approval{margin:0 0 12px;padding:10px 12px;border-left:3px solid var(--warning);background:var(--warning-soft);font-size:var(--fs-3)}.since-approval ul{margin:6px 0 0;padding-left:18px}.since-approval .link{padding:0;min-height:0}

.pin-more{margin:0 0 10px;font-size:var(--fs-2)}.pin-more summary{cursor:pointer;color:var(--muted)}.pin-more label{display:flex;gap:8px;align-items:flex-start;margin-top:6px}
/* A weak photo in words (BK-147) */
.photo-weak{margin:6px 0 0;font-size:var(--fs-2);color:var(--warning)}
/* The one indicator of saving next to the title (BK-148): a line of its own, so its words never move the buttons. */
.save-state{margin:2px 0 0;min-height:18px;font-size:var(--fs-2);line-height:18px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.save-state[data-state=offline],.save-state[data-state=error]{color:var(--danger);font-weight:600}
/* «Повторить» (BK-283): a target of 34 px on a line of 18, its padding outside the line — the line does not clip it. */
.save-state[data-state=error]{display:flex;gap:6px;align-items:baseline;overflow:visible}.save-state[data-state=error] .save-why{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1 1 auto;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;text-decoration:none;cursor:pointer}.save-state[data-state=error] .save-why:hover{text-decoration:underline}.save-state .save-retry{flex:none;font-weight:600;padding:8px 6px;margin:-8px -6px;position:relative}

/* The layout on a phone (BK-133): the page of the book on the first screen. On top a strip of 56 px — «←», the name with
   the save indicator, «⋯». At the bottom a strip of 56 px that stays — «↶», «↷». The panel is a
   sheet from the bottom over it, its tabs always in sight. */
/* Off the phone the phone's own controls are not there, whatever the style of their kind of button says. */
@media(min-width:901px){body .book-bar .phone-only,body .book-panel .phone-only,body .stage-float .phone-only,.tab-more-list{display:none}.view-menu{display:contents}.view-menu>*{flex:none}}
@media(max-width:900px){
 /* BK-321: one bar at the bottom — the sections as in the phone's apps; «↶ ↷» went up to the row over the page and
    «Предпросмотр» to the header. viewport-fit=cover in the page: the bars keep clear of the home strip and the notch. */
 body.spreads-body{--tabbar:56px;padding-bottom:calc(var(--tabbar) + 12px + env(safe-area-inset-bottom,0px));padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
 .book-bar{position:sticky;top:0;z-index:41;display:flex;flex-wrap:nowrap;align-items:center;gap:6px;height:56px;padding:0 8px;box-sizing:border-box}
 /* «⋯» opens over the sheet and the bar at the bottom; a long list scrolls. */
 .bar-more-list{max-height:calc(100vh - 72px);overflow:auto}
 .book-bar .back-link.back-link{min-width:44px;padding:0;justify-content:center}.back-label{display:none}
 .book-bar-title{flex:1;min-width:0}.book-bar-title h1{font-size:var(--fs-4);-webkit-line-clamp:1;margin:0}/* the size of the panels' headings: four sizes on the screen (BK-320) */.spreads-summary{display:none}
 .book-bar .save-state{position:absolute;left:58px;right:104px;bottom:4px;width:auto;font-size:var(--fs-1);line-height:14px;min-height:0}
 .book-bar-title{padding-bottom:12px}
 .approval-badge{display:none}
 .book-bar-actions{display:flex;gap:6px;flex:none}
 .book-bar #preview-toggle{width:44px;min-width:44px;padding:0;justify-content:center;font-size:0}.book-bar #preview-toggle::before{width:20px;height:20px}
 /* An icon on a phone is a sign without a frame (BK-320), as the other icons of the bar. */
 .book-bar #preview-toggle:not([aria-expanded=true]){border-color:transparent;background:transparent}
 /* «Проверка» is under «Ещё» of the bar at the bottom, with its number there. */
 .book-bar .check-book{display:none}
 .edits-state{left:10px;right:10px;bottom:calc(var(--tabbar) + 12px + env(safe-area-inset-bottom,0px));transform:none;width:auto;max-width:none}
 /* The row over the page (BK-262, BK-321): «← 2 из 5 →», «Вид» with the modes and the zoom, «↶ ↷». It stays under the
    header when the page scrolls. */
 .stage-float{order:-1;position:sticky;top:56px;z-index:30;display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:8px;overflow:visible;align-self:stretch;max-width:none;margin:0 -12px 6px;padding:6px 12px;border:0;border-radius:0;background:var(--bg);box-shadow:none}
 .stage-float .grid-toggle,.stage-float .guides-only{display:none}
 .stage-float .stage-nav{gap:4px}.stage-float .stage-nav .button-icon{min-width:40px;min-height:40px}
 .view-toggle{min-height:40px;max-width:150px;padding:0 10px;font-size:var(--fs-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .view-menu{display:none}
 .stage-float.view-open .view-menu{display:grid;gap:10px;position:absolute;top:calc(100% + 4px);left:12px;right:12px;z-index:5;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-3);box-shadow:0 8px 24px var(--shadow-2)}
 .view-menu .view-modes button,.view-menu .zoom button{flex:1 1 0;min-height:44px}.view-menu .zoom #zoom-fit{flex:2 1 0}
 .float-history{display:flex;gap:6px;margin-left:auto}.float-history .button-icon{width:40px;min-width:40px;min-height:40px;padding:0}
 .book-stage{padding-top:0}
 .spread-caption{margin-bottom:6px}
 /* The list of spreads comes after the page: the page first. */
 .book-nav{order:2}#main{order:1}
 /* The sheet opens over the bar from the bottom; closed, only the bar is there. */
 .book-panel{position:fixed;top:auto;left:0;right:0;bottom:calc(var(--tabbar) + 1px + env(safe-area-inset-bottom,0px));z-index:35;max-height:0;overflow:hidden;padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));border:0;border-radius:var(--r-3) var(--r-3) 0 0;background:var(--bg);box-shadow:none;transition:max-height .2s ease}
 /* BK-327: the sheet has a grip and two heights of its own — the middle (45% of the screen) and the full one — whatever the
    section in it; a swipe down on the grip puts it away. */
 body.sheet-open .book-panel{height:45dvh;max-height:calc(100dvh - 56px - var(--tabbar) - 24px - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain;padding-top:0;padding-bottom:16px;border:1px solid var(--line);border-bottom:0;box-shadow:0 -6px 20px var(--shadow-2)}
 body.sheet-open.sheet-full .book-panel{height:calc(100dvh - 56px - var(--tabbar) - 24px - env(safe-area-inset-bottom,0px))}
 /* The page scrolls far enough for its bottom to come up over the open sheet. */
 body.spreads-body.sheet-open{padding-bottom:calc(45dvh + var(--tabbar) + 12px + env(safe-area-inset-bottom,0px))}
 .sheet-grip{position:sticky;top:0;z-index:3;display:block;width:100%;height:22px;margin:0 0 2px;padding:0;border:0;background:var(--bg);cursor:grab;touch-action:none}
 .sheet-grip::before{content:'';display:block;width:40px;height:5px;margin:8px auto 0;border-radius:var(--r-round);background:var(--border-strong)}
 /* Closed, nothing of the panel shows at the edges or is reached with Tab. */
 body:not(.sheet-open) .book-panel>:not(.panel-tabs):not(.tab-more){visibility:hidden}
 .sheet-toggle{position:sticky;top:22px;z-index:2;float:right;margin:0 0 0 6px}
 /* BK-385 (BK-319, редакция 2): four places on the bar — «Фото», «Текст» (tabs), «Страницы» (the list of the spreads) and
    «Книга» (the menu of the book: the look, the order, the check). The last two are buttons, not tabs: they stand beside
    the list of the tabs, in the right half of the bar. */
 .book-panel>.panel-tabs{position:fixed;left:0;right:0;bottom:0;z-index:36;display:flex;flex-wrap:nowrap;gap:0;overflow:visible;height:var(--tabbar);box-sizing:content-box;margin:0;padding:0 calc(max(4px,env(safe-area-inset-right,0px)) + (100% - 8px)/2) env(safe-area-inset-bottom,0px) max(4px,env(safe-area-inset-left,0px));background:var(--surface-tint);border-top:1px solid var(--line)}
 :is(.book-panel>.panel-tabs button,.book-panel>.tab-more){position:relative;flex:1 1 0;min-width:0;height:100%;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;border:0;border-radius:0;background:none;box-shadow:none;color:var(--muted);font-size:var(--fs-1);font-weight:500;line-height:1.15;white-space:nowrap}
 .spreads-body .book-panel>.tab-more{position:fixed;flex:none;right:max(4px,env(safe-area-inset-right,0px));bottom:env(safe-area-inset-bottom,0px);z-index:37;width:calc((100% - 8px)/4);height:var(--tabbar);float:none}.spreads-body .book-panel>.tab-pages{right:calc(max(4px,env(safe-area-inset-right,0px)) + (100% - 8px)/4)}
 .book-panel>.tab-more>span:first-child{max-width:100%;overflow:hidden;text-overflow:ellipsis}
 :is(.book-panel>.panel-tabs button,.book-panel>.tab-more)[data-icon]::before{display:block;width:24px;height:24px}
 :is(.book-panel>.panel-tabs [aria-selected=true],.book-panel>.tab-more.is-current){color:var(--ink);font-weight:700;background:none;box-shadow:none}
 :is(.book-panel>.panel-tabs [aria-selected=true],.book-panel>.tab-more.is-current)::before{background:var(--accent)}
 .book-panel>.panel-tabs :is(#tab-templates,#tab-typo,#tab-style,#tab-check,#tab-print,[hidden],.is-off:not(.is-shown)){display:none}
 .tab-more .check-count{position:absolute;top:4px;left:calc(50% + 6px);min-width:18px;height:18px;margin:0;padding:0 5px}
 .tab-more-list:not([hidden]){position:fixed;right:max(8px,env(safe-area-inset-right,0px));bottom:calc(var(--tabbar) + 8px + env(safe-area-inset-bottom,0px));z-index:45;display:grid;gap:2px;min-width:210px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-3);box-shadow:0 8px 24px var(--shadow-2)}
 .tab-more-list .menu-item>span:first-of-type{flex:1;text-align:left}.tab-more-list .menu-item .check-count{margin:0}
 /* The photos' upload on the bar: the ring by the icon. */
 #nav-tab-photos:is(.is-uploading,.has-failed,.is-waiting){padding-right:2px}
 #nav-tab-photos.is-uploading::after,#nav-tab-photos.has-failed::after,#nav-tab-photos.is-waiting:not(.has-failed)::after{top:6px;right:calc(50% - 22px);margin-top:0}
}
/* A phone on its side: the bar is lower, the icon beside the name — the page keeps the height. */
@media(max-width:900px) and (orientation:landscape) and (max-height:500px){
 /* BK-327: the sheet is a column on the right, the spread stays in sight on the left. */
 body.sheet-open .book-panel{top:56px;bottom:calc(var(--tabbar) + 1px + env(safe-area-inset-bottom,0px));left:auto;right:0;width:min(340px,46vw);height:auto;max-height:none;border-radius:var(--r-3) 0 0 0;border:1px solid var(--line);border-right:0;border-bottom:0;padding-right:max(12px,env(safe-area-inset-right,0px))}
 body.sheet-open.sheet-full .book-panel{height:auto}
 body.sheet-open #main{margin-right:min(340px,46vw)}
 body.spreads-body.sheet-open{padding-bottom:calc(var(--tabbar) + 12px + env(safe-area-inset-bottom,0px))}
 .sheet-grip{display:none}.sheet-toggle{top:6px}
 body.spreads-body{--tabbar:44px}
 :is(.book-panel>.panel-tabs button,.book-panel>.tab-more){flex-direction:row;gap:6px}:is(.book-panel>.panel-tabs button,.book-panel>.tab-more)[data-icon]::before{width:20px;height:20px}
 .tab-more .check-count{top:2px;left:auto;right:calc(50% - 40px)}
}
/* Fields with their labels in sight (BK-140) */
.photo-caption-field{flex:1 1 100%}
.photo-caption-field .photo-caption,.layout-note-field .layout-note{width:100%}
.layout-pad>.layout-note-field{grid-column:1/-1}
.assistant-ask-label{flex:1 0 100%}
.caption-part>.field-hint{grid-column:2}
/* The panel «Разворот» by the chosen thing (BK-149): the chosen photo or block first, then the folds */
#props{display:grid;gap:12px}
.panel-block{border:1px solid var(--line-soft);border-radius:var(--r-3);background:var(--surface);padding:12px;display:grid;gap:10px;min-width:0}
details.panel-block{padding:0 12px}
details.panel-block[open]{padding-bottom:12px}
.panel-block-title{margin:0;font-size:var(--fs-3);font-weight:600;color:var(--ink)}
details.panel-block>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:44px;cursor:pointer}
details.panel-block>summary::-webkit-details-marker{display:none}
details.panel-block[open]>summary::after{transform:rotate(180deg)}
.block-chosen{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-tint-2)}
/* The chosen photo (BK-299, BK-296; Figma P1–P11): no frame of its own, groups one under the other — the head, «Перенести»,
   «Для автосборки», «Размер и положение», the hint at the bottom. */
.photo-tool{display:grid;gap:16px;min-width:0}
.photo-tool img{cursor:auto}
.photo-head{display:flex;align-items:center;gap:12px;min-width:0}
.photo-head img{width:48px;height:48px;object-fit:cover;border-radius:var(--r-2);flex:none}
.photo-head-text{display:grid;gap:2px;flex:1 1 auto;min-width:0}
.photo-head .panel-block-title{font-size:var(--fs-3);font-weight:700;overflow-wrap:anywhere}
.photo-head-story{margin:0;font-size:var(--fs-1);color:var(--muted);overflow-wrap:anywhere}
.photo-step{display:flex;gap:4px;flex:none}
.photo-group{display:grid;gap:8px;min-width:0}
.photo-group-label{margin:0;font-size:var(--fs-1);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.move-photo{display:flex;align-items:center;gap:8px;min-width:0}
.move-photo .move-label{flex:1 1 auto;min-width:0;font-size:var(--fs-3);color:var(--ink)}
.move-photo .move-step{width:36px;height:36px;min-height:36px;padding:0;flex:none}
.photo-keep{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;font-size:var(--fs-3);cursor:pointer}
.photo-hint{margin:0;font-size:var(--fs-1);color:var(--muted)}
.photo-place{min-width:0}
.photo-place>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;font-size:var(--fs-3);font-weight:700;cursor:pointer}
.photo-place>summary::-webkit-details-marker{display:none}
.photo-place>summary::after{transition:transform .15s}
.photo-place[open]>summary::after{transform:rotate(90deg)}
.place-tools{display:grid;gap:8px;margin-top:8px}
.place-tools .place-button{min-height:36px;padding:0 8px;justify-content:center;font-size:var(--fs-2)}
.place-tools .place-button[aria-pressed=true]{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.place-full{width:100%;font-weight:600}
/* «Через сгиб» (BK-366): under «На всю страницу», as wide. The spine over a photo across it: a dashed line on the stage only. */
.place-span{width:100%}
.fold-line{position:absolute;top:0;bottom:0;width:0;border-left:.35mm dashed var(--guide);pointer-events:none;z-index:3}
.place-align{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.place-arrows{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.place-arrows .place-arrow{width:auto}
.place-sizes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
.place-size{display:grid;gap:4px;min-width:0}
.place-size-label{font-size:var(--fs-1);color:var(--muted)}
.place-stepper{display:flex;align-items:center;gap:4px}
.place-tools .place-step{width:32px;min-height:32px;height:32px;padding:0;flex:none}
.place-number{width:0;flex:1 1 auto;min-width:40px;height:32px;box-sizing:border-box;text-align:center;font:inherit;font-size:var(--fs-2);border:1px solid var(--border-strong);border-radius:var(--r-2);background:var(--surface);-moz-appearance:textfield}
.place-number::-webkit-inner-spin-button,.place-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.photo-parts{justify-self:start;text-align:left;overflow-wrap:anywhere}
.photo-drop-hint{margin-top:-4px}
.caption-dialog .caption-parts{margin:8px 0;padding:0;border:0}.caption-dialog .caption-parts legend{display:none}.caption-result{margin:0 0 8px;font-size:var(--fs-2);font-weight:600;overflow-wrap:anywhere}
.panel-block,.panel-block>*{min-width:0}
.photo-tool .field{display:grid;gap:6px;cursor:auto}
.layout-pad.layout-text>button{grid-column:span 2}
.block-chosen>.layout-pad>.layout-selected{font-size:var(--fs-3)}
/* «Поверх фото, на светлой подложке» of a text block (BK-101). */
.layout-check{grid-column:1/-1;display:flex;gap:8px;align-items:flex-start;margin:10px 0 4px;font-size:var(--fs-3);line-height:1.4;cursor:pointer}
.layout-check input{flex:0 0 auto;width:18px;height:18px;margin:2px 0 0;accent-color:var(--accent)}
/* Photos onto this spread (from a folder or the file picker). */
#stage{position:relative}
/* A drag over the spread (BK-272): the page it lands on lights up; files of the device cover the whole stage. */
.drop-page{position:absolute;z-index:6;display:flex;align-items:center;justify-content:center;box-sizing:border-box;pointer-events:none;outline:2px dashed var(--accent);outline-offset:-2px;background:color-mix(in srgb,var(--accent-soft) 60%,transparent)}
.drop-label{padding:6px 12px;border-radius:var(--r-2);background:var(--accent);color:var(--on-accent);font:600 var(--fs-2) var(--sans);box-shadow:0 2px 8px var(--shadow-2);text-align:center}
.drop-layer{position:fixed;z-index:30;display:grid;place-content:center;justify-items:center;gap:4px;pointer-events:none;border-radius:var(--r-3);outline:2px dashed var(--accent);outline-offset:-6px;background:color-mix(in srgb,var(--surface) 70%,transparent);text-align:center}
.drop-layer strong{padding:10px 16px;border-radius:var(--r-3);background:var(--accent);color:var(--on-accent);font-size:var(--fs-4);box-shadow:0 4px 16px var(--shadow-3)}
.drop-layer span{padding:4px 10px;border-radius:var(--r-2);background:var(--surface);font-size:var(--fs-2);font-weight:600;color:var(--accent-text)}

/* «+ Фото» / «+ Текст» over the stage and «+» on the free modules of the grid (tester's feedback 21.10) */

.layout-module.is-free{pointer-events:auto}
.module-add{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border:0;background:transparent;color:var(--accent-text);font-weight:600;line-height:1;cursor:pointer;opacity:0;min-height:0;padding:0}
.module-add:hover,.module-add:focus-visible{opacity:1;background:var(--accent-soft);outline:.4mm dashed var(--accent)}
.layout-module.drop-here{background:var(--accent-soft);outline:.5mm dashed var(--accent)}
@media (pointer:coarse){.module-add{opacity:.55}}
.module-menu{position:fixed;z-index:30;display:grid;min-width:160px;padding:4px;border-radius:var(--r-2);background:var(--surface);box-shadow:0 12px 40px var(--shadow-3);border:1px solid var(--line)}
.module-menu>*{justify-content:flex-start;text-align:left;cursor:pointer}

/* The move buttons of the chosen block fold into one line on a computer with a mouse (tester's feedback 21.10) */
.layout-pad>.layout-pad-fold{grid-column:1/-1}
.layout-pad-fold>summary{cursor:pointer;font-size:var(--fs-2);color:var(--text-2);padding:4px 0}
.layout-pad-fold[open]>summary{margin-bottom:6px}
.layout-keys>button:nth-child(5){grid-column:span 2}
.layout-pad-fold>p.layout-pad-hint{margin:6px 0 0;font-size:var(--fs-1)}

/* «Предпросмотр»: the spread as printed — the text placeholder and any selection are not shown (tester's feedback 21.10) */
/* «Предпросмотр» (BK-234): a big window over the layout, the spread cut to the trim on a neutral ground, the fold a light
   shadow; on a phone the whole screen. */
.preview-dialog{width:calc(100vw - 48px);height:calc(100vh - 48px);max-width:none;max-height:none;padding:0;border:1px solid var(--line);border-radius:var(--r-3);background:var(--stage)}
.preview-dialog[open]{display:flex;flex-direction:column}
.preview-dialog::backdrop{background:var(--scrim)}
.preview-head{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--line)}
.preview-head h2{margin:0;font:600 var(--fs-3)/1.35 var(--sans);min-width:0}
.preview-actions{display:flex;gap:8px;flex-shrink:0}
.preview-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:pan-y pinch-zoom}
.preview-sheet{position:relative;overflow:hidden;box-shadow:0 8px 28px var(--shadow-3)}
.preview-fold{position:absolute;top:0;bottom:0;left:50%;width:6%;transform:translateX(-50%);pointer-events:none;background:linear-gradient(90deg,transparent,var(--shadow-1) 40%,var(--shadow-3) 50%,var(--shadow-1) 60%,transparent)}
.preview-nav{display:flex;gap:12px;align-items:center;justify-content:center;padding:10px 16px}
.preview-where{margin:0;min-width:10ch;text-align:center;font-size:var(--fs-2);color:var(--muted)}
.preview-turn{margin:0 0 12px;text-align:center;font-size:var(--fs-2);color:var(--muted)}
/* The preview on a phone (BK-315), upright or on its side: the whole screen for the spread; the head, the arrows and
   «Разворот N из M» lie over it, small and see-through; the spread zooms by itself, the page does not. */
.preview-view{display:inline-flex}.preview-view[hidden]{display:none}
@media (max-width:767px),(max-height:500px){
 .preview-dialog{width:100vw;height:100dvh;margin:0;border:0;border-radius:0}
 .preview-dialog[open]{display:block}
 .preview-dialog .preview-stage{position:absolute;inset:0;touch-action:none;overscroll-behavior:contain}
 .preview-dialog .preview-sheet{transform-origin:50% 50%;will-change:transform}
 .preview-dialog .preview-head{position:absolute;top:0;left:0;right:0;z-index:2;gap:8px;padding:max(6px,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right,0px)) 6px max(8px,env(safe-area-inset-left,0px));border:0;background:none;pointer-events:none}
 .preview-dialog .preview-head h2{padding:3px 10px;border-radius:var(--r-round);background:var(--surface);opacity:.9;font-size:var(--fs-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .preview-dialog .preview-actions{pointer-events:auto;gap:6px}
 .preview-dialog .preview-actions>button{width:40px;min-width:40px;min-height:40px;padding:0;justify-content:center;font-size:0}.preview-dialog .preview-actions>button::before{width:20px;height:20px}
 .preview-dialog .preview-nav{position:absolute;left:0;right:0;bottom:0;z-index:2;flex-direction:column;gap:6px;padding:0 0 max(8px,env(safe-area-inset-bottom,0px));pointer-events:none}
 .preview-dialog .preview-nav :is(#preview-prev,#preview-next){position:absolute;bottom:calc(50dvh - 22px);width:44px;min-width:44px;min-height:44px;opacity:.6;pointer-events:auto;background:var(--surface)}
 #preview-prev{left:max(6px,env(safe-area-inset-left,0px))}#preview-next{right:max(6px,env(safe-area-inset-right,0px))}
 .preview-dialog .preview-nav :is(#preview-prev,#preview-next):disabled{visibility:hidden}
 .preview-dialog .preview-where{min-width:0;padding:3px 10px;border-radius:var(--r-round);background:var(--surface);opacity:.9;font-size:var(--fs-1)}
 .preview-view{pointer-events:auto}
 .preview-dialog .preview-turn{position:absolute;left:0;right:0;bottom:calc(max(8px,env(safe-area-inset-bottom,0px)) + 92px);z-index:2;margin:0;padding:0 16px;pointer-events:none}
}

/* «Фото» beside «Развороты»: every photo of the book in the layout (tester's feedback 21.10) */
.nav-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:10px;padding:3px;border-radius:var(--r-2);background:var(--surface-sunken)}
.nav-tabs button{padding:6px 8px;border-radius:var(--r-1);font-size:var(--fs-1);font-weight:600;color:var(--text-2);line-height:1.25}
.nav-tabs button[aria-selected=true]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px var(--shadow-2)}
/* «Выбрать фото» (BK-272): «Из книги» / «С устройства» — the device tab takes a drop of files anywhere on the dialog. */
.pick-tabs{margin:12px 0 0}
.pick-device{display:grid;justify-items:center;gap:8px;margin:12px 0;padding:32px 16px;border:2px dashed var(--line);border-radius:var(--r-3);background:var(--surface-sunken);text-align:center}
.pick-device[hidden],.pick-list[hidden]{display:none}.pick-device.is-drop{border-color:var(--accent);background:var(--accent-soft)}.pick-device strong{font-size:var(--fs-3)}
.pick-wrong{margin:0;color:var(--danger);font-size:var(--fs-1)}.pick-wrong:empty{display:none}
.pick-device .upload-button{display:inline-flex;width:auto;margin:4px 0 0}
.photos-head{margin-bottom:12px}.photos-head .panel-title{margin:0}.photos-head .quiet{margin:2px 0 0;font-size:var(--fs-2)}
/* «Фото» (BK-290, Figma M1): «Загрузить фото» across the column, «Не в книге | В книге» halves, the photos two in a row. */
.gallery-upload{display:flex;justify-content:center;width:100%;margin-bottom:10px;box-sizing:border-box}
.gallery-filters{display:grid;grid-template-columns:1fr 1fr;margin-bottom:10px}.gallery-filters .segment{justify-content:center}.segment-count{margin-left:2px;font-weight:400;opacity:.8}
.gallery-hint{margin:10px 0 0;font-size:var(--fs-1)}
.gallery-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.gallery-list>li{min-width:0}
/* The book's own spreads (BK-364): the photos under their stories — a heading across the two columns. */
.gallery-list>.gallery-story{grid-column:1/-1;display:flex;align-items:baseline;gap:4px;margin:6px 0 -2px;font-size:var(--fs-1);font-weight:600;color:var(--muted)}
.gallery-list>.gallery-story:first-child{margin-top:0}.gallery-story-title{min-width:0;overflow-wrap:anywhere}
.gallery-item{position:relative;display:block;width:100%;padding:0;border-radius:var(--r-2);border:2px solid transparent;background:none;cursor:pointer;overflow:hidden}.gallery-item:hover,.gallery-item:focus-visible{border-color:var(--accent)}
.gallery-list li{position:relative}.gallery-more{top:4px;left:4px;right:auto;bottom:auto}.gallery-more .nav-more-list{left:0;right:auto}
.gallery-more>summary{background:var(--surface);border-radius:var(--r-round)}
.gallery-times{position:absolute;top:6px;right:6px;padding:1px 6px;border-radius:var(--r-round);background:var(--ink);color:var(--on-accent);font-size:var(--fs-1);font-weight:600;line-height:1.4;pointer-events:none}
.gallery-item img{display:block;width:100%;aspect-ratio:1;object-fit:cover;background:var(--surface-sunken);pointer-events:none}
.gallery-item.is-out img{opacity:.8}
/* Photos going up (BK-274): the line and the bar, a row for each file not up yet; the arc of the progress on the tab «Фото». */
.upload-box{display:grid;gap:6px;margin:0 0 10px}
.upload-box[hidden]{display:none}.upload-line{margin:0;font-size:var(--fs-1);color:var(--text-2)}
.upload-bar{height:4px;border-radius:var(--r-1);background:var(--surface-sunken);overflow:hidden}.upload-bar[hidden]{display:none}
.upload-bar span{display:block;height:100%;width:0;background:var(--accent);transition:width .2s}
/* The files going up (BK-300, Figma N1): tiles as the photos of «Фото» — the state over the picture, a bar under it; the
   reason of a file not up and what to do under its tile. */
.upload-list{list-style:none;margin:8px 0 0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.upload-list[hidden]{display:none}
.upload-item{display:grid;gap:2px;align-content:start;min-width:0;font-size:var(--fs-1)}
.upload-tile{position:relative;overflow:hidden;border-radius:var(--r-1);background:var(--surface-sunken)}
.upload-tile img{display:block;width:100%;aspect-ratio:1;object-fit:cover}
.upload-item[data-state=queued] .upload-tile img{opacity:.45}
.upload-state{position:absolute;left:4px;right:4px;bottom:10px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:0 4px;padding:2px 4px;border-radius:var(--r-1);background:var(--surface);color:var(--ink);font-weight:600;text-align:center;overflow-wrap:anywhere}
.upload-item[data-state=done] .upload-state{color:var(--accent-text)}
/* While it goes and in the queue (Figma N1): the per cent or «В очереди» in the middle of the faded picture, the bar under it. */
.upload-item:is([data-state=sending],[data-state=queued]) .upload-state{top:0;bottom:4px;background:none;font-size:var(--fs-2)}.upload-item[data-state=sending] .upload-state{font-size:var(--fs-4)}.upload-item[data-state=sending] .upload-tile img{opacity:.55}
.upload-percent{flex-basis:100%;font-size:var(--fs-3)}
.upload-item[data-state=failed] .upload-state{color:var(--danger)}.upload-item[data-state=duplicate] .upload-state{color:var(--warning)}
.upload-item[data-state=failed] .upload-tile{box-shadow:inset 0 0 0 2px var(--danger)}
.upload-tile-bar{position:absolute;left:0;right:0;bottom:0;height:4px;background:var(--line)}
.upload-tile-bar>span{display:block;height:100%;width:0;background:var(--accent);transition:width .2s}
.upload-item:is([data-state=failed],[data-state=waiting],[data-state=duplicate]) .upload-tile-bar{display:none}
.upload-actions{display:flex;flex-wrap:wrap;gap:4px 10px}.upload-actions:empty{display:none}
/* The same file again (feedback 04.11): a short word on the tile, the place in its hint; for several, one row for all. */
.upload-twice{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:6px}.upload-twice[hidden]{display:none}
#nav-tab-photos{position:relative}#nav-tab-photos:is(.is-uploading,.has-failed,.is-waiting){padding-right:24px}
#nav-tab-photos.is-uploading::after,#nav-tab-photos.has-failed::after{content:'';position:absolute;top:50%;right:3px;width:16px;height:16px;margin-top:-8px;border-radius:var(--r-round);pointer-events:none}
#nav-tab-photos.is-uploading::after{background:conic-gradient(var(--accent) calc(var(--upload,0)*1%),var(--line) 0);-webkit-mask:radial-gradient(circle,transparent 4.5px,var(--ink) 5px);mask:radial-gradient(circle,transparent 4.5px,var(--ink) 5px)}
#nav-tab-photos.has-failed:not(.is-uploading)::after{width:8px;height:8px;margin-top:-4px;background:var(--danger)}
/* Photos waiting for the connection (BK-279): a quiet ring — no error, they go by themselves. */
#nav-tab-photos.is-waiting:not(.has-failed)::after{content:'';position:absolute;top:50%;right:6px;width:8px;height:8px;margin-top:-4px;border:2px solid var(--warning);border-radius:var(--r-round);box-sizing:border-box;pointer-events:none}
.upload-item[data-state=waiting] .upload-state{color:var(--warning)}
#gallery.drop-target,#nav-tab-photos.drop-target{outline:2px dashed var(--accent);outline-offset:2px;background:var(--accent-soft)}

/* «Запись и видео» of the story in the layout's panel (tester's feedback 21.10) */
.story-media{display:grid;gap:6px;margin-top:10px}
.story-media-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.story-media-list li{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:var(--fs-2)}
.story-media-list .quiet{font-size:var(--fs-1)}
.story-media-add{display:flex;gap:6px;flex-wrap:wrap}
.story-media>p.quiet{margin:0;font-size:var(--fs-1)}

/* The right panel takes the width the owner pulls it to; the list of spreads folds to its numbers (tester's feedback 21.10) */
@media(min-width:901px){
 .book-layout{grid-template-columns:var(--nav-w,248px) minmax(0,1fr) var(--panel-w,370px)}
 #main{position:relative}
 .panel-resizer{position:absolute;top:0;bottom:0;right:-5px;width:10px;cursor:col-resize;z-index:6;touch-action:none}
 .panel-resizer::after{content:'';position:absolute;top:0;bottom:0;left:4px;width:2px;background:transparent;transition:background .15s}
 .panel-resizer:hover::after,.panel-resizer:focus-visible::after,.panel-resizer.is-dragging::after{background:var(--accent)}
 .nav-collapse{display:flex;margin:-6px 0 6px auto;min-height:0;padding:2px 6px}
 .book-layout.nav-folded{--nav-w:60px}
 .book-layout.nav-folded .book-nav{padding-inline:6px}
 .book-layout.nav-folded :is(.nav-text,.nav-shot,.nav-lock,.nav-add,.nav-part,.nav-pin,#nav-title){display:none!important}
 .book-layout.nav-folded .nav-item{justify-content:center;padding-inline:0}
 .book-layout.nav-folded .nav-more{display:none}
 .book-layout.nav-folded .nav-collapse{margin:0 auto 6px}
}
@media(max-width:1180px) and (min-width:901px){.book-layout{grid-template-columns:var(--nav-w,228px) minmax(0,1fr) var(--panel-w,330px)}}
@media(max-width:900px){.panel-resizer,.nav-collapse{display:none}}
/* Typorobot on the open spread (BK-198): a line and the way to its editor, above the panel's settings */
.typo-on-spread{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px}.typo-on-spread p{margin:0}

/* «Варианты разворота» (BK-254): the spread now and up to three variants, large; on a phone one at a time. */
.variants-dialog{width:calc(100vw - 48px);max-width:1400px;max-height:calc(100vh - 48px);padding:0;border:1px solid var(--line);border-radius:var(--r-3);background:var(--stage)}
.variants-dialog::backdrop{background:var(--shadow-3)}
.variants-state{margin:0 20px 8px;color:var(--muted)}
.variants-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:16px;padding:0 20px 20px;overflow:auto}
.variant-card{display:grid;gap:8px;align-content:start;padding:12px;border:1px solid var(--line-soft);border-radius:var(--r-2);background:var(--surface)}
.variant-card.is-current{border-color:var(--accent)}
.variant-card h3{margin:0;font-size:var(--fs-2)}.variant-card p{margin:0}.variant-card .quiet{color:var(--muted)}
.variant-sheet{position:relative;overflow:hidden;background:var(--surface);box-shadow:0 1px 4px var(--shadow-2)}
.variants-nav{display:none}
@media (max-width:767px){
 .variants-dialog{width:100vw;max-height:100dvh;height:100dvh;margin:0;border:0;border-radius:0}
 .variants-list{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;padding:0 12px 12px}
 .variant-card{flex:0 0 100%;scroll-snap-align:center}
 .variants-nav{display:flex}
}
.variant-card{min-width:0;overflow:hidden}
/* Ready layouts (BK-261): «Выбрать готовую раскладку» under the pages of an empty spread; the choice as small pictures. */
.template-pick{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);z-index:3;white-space:nowrap;color:var(--accent);font-weight:600}
.pick-dialog{width:min(720px,calc(100% - 32px))}.template-title{margin:0 0 6px;font-size:var(--fs-5)}
.template-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin:12px 0 16px}
.template-item{display:grid;gap:6px;justify-items:center;padding:10px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink);font:inherit;font-size:var(--fs-2);cursor:pointer}
.template-item:hover,.template-item:focus-visible{border-color:var(--accent)}
.template-picture{width:100%;max-width:150px;height:auto}.template-sheet{fill:var(--paper);stroke:var(--line);stroke-width:.6}.template-fold{stroke:var(--line);stroke-width:.4}
.template-photo{fill:var(--accent-tint-2);stroke:var(--accent);stroke-width:.5;stroke-dasharray:1.5 1}.template-line{fill:var(--border-strong)}
/* An empty frame on the stage: its card in the middle of the dashed place; the place itself lets the grid's drag through. */
.slot-place{position:absolute;display:flex;align-items:center;justify-content:center;pointer-events:none;padding:8px;box-sizing:border-box;overflow:hidden}
.slot-card{pointer-events:auto;display:grid;gap:4px;justify-items:center;text-align:center;max-width:100%;padding:10px 12px;border-radius:var(--r-2);background:color-mix(in srgb,var(--surface) 92%,transparent);font-size:var(--fs-2);color:var(--muted)}
.pick-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px;max-height:min(60vh,520px);overflow:auto;margin:12px 0;padding:2px}
.pick-item{display:grid;gap:4px;padding:4px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);text-align:left;font:inherit;cursor:pointer}
.pick-item:hover{border-color:var(--accent)}.pick-item img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--r-1)}.pick-note{font-size:var(--fs-1);color:var(--muted);overflow-wrap:anywhere}
/* The bar over the chosen photo or text block (BK-263, Figma A4, B3): white, its own size at any zoom, icons with names;
   on a phone icons only, each 44 px. */
.object-bar{position:absolute;z-index:4;display:flex;flex-wrap:nowrap;max-width:none;align-items:center;gap:2px;padding:4px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 6px 18px var(--shadow-2);white-space:nowrap;font-size:var(--fs-2)}
.object-action{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 8px;border:0;border-radius:var(--r-1);background:none;color:var(--ink);font:inherit;cursor:pointer}
.object-action:hover{background:var(--hover)}.object-action:disabled{opacity:.4;cursor:default;background:none}
.object-action.is-danger{color:var(--danger)}
.object-action.object-ai{color:var(--accent);font-weight:600}
/* «Повернуть» just pressed (BK-304, Figma O9): the button framed while «Повернуто на 90°» stands under the photo. */
.object-action.is-on{box-shadow:inset 0 0 0 2px var(--ink);background:var(--surface-tint);font-weight:600}
/* Ж К Ч on the bar (BK-268): the letter itself on a phone too. */
.object-mark{min-width:32px;justify-content:center;font-weight:700}.object-mark-italic{font-style:italic;font-weight:400}.object-mark-underline{text-decoration:underline;font-weight:400}
.object-action[aria-pressed=true]{background:var(--accent-soft);color:var(--accent-strong)}
.object-style{display:inline-flex;align-items:center;gap:4px;min-height:32px;max-width:150px;padding:2px 6px 2px 8px;border:1px solid var(--line);border-radius:var(--r-1);background:var(--surface);color:var(--ink);font:inherit;font-weight:600;cursor:pointer;white-space:nowrap}
.object-style:hover,.object-style[aria-expanded=true]{border-color:var(--ink)}
/* The list of the styles (BK-297, Figma B4): each in its own look, its size on the right; the chosen one on a light ground. */
.style-menu{min-width:220px;padding:6px}.style-menu-item{display:flex;align-items:baseline;justify-content:space-between;gap:16px;width:100%;min-height:36px;padding:4px 10px;border:0;border-radius:var(--r-1);background:none;text-align:left;cursor:pointer}
.style-menu-item:hover,.style-menu-item:focus-visible{background:var(--hover)}.style-menu-item[aria-checked=true]{background:var(--accent-soft)}
.style-menu-name{line-height:1.25}.style-menu-pt{flex:none;font-size:var(--fs-1);color:var(--muted)}
@media(max-width:900px){.object-label{display:none}.object-action{min-width:44px;min-height:44px;justify-content:center;padding:0}.object-style{min-height:44px}}
.object-size{min-width:3.2em;text-align:center;font-variant-numeric:tabular-nums;color:var(--muted)}.object-size:empty{display:none}
/* «Горячие клавиши» (BK-263): the key on the left, what it does on the right. */
.keys-list{display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;margin:12px 0 16px;font-size:var(--fs-2)}
.keys-list dt{font-weight:600;white-space:nowrap}.keys-list dd{margin:0;color:var(--text-2)}
/* The crop on the photo itself (BK-265, Figma O1–O7): the rest of the photo dimmed around the frame, the frame in the
   accent colour, a layer over the spread that takes the pointer; the bar is the bar over a chosen photo (BK-263). */
.stage .spread-photo.is-cropping{z-index:11;outline-style:solid;outline-color:var(--accent);outline-offset:0}
.crop-ghost{position:absolute;z-index:10;opacity:.35;pointer-events:none}
.crop-catcher{position:absolute;inset:0;z-index:12;cursor:move;touch-action:none;outline:none}
.crop-catcher.is-still{cursor:default}.crop-catcher.is-focus{cursor:crosshair}
.crop-marks{position:absolute;z-index:13;pointer-events:none}
/* The focus (BK-303, Figma O5): one dashed white circle with a dark edge, its size drawn by its edge. */
.crop-spot{position:absolute;box-sizing:border-box;transform:translate(-50%,-50%);border-style:dashed;border-color:var(--surface);border-radius:50%;outline-style:solid;outline-color:var(--ink);pointer-events:none}
.crop-spot[hidden]{display:none}
.crop-bar{justify-content:center}
/* One row with a line between the groups (BK-305, Figma O1, O3); on a phone the icons wrap onto a second row. */
.object-sep{flex:none;width:1px;align-self:stretch;margin:4px 3px;background:var(--line)}
@media(max-width:900px){.object-bar{flex-wrap:wrap;max-width:calc(100% - 8px)}.crop-bar{white-space:normal}}
/* BK-317: on a phone the bar of the chosen thing stands at the bottom of the screen over the sections, one row that scrolls
   sideways — never over the photo or the text; with the sheet open the sheet has it all. */
@media(max-width:900px){
 .object-bar.is-docked{position:fixed;top:auto;left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));bottom:calc(var(--tabbar) + 9px + env(safe-area-inset-bottom,0px));z-index:37;max-width:none;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;white-space:nowrap}
 .object-bar.is-docked::-webkit-scrollbar{display:none}.object-bar.is-docked>*{flex:1 0 auto}.object-bar.is-docked>.object-sep{flex:none}
 /* The page scrolls a bar's height further: its bottom comes up over the bar. */
 body.spreads-body:not(.sheet-open):has(.object-bar.is-docked){padding-bottom:calc(var(--tabbar) + 76px + env(safe-area-inset-bottom,0px))}
 body.sheet-open .object-bar.is-docked:not(.crop-bar){display:none}
 /* BK-324: the photo's four actions with their names under the icons and «⋯»; the text's row a little tighter. */
 .object-bar.is-docked.photo-bar .object-action{flex-direction:column;gap:2px;min-height:50px;font-size:var(--fs-1);line-height:1.1}
 .object-bar.is-docked.photo-bar .object-label{display:block;max-width:76px;overflow:hidden;text-overflow:ellipsis}
 .object-bar.is-docked.text-bar{gap:0}.object-bar.is-docked.text-bar .object-action{min-width:36px}.object-bar.is-docked.text-bar .object-size{flex:none;min-width:30px;font-size:var(--fs-1);text-align:center}
 /* The name of the style gives way first when the row is short. */
 .object-bar.is-docked.text-bar .object-style{flex:0 1 auto;min-width:48px;max-width:96px;overflow:hidden;text-overflow:ellipsis}
 .object-more-list:not([hidden]){position:fixed;right:max(8px,env(safe-area-inset-right,0px));bottom:calc(var(--tabbar) + 76px + env(safe-area-inset-bottom,0px));z-index:46;display:grid;gap:2px;min-width:220px;max-width:calc(100vw - 16px);padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-3);box-shadow:0 8px 24px var(--shadow-2)}
 .object-more-list .object-action{justify-content:flex-start;gap:10px;width:100%;min-height:44px;padding:0 12px;font-size:var(--fs-3)}
 .object-more-list .object-label{display:inline}
 body.sheet-open .object-more-list{display:none}
 /* The crop's bar keeps «Готово» in sight: the slider takes what is left of the row. */
 .crop-bar.is-docked>*{flex:none}.crop-bar.is-docked .crop-zoom{flex:1 1 auto;width:auto;min-width:48px}
}
/* While a photo or a block is dragged or its size drawn, its bar is away; it comes back when let go. */
#stage:has(.dragging) .object-bar:not(.crop-bar){visibility:hidden;pointer-events:none}
.crop-zoom{width:120px;accent-color:var(--accent)}.crop-zoom:disabled{opacity:.4}
.object-action[aria-pressed=true]{background:var(--accent-soft);color:var(--accent-strong)}
.object-action.is-primary{background:var(--ink);color:var(--on-accent)}.object-action.is-primary:hover{background:var(--info)}
.crop-quality{position:absolute;z-index:4;display:grid;justify-items:start;gap:3px;pointer-events:none}
/* One small plaque under the frame (BK-302, Figma O3–O5), the line of the mode under it. */
.crop-quality-line{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border:1px solid var(--line);border-radius:var(--r-1);background:var(--surface);box-shadow:0 2px 8px var(--shadow-2);font-size:var(--fs-1);font-weight:600;white-space:nowrap}
.crop-quality-line.is-good{color:var(--accent-text)}.crop-quality-line.is-weak{color:var(--danger)}
.crop-quality-hint{padding:2px 6px;border-radius:var(--r-1);background:var(--surface);font-size:var(--fs-1);color:var(--muted);white-space:nowrap}
.crop-quality-hint[hidden]{display:none}
@media(max-width:900px){.crop-zoom{width:96px;min-height:44px}}
/* «Не помещается» (BK-266, Figma H1–H7): a plaque at the bottom edge of a text cut off by its block, its own size at any
   zoom; the menu of the ways out under it. On a phone the plaque and the ways are 44 px high. */
.overflow-mark{position:absolute;z-index:5;display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:2px 10px;border:0;border-radius:var(--r-round);background:var(--danger);color:var(--on-accent);font:inherit;font-size:var(--fs-1);font-weight:600;white-space:nowrap;box-shadow:0 4px 12px var(--shadow-2);cursor:pointer}
.overflow-mark:hover,.overflow-mark:focus-visible{filter:brightness(1.08)}.overflow-words{font-weight:400;opacity:.9}
.overflow-menu{position:fixed;z-index:60;display:grid;gap:2px;width:min(340px,calc(100vw - 16px));padding:6px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 10px 28px var(--shadow-3)}
.overflow-way{display:flex;gap:10px;align-items:flex-start;padding:8px 10px;border:0;border-radius:var(--r-1);background:none;color:var(--ink);font:inherit;font-size:var(--fs-2);text-align:left;cursor:pointer}
.overflow-way:hover:not(:disabled),.overflow-way:focus-visible{background:var(--hover)}.overflow-way:disabled{cursor:default;color:var(--muted)}.overflow-way:disabled[data-icon]::before{opacity:.5}
.overflow-way-words{display:grid;gap:2px}.overflow-way-title{font-weight:600}.overflow-way-note{font-size:var(--fs-1);color:var(--muted)}
.overflow-lead-title{padding:6px 10px 0;font-size:var(--fs-2)}.overflow-lead{margin:0;padding:2px 10px 6px;font-size:var(--fs-2);color:var(--text-2)}
/* The marks by the things of the spread (BK-276, Figma R1–R4): a red «!» to decide, an «!» on a weak photo, an «i» to look
   at; at the corner of the thing, under the bar of the chosen one; a press area of 44 px on a phone. */
/* Where two blocks meet (BK-370): lit while the mark of the pair is pointed at or focused. */
.overlap-area{position:absolute;z-index:2;pointer-events:none;background:var(--warning-soft);outline:2px solid var(--warning);outline-offset:-2px;opacity:.85}
.issue-mark{position:absolute;z-index:3;display:inline-grid;place-items:center;width:24px;height:24px;padding:0;border:2px solid var(--surface);border-radius:var(--r-round);font:inherit;font-size:var(--fs-2);font-weight:700;line-height:1;cursor:pointer;box-shadow:0 2px 6px var(--shadow-2)}
.issue-mark::after{content:"";position:absolute;inset:-6px}.issue-mark:hover,.issue-mark:focus-visible{filter:brightness(1.08)}
.issue-mark.is-error{background:var(--danger);color:var(--on-accent)}.issue-mark.is-weak{background:var(--warning);color:var(--on-accent)}
.issue-mark.is-note{border-color:var(--line);background:var(--surface);color:var(--ink);font-family:var(--serif);font-style:italic}
@media(max-width:900px){.overflow-mark{min-height:44px;padding:4px 14px}.overflow-way{min-height:44px}.issue-mark{width:30px;height:30px}.issue-mark::after{inset:-7px}}
/* A block of a chain (BK-266, Figma L11): where its text comes from, at the top, and where it goes on, at the bottom. */
.layout-chain{position:absolute;z-index:61;background:var(--info);color:var(--on-accent);font:600 var(--fs-1)/1.3 system-ui,sans-serif;white-space:nowrap;pointer-events:none}
.layout-chain.chain-from{right:2px;top:2px}.layout-chain.chain-to{left:2px;bottom:2px}


/* The facts of an AI edit in the layout (BK-275): changed ones in the box of the cabinet; none changed — said after the check. */
.proposal-facts-ok{margin:8px 0;font-size:var(--fs-2);color:var(--success)}
/* The caption line under the photo on the spread (BK-294, Figma O10): a line with the cursor, the links under it. */
.caption-line{position:fixed;z-index:60;display:grid;gap:4px;box-sizing:border-box;padding:4px 6px;border-radius:var(--r-1);background:var(--surface);box-shadow:0 0 0 1px var(--accent),0 4px 12px var(--shadow-2)}
.caption-input{display:block;width:100%;box-sizing:border-box;margin:0;padding:2px 0;border:0;outline:0;resize:none;overflow:hidden;background:none;color:var(--ink);font:inherit;font-family:var(--serif);font-size:var(--fs-2);line-height:1.35}
.caption-input::placeholder{color:var(--muted)}
.caption-links{display:flex;flex-wrap:wrap;gap:2px 12px}
.caption-link{display:inline;min-height:0;padding:0;border:0;background:none;color:var(--accent-text);font:inherit;font-size:var(--fs-1);font-weight:600;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.caption-link:hover{text-decoration:underline}
.caption-ai-link[data-icon]::before{width:13px;height:13px}
/* The AI at the caption (BK-294, Figma O13): a card under the caption — what is proposed, the new words, the three buttons. */
.ai-caption-card{position:absolute;z-index:8;display:grid;gap:8px;width:max-content;max-width:min(420px,calc(100% - 8px));padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);box-shadow:0 6px 18px var(--shadow-3);font-family:var(--sans)}
.ai-caption-card.is-busy{display:flex;align-items:center;gap:10px}
.ai-label.is-inline{position:static;justify-self:start;border-radius:var(--r-1);max-width:100%}
.ai-caption-text{margin:0;font-size:var(--fs-3);line-height:1.45;color:var(--ink);white-space:pre-wrap}
.ai-caption-actions{display:flex;flex-wrap:wrap;gap:6px}
.caption-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--r-1)}
@media (pointer:coarse){.caption-input{font-size:var(--fs-phone)}.caption-link{padding:6px 0}}
/* «Фото слабое» (BK-301, Figma R2): the title, two lines, the dark button the whole width, the link under it. */
.weak-window{display:grid;gap:8px;width:min(300px,calc(100vw - 16px));padding:12px}
.weak-window .overflow-lead{margin:0}
.weak-window .weak-replace{width:100%}
.weak-window .weak-keep{justify-self:center}
/* The right column as in Figma (BK-290, A1, A4, P7): the sections on a rail of icons at its right edge — the icon over its
   name, the open one on a white card; the section's content to the left of it. Hidden ones («Настройка интерфейса») go
   from the rail; something that leads there still opens it. On a phone the sections stay the tabs of the sheet (BK-133). */
.panel-tabs .is-off:not(.is-shown){display:none}
@media screen and (min-width:901px){
 .book-panel{display:grid;grid-template-columns:minmax(0,1fr) 92px;align-content:start;column-gap:12px;padding-right:0;background:linear-gradient(to left,var(--surface-sunken) 0 92px,var(--line) 92px 93px,var(--bg) 93px)}
 .book-panel>*{grid-column:1;min-width:0}
 .book-panel>.panel-tabs{grid-column:2;grid-row:1/span 40;position:sticky;top:-12px;align-self:start;display:flex;flex-direction:column;flex-wrap:nowrap;gap:4px;overflow:visible;margin:-12px 0 0;padding:12px 4px;box-sizing:border-box}
 .book-panel>.panel-tabs button:is(.tab-in-header,[hidden]),.book-panel>.panel-tabs .is-off:not(.is-shown){display:none}
 .book-panel>.panel-tabs button{display:flex;flex-direction:column;align-items:center;gap:4px;width:100%;min-height:58px;padding:8px 2px;border:0;border-radius:var(--r-2);background:none;color:var(--text-2);font-size:var(--fs-1);line-height:1.2;text-align:center;overflow-wrap:normal}
 .book-panel>.panel-tabs button[data-icon]::before{width:22px;height:22px}
 /* «Оформление» stands apart from the sections of the spread's content, under a short line (Figma A1). */
 .book-panel>.panel-tabs #tab-style{position:relative;margin-top:9px}
 .book-panel>.panel-tabs #tab-style::after{content:'';position:absolute;top:-7px;left:22%;right:22%;border-top:1px solid var(--line)}
 .book-panel>.panel-tabs button:hover{background:var(--hover)}
 .book-panel>.panel-tabs [aria-selected=true]{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 3px var(--shadow-2)}
 #nav-tab-photos:is(.is-uploading,.has-failed,.is-waiting){padding-right:2px}
 #nav-tab-photos.is-uploading::after,#nav-tab-photos.has-failed::after,#nav-tab-photos.is-waiting:not(.has-failed)::after{top:6px;right:8px;margin-top:0}
}
@media not screen{.panel-tabs button[data-icon]::before{display:none}}
/* «Текст» (BK-290, «Текст 1»): the title, what to do, the dark «+ Текст на разворот», the hint under it. */
.text-head{display:grid;gap:8px;justify-items:start}
.text-head .panel-title{margin:0;font-size:var(--fs-4);font-weight:700}
.text-head p{margin:0}
.text-head .add-text{width:100%}
.text-head-hint{font-size:var(--fs-1)}
.spread-settings{display:grid;gap:12px;margin-top:16px}
.spread-settings-title{margin:0;font-size:var(--fs-3)}
/* A switch (BK-299, BK-290): the photo's «Обязательно оставить в книге», the sections of «Настройка интерфейса». */
input[type=checkbox].switch{appearance:none;-webkit-appearance:none;flex:none;width:36px;height:20px;margin:0;border-radius:var(--r-round);background:var(--border-strong);position:relative;cursor:pointer;transition:background .15s}
input[type=checkbox].switch::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px var(--shadow-3);transition:transform .15s}
input[type=checkbox].switch:checked{background:var(--accent)}
input[type=checkbox].switch:checked::after{transform:translateX(16px)}
input[type=checkbox].switch:disabled{opacity:.5;cursor:default}
input[type=checkbox].switch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sections-list{display:grid;gap:10px;margin:12px 0 16px}
.sections-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:var(--fs-3)}
/* «Открываем макет…» (BK-313): over the page from its first paint until the first spread is drawn — not an empty screen
   while the code and the fonts load. If the page never starts, it gives way by itself after 20 s. */
.layout-splash{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:var(--bg);color:var(--muted);font-size:var(--fs-3);animation:splash-away .3s 20s forwards}
.layout-splash p{margin:0;min-height:1.5em}
.layout-splash-spin{width:28px;height:28px;border-radius:50%;border:3px solid var(--accent);border-right-color:transparent;animation:button-spin .8s linear infinite}
.layout-splash.is-gone{display:none}
@keyframes splash-away{to{opacity:0;visibility:hidden}}
@media (prefers-reduced-motion:reduce){.layout-splash-spin{animation-duration:2.4s}}
/* «Что изменилось» on a phone (BK-325): a short message over the bottom bar — the page does not move under it; with the
   sheet open it waits; it goes by itself, with a swipe or with «×». Over the bar of a chosen
   photo when there is one, as the plate of a message. */
@media(max-width:900px){
 #changes{position:fixed;left:max(10px,env(safe-area-inset-left,0px));right:max(10px,env(safe-area-inset-right,0px));bottom:calc(var(--tabbar) + 12px + env(safe-area-inset-bottom,0px));z-index:44;display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;max-height:45vh;overflow:auto;margin:0;padding:10px 14px;font-size:var(--fs-2);touch-action:pan-y}
 #changes>.changes-title{flex:1 1 auto;min-width:0}#changes>.changes-actions{gap:16px}#changes>.changes-more{flex:1 1 100%;order:3}
 /* «Понятно» stays as a small «×»: the message goes without a gesture too (a screen reader, the keyboard). */
 #changes .changes-ok{font-size:0;min-width:32px;justify-content:center}#changes .changes-ok::before{width:18px;height:18px}
 body.sheet-open #changes{display:none}
 body:has(.object-bar.is-docked) :is(#changes,.edits-state){bottom:calc(var(--tabbar) + 76px + env(safe-area-inset-bottom,0px))}
 body:has(.edits-state:not(:empty)) #changes{bottom:calc(var(--tabbar) + 76px + env(safe-area-inset-bottom,0px))}
 body:has(.edits-state:not(:empty)):has(.object-bar.is-docked) #changes{bottom:calc(var(--tabbar) + 140px + env(safe-area-inset-bottom,0px))}
}
/* The photo analysis in «Фото» (BK-310): how far it is, and «Разобрать с ИИ» while photos wait for it. */
.gallery-ai{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:8px 0 0;font-size:var(--fs-2);color:var(--muted)}.gallery-ai[hidden]{display:none}
/* BK-329: the chosen photo on a phone — the names of the parts in plain letters, the spreads in words, the place compact. */
@media(max-width:900px){
 .photo-group-label{font-size:var(--fs-2);letter-spacing:0;text-transform:none}
 .move-photo.is-words{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .move-photo.is-words .move-label{display:none}
 .move-photo.is-words .move-step{width:auto;height:44px;min-height:44px;padding:0 10px;gap:6px;justify-content:center;font-size:var(--fs-2)}
 .place-tools.is-compact{gap:10px}
 .place-tools.is-compact .place-full-switch,.place-tools.is-compact .place-span-switch{min-height:44px}
 .place-tools.is-compact .place-align{display:flex;gap:0;border:1px solid var(--line);border-radius:var(--r-2);overflow:hidden}
 .place-tools.is-compact .place-align .place-button{flex:1 1 0;min-height:48px;border:0;border-radius:0;border-right:1px solid var(--line);box-shadow:none}
 .place-tools.is-compact .place-align .place-button:last-child{border-right:0}
 .place-tools.is-compact .place-align .place-button[aria-pressed=true]{background:var(--green);color:var(--on-accent)}
 .place-tools.is-compact .place-arrows{display:flex;align-items:center;gap:6px}
 .place-arrows-label{flex:1;min-width:0;font-size:var(--fs-2);color:var(--muted)}
 .place-tools.is-compact .place-arrows .place-arrow{width:48px;min-width:48px;height:48px;min-height:48px;padding:0;flex:none}
 .place-tools.is-compact .place-step{width:40px;height:40px;min-height:40px}
 .place-tools.is-compact .place-number{min-width:0;width:100%;height:40px;text-align:center}
}
@media(max-width:900px){.photo-drop-hint{display:none}}
/* BK-328: the page under the fingers, «Все» in two columns, the list of spreads a sheet from «2 из 5». */
@media(min-width:901px){body .book-nav .phone-only{display:none}.stage-nav .position::after{content:none}}
@media(max-width:900px){
 /* The browser does not zoom the whole screen over the page: two fingers zoom the page itself. */
 .stage:not(.mode-all){touch-action:pan-x pan-y}
 .stage-float .stage-fit{position:absolute;top:calc(100% + 8px);right:12px;z-index:4;box-shadow:0 4px 14px var(--shadow-2)}
 .stage-nav .position{min-height:40px;padding:0 4px 0 6px;gap:2px;font-size:var(--fs-2);white-space:nowrap}
 .all-pages{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .all-pages .thumb-cover{grid-column:1/-1}
 /* The list: closed, nothing of it between the page and the bar; open, a sheet over the bar at the bottom. */
 .book-nav{display:none}
 body.nav-open .book-nav{display:block;position:fixed;left:0;right:0;top:auto;bottom:calc(var(--tabbar) + 1px + env(safe-area-inset-bottom,0px));z-index:44;max-height:min(72dvh,calc(100dvh - 56px - var(--tabbar) - 24px));overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:0 max(12px,env(safe-area-inset-right,0px)) 16px max(12px,env(safe-area-inset-left,0px));background:var(--bg);border:1px solid var(--line);border-bottom:0;border-radius:var(--r-3) var(--r-3) 0 0;box-shadow:0 -6px 20px var(--shadow-2)}
 .nav-sheet-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:8px;margin:0 -4px;padding:8px 4px 6px;background:var(--bg)}
 .nav-sheet-head h2{flex:1;margin:0;font-size:var(--fs-phone)}
 .nav-lock-hint{display:flex;gap:6px;align-items:flex-start;margin:0 0 6px;font-size:var(--fs-1);line-height:1.4}
 .nav-lock-hint .nav-lock{margin-top:2px}
 .book-nav #nav-title{display:none}
 .book-nav .nav-part{margin:14px 0 4px;font-size:var(--fs-2);letter-spacing:0;text-transform:none}
 /* A row: the picture · the name and the pages · «⋯»; the open spread is one frame around the whole row. */
 .book-nav .nav-list>li:not(.nav-part){display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;margin-top:4px;padding:6px;border-radius:var(--r-2)}
 .book-nav .nav-list>li>.nav-shot{grid-column:1;grid-row:1;margin:0}
 .book-nav .nav-list>li>.nav-item{grid-column:2;grid-row:1;padding:4px 0;min-height:48px}
 .book-nav .nav-list>li:not(:has(>.nav-shot))>.nav-item{grid-column:1/3}
 .book-nav .nav-list>li>.nav-more{grid-column:3;grid-row:1;position:static;transform:none}
 .book-nav .nav-list .has-more>.nav-item{padding-right:0}
 .book-nav .nav-item[aria-current=true],.book-nav .nav-item:hover{background:none;box-shadow:none}
 .book-nav .nav-list>li:has(>.nav-item[aria-current=true]){background:var(--surface);box-shadow:inset 0 0 0 2px var(--green)}
 .book-nav .nav-list>li:has(>.nav-item[aria-current=true])>.nav-shot{outline:0}
 .book-nav .nav-add{padding:0}
}
/* The bar over the chosen thing on a computer (BK-318): a grip of dots at its left to drag it on the stage; see-through
   by the choice in «Настройка интерфейса», solid again under the pointer or with the focus in it. */
.object-grip{flex:none;align-self:stretch;width:10px;margin:2px 2px 2px 0;border-radius:var(--r-1);cursor:grab;touch-action:none;background:radial-gradient(circle,var(--muted) 1.2px,transparent 1.7px) 0 0/5px 5px}
.object-bar.is-moving{cursor:grabbing;box-shadow:0 10px 28px var(--shadow-3)}.object-bar.is-moving .object-grip{cursor:grabbing}
.object-bar[data-look=half]{opacity:.6}.object-bar[data-look=faint]{opacity:.3}
.object-bar[data-look]:is(:hover,:focus-within),.object-bar.is-moving{opacity:1}
.sections-bar{display:grid;gap:6px;margin:0 0 16px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-2)}.sections-bar legend{padding:0 4px;font-size:var(--fs-2);font-weight:600}
.sections-bar .sections-look{display:flex;align-items:center;gap:8px;min-height:36px;margin:0;padding:0;font-size:var(--fs-3);cursor:pointer}.sections-look input{margin:0}.sections-bar .quiet{margin:4px 0 0;font-size:var(--fs-1)}.sections-bar .button-text{justify-self:start}
@media(max-width:900px){.object-grip{display:none}}
/* BK-331: the sections of the layout on a phone — photos in a grid, the look and the mosaic in pictures, a short menu and
   a list of the check. */
@media(min-width:901px){.bar-more-list .menu-item::before{display:none}}
@media(max-width:900px){
 .bar-more-list{min-width:250px}.bar-more-list .menu-item{white-space:nowrap}
 .bar-more-list #menu-keys{display:none}
 /* «Фото»: three in a row (four on a phone on its side), the segment light. */
 .gallery-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .gallery-filters .segment[aria-pressed=true]{background:var(--accent-soft);color:var(--ink);box-shadow:inset 0 -2px 0 var(--accent)}
 /* «Оформление»: the styles and the papers as tiles of one width, two in a row. */
 .style-list,.palette-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .style-choice,.palette-choice{min-height:44px;min-width:0;text-align:left}
 .page-elements h3.with-help{display:flex;align-items:center;justify-content:space-between;gap:8px}
 /* «Фотомозаика»: three pictures of a new spread. */
 .typo-actions.is-pictures{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .typo-scheme{display:grid;justify-items:center;gap:6px;min-height:96px;padding:10px 6px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
 .typo-scheme:active{border-color:var(--accent)}
 .typo-pages{display:flex;gap:2px}.typo-page{width:30px;height:40px;border:1px solid var(--border-strong);border-radius:var(--r-1);background:var(--surface)}
 .typo-page.is-on{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 4px var(--surface),inset 0 0 0 40px var(--accent-soft)}
 .typo-scheme-name{font-size:var(--fs-1);text-align:center;line-height:1.25}
 /* «Проверка»: a list — the mark, the title, «Открыть ›»; the words under a press on the title. */
 .check-card.is-line{grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 2px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none}
 .check-card.is-line.is-blocking{background:var(--warning-soft)}
 .check-cards:has(.is-line){gap:0}
 .check-card.is-line .check-line,.check-card.is-line .check-lines{display:none}
 .check-card.is-line.is-open .check-line,.check-card.is-line.is-open .check-lines{display:block}
 .check-toggle{display:block;width:100%;padding:6px 0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:left;cursor:pointer}
 .check-card.is-line>.check-go{align-self:center;white-space:nowrap}
 .check-card.is-line>:is(.audio-player,video){grid-column:1/-1}
}
/* BK-330: the big window of a block's words — «Отмена» and «Готово» in its head. */
.big-writer-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}.big-writer-head h2{flex:1;min-width:0;margin:0;text-align:center}
.big-writer-head>button{flex:none;width:auto}
/* The words of the block on the panel of a phone: two or three lines, a press writes on. */
.layout-pad.layout-text>.note-preview{grid-column:1/-1}
.note-preview{display:block;width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface);color:var(--ink);font:inherit;text-align:left;cursor:text}
.note-preview-text{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line;font-size:var(--fs-3);line-height:1.4}
.note-preview-text.is-empty{color:var(--muted)}
.grid-hint{margin:-2px 0 6px;font-size:var(--fs-1)}
@media(max-width:900px){
 .big-writer{margin:8px auto auto;max-height:calc(100dvh - 16px)}
 .big-writer .big-text{min-height:0;resize:none;overflow:auto}
 /* BK-387 (Э28): the name of the story under the head, the field in the colour of the choice, «Готово» under it too. */
 .big-writer-head h2{font-size:var(--fs-3)}
 .big-writer .write-caption{margin:-4px 0 8px;color:var(--muted);font-size:var(--fs-2)}
 .big-writer .big-text{border-color:var(--accent)}
 .big-writer .write-count{margin:6px 0 0;font-size:var(--fs-2);color:var(--muted)}
 .big-writer .write-hint{margin:4px 0 0;font-size:var(--fs-2);color:var(--muted)}
 .big-writer>.write-done-big{width:100%;min-height:48px;margin-top:12px}
 /* No «+» on every free cell: the cells take a press, one hint over the page says so. */
 .module-add{opacity:0}
 .text-group-label,.font-group-name{font-size:var(--fs-2);font-weight:600;letter-spacing:0;text-transform:none}
 /* The styles: one row that scrolls sideways. */
 .layout-pad .style-tiles{display:grid;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:84px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding-bottom:4px}
 .layout-pad .style-tiles>.style-tile{min-height:60px;scroll-snap-align:start}
 /* The fonts: lines with a rule between them, no frames; the mark only on a font without the Kazakh letters. */
 .font-list{gap:0}
 .font-list .font-choice{border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;min-height:48px}
 .font-list .font-choice[aria-pressed=true]{background:var(--accent-soft)}
 .font-choice:not(.is-missing) .font-letters{display:none}
 .font-search{box-shadow:0 0 0 6px var(--bg);margin-bottom:6px}
 .font-group-name{display:block;margin-top:10px}
}

/* The size of «Красная строка» (BK-371): three buttons in a row under its switch. */
.indent-size{display:flex;gap:6px;margin:-2px 0 8px}
/* «Собрать автоматически» (BK-363): the spreads the assembly makes, shown before it is applied. */
.assemble-preview{max-width:min(720px,calc(100vw - 32px))}
.assemble-grid{display:flex;flex-wrap:wrap;gap:8px;max-height:min(52vh,460px);overflow:auto;margin:8px 0 14px;padding:2px}
.assemble-grid .thumb-sheet{position:relative;overflow:hidden;flex:none;border-radius:var(--r-1);box-shadow:0 0 0 1px var(--line)}
.assemble-story{margin-top:8px}
/* N19 (BK-388): «Собрать автоматически» asks what to lay out — the photos chosen, the open story or the whole book. */
.assemble-scope{width:min(440px,calc(100vw - 32px))}
.assemble-scope-head,.assemble-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.assemble-scope-head h2,.assemble-preview-head h2{margin:0;font-size:var(--fs-4)}
.assemble-scope .scope-question{margin:8px 0}
.assemble-scope .menu-group{margin:0 0 10px}
.scope-words{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left}
.scope-hint{color:var(--muted);font-size:var(--fs-2);font-weight:400}
.assemble-ready{color:var(--muted)}
@media(max-width:900px){
 /* N06/N21: on a phone the new variant is a screen of its own — the spreads one under another, the answers at the bottom. */
 .assemble-preview.is-phone{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0;box-sizing:border-box;
  display:flex;flex-direction:column;padding:12px 16px calc(12px + env(safe-area-inset-bottom))}
 .assemble-preview.is-phone .assemble-grid{flex:1;flex-direction:column;flex-wrap:nowrap;max-height:none;min-height:0;margin:8px 0}
 .assemble-preview.is-phone .style-actions{display:flex;flex-direction:column-reverse;gap:8px;margin:0}
 .assemble-preview.is-phone .style-actions button{width:100%;min-height:48px;justify-content:center}
 /* One way in on a phone: the photos are chosen after «Книга → Собрать автоматически → Выбранные фото». */
 .assemble-story,.gallery-pick:has(#gallery-pick-toggle[aria-pressed=false]){display:none}
}
/* The free spread (BK-365): «Сетка | Свободный», the lines a dragged block is held to, the place in millimetres. */
.free-switch{display:grid;grid-template-columns:1fr 1fr;margin:6px 0 4px}.free-switch .segment{justify-content:center}
.free-guide{position:absolute;pointer-events:none;border-left:1px dashed var(--accent);border-top:1px dashed var(--accent);z-index:30}
.free-fields{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;margin:6px 0 10px}
.free-field{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:6px;font-size:var(--fs-2)}
.free-field input{width:100%;min-width:0;box-sizing:border-box;font:inherit;padding:5px 7px;border:1px solid var(--line);border-radius:var(--r-2);background:var(--surface)}
.free-unit{grid-column:1/-1;margin:0;font-size:var(--fs-1)}.free-ratio{grid-column:1/-1;display:flex;align-items:center;gap:6px;font-size:var(--fs-2)}
/* «Собрать из выбранных» (BK-363): photos chosen in «Фото» are marked; the line says how many and lays them out. */
.gallery-pick{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 10px}.gallery-pick .quiet{font-size:var(--fs-1)}
.gallery-item.is-picked{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent) inset}
.gallery-item.is-picked::after{content:'✓';position:absolute;bottom:6px;left:6px;width:20px;height:20px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-size:var(--fs-1);line-height:20px;text-align:center}

/* BK-319, редакция 2 (BK-389): the sizes of a phone — a target is 48×48 at least, a line of a menu 56 high with 12/16
   inside, its icon 24 and 12 to the words; buttons and fields round 8, groups 12, the sheet's top corners 16. The row
   over the page («← 1 из 4 →», «Вид», «↶ ↷») keeps 40: it goes under the page with BK-386, where it has the room. */
@media(max-width:900px){
 .book-bar{gap:4px;padding:0 4px}
 .book-bar .back-link.back-link,.book-bar #preview-toggle,.book-bar #bar-more-button{width:48px;min-width:48px;height:48px;min-height:48px}
 .book-bar .save-state{left:60px;right:150px}
 .bar-more-list .menu-item{white-space:normal}
 .bar-more-list,.tab-more-list:not([hidden]){padding:8px}.bar-more-list{min-width:min(320px,calc(100vw - 16px))}
 .book-panel,body.sheet-open .book-panel{border-radius:var(--r-4) var(--r-4) 0 0}
 /* 44 of the whole cabinet (ui-quickfix.css, UI-08) becomes 48 in the layout. */
 .spreads-body :is(.book-nav,.book-panel,.book-bar) :is(button,a,select,summary,.nav-item,.segment),.spreads-body :is(.book-nav,.book-panel) label:has(>input:is([type=checkbox],[type=radio])){min-height:48px}
 .spreads-body :is(.book-nav,.book-panel,.book-bar) :is(.button-icon,.nav-more>summary),.object-action{min-width:48px}.object-action{border-radius:var(--r-2)}
 .view-menu .view-modes button,.view-menu .zoom button,.object-action,.object-style,.crop-zoom,.overflow-mark,.overflow-way{min-height:48px}
 .book-panel input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]){min-height:48px}
 .color-swatch,.color-row .color-swatch{width:48px;height:48px}
 /* 14 instead of 13 makes «1 из 4» and «Страница» wider: on 360 the button of the view gives way, not the row. */
 .stage-float .view-toggle{flex:0 1 auto;min-width:0}
}
/* BK-385 (BK-319, редакция 2, Э34): «Книга» — a sheet from the bottom over the bar: its name and «Закрыть», then three
   groups — the look, the order of the book, the end of the work. A group is a card; its lines have no corners of their own. */
.bar-caption{display:none}
@media(max-width:900px){
 .tab-more-list:not([hidden]){left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));display:block;min-width:0;max-height:calc(100dvh - 56px - var(--tabbar) - 24px - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain;padding:0 16px 16px;border-radius:var(--r-4);background:var(--bg)}
 .book-menu-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 -16px;padding:4px 4px 4px 16px;background:var(--bg)}
 .book-menu-head h2{margin:0;font-size:var(--fs-4)}.book-menu-head>button{min-width:48px;min-height:48px}
 .book-menu-group{margin:8px 0 0}.book-menu-group h3{margin:8px 0;font-size:var(--fs-2);font-weight:600;color:var(--muted)}
 .book-menu-group .menu-item>span:first-of-type{flex:1;text-align:left}
 /* «Страницы» is lit while the list of the spreads is open, «Книга» while its menu is: the tab under them is not. */
 :is(body.nav-open .book-panel>.tab-pages,.book-panel>.tab-more[aria-expanded=true]){color:var(--ink);font-weight:700}:is(body.nav-open .book-panel>.tab-pages,.book-panel>.tab-more[aria-expanded=true])::before{background:var(--accent)}
 :is(body.nav-open,body:has(.tab-more[aria-expanded=true])) :is(.book-panel>.panel-tabs [aria-selected=true],.book-panel>.tab-more.is-current:not([aria-expanded=true])){color:var(--muted);font-weight:500}
 :is(body.nav-open,body:has(.tab-more[aria-expanded=true])) :is(.book-panel>.panel-tabs [aria-selected=true],.book-panel>.tab-more.is-current:not([aria-expanded=true]))::before{background:currentColor}
 /* The header's buttons: «Просмотр» (BK-386) and «☰ Меню» with their names under the icons; «Сетка» and «Собрать
    автоматически» are in «Книга» now. */
 .book-bar :is(#bar-more-button,#preview-toggle){flex-direction:column;gap:2px;border-color:transparent;background:transparent}
 .book-bar .bar-caption{display:block;font-size:var(--fs-1);font-weight:500;line-height:1}.book-bar.book-bar :is(#bar-more-button,#preview-toggle){width:auto;padding:0 4px}.book-bar #preview-toggle .desk-label{display:none}
 .bar-more-list :is(#menu-grid,#menu-assemble){display:none}
 /* A photo or a text chosen (Э24, Э27): the bar of the book gives way to the bar of the thing — «Выбрано фото · Снять»
    and four actions with their names; «Действия» has the rest. With the sheet open the bar of the book is back. */
 body:has(.object-bar.is-docked:not(.crop-bar)):not(.sheet-open) .book-panel>:is(.panel-tabs,.tab-more){display:none}
 .object-bar.is-docked:not(.crop-bar){left:0;right:0;bottom:0;display:block;max-width:none;padding:0 max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));border:0;border-top:1px solid var(--line);border-radius:var(--r-4) var(--r-4) 0 0;background:var(--surface);box-shadow:0 -4px 16px var(--shadow-1);overflow:visible;white-space:normal}
 .object-picked{display:flex;align-items:center;justify-content:space-between;gap:12px;height:48px;padding:0 0 0 8px;font-size:var(--fs-2);color:var(--muted)}
 .object-picked>button{min-height:48px;padding:0 12px}
 .object-row{display:flex;height:64px}
 .object-bar.is-docked .object-row>.object-action{flex:1 1 0;min-width:0;min-height:64px;flex-direction:column;justify-content:center;gap:4px;padding:4px 2px;font-size:var(--fs-1);line-height:1.15}
 .object-bar.is-docked .object-row .object-label{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .object-bar.is-docked .object-row>.object-action[data-icon]::before{width:24px;height:24px}
 .object-more-list .object-action,.object-more-list .object-style{justify-content:flex-start;width:100%;min-height:48px;border:0;background:none;text-align:left}
 body.spreads-body:not(.sheet-open):has(.object-bar.is-docked:not(.crop-bar)){padding-bottom:calc(124px + env(safe-area-inset-bottom,0px))}
 body:has(.object-bar.is-docked:not(.crop-bar)) .object-more-list:not([hidden]){bottom:calc(120px + env(safe-area-inset-bottom,0px))}
 body:has(.object-bar.is-docked:not(.crop-bar)) :is(#changes,.edits-state){bottom:calc(124px + env(safe-area-inset-bottom,0px))}
}
/* BK-386 (BK-319, редакция 2, Э20/Э21): over the page «1 страница / 2 страницы» and «↶ ↷»; under it «← Страницы 2–3 из 6 ⤢ →»,
   «⤢» opens the zoom over the row. «Все» is the list of «Страницы» on a phone. All the targets 48. */
.stage-pager{display:none}
@media(max-width:900px){
 .stage-float>.view-modes{display:flex;flex:1 1 auto;min-width:0;max-width:300px}
 .stage-float>.view-modes button{display:inline-flex;align-items:center;flex:1 1 0;min-width:0;min-height:48px;padding:0 8px;justify-content:center;gap:6px;font-size:var(--fs-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .stage-float>.view-modes button[aria-pressed=true]{background:var(--accent-soft);color:var(--ink);font-weight:600}
 .stage-float>.view-modes #mode-all{display:none}.stage-float>.view-modes #mode-page{order:-1}
 .stage-float .float-history .button-icon{width:48px;min-width:48px;min-height:48px}
 .stage-pager{position:relative;display:block;margin:8px 0 0}
 .stage-pager .stage-nav{display:flex;align-items:center;gap:4px}
 .stage-pager .stage-nav .button-icon{width:48px;min-width:48px;min-height:48px;flex:none}
 .stage-pager .position{flex:1 1 auto;min-width:0;min-height:48px;justify-content:center;font-size:var(--fs-3);color:var(--ink)}
 .stage-pager .view-toggle{width:48px;min-width:48px;max-width:none;min-height:48px;padding:0;justify-content:center;border-color:transparent;background:transparent;flex:none}
 .stage-pager.view-open .view-menu{display:grid;gap:10px;position:absolute;bottom:calc(100% + 4px);left:0;right:0;z-index:5;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-3);box-shadow:0 8px 24px var(--shadow-2)}
 .stage-pager .view-menu .zoom button{flex:1 1 0;min-height:48px}.stage-pager .view-menu .zoom #zoom-fit{flex:2 1 0}
 #preview-view [data-view=page]{order:-1}
}

/* N12 (BK-387): the words are not applied — three answers one under another, the first one the main. */
.unsaved-text h2{margin:0 0 8px;font-size:var(--fs-4)}.unsaved-text p{margin:0}
.unsaved-actions{display:grid;gap:8px;margin-top:16px}.unsaved-actions>button{width:100%;min-height:48px}

/* Э30 (BK-387): the list of the fonts is a screen of its own on a phone — «← Шрифт», the search on its own ground, each
   font with a line written in it. On a computer it stays the list under the name. */
.font-list-head,.font-sample{display:none}
@media(max-width:900px){
 body.spreads-body:has(.font-pick[open]) .book-panel{z-index:45}
 .font-pick[open]>.font-list{position:fixed;inset:0;z-index:60;align-content:start;max-height:none;margin:0;padding:0 16px max(16px,env(safe-area-inset-bottom,0px));background:var(--surface);overflow:auto;overscroll-behavior:contain}
 .font-pick[open] .font-list-head{display:flex;align-items:center;gap:8px;position:sticky;top:0;z-index:2;min-height:56px;margin:0 -16px;padding:0 8px;background:var(--surface);border-bottom:1px solid var(--line)}
 .font-list-head h2{margin:0;font-size:var(--fs-4)}
 .font-pick[open] .font-search{position:sticky;top:56px;z-index:2;margin:0 0 8px;box-shadow:0 -8px 0 var(--surface),0 8px 0 var(--surface)}
 .font-pick[open] .font-list .font-choice{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:4px 8px;padding:12px 4px}
 .font-pick[open] .font-sample{display:block;grid-column:1/-1;font-size:var(--fs-3);line-height:1.3;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
