/* ==========================================================================
   Nocturne — fill pages (P6): "Vyplnit a exportovat" — the single-variant
   fill page (Live VariantFiller), the group fill page and the document fill
   page. Prototype: renderTpFill / fiHist / fiShare (prototype/app.js) and the
   "Vyplnit a exportovat" + "Historie exportů popover" sections of
   prototype/app.css; screenshots 23 (fill page + history) and 24 (share).

   Imported AFTER app.css on purpose: the fill overlay's behaviour CSS lives
   there (`.fill-*`, `.group-fill-*`, the echo/spinner/z-order contracts) and
   this file only re-skins it — at equal specificity the later file wins, so
   no rule here needs to out-rank app.css by selector weight. Never restyle
   the behavioural bits (display toggles of `.fill-js`, `fill-panel-open`,
   `.fill-echo-*`, `.is-echo`, positioning) — colours, radii, type only.
   ========================================================================== */

/* ---------- Page header (prototype `.fi-head`) ---------- */
.fi-head { align-items: flex-end; margin-bottom: 20px; }
.fi-head .head-tools { align-items: center; justify-content: flex-end; }
.fi-head a.btn { text-decoration: none; }
.fi-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fi-title .head-lead { color: var(--muted); font-size: 14px; }
.fi-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; text-decoration: none; }
.fi-back:hover { color: var(--text); }
.fi-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: rgb(0 0 0 / .14); font-size: 11px; font-weight: 700; }
/* Split primary (ZIP + print PDFs): one pill, two halves. */
.fi-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fi-split > .dropdown-toggle-split { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 12px; border-left: 1px solid rgb(0 0 0 / .14); }

/* Draft button doubles as the status (fill_draft_controller sets data-saved). */
.fi-draft > span { display: inline-flex; align-items: center; gap: 8px; }
.fi-draft .fi-draft-saved { display: none; }
.fi-draft[data-saved] .fi-draft-dirty { display: none; }
.fi-draft[data-saved] .fi-draft-saved { display: inline-flex; }
.fi-draft[data-saved] .i { color: var(--mnt-ink); }

/* ---------- Historie exportů (prototype `.fi-hpop`) ---------- */
.fi-hw { position: relative; display: inline-flex; }
.fi-hbtn.dropdown-toggle::after { display: none; }
.fi-hlabel { display: inline-block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-hchev { margin-left: 2px; transition: transform var(--dur-2); }
.fi-hbtn[aria-expanded="true"] .fi-hchev { transform: rotate(180deg); }
.dropdown-menu.fi-hpop { --bs-dropdown-bg: var(--surface); --bs-dropdown-padding-x: 0; --bs-dropdown-padding-y: 0; width: 380px; max-width: calc(100vw - 32px); border-radius: 18px; overflow: hidden; }
.fi-hh { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 6px; }
.fi-hh b { font-size: 14px; color: var(--text); }
.fi-hh .cap { font-size: 12px; }
.fi-hbody { display: flex; flex-direction: column; max-height: min(28rem, 60vh); overflow-y: auto; scrollbar-width: thin; padding: 0 8px; }
.fi-hsec.dropdown-header { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.dropdown-item.fi-hi { display: flex; align-items: center; gap: 2px; min-height: 0; margin: 0 0 2px; padding: 0 4px 0 0; border-radius: 12px; color: var(--text); white-space: normal; background: transparent; }
.dropdown-item.fi-hi:hover, .dropdown-item.fi-hi:focus-within { background: var(--surface-2); color: var(--text); }
.dropdown-item.fi-hi.pin { background: var(--lav-deep); }
.dropdown-item.fi-hi.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--lav); }
.dropdown-item.fi-hi.pin.active { background: var(--lav-deep); }
.fi-hload { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; color: var(--text); text-decoration: none; }
.fi-hload:hover { color: var(--text); }
.fi-hload > div { max-width: 100%; font-size: 14px; font-weight: 600; }
.fi-hload .cap { font-size: 12px; }
.fi-hedit { flex: 1; min-width: 0; padding: 6px 4px 6px 8px; }
.fi-hpills { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.fi-hpills:empty { display: none; }
.pill.fi-pn { background: var(--surface-3); color: var(--muted); }
.fi-hpin { display: inline-flex; }
.fi-hb { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--subtle); cursor: pointer; }
.fi-hb:hover { background: var(--surface-3); color: var(--text); }
.fi-hb:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 1px; }
.fi-hb.on { color: var(--lav-ink); }
.fi-hb.on .i { transform: rotate(-30deg); }
.fi-hfoot { display: flex; flex-direction: column; margin: 6px -8px 0; border-top: 1px solid var(--line); }
.fi-hmore { display: flex; align-items: center; gap: 8px; padding: 13px 18px; color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.fi-hmore + .fi-hmore { border-top: 1px solid var(--line); }
.fi-hmore:hover { background: var(--surface-2); color: var(--text); }
/* Inline rename field (row flavour + the history page). */
.export-version-rename .input-group { gap: 4px; }
.export-version-rename .form-control { min-height: 36px; height: 36px; border-radius: 10px !important; font-size: 14px; }
.export-version-rename .input-group .export-version-rename__btn { --n-btn-h: 36px; width: 36px; min-height: 36px; padding: 0; border-radius: 10px !important; margin: 0 !important; }

/* ---------- Toolbar row (prototype `.fi-bar`) ---------- */
.fi-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 16px; }
.fi-sp { flex: 1 1 auto; }
.fi-sw { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; user-select: none; }
.fi-sw .sw { pointer-events: none; }
.fi-sw:has(input:checked) .sw { background: var(--a-deep, var(--lav-deep)); border-color: var(--a-line, var(--lav-line)); }
.fi-sw:has(input:checked) .sw::after { left: 17px; background: var(--a, var(--lav)); box-shadow: 0 0 12px var(--a-glow, var(--lav-glow)); }
.fi-sw:has(input:focus-visible) .sw { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-preview-on .fi-sw { opacity: .45; }
.fi-clean[aria-pressed="true"] { background: var(--lav-deep); border-color: var(--lav-line); color: var(--lav-ink); }
.fi-autob[aria-pressed="true"] { color: var(--lav-ink); border-color: var(--lav-line); background: var(--lav-deep); }
.fi-zoom, .fi-hist { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid var(--line-2); }
.fi-hist { border: 0; }
.fi-zoom .btn, .fi-hist .btn { --n-btn-h: 30px; min-height: 30px; }
.fi-zoom .btn.icon, .fi-hist .btn.icon { width: 30px; height: 30px; }
.fi-zl { min-width: 58px; font-variant-numeric: tabular-nums; }
.fi-fmt { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
.fi-fmt .sz-ctl { padding: 0 4px; }
.fi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fi-chips .chip { height: 34px; padding: 0 14px; --a-deep: var(--lav-deep); --a-line: var(--lav-line); --a-ink: var(--lav-ink); }
.fi-chips .chip[aria-pressed="false"] .i { display: none; }

/* Overflow alert above the previews. */
.fill-form > .alert[data-variant-fill-overlay-target="overflowAlert"] { margin: 0 0 12px; }

/* ---------- Format cards (prototype `.fi-grid` / `.fi-card` / `.fi-ch`) ---------- */
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, min(var(--fimin, 440px), 100%)); gap: 20px; align-items: start; justify-content: start; }
.fi-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; overflow: visible; }
.fi-card[hidden] { display: none; }
.fi-card.group-fill-preview-card { margin: 0; }
.fi-ch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; padding: 2px 2px 0 4px; font-size: 13px; color: var(--text); border: 0; }
.fi-ch b { font-weight: 700; }
.fi-ch .cap { font-size: 12px; }
.fi-ch .dropdown { display: inline-flex; }
.fi-ch .fi-share.dropdown-toggle::after { display: none; }
.fi-ch .badge.pill { gap: 4px; }
.group-fill-preview-heading { padding: 2px 2px 0 4px; border-bottom: 0; font-size: 13px; color: var(--text); }
.group-fill-preview-frame { border-radius: 8px; background: var(--surface-2); }
.group-fill-preview-spinner { background: color-mix(in oklab, var(--bg) 35%, transparent); }
.group-fill-preview-error { background: var(--rose); color: var(--on-accent); font-weight: 600; }

/* Single page: one card around the zoomable viewport. With JS the stage is
   absolutely placed and centred by fill_viewport.js (text-align only matters
   for the no-JS fallback). The card stays full width: a shrink-wrapped
   container would feed the fit zoom its own size. */
.fill-body { gap: 20px; }
.fi-card--single { flex: 1 1 auto; min-width: 0; }
.fi-card--single .fill-viewport { text-align: center; border-radius: 8px; }
.fi-card--single .fill-stage { text-align: left; }

/* ---------- Boxes on the preview: lavender text, mint image, peach colour ---------- */
.fill-form.fill-js.fill-highlight-on .fill-box--text { border-color: color-mix(in oklab, var(--lav) 80%, white); background: color-mix(in oklab, var(--lav) 7%, transparent); box-shadow: none; }
.fill-form.fill-js.fill-highlight-on .fill-box--image { border-color: color-mix(in oklab, var(--mnt) 85%, white); background: color-mix(in oklab, var(--mnt) 7%, transparent); box-shadow: none; }
.fill-form.fill-js.fill-highlight-on .fill-box--shape { border-color: color-mix(in oklab, var(--pch) 85%, white); background: color-mix(in oklab, var(--pch) 7%, transparent); box-shadow: none; }
.fill-form.fill-js .fill-box--overflow { border-color: var(--rose) !important; background: color-mix(in oklab, var(--rose) 10%, transparent); box-shadow: none; }
.fill-box { border-radius: 3px; }
.fill-box__name { top: -1px; left: -1px; height: 16px; padding: 0 5px; border-radius: 3px 0 4px 0; background: color-mix(in oklab, var(--lav) 85%, black); color: #fff; font-family: var(--font); font-size: 9.5px; font-weight: 700; line-height: 16px; }
.fill-box--image .fill-box__name { background: color-mix(in oklab, var(--mnt) 60%, black); color: #fff; }
.fill-box--shape .fill-box__name { background: color-mix(in oklab, var(--pch) 60%, black); color: #fff; }
.fill-box--tools-left .fill-box__name { left: auto; right: -1px; border-radius: 0 3px 0 4px; transform-origin: top right; }
/* The single page zooms its stage (CSS transform): counter-scale the tag like
   the tool dots so it stays readable at any zoom; its max width follows the
   box's ON-SCREEN width. The group / document surfaces are unzoomed (1). */
.fill-box__name { max-width: calc((100% - 30px) * var(--fill-zoom, 1)); transform: scale(calc(1 / var(--fill-zoom, 1))); transform-origin: top left; }
.fill-form.fill-js .fill-box--overflow .fill-box__name { background: var(--rose); color: var(--on-accent); }
/* Action dots (prototype `.fi-ab`): 26 px circles with the surface ring. */
.fill-box__tools { top: -11px; right: -11px; gap: 3px; }
.fill-box--tools-left .fill-box__tools { left: -11px; }
.fill-box__tool { width: 26px; height: 26px; border: 2px solid var(--surface); background: var(--surface); color: var(--text-2); box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.fill-box__tool--edit { background: var(--lav); color: var(--on-accent); }
.fill-box--image .fill-box__tool--edit { background: var(--mnt); color: var(--on-accent); }
.fill-box--shape .fill-box__tool--edit { background: var(--pch); color: var(--on-accent); }
.fill-box__tool:hover { filter: none; transform: scale(1.12); }
.fill-box__tool:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.fill-box__tool--hide.is-active { background: var(--pch-deep); color: var(--pch-ink); border-color: var(--surface); }
.fill-box__tool .i { width: 13px; height: 13px; }
/* Chrome follows the ON-CANVAS part of the box: a frame that runs past the
   artwork (box top < 0 …) shifts its tag + cluster by the clipped insets the
   overlay controller writes (`_placeChrome`), so the stage edge never cuts a
   pencil in half. 0 for a box fully on the canvas = the rules above. */
.fill-box__name { top: calc(var(--fill-vis-top, 0px) - 1px); left: calc(var(--fill-vis-left, 0px) - 1px); }
.fill-box--tools-left .fill-box__name { left: auto; right: calc(var(--fill-vis-right, 0px) - 1px); }
.fill-box__tools { top: calc(var(--fill-vis-top, 0px) - 11px); right: calc(var(--fill-vis-right, 0px) - 11px); }
.fill-box--tools-left .fill-box__tools { right: auto; left: calc(var(--fill-vis-left, 0px) - 11px); }
.fill-box.fill-box--tools-inside .fill-box__tools { top: calc(var(--fill-vis-top, 0px) + 4px); right: calc(var(--fill-vis-right, 0px) + 4px); }
.fill-box.fill-box--tools-left.fill-box--tools-inside .fill-box__tools { right: auto; left: calc(var(--fill-vis-left, 0px) + 4px); }

/* One pencil per container: the container box = a solid lavender outline
   around the block with its tag hanging ABOVE it (the first member's own tag
   sits at the same corner inside); members keep a lighter dotted outline. */
.fill-form.fill-js.fill-highlight-on .fill-box--container { border: 1.5px solid color-mix(in oklab, var(--lav) 90%, white); border-radius: 6px; background: none; box-shadow: 0 0 0 1px rgb(0 0 0 / .18); }
.fill-form.fill-js.fill-highlight-on .fill-box--container.is-sheet-open { border-width: 2px; box-shadow: 0 0 0 3px var(--lav-glow); }
.fill-box--container .fill-box__name { border-radius: 4px 4px 0 0; transform: scale(calc(1 / var(--fill-zoom, 1))) translateY(calc(-100% - 1px)); }
.fill-form.fill-js.fill-highlight-on .fill-box--sheet-member { border-style: dotted; }
.fill-form.fill-js.fill-highlight-on .fill-box--sheet-member:hover { background: color-mix(in oklab, var(--lav) 16%, transparent); }

/* Live-preview veil + spinner badge. */
.fill-spinner { background: color-mix(in oklab, var(--bg) 30%, transparent); }
.fill-spinner__badge { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); }
.fill-spinner__icon { width: 26px; height: 26px; border: 3px solid var(--lav-deep); border-top-color: var(--lav); }

/* ---------- Floating edit pop-up (prototype `.fi-pop`) ---------- */
.fill-form.fill-js .fill-popover { width: min(380px, calc(100vw - 24px)); max-width: none; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text); }
.fill-form.fill-js .fill-popover--rich { width: min(420px, calc(100vw - 24px)); }
.fill-popover > .card-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; }
.fill-popover__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fill-popover__lead { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.fill-popover__name { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--text); }
.fill-popover__lead .fill-popover__name { flex: 0 1 auto; }
.fill-popover__drag { width: 20px; height: 28px; color: var(--subtle); cursor: grab; touch-action: none; -webkit-mask-size: 14px; mask-size: 14px; }
.fill-popover__drag:active { cursor: grabbing; }
.fill-popover__ok { box-shadow: 0 6px 18px var(--mnt-glow); }
.fill-popover__x { color: var(--muted); }
.fill-popover__desc { margin: -4px 0 0; font-size: 12px; }
.fill-popover .form-control, .fill-popover .form-select { font-size: 15px; }
textarea.fill-popover__input { min-height: 44px; padding: 10px 12px; border-radius: 12px; }
.fill-popover__font-label { display: inline-flex; align-items: center; gap: 6px; flex: none; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.fill-popover .fill-popover__font { min-height: 36px; font-size: 13px; }
.fill-popover small.text-muted, .fill-popover [data-fill-counter] { font-size: 11px; color: var(--subtle) !important; }
.fill-popover__add { align-self: flex-start; margin-top: 8px; }
.fill-popover__swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fill-popover__eye { width: 30px; height: 30px; border-radius: 8px; color: var(--subtle); opacity: 1; }
.fill-popover__eye:hover { background: var(--surface-3); color: var(--text); }
.fill-popover__eye.is-active { background: var(--pch-deep); color: var(--pch-ink); }
.fill-popover__reorder { width: 18px; height: 18px; color: var(--subtle); opacity: 1; }
.fill-popover__reorder:hover { color: var(--text); }
@media (max-width: 700px) {
    /* Phones: the pop-up docks to the bottom edge (prototype). The controller
       still writes left/top — the !important pins it. */
    .fill-form.fill-js:not(.fill-panel-open) .fill-popover.is-open { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
}

/* Rich text toolbar + swatches inside the pop-up. */
.fill-richtext-toolbar { gap: 6px !important; }
.fill-richtext-toolbar .btn-group > .btn, .fill-richtext-toolbar > .btn { --n-btn-h: 32px; min-height: 32px; min-width: 32px; padding: 0 9px; font-size: 13px; }
.fill-richtext-toolbar .btn.active { background: var(--lav-deep); border-color: var(--lav-line); color: var(--lav-ink); }
.fill-richtext-toolbar__font { min-height: 32px; font-size: 13px; }
.fill-rt-ol { font-size: 12px; font-weight: 700; line-height: 1; }
.fill-richtext-editor { min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 15px; }
.fill-richtext-editor:focus { border-color: var(--lav); box-shadow: 0 0 0 3px var(--lav-glow); }
.fill-richtext-editor:empty::before { color: var(--subtle); }
.fill-richtext-swatch { width: 28px; height: 28px; border: 1px solid var(--line-2); }
.fill-popover--shape .fill-richtext-swatch { width: 32px; height: 32px; }
.fill-richtext-swatch:hover { box-shadow: 0 0 0 2px var(--line-3); }
.fill-richtext-swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--lav); }

/* ---------- "Všechna pole" (the docked panel) ---------- */
.fill-panel-backdrop { background: rgb(5 4 7 / .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
:root[data-theme="light"] .fill-panel-backdrop { background: rgb(23 21 27 / .4); }
.fill-form.fill-js.fill-panel-open .fill-popovers { gap: 12px; top: 5vh; width: 640px; max-width: calc(100vw - 24px); max-height: 90vh; padding: 0 22px 22px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow-4); scrollbar-width: thin; }
.fill-popovers__header { gap: 10px; padding: 20px 0 14px; border-bottom: 1px solid var(--line); }
.fill-form.fill-js.fill-panel-open .fill-popovers__header { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.fill-popovers__title { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.fill-popovers__title h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.fill-popovers__arrange { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.fill-panel-done { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--lav); color: var(--on-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex: none; }
.fill-panel-done:hover { background: color-mix(in oklab, var(--lav) 88%, white); }
.fill-panel-x { width: 32px; height: 32px; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.fill-panel-x:hover { background: var(--surface-3); color: var(--text); }
.fill-panel-done:focus-visible, .fill-panel-x:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-form.fill-js.fill-panel-open .fill-popover,
.fill-form.fill-js.fill-panel-open .fill-popover--rich,
.fill-form.fill-js.fill-panel-open .fill-popover--image { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: none; }
.fill-form.fill-js.fill-panel-open .fill-popover.fill-popover--reorder-ghost { outline-color: var(--lav); }
.fill-popovers__empty { display: flex; align-items: center; gap: 8px; color: var(--muted) !important; }
.fill-form.fill-js.fill-panel-open .fill-popovers .document-fill-panel-heading { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--subtle); }
.fill-form.fill-js.fill-panel-open .fill-popovers .document-fill-panel-heading.is-shared { color: var(--lav-ink); }

/* ---------- Container sheet (one pencil per container) ---------- */
.fill-form.fill-js.fill-sheet-open .fill-popovers { padding: 0 14px 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-4); scrollbar-width: thin; }
.fill-sheet__head { gap: 8px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.fill-sheet__drag { flex: none; }
@media (max-width: 700px) { .fill-sheet__drag { display: none; } }
.fill-sheet__lead { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; color: var(--lav-ink); }
.fill-sheet__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; color: var(--text); }
.fill-sheet__count { flex: none; font-size: 12px; color: var(--subtle); }
.fill-sheet__ok { box-shadow: 0 6px 18px var(--mnt-glow); }
.fill-sheet__x { color: var(--muted); }
.fill-sheet__eye { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--subtle); cursor: pointer; }
.fill-sheet__eye:hover { background: var(--surface-3); color: var(--text); }
.fill-sheet__eye.is-active { background: var(--pch-deep); color: var(--pch-ink); }
.fill-sheet__eye:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-sheet__section { gap: 6px; min-height: 0; margin: 6px 0 -2px calc(var(--sheet-depth, 0) * 10px); padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--subtle); }
.fill-sheet__section-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fill-sheet__section--plain { padding-top: 4px; }
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-popover.is-in-sheet { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: none; }
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-popover.is-in-sheet > .card-body { gap: 8px; padding: 10px 12px 12px; }
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-popover.is-sheet-target { border-color: var(--lav); box-shadow: 0 0 0 3px var(--lav-glow); }

/* ---------- Repeatable rows (container-rows P4) ---------- */
/* One row = one framed block: the flat cards cannot have a wrapper (the sheet
   only orders them), so the head and the members draw the frame together.
   -8px cancels the sheet's flex gap between them. */
.fill-sheet__section--row { flex: none; gap: 8px; margin: 8px 0 0 calc(var(--sheet-depth, 0) * 10px); padding: 6px 6px 6px 4px; border: 1px solid var(--line-2); border-radius: 14px 14px 0 0; background: var(--surface-3); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); cursor: pointer; }
.fill-sheet__section--row.is-collapsed,
.fill-popovers.is-rows-dragging > .fill-sheet__section--row { border-radius: 14px; }
.fill-sheet__section--row .fill-sheet__section-name { flex: none; }
.fill-sheet__row-summary { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--muted); }
.fill-sheet__row-grip { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--subtle); cursor: grab; touch-action: none; }
.fill-sheet__row-grip:hover:not(:disabled) { color: var(--text); }
.fill-sheet__row-grip:active:not(:disabled) { cursor: grabbing; }
.fill-sheet__row-grip:disabled { opacity: .3; cursor: default; }
.fill-sheet__row-grip:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-sheet__section--row [data-row-toggle] .i { transition: transform var(--dur-1) var(--ease); }
.fill-sheet__section--row.is-collapsed [data-row-toggle] .i { transform: rotate(-90deg); }
.fill-form.fill-js.fill-sheet-open .fill-popovers > :is(.fill-popover, .fill-sheet__section).is-in-sheet.is-row-member { margin: -8px 0 0 calc(var(--row-depth, 0) * 10px); border: solid var(--line-2); border-width: 1px 1px 0; border-top-color: var(--line); border-radius: 0; background: var(--surface); }
.fill-form.fill-js.fill-sheet-open .fill-popovers > :is(.fill-popover, .fill-sheet__section).is-in-sheet.is-row-member.is-row-last { border-bottom-width: 1px; border-radius: 0 0 14px 14px; }
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-popover.is-in-sheet.is-row-member.is-sheet-target { position: relative; z-index: 1; border-color: var(--lav); }
.fill-form.fill-js.fill-sheet-open .fill-popovers > :is(.fill-popover, .fill-sheet__section).is-row-collapsed,
.fill-form.fill-js.fill-sheet-open .fill-popovers.is-rows-dragging > :is(.fill-popover, .fill-sheet__section).is-row-member { display: none; }
.fill-popovers.is-rows-dragging { user-select: none; }
.fill-sheet__section--row.is-row-dragging { opacity: .5; }
.fill-sheet__row-drop { position: absolute; left: 14px; right: 14px; z-index: 3; height: 3px; border-radius: 3px; background: var(--lav); pointer-events: none; }
.fill-sheet__row-index { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--lav-deep); color: var(--lav-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fill-sheet__row-tools { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.fill-sheet__row-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.fill-sheet__row-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.fill-sheet__row-btn:disabled { opacity: .3; cursor: default; }
.fill-sheet__row-btn:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-sheet__row-add { flex-wrap: wrap; gap: 4px 10px; margin: 2px 0 4px calc(var(--sheet-depth, 0) * 10px); }
.fill-sheet__add.is-disabled { opacity: .5; cursor: not-allowed; }
.fill-sheet__add-reason { font-size: 12px; color: var(--subtle); }
.fill-popover__row { flex: none; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--lav-deep); color: var(--lav-ink); font-size: 11px; font-weight: 600; white-space: nowrap; }
.fill-form.fill-js.fill-sheet-open .fill-popover.is-in-sheet .fill-popover__row { display: none; }
/* "+ Řádek" under the last active row on the preview — counter-scaled to a
   constant on-screen size like the box tools; follows the same toggles. */
.fill-row-chip { position: absolute; z-index: 6; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 9px 0 6px; border: 1px solid var(--lav-line); border-radius: 999px; background: var(--surface); color: var(--lav-ink); font: 600 11px/1 var(--font); white-space: nowrap; box-shadow: 0 2px 6px rgb(0 0 0 / .25); cursor: pointer; pointer-events: auto; transform-origin: top center; transform: translate(-50%, 4px) scale(calc(1 / var(--fill-zoom, 1))); }
.fill-row-chip:hover { background: var(--lav); color: var(--on-accent); border-color: var(--lav); }
.fill-row-chip:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fill-row-chip[hidden],
.fill-form:not(.fill-js) .fill-row-chip,
.fill-form.fill-js:not(.fill-highlight-on) .fill-row-chip,
.fill-form.fill-js.fill-preview-on .fill-row-chip { display: none; }

/* Image card (panel row of an image slot; prototype `.fi-img`). */
.fill-image-card { display: flex; align-items: center; gap: 12px; }
.fill-image-card__thumb { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line-2); background-color: var(--surface-2); background-size: contain; background-repeat: no-repeat; }
.fill-image-card__hint { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; }
.fill-image-card__hint .i { margin-top: 1px; }

/* ---------- Image picker (both the custom `.fill-modal` and Bootstrap) ---------- */
.fill-modal { background: rgb(5 4 7 / .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
:root[data-theme="light"] .fill-modal { background: rgb(23 21 27 / .4); }
.fill-modal__dialog { width: min(820px, 100%); padding: 22px 26px 26px; border-radius: 22px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-4); scrollbar-width: thin; }
.fill-modal__dialog h5 { font-size: 19px; font-weight: 600; }
.fill-modal__dialog .form-label { color: var(--muted); }
.modal[data-image-modal] .modal-dialog { --bs-modal-width: 820px; }
.fi-gnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 10px; }
.fi-gcrumb { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--lav-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fi-gcrumb:hover { background: var(--surface-3); }
.fi-gcrumb.on { color: var(--text); background: var(--surface-3); cursor: default; }
.fi-gsep { color: var(--subtle); }
.fi-gfolders { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fi-gfold { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.fi-gfold .i { color: var(--lav-ink); }
.fi-gfold span:not(.i) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-gfold:hover { border-color: var(--line-3); background: var(--surface-3); }
/* Thumbnail size: fill-gallery sets --galmin from the gallery's slider
   (`wb-galsize`); the slider sits at the right end of the crumb row and
   hides on phones (gallery.css), where the grid keeps its 150 px floor. */
.fi-gnav .sz-ctl { margin-left: auto; height: 30px; padding-right: 0; }
.fi-ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--galmin, 150px), 100%), 1fr)); gap: 12px; align-items: start; margin: 0 0 12px; padding: 2px; }
.fi-gcell { min-width: 0; }
.gallery-asset.fi-gt { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.gallery-asset.fi-gt:hover { border-color: var(--line-3); }
.fi-gsel { display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fi-gsel:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: -2px; border-radius: 14px; }
.gallery-asset__select.fi-gsel:hover, .gallery-asset__select.fi-gsel:focus-visible { background: none; }
.fi-gi { display: grid; place-items: center; aspect-ratio: 1; padding: 10px; overflow: hidden; color: var(--subtle); background: var(--surface-2); background-image: linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%), linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.fi-gi img { width: 100%; height: 100%; object-fit: contain; color: transparent; font-size: 0; }
.fi-gt .gallery-asset__caption { padding: 9px 10px; border-top: 0; font-size: 13px; }
.fi-gt .gallery-asset__name { font-weight: 600; color: var(--text); }
.fi-gt .gallery-asset__meta { color: var(--subtle); font-size: 11px; }
.fi-gt .gallery-asset__format { background: var(--surface-3); color: var(--muted); }
.fi-gt:has(.group-fill-image-option.selected) { border-color: var(--lav); box-shadow: 0 0 0 3px var(--lav-glow); }
.gallery-asset__select.group-fill-image-option.selected { box-shadow: none; }
.gallery-asset--new { outline-color: var(--mnt); }
.gallery-dropzone.gal-drop { padding: 16px; background: none; border: 1.5px dashed var(--line-3); border-radius: 16px; }
.gallery-dropzone.gal-drop:hover, .gallery-dropzone.gal-drop:focus-visible { border-color: var(--lav-line); background: none; }
.gallery-dropzone.gal-drop.gallery-dropzone--over { border-color: var(--lav); background: var(--lav-deep); }
.gallery-dropzone.gal-drop b { color: var(--text); }
.gallery-dropzone.gal-drop .cap b { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.gallery-dropzone.gal-drop .cap .i { width: 12px; height: 12px; margin: 0; color: inherit; }

/* Publish modal (connected Facebook) — the destination list + caption. */
.fill-modal__dialog textarea.form-control { border-radius: 12px; }

/* Draft / upload toasts (fill_draft_controller, fill-gallery) in kit look. */
.gallery-toast-container .gallery-toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text); font-size: 13px; }
.gallery-toast-container .gallery-toast > i { color: var(--mnt-ink); }
.gallery-toast-container .gallery-toast--warning > i { color: var(--pch-ink); }

/* ---------- Group picture placement toolbar ---------- */
.group-fill-placement-toolbar { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text); }
.group-fill-placement-toolbar__name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.group-fill-placement-toolbar__center { --n-btn-h: 28px; min-height: 28px; padding: 0 8px; font-size: 12px; }
.group-fill-placement-control label { display: inline-flex; color: var(--muted); }
.group-fill-placement-control .form-range { accent-color: var(--lav); }
.group-fill-placement-toolbar__hint { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 11px; }
.group-fill-ghost:hover, .group-fill-ghost:focus-visible, .group-fill-ghost.is-selected { border-color: var(--lav); }
.group-fill-placement-layer.is-active .group-fill-ghost { border-color: var(--lav); }

/* ---------- Document fill: page strip + stacked pages ---------- */
.document-fill .document-fill-layout { gap: 20px; }
.document-fill .document-fill-sidebar { flex-basis: 132px; top: 16px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); scrollbar-width: thin; }
.document-fill .document-pages { display: flex; flex-direction: column; gap: 8px; }
.document-fill .document-pages__item { margin: 0; padding: 6px; border-radius: 12px; border: 1px solid transparent; }
.document-fill .document-pages__item:hover { background: var(--surface-2); }
.document-fill .document-pages__item.is-active { border-color: var(--lav-line); background: var(--lav-deep); }
.document-fill .document-pages__thumb, .document-fill .document-fill-sidebar .document-pages__thumb { padding: 0; border: 0; border-radius: 6px; background: none; }
.document-fill .document-pages__item.is-active .document-pages__thumb { border: 0; background: none; }
.document-fill .document-pages__thumb img { border-radius: 4px; background: var(--surface-2); box-shadow: 0 4px 12px rgb(0 0 0 / .25); }
.document-pages__num { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.document-fill .document-pages__item.is-active .document-pages__num { color: var(--lav-ink); }
.document-fill .document-fill-pages { display: flex; flex-direction: column; gap: 20px; }
.document-fill .document-fill-page { scroll-margin-top: 16px; }

/* ---------- "Sdílet na sítě" fake door ---------- */
.fi-door .modal-body { display: flex; flex-direction: column; gap: 10px; }
.fi-door .modal-body p { margin: 0; color: var(--text-2); }
.fi-door .modal-body p.cap { color: var(--muted); }
.fi-door-nets { display: flex; gap: 10px; margin-bottom: 4px; }
.fi-door-net { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--lav-deep); color: var(--lav-ink); box-shadow: inset 0 0 0 1px var(--lav-line); }
.fi-door-net.ai { background: linear-gradient(135deg, var(--lav), var(--mnt)); color: var(--on-accent); box-shadow: none; }
.fi-door .fi-door-lead { font-size: 16px; font-weight: 600; color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .fi-head .head-tools { justify-content: flex-start; }
}
@media (max-width: 700px) {
    .fi-head .head-tools { width: 100%; }
    .fi-head .head-tools > .btn, .fi-head .head-tools > .fi-hw, .fi-head .head-tools > .fi-split { flex: 1 1 auto; }
    .fi-head .head-tools > .fi-hw .dropdown, .fi-head .head-tools > .fi-hw .fi-hbtn { width: 100%; }
    .fi-head .head-tools > .fi-split > .btn:first-child { flex: 1 1 auto; }
    .fi-bar { gap: 10px; }
    .fi-bar .fi-sp { display: none; }
    .fi-fmt { margin-left: 0; justify-content: flex-start; }
    .fi-ch { row-gap: 6px; }
    .fi-card { padding: 10px; border-radius: 16px; }
}
@media (max-width: 560px) {
    .fi-zoom { display: none; }
    .fi-ggrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- Image adjust (both fill pages; `_fill_image_adjust.html.twig`) ----------
   Single page: `.fill-adjust` floats fixed next to the selected picture
   (variant-image-fill#_positionAdjust), a bottom sheet on phones. Group /
   document pages: the same body inside `.group-fill-placement-toolbar`. */
.fill-adjust { position: fixed; z-index: 1150; width: 300px; max-width: calc(100vw - 16px); padding: 10px 12px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text); }
.fill-adjust[hidden] { display: none; }
.fill-adjust__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fill-adjust__name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
.fill-adjust__name .i { flex: none; color: var(--mnt-ink); }
.fill-adjust__close { flex: none; width: 14px; height: 14px; padding: 6px; background-size: 12px; opacity: .7; }
.fill-adjust__zoom { display: flex; align-items: center; gap: 6px; }
/* The gallery size slider (`.sz-ctl`), stretched to the panel width. */
.fill-adjust__slider.sz-ctl { display: flex; flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 2px; gap: 8px; }
.fill-adjust__slider.sz-ctl input { flex: 1 1 auto; width: auto; min-width: 0; margin: 0; }
.fill-adjust__value { flex: 0 0 48px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.fill-adjust__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 8px; }
.fill-adjust__field { position: relative; display: flex; align-items: center; margin: 0; }
.fill-adjust__field .form-control { --n-input-h: 32px; min-height: 32px; height: 32px; padding: 0 30px 0 24px; border-radius: 10px; font-size: 13px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.fill-adjust__field .form-control::-webkit-outer-spin-button, .fill-adjust__field .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fill-adjust__key { position: absolute; left: 9px; font-size: 11px; font-weight: 700; color: var(--muted); pointer-events: none; }
.fill-adjust__unit { position: absolute; right: 9px; font-size: 11px; color: var(--subtle); pointer-events: none; }
.fill-adjust__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fill-adjust__actions .btn { flex: 1 1 auto; }
.fill-adjust__hint { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 11px; color: var(--muted); }
/* The group toolbar hosts the same body. */
.group-fill-placement-toolbar { width: min(300px, calc(100% - 16px)); }
.group-fill-placement-toolbar .fill-adjust__grid { margin-bottom: 6px; }
@media (max-width: 767.98px) {
    /* Bottom sheet; thumb-sized slider + fields. */
    .fill-adjust { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; max-width: none; padding: 12px 14px 14px; border-radius: 18px; }
    .fill-adjust__slider.sz-ctl { height: 44px; }
    .fill-adjust__slider.sz-ctl input { height: 28px; }
    .fill-adjust__field .form-control { height: 40px; min-height: 40px; font-size: 16px; }
    .fill-adjust__actions .btn { min-height: 40px; }
    .fill-adjust__hint { display: none; }
}

/* Resize / rotate handles (image_adjust_handles.js): a fixed layer on <body>,
   so a corner past the canvas edge stays visible and grabbable. */
.fill-adjust-handles { position: fixed; inset: 0; z-index: 1140; pointer-events: none; }
.fill-adjust-handles[hidden] { display: none; }
.fill-adjust-handles__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fill-adjust-handles__outline { fill: none; stroke: var(--mnt); stroke-width: 1.5; stroke-dasharray: 5 4; filter: drop-shadow(0 0 1px rgb(0 0 0 / .6)); }
.fill-adjust-handles__stem { stroke: var(--mnt); stroke-width: 1.5; }
.fill-adjust-handle { position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: auto; touch-action: none; }
.fill-adjust-handle[hidden] { display: none; }
.fill-adjust-handle::after { content: ""; position: absolute; inset: 8px; border-radius: 3px; background: #fff; border: 2px solid var(--mnt-ink); box-shadow: 0 1px 4px rgb(0 0 0 / .45); }
.fill-adjust-handle--tl, .fill-adjust-handle--br { cursor: nwse-resize; }
.fill-adjust-handle--tr, .fill-adjust-handle--bl { cursor: nesw-resize; }
.fill-adjust-handle--rotate { cursor: grab; }
.fill-adjust-handle--rotate::after { border-radius: 50%; }
/* Corner clamped onto the visible edge (the real one is off screen). */
.fill-adjust-handle.is-clamped::after { background: var(--mnt); border-style: dashed; border-color: #fff; }
.fill-adjust-handles.is-dragging .fill-adjust-handle { cursor: inherit; }
html.fill-adjust-scaling, html.fill-adjust-scaling * { cursor: nwse-resize !important; }
html.fill-adjust-rotating, html.fill-adjust-rotating * { cursor: grabbing !important; }
@media (pointer: coarse) {
    .fill-adjust-handle { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
    .fill-adjust-handle::after { inset: 12px; }
}
.fill-box__tool--adjust[hidden] { display: none; }

/* ---------- User-movable elements ("Uživatel může posunout", M3) ----------
   The ✥ / ↕ / ↔ tool sits in the box's dot cluster after the pencil
   (fill_element_move.js). Neutral dot with a lavender glyph; lavender fill
   while its element is selected ("move mode"). 44 px hit area on a 26 px
   dot; touch-action none on the tool only, so a drag on it never pans. */
.fill-box__tool--move { position: relative; color: var(--lav-ink); cursor: grab; touch-action: none; }
.fill-box__tool--move::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.fill-box__tool--move[hidden] { display: none; }
.fill-box__tool--move.is-moved { box-shadow: 0 0 0 2px var(--lav-line), 0 2px 6px rgb(0 0 0 / .25); }
.fill-box__tool--move[aria-pressed="true"], .fill-box__tool--move.is-dragging { background: var(--lav); color: var(--on-accent); }
html.fill-move-dragging, html.fill-move-dragging * { cursor: grabbing !important; user-select: none; }
/* Move-only box (locked text, decorative image, plain shape, container
   without a sheet): a quiet dotted outline — it carries no field. */
.fill-form.fill-js.fill-highlight-on .fill-box--move { border-style: dotted; border-color: color-mix(in oklab, var(--lav) 55%, transparent); background: none; box-shadow: none; }
.fill-box--move .fill-box__name { background: color-mix(in oklab, var(--lav) 55%, black); }
/* Move mode: the selected box takes the pointer (drag it anywhere inside). */
.fill-form.fill-js:not(.fill-preview-on) .fill-box.is-moving { pointer-events: auto; cursor: move; touch-action: none; border: 2px solid var(--lav) !important; border-radius: 4px; box-shadow: 0 0 0 3px var(--lav-glow) !important; }
/* Range band (asymmetric per direction), the designed spot and the
   see-through ghost of a non-text element — stage layer, never the bitmap. */
.fill-move-band, .fill-move-origin, .fill-move-ghost, .fill-move-readout { position: absolute; pointer-events: none; }
.fill-move-band { border: 1.5px dashed var(--lav); border-radius: 4px; background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--lav) 12%, transparent) 0 6px, transparent 6px 12px); box-shadow: 0 0 0 1px rgb(0 0 0 / .18); }
.fill-move-band.is-limit { animation: fill-move-limit 340ms var(--ease); }
@keyframes fill-move-limit { 0%, 40% { border-color: var(--rose); box-shadow: 0 0 0 3px color-mix(in oklab, var(--rose) 40%, transparent); } }
.fill-move-origin { border: 1.5px dashed color-mix(in oklab, var(--text-2) 75%, transparent); border-radius: 3px; }
.fill-move-ghost { opacity: .7; outline: 1.5px solid var(--lav); outline-offset: -1px; }
.fill-move-ghost.is-empty { opacity: 1; background: var(--lav-glow); }
.fill-move-band[hidden], .fill-move-origin[hidden], .fill-move-readout[hidden] { display: none; }
.fill-move-readout { z-index: 2; padding: 2px 8px; border-radius: 999px; background: var(--lav); color: var(--on-accent); font: 600 11px/18px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 2px 6px rgb(0 0 0 / .3); transform-origin: bottom left; transform: translateY(calc(-100% - 6px)) scale(calc(1 / var(--fill-zoom, 1))); }
.fill-form.fill-preview-on .fill-move-band, .fill-form.fill-preview-on .fill-move-origin, .fill-form.fill-preview-on .fill-move-readout { display: none; }
/* "Poloha" rows: popovers, sheet head, "Všechna pole", the chip. */
.fill-move-pos { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.fill-move-pos__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fill-move-pos__title { font-size: 12px; font-weight: 600; color: var(--text-2); }
.fill-move-pos__axis { display: grid; grid-template-columns: 92px auto minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.fill-move-pos__label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.fill-move-pos__field .form-control { padding-left: 10px; }
.fill-move-pos__hint { margin: 2px 0 6px 96px; font-size: 11px; color: var(--muted); }
.fill-move-pos.is-disabled { opacity: .5; }
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-sheet__head.is-in-sheet:has(.fill-sheet__move) { flex-wrap: wrap; }
.fill-sheet__move { flex: 1 0 100%; padding: 0 2px; }
.fill-sheet__move .fill-move-pos { margin-top: 4px; }
/* Move-mode chip: floats under the selected box (fixed, clamped). */
.fill-move-chip { position: fixed; z-index: 1150; width: 300px; max-width: calc(100vw - 16px); padding: 10px 12px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); color: var(--text); }
.fill-move-chip[hidden] { display: none; }
.fill-move-chip__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fill-move-chip__name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
.fill-move-chip__name .i { flex: none; color: var(--lav-ink); }
.fill-move-chip .fill-move-pos { margin-top: 8px; }
.fill-move-chip__hint { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
/* Group / document page: the move belongs to ONE size / page (M4). */
.fill-move-chip__scope { display: flex; align-items: center; gap: 4px; margin: 6px 0 0; font-size: 11px; color: var(--lav-ink); }
.fill-form.fill-preview-on .fill-move-chip { display: none; }
@media (max-width: 700px), (pointer: coarse) {
    .fill-move-pos__axis { grid-template-columns: 76px 44px minmax(0, 1fr) 44px; }
    .fill-move-pos__step { min-width: 44px; min-height: 44px; }
    .fill-move-pos__field .form-control { height: 40px; min-height: 40px; font-size: 16px; }
    .fill-move-pos__hint { margin-left: 80px; }
}
@media (max-width: 700px) {
    /* Bottom sheet like the image adjust panel. */
    .fill-move-chip { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; max-width: none; padding: 12px 14px 14px; border-radius: 18px; }
    .fill-move-chip__hint { display: none; }
}
