/* Scroll container around .canvas-stage: panning a zoomed-in canvas scrolls
   HERE, never the page — the left panel and the sticky toolbar stay put.
   Floating chrome clamps within this box because anything positioned outside
   it would be clipped by the overflow. */
.canvas-viewport {
    overflow: auto;
}

/* Editor app shell (lg+, where the panel/stage columns sit side by side):
   the PAGE itself does not scroll — its height is pinned to the window by
   canvas_zoom_controller, and the left panel + canvas viewport each scroll
   on their own. Sizing it in JS rather than calc(100vh - Npx) is deliberate:
   the title/breadcrumb block above wraps to arbitrary heights and the theme
   adds its own padding below, so the offset is not a constant. Without this
   the window keeps a second scrollbar next to the canvas one. */
@media (min-width: 992px) {
    /* Class set by canvas_zoom_controller while the shell fits the window: the
       page can then never scroll, so the canvas viewport owns the only
       scrollbar. body's overflow propagates to the viewport (html is visible),
       the same mechanism Bootstrap's modal-open uses. */
    body.editor-shell-page {
        overflow: hidden;
    }

    .editor-shell {
        display: flex;
        flex-direction: column;
    }

    /* The single-variant editor wraps its toolbar + columns in a <form>; the
       group editor has no form. Both reach .editor-shell-row either way. */
    .editor-shell > form {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    /* Toolbars / the group variant rail keep their natural height (flex items
       don't shrink below their content); the columns row takes the rest. */
    .editor-shell-row {
        flex: 1 1 auto;
        min-height: 0;
    }

    .editor-shell-row > [class*="col-"] {
        min-height: 0;
        max-height: 100%;
    }

    .editor-left-panel {
        overflow-y: auto;
    }

    /* Stage column: viewport takes the leftover height, the pointer-modifier
       hint stays pinned under it instead of scrolling away with the canvas. */
    .editor-stage-col {
        display: flex;
        flex-direction: column;
    }

    .editor-stage-col > .canvas-viewport {
        flex: 1 1 auto;
        min-height: 0;
    }
}

/* Below lg the columns stack and the page scrolls normally — the panel card
   sticks to the top of the page instead of scrolling in its own pane, clearing
   the sticky phone top bar `.mbar` (60px, shown ≤ 860px; nocturne/shell.css). */
@media (max-width: 991.98px) {
    .editor-left-panel-card {
        position: sticky;
        top: 64px;
        z-index: 999;
    }
}

.canvas-wrapper {
    display: inline-block;
    /* Top-align the inline-block (the .fill-stage rule): baseline-aligned, the
       stage's line box grows to the wrapper's INTERNAL baseline — Fabric's
       lower-canvas is an in-flow inline element, so that baseline sits at the
       UNSCALED canvas bottom (A4 = 3508px down) and the zoom controller's
       negative-margin compensation only trims space BELOW the baseline. */
    vertical-align: top;
    transform-origin: top left;
}

/* Floating element-anchored editing chrome (canvas_floating_toolbar_controller).
   .canvas-stage is the UNSCALED positioning context; .canvas-wrapper inside it
   is the only element the zoom transform scales. The toolbar/popovers/outlines
   are absolutely positioned within the stage so they never scale with the canvas. */
.canvas-stage {
    position: relative;
}

/* Print bleed zone (canvas_editor_controller#_renderStageGuides): a DOM overlay
   inside Fabric's container, which the zoom transform scales with the canvas.
   The red outline is the bleed edge (where the artwork must reach), the inner
   box the trim. The band between them is tinted (it gets cut off) on the
   canvas bitmap by canvas_viewport.js, under the selection handles — a DOM
   tint up here would wash them out. --bleed-line is 1 screen px at any zoom. */
.canvas-bleed-guide {
    position: absolute;
    /* left/top/width/height inline: the bleed box, inset by the pasteboard */
    z-index: 2;
    pointer-events: none;
    outline: var(--bleed-line, 1px) solid #e3342f;
    outline-offset: calc(-1 * var(--bleed-line, 1px));
}

.canvas-bleed-guide__trim {
    position: absolute;
    outline: var(--bleed-line, 1px) solid rgba(33, 37, 41, 0.6);
}

/* Selection border + transform handles (canvas_handles.js): an SVG in the
   unscaled stage — constant on-screen size, never clipped by the canvas
   element. Above outlines (900) / guides (940) / rulers (996-997), below
   snap chrome (1000) and the floating toolbar (1005). Only the handle shapes
   take the pointer; a press is forwarded to Fabric. */
.canvas-handles {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 998;
}

.canvas-handles--body {
    z-index: 950;
}

.canvas-handles__body {
    fill: transparent;
    pointer-events: all;
}

.canvas-handles__border {
    fill: none;
    stroke: #727cf5;
    stroke-width: 1.5px;
}

.canvas-handles__connector {
    stroke: #727cf5;
    stroke-width: 1.5px;
}

.canvas-handles__handle {
    fill: #fff;
    stroke: #727cf5;
    stroke-width: 1.5px;
    pointer-events: all;
}

.canvas-handles__handle:hover {
    fill: #e7e9fd;
}

/* While Fabric owns a transform, pin its cursor over the whole page. */
html.canvas-transforming,
html.canvas-transforming * {
    cursor: var(--canvas-transform-cursor) !important;
}

.canvas-mini-toolbar {
    position: absolute;
    z-index: 1005;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
    white-space: nowrap;
}

.canvas-mini-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 7px;
    line-height: 1;
    background: transparent;
    color: var(--text);
    transition: background-color .12s ease, color .12s ease;
}

.canvas-mini-toolbar .btn i {
    font-size: 1.05rem;
}

.canvas-mini-toolbar .btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

.canvas-mini-toolbar .btn.active {
    background: rgba(114, 124, 245, 0.16);
    color: #727cf5;
}

.canvas-mini-toolbar .btn.text-danger:hover {
    background: rgba(250, 92, 124, 0.14);
}

.canvas-mini-toolbar-sep {
    align-self: stretch;
    width: 1px;
    margin: 4px 3px;
    background: var(--line-2);
}

/* "Přidat tvar" picker (left panel dropdown): an icon grid rather than a list
   of menu items — a shape is recognised by its silhouette long before its
   name is read, and three per row keeps the menu narrower than the panel. */
.shape-picker {
    min-width: 15rem;
}

.shape-picker__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.shape-picker__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: .7rem;
    line-height: 1.1;
    text-align: center;
    transition: background-color .12s ease, border-color .12s ease;
}

.shape-picker__item i {
    font-size: 1.35rem;
    line-height: 1;
}

.shape-picker__item:hover,
.shape-picker__item:focus-visible {
    background: rgba(114, 124, 245, 0.12);
    border-color: rgba(114, 124, 245, 0.35);
    color: #727cf5;
}

/* Scoped under .canvas-stage so `position: absolute` outranks the Hyper theme's
   `.card { position: relative }` (the popover is also a .card, and the theme CSS
   loads AFTER app.css — equal specificity would let the theme win and drop the
   popover to its static position at the bottom of the page). */
.canvas-stage .canvas-floating-popover {
    position: absolute;
    z-index: 1006;
    width: 360px;
    max-width: 92vw;
    max-height: 80vh;
    overflow-y: auto;
    /* Never scroll horizontally — a long <option> label (e.g. a verbose font
       family name) sizes the <select> to its widest option and would otherwise
       force a horizontal scrollbar (overflow-y:auto makes overflow-x compute to
       auto too). The control rule below caps every field at the popover width. */
    overflow-x: hidden;
    margin: 0;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

/* Keep every form control inside the popover width so it truncates instead of
   overflowing (the <select> renders its own ellipsis + arrow when capped). */
.canvas-stage .canvas-floating-popover .form-select,
.canvas-stage .canvas-floating-popover .form-control {
    max-width: 100%;
    min-width: 0;
}

/* Drag grip in the popover title: lets the user nudge the popover aside when it
   covers the element it edits. Shared look with the fill-page grip below. */
.canvas-popover-drag,
.fill-popover__drag {
    flex: 0 0 auto;
    cursor: move;
    opacity: 0.45;
    touch-action: none;
    transition: opacity .12s ease;
}

.canvas-popover-drag:hover,
.fill-popover__drag:hover,
.canvas-popover-drag.is-dragging,
.fill-popover__drag.is-dragging {
    opacity: 0.85;
}

/* Drag & drop cursor contract: every drag handle / draggable row shows
   `move`, never `pointer`. The grips carry role="button" (a11y) and the
   theme's reboot `[role=button] { cursor: pointer }` loads AFTER app.css at
   equal specificity, so the plain class rules above lose — re-assert one level
   deeper. The editor's layer rows are draggable as a whole, but their main
   part is a <button> (reboot: pointer). While a SortableJS drag is running
   (sort_drag_cursor.js flags <html>), the cursor stays `move` over anything
   the pointer crosses. */
[role="button"][data-popover-drag-handle],
[role="button"][data-fill-field-order-handle],
.canvas-layer-row .canvas-layer-row__main,
.canvas-layer-row .canvas-layer-row__grip {
    cursor: move;
}

html.is-sort-dragging,
html.is-sort-dragging * {
    cursor: move !important;
}

.editable-outline {
    position: absolute;
    z-index: 900;
    pointer-events: none;
    border: 1.5px dashed #727cf5;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* Captions on, frames off: the element still carries the name tag and still
   rides the after:render positioning loop — only the frame stops painting. */
.editable-outline--frameless {
    border-color: transparent;
    box-shadow: none;
}

/* Field-name tag inside a highlight outline (same look as the fill page's
   .fill-box__name), so the designer sees which input each box is. Its own
   top-bar switch (#caption-visible-control) — the tag sits over the top of
   every element, which is exactly what a composition review does not want. */
.editable-outline__name {
    position: absolute;
    top: 0;
    left: 0;
    max-width: calc(100% - 4px);
    padding: 1px 5px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: #727cf5;
    border-radius: 0 0 3px 0;
    pointer-events: none;
}

/* Smart-guide chrome (canvas_snapping_controller): magenta alignment lines +
   gap badges + `=` equal-spacing marks. Plain DOM in the unscaled stage layer,
   like .editable-outline — shown only mid-drag, never on the canvas bitmap, so
   they can't leak into the saved preview or the server PNG export. Above the
   outlines, below the floating toolbar (z 1005). Never intercept the drag. */
.snap-guide {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
    background: #f24bb0;
}

.snap-guide--v {
    width: 1px;
    transform: translateX(-0.5px);
}

.snap-guide--h {
    height: 1px;
    transform: translateY(-0.5px);
}

.snap-badge {
    position: absolute;
    z-index: 1001;
    pointer-events: none;
    transform: translate(-50%, -50%);
    padding: 1px 5px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: #f24bb0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Equal-spacing mark: a bolder `=` chip so an even rhythm reads at a glance. */
.snap-badge--eq {
    min-width: 16px;
    text-align: center;
    font-size: 12px;
}

/* Photoshop-style rulers + guides (canvas_rulers_controller). The bars are 2D
   <canvas> elements in the unscaled stage layer; .has-rulers reserves a gutter
   for them so they never cover the artwork. Guides are DOM lines with a wider
   transparent hit strip (grabbable), all export-invisible by construction. */
.canvas-stage.has-rulers {
    padding-top: 23px;
    padding-left: 23px;
}

.canvas-ruler {
    position: absolute;
    z-index: 996;
    background: #fafbfe;
    border: 1px solid #e3e6ef;
    user-select: none;
}

.canvas-ruler--h {
    border-left: 0;
    cursor: row-resize;
}

.canvas-ruler--v {
    border-top: 0;
    cursor: col-resize;
}

.canvas-ruler-corner {
    position: absolute;
    z-index: 997;
    background: #fafbfe;
    border: 1px solid #e3e6ef;
}

/* A guide: 7px invisible hit strip centered on a 1px cyan line (the span
   child). Sits under the snap chrome (z 1000) so magenta feedback wins. */
.canvas-guide {
    position: absolute;
    z-index: 940;
}

.canvas-guide--v {
    width: 7px;
    transform: translateX(-3.5px);
    cursor: col-resize;
}

.canvas-guide--h {
    height: 7px;
    transform: translateY(-3.5px);
    cursor: row-resize;
}

.canvas-guide > span {
    position: absolute;
    pointer-events: none;
    background: rgba(0, 184, 216, 0.85);
}

.canvas-guide--v > span {
    left: 3px;
    top: 0;
    width: 1px;
    height: 100%;
}

.canvas-guide--h > span {
    top: 3px;
    left: 0;
    height: 1px;
    width: 100%;
}

.canvas-guide:hover > span,
.canvas-guide.is-dragging > span {
    background: #00b8d8;
    box-shadow: 0 0 0 0.5px rgba(0, 184, 216, 0.35);
}

/* Dragged outside the canvas = will be deleted on release. */
.canvas-guide.is-deleting > span {
    background: rgba(250, 92, 124, 0.9);
}

/* Live position chip next to the cursor while dragging a guide. */
.canvas-guide-badge {
    position: absolute;
    z-index: 1010;
    pointer-events: none;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #fff;
    background: #37404a;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Axis-lock cursor everywhere while a guide drag is in flight. */
body.is-dragging-guide-v,
body.is-dragging-guide-v * { cursor: col-resize !important; }
body.is-dragging-guide-h,
body.is-dragging-guide-h * { cursor: row-resize !important; }

/* Hovering a row in the layers panel (canvas_layers_controller) highlights the
   object on the stage — a stronger, filled sibling of .editable-outline. */
.layer-hover-outline {
    position: absolute;
    z-index: 901;
    pointer-events: none;
    border: 2px solid #727cf5;
    border-radius: 2px;
    background: rgba(114, 124, 245, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* Layers panel (canvas_layers_controller): compact Photoshop-style rows in the
   left card — topmost object first. Rows are drag-sortable (SortableJS,
   fallback mode reusing the shared .gu-mirror / .gu-transit drag classes). */
.canvas-layers-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 42vh;
    overflow-y: auto;
    margin: 0 -0.4rem;
    padding: 0 0.4rem;
}

.canvas-layer-row {
    display: flex;
    align-items: stretch;
    gap: 2px;
    border-radius: 6px;
    color: var(--text);
    transition: background-color .12s ease, color .12s ease;
}

.canvas-layer-row:hover {
    background: rgba(0, 0, 0, 0.05);
}

.canvas-layer-row.is-active {
    background: rgba(114, 124, 245, 0.14);
    color: #727cf5;
}

/* The background layer of a layer-mode variant: visually distinct (tint +
   colored icon) so it always reads as "the background", yet an ordinary,
   freely reorderable row like any other layer. */
.canvas-layer-row--background {
    background: rgba(57, 175, 209, 0.10);
    border: 1px dashed rgba(57, 175, 209, 0.45);
}

.canvas-layer-row--background:hover {
    background: rgba(57, 175, 209, 0.18);
}

.canvas-layer-row--background .canvas-layer-row__icon {
    color: #39afd1;
}

/* Layer-mode variants may have no background at all — a checkerboard behind
   the (transparent) canvas element makes that state visible in the editor,
   like every raster editor does. Any background layer paints over it.
   The checkerboard belongs to the BOTTOM surface only: the fill page's echo
   canvas (a Fabric StaticCanvas, so it carries `lower-canvas` too, and a
   direct child of the same wrapper) is an overlay ABOVE the fill canvas —
   with the checkerboard it turned into an opaque sheet the moment it became
   visible, hiding the whole preview while the user typed (2026-09-08). The
   text branch's echo base gets it instead of the hidden settle img. */
.canvas-wrapper--transparent canvas.lower-canvas:not(.fill-echo-canvas),
.canvas-wrapper--transparent > canvas:not(.fill-echo-canvas),
.fill-preview-img--transparent,
.fill-echo-base--transparent {
    background-image:
        linear-gradient(45deg, #e4e7ec 25%, transparent 25%, transparent 75%, #e4e7ec 75%),
        linear-gradient(45deg, #e4e7ec 25%, transparent 25%, transparent 75%, #e4e7ec 75%);
    background-color: #f8f9fb;
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}

.canvas-layer-row__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px 4px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    text-align: left;
}

.canvas-layer-row__main:focus-visible {
    outline: 2px solid #727cf5;
    outline-offset: -2px;
}

.canvas-layer-row__icon {
    flex: 0 0 auto;
    font-size: 0.95rem;
    opacity: 0.75;
    line-height: 1;
}

.canvas-layer-row__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Padlock, same restraint as the eye: barely there until hovered, full
   strength once the layer is actually locked (that is the state worth
   noticing at a glance). */
.canvas-layer-row__lock {
    flex: 0 0 auto;
    align-self: center;
    padding: 2px 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.45;
}

.canvas-layer-row__lock:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.07);
}

.canvas-layer-row__lock:focus-visible {
    outline: 2px solid #727cf5;
    outline-offset: -2px;
    opacity: 1;
}

.canvas-layer-row--locked .canvas-layer-row__lock {
    opacity: 0.9;
}

/* Photoshop-style visibility eye. Subtle until hovered/hidden so the panel
   stays calm; a hidden row dims as a whole (the eye keeps full opacity as
   the affordance to un-hide). */
.canvas-layer-row__eye {
    flex: 0 0 auto;
    align-self: center;
    padding: 2px 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.45;
}

.canvas-layer-row__eye:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.07);
}

.canvas-layer-row__eye:focus-visible {
    outline: 2px solid #727cf5;
    outline-offset: -2px;
    opacity: 1;
}

.canvas-layer-row--hidden .canvas-layer-row__main,
.canvas-layer-row--hidden .canvas-layer-row__grip {
    opacity: 0.4;
}

.canvas-layer-row--hidden .canvas-layer-row__eye {
    opacity: 0.8;
}

/* Drag affordance at the row's right edge (the whole row is draggable). */
.canvas-layer-row__grip {
    flex: 0 0 auto;
    align-self: center;
    margin-right: 4px;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.3;
    cursor: grab;
}

.canvas-layer-row:hover .canvas-layer-row__grip {
    opacity: 0.7;
}

/* The cursor-following drag mirror (SortableJS fallback clone, .gu-mirror
   adds the fixed positioning): give the detached row a card so it reads as
   "picked up" over any backdrop. */
.canvas-layer-row.gu-mirror {
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

/* Container ("smart text area") zone overlay (canvas_container_controller).
   Plain DOM in the unscaled stage layer — like .editable-outline it never
   touches the canvas bitmap, so it can't leak into thumbnails or exports.
   The zone itself is click-through; only the label + resize handle are
   interactive. */
/* Zones are DEPTH-COLOR-CODED: the container controller stamps --zone-color /
   --zone-tint per zone (root cyan, child violet, grandchild green, cycled) so
   parent and child containers never read as the same box. The legacy cyan
   stays as the var fallback. */
.container-zone {
    position: absolute;
    z-index: 899;
    pointer-events: none;
    border: 1.5px dashed var(--zone-color, #39afd1);
    border-radius: 3px;
    background: var(--zone-tint, rgba(57, 175, 209, 0.04));
}

/* Top-bar switch (#container-zones-control): hide the zone chrome entirely.
   A class rather than inline styles because _positionZones() rewrites
   `zone.style.display` on every render frame; clearing that inline value is
   what lets this rule through. Definitions are untouched — the design still
   reflows and the Kontejnery panel still lists them. */
.container-zones-off .container-zone {
    display: none;
}

/* Hovering a zone's label lifts the whole zone above colliding siblings so
   its icon row is reachable even when two containers share a top edge. */
.container-zone--raise {
    z-index: 930;
}

/* Panel-row hover: the hovered container's zone pops, everything else fades —
   the overlapping-chrome escape hatch driven from the Kontejnery panel. */
.container-zones-dim .container-zone {
    opacity: 0.15;
}

.container-zones-dim .container-zone--focus {
    opacity: 1;
    z-index: 931;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 12px rgba(0, 0, 0, 0.25);
}

.container-zone--overflow {
    border-color: #fa5c7c;
    background: rgba(250, 92, 124, 0.06);
}

/* The label doubles as the MOVE handle for the whole container (members are
   dragged individually on the canvas itself). */
.container-zone__label {
    position: absolute;
    top: -20px;
    left: -1.5px;
    padding: 1px 6px;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    color: #fff;
    background: var(--zone-color, #39afd1);
    border-radius: 3px 3px 0 0;
    pointer-events: auto;
    cursor: move;
    user-select: none;
}

.container-zone--overflow .container-zone__label {
    background: #fa5c7c;
}

/* Removes the container definition (texts stay). Sits next to the label. */
.container-zone__delete {
    position: absolute;
    top: -20px;
    right: -1.5px;
    padding: 1px 7px;
    border: none;
    font-size: 12px;
    line-height: 1.3;
    color: #fff;
    background: var(--zone-color, #39afd1);
    border-radius: 3px 3px 0 0;
    pointer-events: auto;
    cursor: pointer;
}

.container-zone__delete:hover {
    background: #fa5c7c;
}

.container-zone--overflow .container-zone__delete {
    background: #fa5c7c;
}

.container-zone__handle {
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 44px;
    height: 10px;
    margin-left: -22px;
    border-radius: 5px;
    background: var(--zone-color, #39afd1);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.8);
    cursor: ns-resize;
    pointer-events: auto;
}

.container-zone--overflow .container-zone__handle {
    background: #fa5c7c;
}

/* Width handles: resizing the container rescales the member textboxes'
   wrap widths, so the text re-wraps and the flow re-runs. */
.container-zone__side {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 44px;
    margin-top: -22px;
    border-radius: 5px;
    background: var(--zone-color, #39afd1);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.8);
    cursor: ew-resize;
    pointer-events: auto;
}

.container-zone__side--left {
    left: -6px;
}

.container-zone__side--right {
    right: -6px;
}

.container-zone--overflow .container-zone__side {
    background: #fa5c7c;
}

/* Nested container zone: hugs its content (no maxHeight box of its own — the
   outer container's bound is the contract), visually quieter than its parent
   so the hierarchy reads at a glance. */
.container-zone--nested {
    z-index: 900;
    border-style: dotted;
    border-color: var(--zone-color, #39afd1);
    background: var(--zone-tint, rgba(57, 175, 209, 0.02));
}

/* Nested chrome sits INSIDE the dotted box (root chrome sits above its top
   edge), so parent and child rows occupy different bands and never overlap
   even when the two boxes share a top edge. */
.container-zone--nested .container-zone__label {
    top: 2px;
    left: 2px;
    border-radius: 3px;
}

.container-zone--nested .container-zone__delete {
    top: 2px;
    right: 2px;
    border-radius: 3px;
}

/* Per-zone settings (⚙ → gap / max height popover). Sits left of the ×. */
.container-zone__settings,
.container-zone__duplicate {
    position: absolute;
    top: -20px;
    padding: 1px 6px;
    border: none;
    font-size: 11px;
    line-height: 1.5;
    color: #fff;
    background: var(--zone-color, #39afd1);
    border-radius: 3px 3px 0 0;
    pointer-events: auto;
    cursor: pointer;
}

.container-zone__settings {
    right: 22px;
}

/* Duplicates the container INCLUDING its objects. Sits left of the ⚙. */
.container-zone__duplicate {
    right: 46px;
}

.container-zone__settings:hover,
.container-zone__duplicate:hover {
    background: #2c8caa;
}

.container-zone--overflow .container-zone__settings,
.container-zone--overflow .container-zone__duplicate {
    background: #fa5c7c;
}

.container-zone--nested .container-zone__settings {
    top: 2px;
    right: 26px;
    border-radius: 3px;
}

.container-zone--nested .container-zone__duplicate {
    top: 2px;
    right: 50px;
    border-radius: 3px;
}

/* Kontejnery left-panel list (the Vrstvy pattern): depth-colored rows, hover
   drives the zone highlight + dim on the stage, click selects. */
.container-panel-list {
    max-height: 220px;
    overflow-y: auto;
}

.container-panel-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    font-size: 12px;
    cursor: pointer;
    border-left: 3px solid var(--zone-color, #39afd1);
    border-radius: 2px;
    user-select: none;
    min-width: 0;
}

.container-panel-row:hover {
    background: rgba(114, 124, 245, 0.08);
}

.container-zone-popover {
    position: absolute;
    z-index: 1001;
    width: 260px;
    /* The ⚙ popover grew (hide, nesting, repeatable row, move) — scroll
       inside instead of running off a short stage. */
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 14px 16px;
    /* Nocturne surface like the editor inspector popovers (F19: it kept the
       pre-redesign white background while its labels/inputs follow the theme). */
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: var(--shadow-3);
    pointer-events: auto;
}

.container-zone-popover__title {
    margin-bottom: 10px;
    padding-right: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.container-zone-popover .form-label {
    color: var(--text-2);
    font-weight: 500;
}

.container-zone-popover__close {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 0;
    border: none;
    background: none;
    font-size: 16px;
    line-height: 1;
    color: var(--subtle);
    cursor: pointer;
}

.container-zone-popover__close:hover {
    color: var(--text);
}

/* Repeatable rows (container-rows P3). Ghost outlines of rows 2…max sit in
   the same unscaled zone layer as the zones (never on the canvas bitmap):
   the default rows stronger, rows past what fits red. */
.container-row-ghost {
    position: absolute;
    z-index: 898;
    pointer-events: none;
    border: 1.5px dashed var(--zone-color, #9d71f7);
    border-radius: 3px;
    opacity: 0.45;
    background: repeating-linear-gradient(
        -45deg,
        transparent 0 6px,
        rgba(157, 113, 247, 0.05) 6px 12px
    );
}

.container-row-ghost--default {
    opacity: 0.8;
}

.container-row-ghost--over {
    opacity: 0.85;
    border-color: #fa5c7c;
    background: repeating-linear-gradient(
        -45deg,
        transparent 0 6px,
        rgba(250, 92, 124, 0.08) 6px 12px
    );
}

.container-row-ghost__label {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 0 5px;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
    color: #fff;
    background: var(--zone-color, #9d71f7);
    border-radius: 3px;
}

.container-row-ghost--over .container-row-ghost__label {
    background: #fa5c7c;
}

/* The bound the rows run into: the root's max height (or the page bottom
   less spaceAfter), drawn across the row. */
.container-row-limit {
    position: absolute;
    z-index: 902;
    height: 0;
    pointer-events: none;
    border-top: 2px solid #fa5c7c;
}

.container-row-limit__label {
    position: absolute;
    left: 0;
    bottom: 2px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
    color: #fff;
    background: #fa5c7c;
    border-radius: 3px;
}

.container-zones-off .container-row-ghost,
.container-zones-off .container-row-limit,
.container-zones-dim .container-row-ghost,
.container-zones-dim .container-row-limit {
    display: none;
}

/* A row whose max does not fit: the badge says so in the warning colour. */
.container-zone--row-short .container-zone__label {
    background: #fa5c7c;
}

.container-panel-row__badge {
    margin-left: auto;
    flex: none;
    font-size: 11px;
    color: var(--text-2);
}

.container-repeat {
    padding-top: 8px;
    border-top: 1px solid var(--line-2);
}

.container-repeat__fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 4px;
}

.container-repeat__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--text-2);
    font-weight: 500;
}

.container-repeat__field > span {
    font-size: 11px;
    line-height: 1.2;
}

.container-repeat__blocked {
    color: var(--subtle);
    font-style: italic;
}

.container-repeat__warn {
    margin-top: 4px;
    color: #fa5c7c;
}

/* ---- User-fill placeholder overlay (variant_fill_overlay_controller) ----
   Click-into-preview editing: each placeholder shows an always-visible icon
   cluster (pencil = edit, eye = hide) over the preview. The highlight toggle
   controls ONLY the dashed border. Text edits in a floating popover; image
   picking in a gallery modal.

   Progressive enhancement: the BASE rules (no `.fill-js`) render the popovers as
   a plain stacked, editable list and hide the boxes, so a JS failure never
   strands the user. The controller adds `.fill-js` on connect. */
/* Viewport around the stage. The controller caps its max-height to the visible
   area and picks a fit zoom where the WHOLE canvas fits inside, so by default
   nothing scrolls anywhere; only a manual zoom-in past fit pans in here.
   overscroll-behavior keeps that panning from chaining into a page scroll. */
.fill-viewport {
    overflow: auto;
    overscroll-behavior: contain;
}

/* JS mode (single page): fill_viewport.js pans/zooms the stage with ONE
   transform inside a viewport that never scrolls natively — so nothing in the
   stage (a design-size layer, a frame bleeding off the canvas, chrome hanging
   past an edge) can widen a scroll range. The controller sets the height
   (the stage is out of flow); the pan clamp keeps the canvas in view. */
.fill-viewport.fill-viewport--pan {
    position: relative;
    overflow: hidden;
    /* clip = not a scroll container at all (no programmatic scroll on focus). */
    overflow: clip;
    /* Fit zoom: the page keeps its native touch scrolling. Zoomed past fit
       (.is-pannable) every touch gesture is ours — one finger pans, two pinch. */
    touch-action: pan-x pan-y;
}

.fill-viewport.fill-viewport--pan.is-pannable {
    touch-action: none;
}

.fill-viewport.fill-viewport--pan > .fill-stage {
    position: absolute;
    top: 0;
    left: 0;
}

.fill-viewport--pan.is-grab,
.fill-viewport--pan.is-grab * {
    cursor: grab !important;
}

.fill-viewport--pan.is-grabbing,
.fill-viewport--pan.is-grabbing * {
    cursor: grabbing !important;
}

/* Position bars: thin, non-interactive, fade in only while panning. */
.fill-viewport__bar {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}

.fill-viewport__bar[hidden] {
    display: none;
}

.fill-viewport--pan.is-panning .fill-viewport__bar {
    opacity: 1;
    transition-duration: .08s;
}

.fill-viewport__bar--x {
    left: 8px;
    right: 14px;
    bottom: 4px;
    height: 5px;
}

.fill-viewport__bar--y {
    top: 8px;
    bottom: 14px;
    right: 4px;
    width: 5px;
}

.fill-viewport__thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgb(20 20 30 / .45);
    box-shadow: 0 0 0 1px rgb(255 255 255 / .35);
}

.fill-stage {
    position: relative;
    display: inline-block;
    /* Top-align the inline-block: sitting on the text baseline would add the
       line box's descender space below it — a few phantom pixels that turn
       into a needless scrollbar in the exactly-fitted viewport. */
    vertical-align: top;
    max-width: 100%;
}

/* JS mode: the fit/zoom transform owns ALL fitting, so the responsive clamps
   must not fight it — a shrink-to-fit-clamped stage makes zooming in shrink
   the layout box instead of growing the artwork (self-cancelling zoom). The
   base max-widths above/below stay for the no-JS fallback. */
.fill-form.fill-js .fill-stage {
    max-width: none;
}

.fill-preview-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.fill-form.fill-js .fill-preview-img {
    max-width: none;
}

/* Client-side text echo: while the user types, the settle preview yields to
   the text-transparent base + the echo canvas stacked over it (both sized to
   the same displayed width, so the CSS zoom transform scales all three
   together). Hidden by default — the settle render is the truth at rest. */
.fill-echo-base,
.fill-echo-canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    visibility: hidden;
    pointer-events: none;
}

.fill-echo-base {
    width: 100%;
    height: auto;
}

.fill-echo-active .fill-echo-base,
.fill-echo-active .fill-echo-canvas {
    visibility: visible;
}

/* Text branch only: the settle img hides under the echo composite — the base
   may legitimately be transparent (layer-mode variants), so the settle text
   must not show through. The image branch keeps its fill canvas visible (it
   IS the composite there; only its sources swap). */
.fill-echo-active .fill-preview-img {
    visibility: hidden;
}

/* While the echo covers the typing, the "rendering" veil is noise — the user
   already sees their text; the settle lands silently underneath. Must out-
   rank `.fill-spinner.is-active` (same specificity, declared later), hence
   the `.is-active` here. */
.fill-echo-active .fill-spinner.is-active {
    display: none;
}

/* Base (no-JS) — the popovers render as a plain stacked, editable list under
   the preview. (The .fill-overlay itself only holds the boxes, hidden here.) */
.fill-popovers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fill-box {
    display: none;
    position: absolute;
    pointer-events: none;
    border: 1.5px dashed transparent;
    border-radius: 2px;
}

/* The icon cluster follows the "Zobrazit oblasti k vyplnění" toggle: shown with
   the highlight, hidden when it's off so the preview is clean (see the
   :not(.fill-highlight-on) rule below). */
.fill-box__tools {
    position: absolute;
    top: -14px;
    right: -14px;
    display: flex;
    gap: 4px;
    pointer-events: auto;
    /* The box scales with the artwork, but the tappable icon cluster must keep
       its default size at any zoom — counter-scale by the inverse of the stage
       zoom, anchored at the corner the cluster hangs from. */
    transform: scale(calc(1 / var(--fill-zoom, 1)));
    transform-origin: top right;
}

/* Edge-aware placement (toggled per box in the controller's reposition) so the
   cluster never hangs off the top of the canvas or past the right edge. */
.fill-box--tools-inside .fill-box__tools {
    top: 4px;
    right: 4px;
}

.fill-box--tools-left .fill-box__tools {
    right: auto;
    left: -14px;
    transform-origin: top left;
}

.fill-box--tools-left.fill-box--tools-inside .fill-box__tools {
    left: 4px;
}

.fill-box__tool {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #4a4a5a;
    line-height: 1;
    cursor: pointer;
    /* Dual ring (white + dark) so the badge reads on any artwork. */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1.5px rgba(0, 0, 0, 0.12);
    transition: filter .12s ease, background-color .12s ease, color .12s ease, transform .12s ease;
}

.fill-box__tool i {
    font-size: 1.05rem;
}

.fill-box__tool--edit {
    background: #727cf5;
    color: #fff;
}

.fill-box--image .fill-box__tool--edit {
    background: #0acf97;
}

/* Recolourable shapes: the palette badge in the theme's warning amber. */
.fill-box--shape .fill-box__tool--edit {
    background: #ffbc00;
    color: #313a46;
}

.fill-box__tool:hover {
    filter: brightness(0.96);
    transform: scale(1.06);
}

.fill-box__tool:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #727cf5, 0 2px 8px rgba(0, 0, 0, 0.35);
}

.fill-box__tool--hide.is-active {
    background: #fa5c7c;
    color: #fff;
}

/* JS-enhanced floating overlay.
   `overflow: clip` (NOT hidden, NOT visible): a placeholder whose designed
   frame runs off the canvas — the editor's "Prvky mimo plátno" case — gets a
   box that wide too, and an unclipped one inflates .fill-viewport's scrollable
   width, so the user could pan hundreds of px into empty space past the edge
   of the artwork. `hidden` would fix that but also eats the tool clusters,
   which hang 14 px outside the canvas by design; `clip` + a clip margin keeps
   them visible while contributing nothing to any ancestor's scroll extent
   (clip, unlike hidden, is not a scroll container). Old browsers fall back to
   `visible`, i.e. today's behaviour. */
.fill-form.fill-js .fill-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: clip;
    overflow-clip-margin: 20px;
}

.fill-form.fill-js .fill-popovers {
    display: contents;
}

.fill-form.fill-js .fill-box {
    display: block;
}

/* The highlight toggle controls ONLY the dashed border. */
.fill-form.fill-js.fill-highlight-on .fill-box--text {
    border-color: #727cf5;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* Container-overflow state: the affected boxes go red regardless of the
   highlight toggle — this is a validation signal, not a hint. */
.fill-form.fill-js .fill-box--overflow {
    border-color: #fa5c7c !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.fill-form.fill-js.fill-highlight-on .fill-box--image {
    border-color: #0acf97;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.fill-form.fill-js.fill-highlight-on .fill-box--shape {
    border-color: #ffbc00;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* Toggle off: hide the pencil/eye clusters too (all boxes, overflow included)
   so the preview is completely undisturbed. */
.fill-form.fill-js:not(.fill-highlight-on) .fill-box__tools {
    display: none;
}

/* "Náhled" (#fill-preview-toggle): a clean preview as if both switches were
   off and nothing overflowed — beats the overflow !important rule
   and the overflow tag. The overflow signal lives on in the alert + the group
   page's per-dimension header badge. */
.fill-form.fill-js.fill-preview-on .fill-box {
    border-color: transparent !important;
    background: none !important;
    box-shadow: none !important;
}

.fill-form.fill-js.fill-preview-on .fill-box__tools {
    display: none;
}

.fill-form.fill-js.fill-preview-on .fill-box .fill-box__name {
    opacity: 0;
}

/* Field-name tag INSIDE the box (never hanging outside like the container
   label, so neighbouring boxes' tags can't collide). Anchored to the top edge
   opposite the tool cluster — left by default, since the tools sit top-right —
   with the tool corner reserved so the name is NEVER hidden under the pencil.
   Shown/hidden by its OWN toggle, not the dashed border's. */
.fill-box__name {
    position: absolute;
    top: 0;
    left: 0;
    max-width: calc(100% - 68px);
    padding: 1px 5px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: #727cf5;
    border-radius: 0 0 3px 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease;
}

.fill-box--image .fill-box__name {
    background: #0acf97;
}

.fill-box--shape .fill-box__name {
    background: #ffbc00;
    color: #313a46;
}

/* Near the right edge the tool cluster flips to the LEFT (fill-box--tools-left);
   put the name on the right so the two never overlap. */
.fill-box--tools-left .fill-box__name {
    left: auto;
    right: 0;
    border-radius: 0 0 0 3px;
}

/* Own switch (#fill-captions-toggle), independent of the border toggle — and
   always visible for an overflowing member, which is a validation signal. */
.fill-form.fill-js.fill-captions-on .fill-box__name {
    opacity: 1;
}

.fill-form.fill-js .fill-box--overflow .fill-box__name {
    background: #fa5c7c;
    opacity: 1;
}

/* Fill-page body: the preview viewport (single page) / dimension grid (group
   page) as the one flex child taking the full width. It once shared the row
   with a "Vrstvy" panel (removed 2026-10-21); keep it a ROW — the column
   variant broke the phone fit zoom (shrink-to-fit width). */
.fill-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.fill-body .fill-viewport {
    flex: 1 1 auto;
    min-width: 0;
}

/* Fixed in viewport coordinates (the controller positions + clamps it fully
   on-screen). It lives OUTSIDE the zoom-scaled stage and the scrolling
   .fill-viewport, so no ancestor overflow or transform can ever clip it — and
   it needs no zoom counter-scale. */
.fill-form.fill-js .fill-popover {
    position: fixed;
    z-index: 1200;
    width: 280px;
    max-width: 92vw;
    margin: 0;
    display: none;
    pointer-events: auto;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.fill-form.fill-js .fill-popover.is-open {
    display: block;
}

/* Popover text field: an auto-growing textarea. The controller sets its height
   to scrollHeight on open + every input, so the whole entered value is always
   visible — no horizontal scroll, no manual drag handle. */
.fill-popover__input {
    resize: none;
    overflow: hidden;
    min-height: calc(1.5em + 0.5rem + 2px);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Rich text (WYSIWYG) popover ------------------------------------------ */

/* The toolbar needs more room than the plain text popover. */
.fill-form.fill-js .fill-popover--rich {
    width: 360px;
}

/* --- "Všechna pole" panel --------------------------------------------------
   The popovers container (.fill-popovers) has THREE presentations: the no-JS
   stacked list (base rules above), the JS floating mode (display: contents —
   each popover positions itself, image cards hidden) and the DOCKED panel:
   the very same container becomes a centred modal listing every text popover
   + image card as one stacked form. Same DOM, same editor instances — a
   WYSIWYG keeps its state across the switch — only the layout changes.
   z-order: above the page and the floating popovers (never open at the same
   time), BELOW the gallery pickers (.fill-modal 1300, Bootstrap's modal 1055)
   so picking from a docked image card opens the picker over the panel. */
.fill-panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.5);
}

.fill-form.fill-js.fill-panel-open .fill-panel-backdrop {
    display: block;
}

.fill-popovers__header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line-2);
}

/* Panel-only chrome: one card per image slot (thumb + picker button + eye,
   the group page adds its per-dimension placement rows). Floating mode has
   the box's pencil for that. */
.fill-form.fill-js .fill-popover--image {
    display: none;
}

.fill-form.fill-js.fill-panel-open .fill-popovers {
    display: flex;
    flex-direction: column;
    /* Roomy enough that the cards' shadows never touch. */
    gap: 0.75rem;
    position: fixed;
    top: 4vh;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-width: 94vw;
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1041;
    margin: 0;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.fill-form.fill-js.fill-panel-open .fill-popovers__header {
    display: flex;
}

.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 {
    position: static;
    display: block;
    width: auto;
    max-width: none;
    /* A flex item honours z-index even when static: the floating popovers'
       1200 painted the cards over the sticky panel header on scroll. */
    z-index: auto;
    /* Each field is its own card: a soft lift (not the floating popover's
       deep drop shadow) so the stack reads as separate rows on the white
       panel instead of hairline-bordered boxes melting into it. */
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
}


/* Floating-only bits of a popover (drag grip, Uložit, close): pointless in
   a stacked form. !important: the Uložit button carries Bootstrap's
   `d-inline-flex` utility, which is !important itself. */
.fill-form.fill-js.fill-panel-open .fill-popover__chrome {
    display: none !important;
}

/* Admin reorder handle of a "Všechna pole" field (fill_field_order_controller):
   only meaningful in the docked panel — the floating popovers sit at their
   boxes, so their order is invisible. */
.fill-popover__reorder {
    display: none;
    flex: 0 0 auto;
    cursor: move;
    opacity: 0.45;
    touch-action: none;
    font-size: 1.1rem;
    line-height: 1;
}

.fill-popover__reorder:hover {
    opacity: 0.9;
}

.fill-form.fill-js.fill-panel-open .fill-popover__reorder {
    display: inline-block;
}

.fill-form.fill-js.fill-panel-open .fill-popover.fill-popover--reorder-ghost {
    opacity: 0.4;
    outline: 2px dashed var(--bs-primary, #727cf5);
    outline-offset: -2px;
}

/* The popover's own hide eye — the panel row's hide control (a box has its
   own eye next to the pencil, so the floating popover hides it). */
.fill-popover__eye {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
}

.fill-popover__eye:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.fill-popover__eye.is-active {
    color: #fa5c7c;
    opacity: 1;
}

.fill-form.fill-js .fill-popover__eye {
    display: none;
}

.fill-form.fill-js.fill-panel-open .fill-popover__eye {
    display: inline-flex;
}

/* --- Container sheet (one pencil per container, 2026-11-09) ---------------
   The popovers container's THIRD presentation (see variant-fill-overlay
   `openSheet`): only one container's cards (`.is-in-sheet`, ordered by the
   controller with `order`) under that container's head + section headings,
   as a floating sheet the controller places beside the container box. The
   cards are the very same "Všechna pole" cards — no second editor. z-order:
   above the page, below the gallery pickers (like the panel) so a pick
   started from an image card opens over it. */
.fill-sheet__head,
.fill-sheet__section,
.fill-sheet__row-add {
    display: none;
}

.fill-form.fill-js.fill-sheet-open .fill-popovers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: 12px;
    left: 12px;
    width: min(440px, calc(100vw - 24px));
    max-height: min(680px, calc(100vh - 24px));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1045;
    margin: 0;
    pointer-events: auto;
}

.fill-form.fill-js.fill-sheet-open .fill-popovers > :not(.is-in-sheet) {
    display: none !important;
}

.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-sheet__head.is-in-sheet {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-sheet__section.is-in-sheet,
.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-sheet__row-add.is-in-sheet {
    display: flex;
    align-items: center;
}

/* Repeatable rows (container-rows P4): the rows a fill does not use are
   materialised but never shown — sheet sections, cards, hide toggles. Beats
   every presentation's display rule (floating, panel, sheet). */
.fill-form .fill-popovers > .is-row-inactive {
    display: none !important;
}

.fill-form.fill-js.fill-sheet-open .fill-popovers > .fill-popover.is-in-sheet {
    position: static;
    display: block;
    width: auto;
    max-width: none;
    margin-left: calc(var(--sheet-depth, 0) * 10px);
    /* A flex item honours z-index even when static: the floating popovers'
       1200 would paint every card over the sticky head. */
    z-index: auto;
}

.fill-form.fill-js.fill-sheet-open .fill-popover__chrome {
    display: none !important;
}

.fill-form.fill-js.fill-sheet-open .fill-popover.is-in-sheet .fill-popover__eye {
    display: inline-flex;
}

@media (max-width: 700px) {
    /* Phones: docked to the bottom edge like the pop-ups. The controller
       leaves left/top alone there; !important beats a stale inline value. */
    .fill-form.fill-js.fill-sheet-open .fill-popovers {
        left: 12px !important;
        right: 12px;
        top: auto !important;
        bottom: 12px;
        width: auto;
        max-height: 75vh;
    }
}

/* The container box: an outline around the whole block, its own tool
   cluster (pencil → sheet, eye when hidable). Never clickable itself — a
   picture under it stays draggable; the member boxes inside are. */
.fill-form.fill-js .fill-box--container {
    pointer-events: none;
}

/* Members of a one-pencil container: no tools of their own; with the areas
   shown, a click opens the container sheet at that field. */
.fill-form.fill-js.fill-highlight-on:not(.fill-preview-on) .fill-box--sheet-member {
    pointer-events: auto;
    cursor: pointer;
}

/* …except an IMAGE slot member (plan P2a): its box lies over the picture,
   and the picture owns the pointer — drag / select for the adjust panel on
   the single page, the ghost on the group page. The sheet stays reachable
   through the container's pencil. */
.fill-form.fill-js.fill-highlight-on:not(.fill-preview-on) .fill-box--image.fill-box--sheet-member {
    pointer-events: none;
    cursor: auto;
}

.fill-image-card__thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.25rem;
    background-color: #f6f7fb;
    background-size: cover;
    background-position: center;
}

/* A fill SURFACE (one preview of one dimension) — the overlay's boxes are
   absolutely positioned inside it. The single page's .fill-stage is one;
   the group page wraps each dimension's preview frame in one. */
.fill-surface {
    position: relative;
}

/* The contenteditable editing surface. Grows with content (no fixed height);
   single visual line by default, wraps like the exported textbox. */
.fill-richtext-editor {
    min-height: calc(1.5em + 0.5rem + 2px);
    height: auto;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    cursor: text;
}

.fill-richtext-editor:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Placeholder hint while empty (contenteditable has no placeholder attr). */
.fill-richtext-editor:empty::before {
    content: "Zadejte text\2026";
    color: var(--muted);
    pointer-events: none;
}

.fill-richtext-toolbar__font {
    width: auto;
    max-width: 11rem;
    flex: 1 1 auto;
}

/* Color chips: brand swatches + the "default" and free-picker chips. */
.fill-richtext-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
}

.fill-richtext-swatch:hover {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35);
}

/* Selected chip (admin editor: the textbox's current fill). */
.fill-richtext-swatch.is-active {
    box-shadow: 0 0 0 2px #727cf5;
}

/* "Default color" chip: white with a diagonal strike = inherit designed color. */
.fill-richtext-swatch--auto {
    background:
        linear-gradient(to top right, transparent 44%, #dc3545 46%, #dc3545 54%, transparent 56%),
        #fff;
}

/* Free-picker chip: rainbow ring wrapping a visually-hidden <input type=color>
   so the native picker opens on click. */
.fill-richtext-swatch--custom {
    background: conic-gradient(#f44, #fb0, #4c4, #19d, #b3f, #f44);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.fill-richtext-swatch__input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
}

/* Live-preview spinner overlay. No z-index: DOM order (preview < spinner <
   overlay) keeps it above the preview but below the icons + open popover, so it
   never covers the field the user is typing in. */
.fill-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.fill-spinner.is-active {
    display: flex;
}

/* Self-contained spinner (no dependency on the theme's .spinner-border): a white
   badge with a CSS-keyframe ring, centered over the preview. */
.fill-spinner__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.fill-spinner__icon {
    display: block;
    width: 32px;
    height: 32px;
    border: 4px solid rgba(114, 124, 245, 0.25);
    border-top-color: #727cf5;
    border-radius: 50%;
    animation: fill-spinner-rotate 0.7s linear infinite;
}

@keyframes fill-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Image gallery modal (controller-managed; no Bootstrap JS dependency). */
.fill-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
}

.fill-modal.is-open {
    display: flex;
}

.fill-modal__dialog {
    width: 640px;
    max-width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    padding: 1rem 1.25rem;
}

.manual-preview-color {
    text-align: center;
    color: #fff;
    min-height: 600px;
    padding: 40px 0;
}

.manual-font {
    word-wrap: anywhere;
}

.manual-image-wrapper {
    text-align: center;
    position: relative;
}

/* Logo size in a manual card = the default × `--logo-scale` ("Šířka loga v
   manuálu", % of the DEFAULT size, set inline by _manual_logo_image.html.twig;
   absent = 1). The default is "as wide as the card, height capped at
   --logo-cap"; scaling BOTH the width and the cap scales the visible logo
   exactly, whatever its aspect ratio (the SVG letterboxes inside the box).
   The width factor stops at 1, so growing is clamped to the frame.
   Each card type sets only its cap — never `max-height` on the img. */
.manual-image-wrapper {
    --logo-cap: 200px;
}

.manual-image-wrapper.manual-image-horizontal,
.manual-image-wrapper.manual-image-vertical-big {
    --logo-cap: 120px;
}

.manual-image-wrapper img {
    max-height: calc(var(--logo-cap) * var(--logo-scale, 1));
    max-width: 100%;
    width: calc(100% * min(var(--logo-scale, 1), 1));
}

/* Equal-height logo cards.
   Horizontal / square cards are laid out in 2-column grids, but each card used
   to size to its own logo, so columns drifted out of alignment (logos have
   different aspect ratios). Give every card of a type one fixed height and
   center the logo inside it, so neighbouring columns always line up.
   Height = image max-height cap + wrapper padding (72px/side) + border (1px/side),
   so the tallest possible logo still fits (never clipped) and shorter logos are
   centered with even whitespace. Applies to every manual (backward compatible
   + future proof); protected-zone / vertical-big variants keep their own sizing. */
.manual-image-wrapper.manual-image-horizontal,
.manual-image-wrapper.manual-image-square {
    display: flex;
    align-items: center;
    justify-content: center;
}

.manual-image-wrapper.manual-image-horizontal {
    min-height: 266px;
}

.manual-image-wrapper.manual-image-square {
    min-height: 346px;
}

.manual-image-wrapper.manual-image-square-symbol {
    height: 416px;
}

/* Per-slug fixed logo widths in the protective zone (no such manual on prod
   as of 2026-11-09; kept working): they set the zone's logo width variable,
   so the white area and the 1/3 zone still follow the logo. */
.manual-kozelsky-koupelny-logomanual .manual-image-vertical-big.protected-zone-wrapper img {
    --pz-w: calc(400px * var(--logo-scale, 1));
}

.manual-kozelsky-koupelny-logomanual .manual-image-symbol.protected-zone-wrapper img {
    --pz-w: calc(110px * var(--logo-scale, 1));
}

.manual-kozelsky-koupelny-logomanual .manual-image-vertical.protected-zone-wrapper img {
    --pz-w: calc(400px * var(--logo-scale, 1));
}

.manual-page {
    margin-bottom: 50px;
}

/* Protective zone ("Ochranná zóna", reworked 2026-11-09 — LogoScale::protectedZone()
   is the contract). The white logo area hugs the logo edge to edge and the
   grey zone around it is 1/3 of the logo HEIGHT on every side.

   Markup (manual_preview.html.twig): frame > grey div.p-5 > white div > img.
   Both divs used to shrink-wrap the <img>, whose box for a viewBox-only SVG
   is the 300 px default object width — so the white area was wider than the
   logo (white bands), the zone was a fixed 72 px, and since the logo width
   was a % of that same shrink-wrapped box, a scale above 100 % could never
   grow it. Now everything lives on the img itself:
   - its CONTENT box is the logo: width --pz-w, height auto (the SVG's own
     ratio), white background clipped to the content box;
   - its PADDING is the zone: --pz-w / ratio / 3, transparent, so the grey
     div shows through (its own padding and the white div's background are
     neutralised);
   - --pz-w = default × scale, clamped so logo + both side zones fit the
     frame (--pz-fit, container units on the frame); default = the card's
     height cap (--logo-cap) × ratio, at most 2/3 of --pz-fit so the
     half-width cards can still grow to 150 %.
   --logo-ratio (width / height) comes from the partial (LogoAspectRatio);
   without it the zone falls back to a square logo's. */
.protected-zone-wrapper {
    container-type: inline-size;
}

.protected-zone-wrapper > .p-5 {
    padding: 0 !important;
}

.protected-zone-wrapper > .p-5 > div {
    background: transparent !important;
}

.protected-zone-wrapper img {
    --pz-ratio: var(--logo-ratio, 1);
    --pz-fit: calc(100cqw * 3 * var(--pz-ratio) / (3 * var(--pz-ratio) + 2));
    --pz-default: min(calc(var(--logo-cap) * var(--pz-ratio)), calc(var(--pz-fit) * 2 / 3));
    --pz-w: min(calc(var(--pz-default) * var(--logo-scale, 1)), var(--pz-fit));
    display: block;
    box-sizing: content-box;
    width: var(--pz-w);
    height: auto;
    max-width: none;
    max-height: none;
    padding: calc(var(--pz-w) / var(--pz-ratio) / 3);
    background: #ffffff content-box;
}

/* The card's buttons (download top-right, width pencil top-left) would land
   on the logo now that the zone box is tight — hang them just outside it,
   in the frame's padding. */
.protected-zone-wrapper > .p-5 > div > .dropdown.position-absolute {
    top: 0 !important;
    right: auto !important;
    left: calc(100% + 8px) !important;
}

.protected-zone-wrapper .manual-logo-width-edit {
    top: 0;
    left: auto;
    right: calc(100% + 8px);
}

/* The zone labels sit in the zone, sized in % of the zone box (= the img's
   border box): the top / bottom zone is exactly 20 % of its height (H/3 of
   5H/3); the side zones are as wide as that (aspect-ratio 1). */
.protected-zone-top,
.protected-zone-bottom,
.protected-zone-left,
.protected-zone-right {
    position: absolute;
    display: flex;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.protected-zone-top,
.protected-zone-bottom {
    border-left: 1px solid #ffffff;
    left: 30%;
    right: 0;
    height: 20%;
    align-items: center;
    padding-left: 10px;
    /* a narrow logo's zone box is narrow — wrap rather than run off the grey */
    white-space: normal;
}

.protected-zone-top {
    top: 0;
}

.protected-zone-bottom {
    bottom: 0;
}

.protected-zone-left,
.protected-zone-right {
    border-bottom: 1px solid #ffffff;
    top: 30%;
    height: 20%;
    aspect-ratio: 1;
    align-items: flex-end;
    justify-content: center;
}

.protected-zone-left {
    left: 0;
}

.protected-zone-right {
    right: 0;
}

.with-width-info {
    padding-top: 35px;
}

.logo-width-info {
    position: absolute;
    top: -38px;
    left: 0;
    text-align: center;
    border-bottom: 2px solid #ccc;
    width: 100%;
    font-weight: bold;
}

.logo-width-info::before {
    content: "";
    width: 2px;
    height: 10px;
    position: absolute;
    background: #ccc;
    left: -2px;
    bottom: -6px;
}

.logo-width-info::after {
    content: "";
    width: 2px;
    height: 10px;
    position: absolute;
    background: #ccc;
    right: -2px;
    bottom: -6px;
}


.with-height-info {
    padding-left: 100px;
}

.logo-height-info {
    position: absolute;
    left: -100px;
    text-align: center;
    border-right: 2px solid #ccc;
    width: 85px;
    height: 100%;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}


.logo-height-info::before {
    content: "";
    height: 2px;
    width: 10px;
    position: absolute;
    background: #ccc;
    top: -2px;
    right: -6px;
}

.logo-height-info::after {
    content: "";
    height: 2px;
    width: 10px;
    position: absolute;
    background: #ccc;
    bottom: -2px;
    right: -6px;
}

/* Weekly menu planner / meal pages: moved to assets/styles/nocturne/weekly-menu.css (P9). */

/* Dragula drag and drop styles */
.gu-mirror {
    position: fixed !important;
    margin: 0 !important;
    z-index: 9999 !important;
    opacity: 0.8;
    pointer-events: none;
}

.gu-hide {
    display: none !important;
}

.gu-unselectable {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.gu-transit {
    opacity: 0.4;
}


/* Project image gallery — drag & drop upload dropzone */
.gallery-dropzone {
    border: 2px dashed var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--bs-tertiary-bg, #f8f9fa);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.gallery-dropzone:hover,
.gallery-dropzone:focus-visible {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.04);
    outline: none;
}

.gallery-dropzone--over {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.09);
}

/* Let drag/drop + click always target the dropzone itself, never a child
   (prevents dragleave flicker when hovering the icon/labels). */
.gallery-dropzone > * {
    pointer-events: none;
}

.gallery-asset--trashed img {
    opacity: 0.8;
    filter: grayscale(0.25);
}

/* Tile caption: the uploaded file name + pixel size / format, always visible
   under the thumbnail — the only way to tell two look-alike pictures of
   different sizes apart. Base and extension are separate spans so a long name
   truncates in the MIDDLE ("pozadi-tmave-mo… 1350.png" keeps its tail). */
.gallery-asset__select,
.gallery-asset__rename-trigger {
    /* The modal tile (and the standalone caption, the rename handle) is a
       <button class="btn">: undo the button's centring, font sizing and
       focus/hover chrome so the caption reads like text. */
    font-size: inherit;
    line-height: inherit;
    border-radius: inherit;
}

.gallery-asset__select:hover,
.gallery-asset__select:focus-visible,
.gallery-asset__rename-trigger:hover,
.gallery-asset__rename-trigger:focus-visible {
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.06);
}

.gallery-asset__rename-trigger {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    cursor: text;
}

/* Inline rename form in place of the caption. */
.gallery-asset__rename {
    padding: 0.3rem 0.4rem 0.4rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.gallery-asset__rename .form-control,
.gallery-asset__rename .input-group-text {
    font-size: 0.75rem;
}

.gallery-asset__caption {
    padding: 0.3rem 0.5rem 0.4rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    font-size: 0.75rem;
    line-height: 1.3;
    min-width: 0;
}

.gallery-asset__name {
    display: flex;
    min-width: 0;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
}

.gallery-asset__name-base {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-asset__name-ext {
    flex: 0 0 auto;
    white-space: nowrap;
}

.gallery-asset__name-missing {
    color: var(--bs-secondary-color, #6c757d);
    font-weight: 400;
}

.gallery-asset__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-top: 0.1rem;
    color: var(--bs-secondary-color, #6c757d);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.gallery-asset__size {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-asset__format {
    flex: 0 0 auto;
    padding: 0 0.3rem;
    border-radius: 0.25rem;
    background: var(--bs-tertiary-bg, #f1f3fa);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* Freshly uploaded thumbnail: a short highlight pulse so the user sees the
   file land in the folder they are looking at. */
.gallery-asset--new {
    outline: 2px solid var(--bs-success, #0acf97);
    outline-offset: 1px;
    animation: gallery-asset-new-pulse 1.2s ease-out 2;
}

@keyframes gallery-asset-new-pulse {
    0% { box-shadow: 0 0 0 0 rgba(10, 207, 151, 0.55); }
    100% { box-shadow: 0 0 0 12px rgba(10, 207, 151, 0); }
}

/* Success toast shown after uploads finish (lives on <body>, above modals). */
.gallery-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.gallery-toast {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    background: var(--bs-success, #198754);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-toast--show {
    opacity: 1;
    transform: translateY(0);
}

/* Selected-file preview rows (before upload is confirmed). */
.gallery-upload-item__thumb {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.25rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.gallery-upload-item__thumb--ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color, #adb5bd);
    font-size: 1.25rem;
}

/* Utility Bootstrap lacks: a flex child that may shrink below its content, so
   a nowrap/ellipsis line inside it (upload file names, font specimens, owner
   lines) truncates instead of pushing out of its card. The theme defines no
   such class, so the load-order gotcha does not apply. */
.min-w-0 {
    min-width: 0;
}

/*
 * Mockup pages — canonical CSS-grid render.
 *
 * Every mockup layout lives on one 3-columns × 2-rows grid (spans define the
 * segments) with a fixed page aspect ratio and a uniform gap, mirroring
 * MockupPageLayout::slots(). Used by the manual preview render, the admin
 * listing thumbnails, the layout picker and the interactive editor, so all
 * surfaces show identical proportions. Gap/radius use cqw so they scale with
 * the rendered size (36 / 1380 page units and 20 / 1380 respectively).
 */
/*
 * The admin pencil that sizes ONE logo card. Top-LEFT on purpose: the download
 * and colour-mapping buttons already own the right-hand corner and not every
 * card carries both, so sharing that side would collide unevenly. It only
 * opens the page's one width bar below (manual_logo_width_controller.js).
 */
.manual-logo-width-edit {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
    line-height: 1;
}

/*
 * The width bar — anchored just ABOVE the card being sized (the controller
 * sets top/left in px against `.manual-logo-width-root`, the manual root), so
 * it scrolls with the page instead of floating over the viewport. NOT modal:
 * no backdrop, the card stays in full view while the slider moves. Below
 * Bootstrap's modal layer (1050) so the colour-mapping modals still open over
 * it. `.card.` because the theme's `.card { position: relative }` loads after
 * app.css and would otherwise win.
 */
.manual-logo-width-root {
    position: relative;
}

.card.manual-logo-width-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 820px;
    max-width: 100%;
    z-index: 1040;
}

.card.manual-logo-width-bar .manual-logo-width-number {
    width: 6.5rem;
    flex: 0 0 auto;
}

/* An outline, not a border: the card's own border is part of the manual's design.
   Literal colours: manual_preview has no Nocturne tokens (legacy Hyper look). */
.manual-page .manual-logo-width-card-active {
    outline: 3px solid #727cf5;
    outline-offset: 3px;
}

.manual-page .manual-logo-width-card-saved {
    outline: 3px solid #0acf97;
    outline-offset: 3px;
}

.mockup-grid-container {
    container-type: inline-size;
}

.mockup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2.609cqw;
    aspect-ratio: 1380 / 798;
}

.mockup-slot {
    position: relative;
    overflow: hidden;
    border-radius: 1.45cqw;
}

.mockup-slot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * The corner button of a mockup slot whose image carries a downloadable file.
 * Kept legible over any artwork by its own solid ground rather than a tint.
 */
.mockup-slot-download {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.45em 0.7em;
    border-radius: 2em;
    background: rgba(255, 255, 255, 0.94);
    color: #313a46;
    /* Follows the page's own scale (the grid is a container) but stays
       readable on a small admin card and unobtrusive on the full manual. */
    font-size: clamp(0.625rem, 1.1cqw, 0.8125rem);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 0.15em 0.5em rgba(23, 27, 38, 0.25);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mockup-slot-download:hover,
.mockup-slot-download:focus {
    background: var(--bs-primary, #727cf5);
    color: #fff;
}

.mockup-slot-download i {
    font-size: 1.15em;
}

.mockup-slot-download-format {
    letter-spacing: 0.03em;
}

.mockup-slot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f1f3f9;
    border: 1px dashed #d3d8e5;
    border-radius: inherit;
    color: #98a2b3;
    font-size: 1.25rem;
}

/*
 * Manual content pages (intro + custom pages, `_manual_content_page.html.twig`)
 * — the mockup grid's 3 × 2 slots on a FIXED 845 px page (screens narrower
 * than 768 px keep auto height: three columns that narrow cannot hold a page).
 * Shared by the public manual (app_plain, always light) and the Nocturne
 * editor's preview panel, so it carries its own typography and colours instead
 * of inheriting either skin.
 */
.mcp-page {
    --mcp-h: 845px;
    container-type: inline-size;
    color: #313a46;
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Optional whole-page background picture (ManualContentPage::$background). */
.mcp-bg { background-repeat: no-repeat; background-position: center top; }
.mcp-bg-cover { background-size: cover; }
.mcp-bg-contain { background-size: contain; }

.mcp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 2.609cqw;
}

.mcp-seg {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.mcp-va-center { justify-content: center; }
.mcp-va-bottom { justify-content: flex-end; }

@media (min-width: 768px) {
    .mcp-page { height: var(--mcp-h); overflow: hidden; }
    .mcp-grid { height: 100%; grid-template-rows: repeat(2, minmax(0, 1fr)); }
    .mcp-seg { min-height: 0; overflow: hidden; }
    /* A natural picture scales to fit its slot instead of being cut off. */
    .mcp-rows-1 .mcp-img-natural img { max-height: calc((var(--mcp-h) - 2.609cqw) / 2); }
    .mcp-rows-2 .mcp-img-natural img { max-height: var(--mcp-h); }
}

.mcp-h {
    margin: 0;
    color: inherit;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.mcp-h1 { font-size: 2.25rem; }
.mcp-h2 { font-size: 1.75rem; }
.mcp-h3 { font-size: 1.375rem; }

.mcp-rt { overflow-wrap: anywhere; }
.mcp-rt > :first-child { margin-top: 0; }
.mcp-rt > :last-child { margin-bottom: 0; }
.mcp-rt p { margin: 0 0 0.75em; }
.mcp-rt ul, .mcp-rt ol { margin: 0 0 0.75em; padding-left: 1.5em; }
.mcp-rt li > p { margin: 0 0 0.25em; }
.mcp-rt a { color: inherit; text-decoration: underline; }

.mcp-img { margin: 0; }

/* natural = the legacy intro image: own ratio, never wider than the slot, centred */
.mcp-img-natural img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* cover = the mockup look: slot width, cropped to the slot's canonical ratio
   (the figure carries `aspect-ratio` inline) */
.mcp-img-cover {
    overflow: hidden;
    border-radius: 1.45cqw;
}

.mcp-img-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * Mockup page editor — layout picker (radio cards with live mini previews).
 */
.mockup-layout-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.mockup-layout-option {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.625rem;
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 0;
}

.mockup-layout-option:hover {
    border-color: var(--bs-primary, #727cf5);
}

.mockup-layout-option:has(.mockup-layout-radio:checked) {
    border-color: var(--bs-primary, #727cf5);
    box-shadow: 0 0 0 0.2rem rgba(114, 124, 245, 0.2);
}

.mockup-layout-option-static {
    width: 120px;
    cursor: default;
}

.mockup-layout-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mockup-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
    aspect-ratio: 1380 / 798;
}

.mockup-mini-grid > span {
    background: #d6dae7;
    border-radius: 3px;
    transition: background-color 0.15s ease;
}

.mockup-mini-grid > span.is-filled {
    background: var(--bs-primary, #727cf5);
}

.mockup-layout-count {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #98a2b3);
    text-align: center;
}

/*
 * Mockup page editor — interactive upload stage.
 */
.mockup-editor-desk {
    background: #eef0f4;
    border-radius: 0.625rem;
    padding: 1.25rem;
}

.mockup-editor-stage-container {
    container-type: inline-size;
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
}

.mockup-editor-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2.609cqw;
    aspect-ratio: 1380 / 798;
}

.mockup-editor-no-layout {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.9375rem;
}

.mockup-editor-no-layout i {
    font-size: 2rem;
}

.mockup-editor-slot {
    position: relative;
    overflow: hidden;
    border: 2px dashed #c4cbdc;
    border-radius: 1.45cqw;
    background: #f6f7fb;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mockup-editor-slot:hover,
.mockup-editor-slot.is-dragover {
    border-color: var(--bs-primary, #727cf5);
    background: #eef0ff;
}

.mockup-editor-slot.has-image {
    border-style: solid;
    border-color: transparent;
    background: #e9ebf3;
}

.mockup-editor-slot.has-image.level-warning {
    border-color: var(--bs-warning, #ffbc00);
}

.mockup-editor-slot.has-image.level-danger {
    border-color: var(--bs-danger, #fa5c7c);
}

.mockup-editor-slot-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mockup-editor-slot-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    text-align: center;
    padding: 0.5rem;
    color: #8790a4;
    font-size: 0.8125rem;
}

.mockup-editor-slot-empty i {
    font-size: 1.5rem;
    line-height: 1;
}

.mockup-editor-slot-dims {
    font-size: 0.75rem;
}

.mockup-editor-slot-error {
    font-size: 0.75rem;
    font-weight: 600;
}

.mockup-editor-slot-removed {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    padding: 0.5rem;
    color: var(--bs-danger, #fa5c7c);
    font-size: 0.8125rem;
}

.mockup-editor-slot-removed i {
    font-size: 1.5rem;
    line-height: 1;
}

.mockup-editor-slot-number {
    position: absolute;
    top: 0.375rem;
    left: 0.375rem;
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(55, 62, 80, 0.65);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.mockup-editor-slot-chip {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

.mockup-editor-slot-chip.chip-success {
    background: var(--bs-success, #0acf97);
}

.mockup-editor-slot-chip.chip-warning {
    background: var(--bs-warning, #ffbc00);
    color: #343a40;
}

.mockup-editor-slot-chip.chip-danger {
    background: var(--bs-danger, #fa5c7c);
}

.mockup-editor-slot-meta {
    position: absolute;
    left: 0;
    right: 0;
    /* Sits above the always-visible attachment bar. */
    bottom: 1.75rem;
    padding: 1rem 0.5rem 0.375rem;
    background: linear-gradient(transparent, rgba(23, 27, 38, 0.75));
    color: #fff;
    font-size: 0.6875rem;
    line-height: 1.3;
}

.mockup-editor-slot-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    opacity: 0;
    background: rgba(23, 27, 38, 0.35);
    transition: opacity 0.15s ease;
}

.mockup-editor-slot:hover .mockup-editor-slot-actions {
    opacity: 1;
}

.mockup-editor-slot:not(.has-image):not(.is-removed) .mockup-editor-slot-actions {
    display: none;
}

.mockup-editor-slot.is-removed .mockup-editor-slot-actions {
    background: transparent;
    align-items: flex-end;
    padding-bottom: 0.625rem;
}

/*
 * Mockup page editor — the downloadable file of ONE image, attached ON that
 * image. It used to be a list of "Obrázek 1 / 2 / 3" rows under the stage,
 * where nothing told the designer which row was which picture. The bar is
 * always visible (not hover-only): an attachment is invisible in the artwork,
 * so hiding the control would hide the only evidence that a file is there.
 *
 * z-index 3 is load-bearing: `.mockup-editor-slot-actions` is `inset: 0` and
 * still takes pointer events at opacity 0, so without it the bar would be
 * unclickable on any slot that has an image.
 */
.mockup-editor-slot-file {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: stretch;
    min-height: 1.75rem;
    background: rgba(23, 27, 38, 0.82);
    color: #fff;
    font-size: 0.6875rem;
}

.mockup-editor-slot-file.has-file {
    background: rgba(10, 207, 151, 0.92);
    color: #10241d;
}

.mockup-editor-slot-file.is-removed {
    background: rgba(250, 92, 124, 0.92);
}

.mockup-editor-slot-file.is-error {
    background: rgba(250, 92, 124, 0.95);
}

.mockup-editor-slot-file-pick,
.mockup-editor-slot-file-clear {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.2;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.mockup-editor-slot-file-pick {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    text-align: left;
}

.mockup-editor-slot-file-pick span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mockup-editor-slot-file-pick i {
    flex: 0 0 auto;
    font-size: 0.875rem;
}

.mockup-editor-slot-file-clear {
    flex: 0 0 auto;
    font-size: 0.875rem;
}

.mockup-editor-slot-file-pick:hover,
.mockup-editor-slot-file-clear:hover {
    background: rgba(255, 255, 255, 0.18);
}

/*
 * Mockup page editor — the file offered next to the WHOLE page. Its own card,
 * clearly apart from the per-image bars on the stage.
 */
.mockup-page-file {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    background: var(--bs-body-bg, #fff);
    font-size: 0.8125rem;
}

.mockup-page-file-label {
    flex: 0 0 auto;
    font-weight: 600;
}

.mockup-page-file-state {
    flex: 1 1 10rem;
    color: var(--bs-secondary-color, #98a2b3);
    overflow-wrap: anywhere;
}

.mockup-page-file-state.has-file {
    color: var(--bs-body-color, #6c757d);
    font-weight: 600;
}

.mockup-page-file-state.is-removed {
    color: var(--bs-danger, #fa5c7c);
    font-weight: 600;
}

.mockup-page-file-actions {
    display: flex;
    gap: 0.375rem;
    margin-left: auto;
}

.mockup-page-file-error {
    flex: 1 1 100%;
    font-weight: 600;
}

/*
 * Mockup page editor — sticky save bar with unsaved-changes state.
 */
.mockup-editor-savebar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    box-shadow: 0 -0.125rem 0.75rem rgba(0, 0, 0, 0.06);
}

.mockup-editor-savebar > :first-child {
    margin-right: auto;
}

.mockup-editor-dirty {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--bs-warning-text-emphasis, #997404);
    font-size: 0.8125rem;
    font-weight: 600;
}

.mockup-editor-dirty-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--bs-warning, #ffbc00);
}

/* Canvas display-settings menu (the gear in the editor top bar). Wide enough
   that no switch label wraps, and above the sticky header's own stacking
   context so it paints over the stage. Qualified with .dropdown-menu to
   outrank the theme's own min-width/z-index on that class. */
.dropdown-menu.editor-display-menu {
    min-width: 17rem;
    z-index: 1010;
}

/* --- Template-group editor: variant rail (compact chips) ---------------- */

/* The rail card doubles as the propagation-scope indicator: a primary border
   while an edit reaches EVERY variant (mode on, every switch on, nothing
   "Nenačteno"), plain otherwise. The border is always present (transparent)
   so toggling it never shifts the stage below by its width. Two classes so
   the rule outranks the theme's `.card` border (that sheet loads after this
   one — see the .group-variant-include note). */
.card.group-variant-rail-card {
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card.group-variant-rail-card--all {
    border-color: var(--bs-primary, #727cf5);
    /* Ring ON TOP of the theme's card shadow, not instead of it. */
    box-shadow: 0 0 0 0.2rem rgba(114, 124, 245, 0.15), var(--shadow-2);
}

.group-variant-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* "Úprava více variant" mode switch — sits left of the chips it governs.
   Selector doubled up to outrank the theme's `.btn-sm` radius (see the
   .group-variant-include note below for why order alone does not do it). */
.group-variant-rail .group-variant-mode {
    border-radius: 2rem;
    margin-right: 0.25rem;
}

.group-variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 2px solid transparent;
    border-radius: 2rem;
    padding: 0.125rem 0.5rem 0.125rem 0.25rem;
    background: var(--bs-light, #f8f9fa);
}

.group-variant-chip.group-variant-active {
    border-color: var(--bs-primary, #727cf5);
}

.group-variant-chip.group-variant-excluded {
    opacity: 0.5;
}

.group-variant-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    border-radius: 2rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: inherit;
    white-space: nowrap;
}

.group-variant-chip.group-variant-active .group-variant-label {
    font-weight: 600;
}

.group-variant-dirty {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--bs-danger, #fa5c7c);
}

/* "Přenést do ostatních variant" feedback: the chips the push changed pulse
   once, so the designer knows which tab to open to check the result. */
.group-variant-chip.group-variant-flash {
    animation: group-variant-flash 1.5s ease-out;
}

@keyframes group-variant-flash {
    0%, 30% { box-shadow: 0 0 0 0.25rem rgba(10, 207, 151, 0.55); background: rgba(10, 207, 151, 0.18); }
    100% { box-shadow: 0 0 0 0 rgba(10, 207, 151, 0); }
}

/* Re-sync report toast — reuses the gallery toast container/animation but is
   a light multi-line card (per-variant rows) rather than a one-line pill. */
.gallery-toast.group-resync-toast {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    max-width: 28rem;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #313a46);
    border-left: 4px solid var(--bs-secondary, #6c757d);
    pointer-events: auto;
}

.gallery-toast.group-resync-toast--success {
    border-left-color: var(--bs-success, #0acf97);
}

.group-resync-toast__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.group-resync-toast__list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.group-resync-toast__row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.1rem 0;
}

.group-resync-toast__row .i {
    flex: 0 0 auto;
    align-self: center;
}

.group-resync-toast__variant {
    font-weight: 600;
    white-space: nowrap;
}

.group-resync-toast__row--success .i { color: var(--bs-success, #0acf97); }
.group-resync-toast__row--warning .i { color: var(--bs-warning, #ffbc00); }
.group-resync-toast__row--danger .i { color: var(--bs-danger, #fa5c7c); }
.group-resync-toast__row--muted { color: var(--bs-secondary-color, #6c757d); }

.group-resync-toast__note {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* The per-variant opt-in switches are chrome of the multi-variant mode:
   with the mode off there is nothing to opt into, so they are not rendered
   at all (never merely dimmed — a visible switch that changes nothing is
   worse than no switch).

   Two class selectors, not one: Bootstrap's `.form-check {display: block}`
   (and the Nocturne layer) would otherwise tie on specificity. */
.group-variant-chip .group-variant-include {
    display: none;
}

.group-variant-rail--multi .group-variant-chip .group-variant-include {
    display: block;
}

/* Group fill & export page (template_group_fill.html.twig) */
/* Which dimension this card is, above the image (a caption underneath reads
   as belonging to whatever follows it). */
.group-fill-preview-heading {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    color: var(--muted);
}

/* Background gallery picker (add/edit template + group forms): thumbnail of
   the picked gallery file next to the pick/clear buttons. */
.background-picker-thumb {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
    background-size: cover;
    background-position: center;
}

/* Per-dimension PNG download in the heading — a submit button riding the
   fill form via formaction, styled as a quiet inline link. */
.group-fill-variant-download {
    border: 0;
    background: none;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
    color: var(--lav-ink);
}

.group-fill-variant-download:hover {
    text-decoration: underline;
}

.group-fill-variant-download:disabled {
    color: inherit;
    opacity: 0.65;
}

.group-fill-preview-frame {
    position: relative;
    width: 100%;
    background: #f6f7fb;
    border-radius: 0 0 0.25rem 0.25rem;
    overflow: hidden;
}

.group-fill-preview-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease;
}

.group-fill-preview-frame.is-pending img,
.group-fill-preview-frame.is-loading img {
    opacity: 0.55;
}

.group-fill-preview-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    /* Dim the stale preview underneath so "loading" is unmissable. */
    background: rgba(255, 255, 255, 0.55);
}

.group-fill-preview-frame.is-loading .group-fill-preview-spinner {
    display: flex;
}

.group-fill-preview-error {
    position: absolute;
    inset: auto 0 0 0;
    display: none;
    padding: 0.15rem 0.5rem;
    background: rgba(250, 92, 124, 0.9);
    color: #fff;
    font-size: 11px;
    text-align: center;
}

.group-fill-preview-frame.is-error .group-fill-preview-error {
    display: block;
}

/* Image placement over a group preview.
   The layer never intercepts pointer events itself — only the per-slot grab
   boxes do — so the rest of the preview stays inert. A box exists as soon as a
   picture is chosen (it IS the grab handle); the picture inside it is revealed
   only while placing, until the fresh server render lands and takes over. */
.group-fill-placement-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.group-fill-ghost {
    position: absolute;
    overflow: hidden;
    pointer-events: auto;
    cursor: grab;
    border: 1px dashed transparent;
    border-radius: 2px;
}

.group-fill-ghost:hover,
.group-fill-ghost:focus-visible {
    border-color: rgba(114, 124, 245, 0.9);
    outline: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.group-fill-ghost:active {
    cursor: grabbing;
}

.group-fill-ghost img {
    position: absolute;
    display: block;
    max-width: none;
    object-fit: fill;
    opacity: 0;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

/* While placing, the stand-in replaces the (now stale) rendered pixels of that
   slot — the neutral backdrop hides the old position underneath. */
.group-fill-placement-layer.is-active .group-fill-ghost {
    background: #fff;
    border-color: rgba(114, 124, 245, 0.9);
}

.group-fill-placement-layer.is-active .group-fill-ghost img,
.group-fill-preview-frame.is-loading .group-fill-placement-layer.is-active .group-fill-ghost img,
.group-fill-preview-frame.is-pending .group-fill-placement-layer.is-active .group-fill-ghost img {
    opacity: 1;
}

/* Text echo composite (mirrors the single fill page's fill-echo-* pair):
   while the user types, the settle preview yields to the text-transparent
   base render + the client-drawn text canvas stacked above it. Placed after
   the is-pending/is-loading dim rules on purpose — the echo layers must
   never be veiled or dimmed while a settle render is on its way. */
.group-fill-echo-base,
.group-fill-echo-canvas {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    visibility: hidden;
    pointer-events: none;
}

.group-fill-echo-base {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.group-fill-preview-frame.is-echo .group-fill-echo-base,
.group-fill-preview-frame.is-echo .group-fill-echo-canvas {
    visibility: visible;
}

.group-fill-preview-frame.is-echo > img[data-group-fill-target="preview"] {
    visibility: hidden;
}

/* The echo IS the feedback — no veil, no dimming over it. */
.group-fill-preview-frame.is-echo .group-fill-preview-spinner {
    display: none;
}

.group-fill-preview-frame.is-echo.is-pending .group-fill-echo-base,
.group-fill-preview-frame.is-echo.is-loading .group-fill-echo-base {
    opacity: 1;
}

.group-fill-ghost.is-selected {
    border: 2px solid rgba(114, 124, 245, 1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

/* Placement toolbar of the picture selected in a preview: floats over the
   dimension's fill surface, anchored to the picture's frame by the
   group-fill controller (top/left). Steps aside while the picture is dragged. */
.group-fill-placement-toolbar {
    position: absolute;
    z-index: 30;
    width: min(280px, calc(100% - 16px));
    padding: 0.45rem 0.6rem 0.5rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.4rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.group-fill-placement-toolbar.is-dragging {
    visibility: hidden;
}

.group-fill-placement-toolbar__name {
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
}

.group-fill-placement-toolbar__close {
    width: 0.6rem;
    height: 0.6rem;
    padding: 0.25rem;
    background-size: 0.6rem;
}

.group-fill-placement-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.group-fill-placement-control label {
    flex: 0 0 auto;
    margin: 0;
    color: var(--muted);
}

.group-fill-placement-control .form-range {
    flex: 1 1 auto;
    min-width: 0;
}

.group-fill-placement-control__value {
    flex: 0 0 3.25rem;
    text-align: right;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* Dimension cards on the group fill page. The theme's 0.75rem card margin is
   too tight for a grid of previews with controls underneath — consecutive
   cards read as one column of stuff. */
.group-fill-preview-card {
    margin-bottom: 1.5rem;
}

/* The dimension grid inside the .fill-body flex row. */
.group-fill-previews {
    flex: 1 1 auto;
    min-width: 0;
}

/* Group picker: the picked tile (the "Výchozí" one until the user picks).
   Tiles are the gallery's (`_fill_gallery_tile.html.twig`); only the
   selection ring is the group page's own. */
.gallery-asset__select.group-fill-image-option.selected {
    box-shadow: 0 0 0 2px var(--bs-primary, #727cf5);
}

/* Photoshop-style navigator mini-map (canvas_navigator_controller): fixed
   bottom-right, auto-hidden while the whole canvas is visible. The rect is
   the viewport marker; panning happens on the map itself. */
.canvas-navigator {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1030;
    padding: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* Grip bar: drags the whole panel (canvas_navigator_controller#beginMove). */
.canvas-navigator__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 14px;
    margin: -4px -2px 4px;
    color: #98a6ad;
    font-size: 16px;
    line-height: 1;
    cursor: grab;
    touch-action: none;
    user-select: none;
    border-radius: 4px;
}

.canvas-navigator__handle:hover {
    color: #6c757d;
    background: #f1f3fa;
}

.canvas-navigator--moving .canvas-navigator__handle {
    cursor: grabbing;
}

.canvas-navigator__map {
    position: relative;
    line-height: 0;
    cursor: pointer;
    background: #f1f3fa;
}

.canvas-navigator__map:active {
    cursor: move;
}

.canvas-navigator__map canvas {
    display: block;
}

.canvas-navigator__rect {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid #727cf5;
    background: rgba(114, 124, 245, 0.12);
    pointer-events: none;
}

/* WYSIWYG list lines (rich_text_editor_controller line-div rendering):
   bullets/ordinals are ::before chrome — they exist only in the editor UI,
   the export draws its own bullet objects from the shared blocks layout. */
.fill-richtext-editor .rt-line { min-height: 1em; }

.fill-richtext-editor .rt-line[data-type="ul"],
.fill-richtext-editor .rt-line[data-type="ol"],
.fill-richtext-editor .rt-line[data-type="cb"],
.fill-richtext-editor .rt-line[data-type="cbx"] {
    position: relative;
    padding-left: 1.6em;
}

.fill-richtext-editor .rt-line[data-type="ul"]::before {
    content: '\2022';
    position: absolute;
    left: 0.35em;
}

.fill-richtext-editor .rt-line[data-type="ol"]::before {
    content: attr(data-number);
    position: absolute;
    left: 0;
    font-variant-numeric: tabular-nums;
}

/* Checkbox items ('cb' unchecked / 'cbx' checked): the marker mirrors the
   export's default drawn checkbox — a rounded square in the line's text
   color, the checked one with a white check. Clicking the marker toggles
   the state (rich_text_editor_controller editorClick). */
.fill-richtext-editor .rt-line[data-type="cb"]::before,
.fill-richtext-editor .rt-line[data-type="cbx"]::before {
    content: '';
    position: absolute;
    left: 0.1em;
    top: 0.3em;
    width: 0.85em;
    height: 0.85em;
    border-radius: 0.19em;
    background-color: currentColor;
    cursor: pointer;
}

.fill-richtext-editor .rt-line[data-type="cbx"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.6 6.6 12 12.8 4.4' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 80% 80%;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Font choice ("Uživatel může přepínat písmo") ------------------------- */

/* The admin's per-input font checklist (text popover + "Přidat text" modal):
   fonts as group headers with a tri-state checkbox, faces beneath previewed
   in their own face, the designed face locked-checked with a badge. */
.font-choice {
    max-height: 190px;
    overflow: auto;
    border: 1px solid var(--line-2);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    background: var(--surface-2);
}

.font-choice__group + .font-choice__group {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line-2);
}

.font-choice__header,
.font-choice__face {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
    line-height: 1.6;
}

.font-choice__header {
    font-weight: 600;
}

.font-choice__face {
    padding-left: 1.4rem;
}

.font-choice__name {
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-choice__badge {
    font-size: 0.6rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* The end user's whole-text font select in a plain fill popover. */
.fill-popover__font {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

/* --- Fonts page: type specimens ------------------------------------------- */

.font-specimen {
    font-size: 20px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bs-body-color, #212529);
}

.font-wire {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.75rem;
}

/* Admin colour allowlist chips (text popover): a swatch with a check mark
   when allowed, dimmed otherwise. */
.color-choice-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    position: relative;
    opacity: 0.45;
    cursor: pointer;
}

.color-choice-swatch--on {
    opacity: 1;
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 2px #fff inset;
}

.color-choice-swatch--on::after {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Fonts page: the 100–900 weight axis per family. */
.weight-axis {
    display: flex;
    gap: 3px;
}

.weight-axis__cell {
    flex: 1 1 0;
    height: 18px;
    border-radius: 3px;
    background: var(--bs-tertiary-bg, #f1f3f5);
    border: 1px solid var(--bs-border-color, #dee2e6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--bs-secondary-color, #98a6ad);
    overflow: hidden;
}

.weight-axis__cell--upright {
    background: var(--bs-body-color, #343a40);
    border-color: var(--bs-body-color, #343a40);
    color: #fff;
}

.weight-axis__cell--italic::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: var(--bs-primary, #727cf5);
    transform: skewX(-18deg);
}

.weight-axis__label {
    pointer-events: none;
}

/* Layers panel: a picture whose file is gone for good (404 — purged from the
   gallery) loads as a red stand-in tile (canvas_missing_images.js); its row
   carries the same signal so a hidden layer's missing picture is noticed too. */
.canvas-layer-row--missing .canvas-layer-row__icon {
    color: #e11d48;
}

.canvas-layer-row__missing {
    flex: 0 0 auto;
    margin-left: 0.35rem;
    padding: 0 0.3rem;
    border-radius: 0.25rem;
    background: #fff1f2;
    color: #e11d48;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* The gallery toast chrome in its warning tone — the editors' "a picture in
   this design no longer exists" notice. */
.gallery-toast--warning {
    background: var(--bs-warning, #ffbc00);
    color: #313a46;
    max-width: 26rem;
    pointer-events: auto;
}

/* Export-version rename editor (_export_version_rename_form.html.twig): the
   ✓ / × buttons take the name field's light border, so the -1px input-group
   overlap reads as one continuous outline whether the field (focused, on top)
   or a button covers the shared edge. Scoped one level deeper than the
   theme's equal-specificity `.btn-outline-secondary`. */
.export-version-rename .input-group .export-version-rename__btn {
    border-color: var(--line-2);
}

.export-version-rename .input-group .export-version-rename__btn:hover,
.export-version-rename .input-group .export-version-rename__btn:focus-visible {
    border-color: var(--muted);
}

/* Projects list (_project_card.html.twig): a project someone else owns gets
   a muted owner line under its name. */
.project-card .project-card-owner {
    margin-top: .25rem;
    font-size: .8125rem;
    color: var(--muted);
}

/* ======================================================================
   Multi-page documents — document page sidebar
   ====================================================================== */

.document-pages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.document-pages__item {
    position: relative;
    margin-bottom: 1rem;
    text-align: center;
}

.document-pages__thumb {
    display: block;
    padding: .5rem;
    border: 2px solid transparent;
    border-radius: .5rem;
}

.document-pages__item.is-active .document-pages__thumb {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .08);
}

.document-pages__thumb img {
    display: block;
    width: 100%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.document-pages__item .dragula-handle {
    position: absolute;
    top: .75rem;
    left: .75rem;
}

.document-page-preview img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

/* ======================================================================
   Multi-page documents — fill page (template_document_fill.html.twig):
   a sticky page sidebar + the pages stacked like Preview. Scoped under
   .document-fill (app.css loads BEFORE the theme — CLAUDE.md).
   ====================================================================== */
.document-fill .document-fill-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.document-fill .document-fill-sidebar {
    position: sticky;
    top: 1rem;
    flex: 0 0 120px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: .25rem;
}

.document-fill .document-fill-sidebar .document-pages__thumb {
    padding: .25rem;
}

.document-fill .document-fill-pages {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 900px;
    margin: 0 auto;
}

/* The page cards carry scroll targets: keep the heading clear of the top. */
.document-fill .document-fill-page {
    scroll-margin-top: 1rem;
}

@media (max-width: 767.98px) {
    .document-fill .document-fill-sidebar {
        display: none;
    }
}

/* "Všechna pole" section headings ("Společná pole", "Strana n — …"): only
   in the docked panel — floating popovers are per field. */
.fill-form.fill-js .fill-popovers .document-fill-panel-heading {
    display: none;
}

.fill-form.fill-js.fill-panel-open .fill-popovers .document-fill-panel-heading {
    display: block;
    margin: .5rem 0 0;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}

.fill-form.fill-js.fill-panel-open .fill-popovers .document-fill-panel-heading.is-shared {
    color: var(--bs-primary, #727cf5);
}

/* Shape popover — gradient stops (canvas-shape-properties#_renderGradientStops).
   The preview paints the gradient over a checkerboard so a transparent stop
   reads as transparent, not white. */
.canvas-stage .shape-gradient-preview {
    height: 18px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background:
        var(--shape-gradient-preview, transparent),
        repeating-conic-gradient(#d5d5d5 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}

.canvas-stage .shape-gradient-stop {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 20px;
    gap: 4px;
    align-items: center;
    margin-bottom: 4px;
}

.canvas-stage .shape-gradient-stop--head {
    margin-bottom: 2px;
    font-size: .7rem;
}

.canvas-stage .shape-gradient-stop .shape-gradient-stop__color {
    width: 36px;
    height: 30px;
    padding: 2px;
}

.canvas-stage .shape-gradient-stop__percent .form-control {
    min-width: 0;
}

.canvas-stage .shape-gradient-stop__remove:disabled {
    opacity: .3;
}

/* Mapování barev loga (LogoColorsMapping modal, manual preview = app_plain,
   always light; Hyper loads AFTER this file, hence the `.modal` scope).
   Target swatch: the colour (`--swatch`, set by custom_color_controller incl.
   Krytí) painted OVER a checkerboard, so a translucent target reads as one. */
.modal .logo-map-row { gap: 8px; }
.modal .logo-map-arrow { flex: 1 1 24px; max-width: 120px; color: #98a6ad; }
.modal .logo-map-swatch {
    flex: none;
    border: 1px solid rgba(0, 0, 0, .1);
    background:
        linear-gradient(var(--swatch, transparent), var(--swatch, transparent)),
        repeating-conic-gradient(#d5d5d5 0 25%, #fff 0 50%) 50% / 10px 10px;
}
.modal .logo-map-opacity { position: relative; flex: none; width: 84px; }
.modal .logo-map-opacity .form-control { padding-right: 26px; }
.modal .logo-map-opacity-unit { position: absolute; right: 12px; bottom: 9px; color: #98a6ad; pointer-events: none; }

/* Manual picture no longer in the gallery (Koš / gone) — content pages P3.
   Shown to editors only (readers see nothing); lives here because the public
   manual and the editor preview both load app.css. */
.manual-img-standin {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 100%; min-height: 80px; padding: 12px;
    border: 1.5px dashed #c0392b; border-radius: 8px; color: #8e2a1f;
    background: repeating-linear-gradient(45deg, #fdf0ee 0 10px, #fbe3df 10px 20px);
    font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center;
}
