/* ==========================================================================
   Nocturne — Manuály (P4): manual list, section tabs, logo variant cards,
   colour palette cards, manual fonts, mockup pages (list + editor chrome),
   plus the small Kalendáře teaser page. Values copied from prototype app.css
   (§ "Manuál", § "Paleta barev"). app.css loads AFTER this file, so rules
   that compete with legacy app.css feature rules are scoped one level deeper.
   ========================================================================== */

/* ---- Manual list (cards: white cover + name + type + colours) ------------ */
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.mn-card { position: relative; display: flex; flex-direction: column; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mn-card:hover { border-color: var(--line-3); box-shadow: var(--shadow-2); }
.mn-card:has(.mn-name a:focus-visible) { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.mn-cover { position: relative; display: grid; place-items: center; height: 180px; padding: 24px 40px; background: #fff; overflow: hidden; }
.mn-cover img { max-width: 100%; max-height: 132px; object-fit: contain; }
.mn-mono { display: none; width: 72px; height: 72px; border-radius: 20px; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 26px; font-weight: 700; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px var(--line-2); }
.mn-cover:not(:has(img)), .mn-cover.is-broken { background: var(--surface-2); }
.mn-cover:not(:has(img)) .mn-mono, .mn-cover.is-broken .mn-mono { display: grid; }
.mn-cover.is-broken img { display: none; }
.mn-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.mn-head { display: flex; align-items: flex-start; gap: 8px; }
.mn-name { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.mn-name a { color: var(--text); text-decoration: none; }
.mn-name a::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.mn-name a:focus-visible { outline: none; }
.mn-name a:hover { color: var(--lav-ink); }
.mn-acts { position: relative; z-index: 2; margin: -4px -6px 0 0; }
.mn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- Section tabs ---------------------------------------------------------- */
.man-tabs { overflow-x: auto; scrollbar-width: none; }
.man-tabs a { flex: none; }
.man-tabs .pd-n { margin-left: 2px; }
.man-miss { flex-wrap: wrap; }
.man-miss-txt { flex: 1 1 0; min-width: 0; }
.man-miss > .man-miss-x { flex: none; margin: -4px -6px -4px 0; }

/* ---- Logo variant cards ---------------------------------------------------- */
.man-form { display: flex; flex-direction: column; gap: 20px; }
.man-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 16px; align-items: start; }
.man-var { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.man-vh { display: flex; align-items: center; gap: 10px; }
.man-vh h3 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; }
.man-st { height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--mnt-deep); color: var(--mnt-ink); }
.man-st.miss { background: var(--surface-2); color: var(--subtle); }
.man-prev { position: relative; display: grid; place-items: center; height: 200px; margin: 0; padding: 28px; border-radius: 16px; background: #fff; overflow: hidden; cursor: pointer; }
.man-prev img { max-width: 100%; max-height: 144px; object-fit: contain; }
.man-prev-miss { display: none; flex-direction: column; align-items: center; gap: 8px; color: #6b6772; font-size: 12px; }
.man-prev.is-broken img { display: none; }
.man-prev.is-broken .man-prev-miss { display: flex; }
.man-prev-hint { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(20,18,24,.72); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .15s; }
.man-prev:hover .man-prev-hint, .man-var:focus-within .man-prev-hint { opacity: 1; }
@media (hover: none) { .man-prev-hint { opacity: 1; } }
.man-prev.is-over { outline: 2px dashed var(--lav); outline-offset: 3px; }
.man-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 200px; margin: 0; padding: 20px; border-radius: 16px; border: 1.5px dashed var(--line-3); text-align: center; cursor: pointer; color: var(--text-2); transition: border-color .15s, background .15s; }
.man-drop > .i { width: 26px; height: 26px; color: var(--lav-ink); margin-bottom: 6px; }
.man-drop b { font-weight: 600; }
.man-drop u { color: var(--lav-ink); text-underline-offset: 3px; }
.man-drop:hover, .man-drop.is-over { border-color: var(--lav); background: var(--lav-deep); }
.man-drop img { max-width: 100%; max-height: 120px; object-fit: contain; padding: 8px; border-radius: 12px; background: #fff; }
.man-drop:has(img:not([hidden])) > .i, .man-drop:has(img:not([hidden])) > b { display: none; }
.man-var:has(.sr:focus-visible) .man-prev, .man-var:has(.sr:focus-visible) .man-drop { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.man-picked { margin-top: -6px; padding: 8px 12px; border-radius: 12px; background: var(--lav-deep); color: var(--lav-ink); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.man-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 26px; }
.man-cols > .cap:first-child { margin-right: 4px; }
.man-col { display: inline-block; width: 26px; height: 26px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 1px var(--line-2); }
.man-cols-n { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.man-fields { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.man-wh { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.man-scale > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
/* F10 reset pill: 26 px so showing / hiding it never moves the row */
.man-scale .btn.man-scale-reset { min-height: 26px; height: 26px; --bs-btn-padding-x: 10px; --bs-btn-font-size: 12px; gap: 4px; }
.man-scale > span:first-child label { margin: 0; font: inherit; color: inherit; }
.man-scale-row { display: flex; align-items: flex-start; gap: 12px; }
.man-scale-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.man-scale-track input[type="range"] { width: 100%; margin: 0; accent-color: var(--lav); }
/* 10 % · výchozí (at 100 %) · 200 % under the track; the middle label is
   placed at 100 %'s position on a 10–200 track (inline left) */
.man-scale-ticks { position: relative; display: flex; justify-content: space-between; font-size: 11px; line-height: 1.3; color: var(--subtle); }
.man-scale-ticks .man-scale-tick-default { position: absolute; top: 0; transform: translateX(-50%); color: var(--muted); }
.man-scale-num { position: relative; flex: none; }
.man-scale .form-control.man-scale-n { width: 92px; text-align: right; padding-right: 28px; }
.man-scale-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--subtle); pointer-events: none; }
.man-scale .cap { font-size: 12px; line-height: 1.45; }
.man-page { position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; }
.man-page .sw { flex: none; margin-top: 2px; pointer-events: none; }
.man-page:has(input:checked) .sw { background: var(--a-deep); border-color: var(--a-line); }
.man-page:has(input:checked) .sw::after { left: 23px; background: var(--a); box-shadow: 0 0 12px var(--a-glow); }
.man-page > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.man-page b { font-weight: 600; }
.man-page:has(input:focus-visible) .sw { outline: 2px solid var(--lav-ink); outline-offset: 2px; }

/* Shared form fields of the kit (`.pal-f`: 11 px label, 36 px control) */
.pal-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }
.pal-f > span:first-child, .pal-f > .form-label { margin: 0; font-size: 11px; font-weight: 600; color: var(--subtle); letter-spacing: .02em; }
.pal-f .form-control, .pal-f .form-select { min-height: 36px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pal-f .form-select { padding-right: 32px; }

/* Sticky save bar under long manual forms */
.man-savebar { position: sticky; bottom: 16px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; background: color-mix(in oklab, var(--surface-2) 92%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); }
.man-savebar .cap { flex: 1; min-width: 0; }

@media (max-width: 560px) {
    .man-prev, .man-drop { height: 160px; min-height: 160px; }
    .man-prev img { max-height: 104px; }
    .man-var { padding: 14px; }
    .man-savebar { border-radius: 18px; }
    .man-savebar .cap { display: none; }
    .man-savebar .btn { flex: 1; }
}

/* ---- Colour palette kit (prototype § Paleta barev; used by project_palette) -- */
.pal-strip { display: flex; height: 28px; min-width: 160px; max-width: 360px; flex: 0 1 360px; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); }
.pal-strip span { flex: 1; min-width: 0; }
.pal-group { display: flex; flex-direction: column; gap: 12px; }
.pal-gh { display: flex; flex-direction: column; gap: 4px; }
.pal-gh h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 600; }
.pal-none { margin: 0; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 12px; }
.pal-grid:empty { display: none; }
.pal-card { display: flex; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; min-width: 0; }
.pal-card.gu-transit { opacity: .45; }
.pal-sw { position: relative; flex: none; width: 112px; border: 0; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; cursor: copy; font: inherit; color: #fff; box-shadow: inset -1px 0 0 var(--line); text-align: left; }
.pal-sw.is-light { color: #141218; }
.pal-sw .i { opacity: 0; transition: opacity .15s; }
.pal-sw:hover .i, .pal-sw:focus-visible .i { opacity: .85; }
.pal-sw:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: -4px; }
.pal-src { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.pal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 16px; }
.pal-row1 { display: flex; align-items: flex-end; gap: 8px; }
.pal-f.hex { width: 118px; flex: none; }
.pal-f.hex input { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.pal-hex-ro { display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px dashed var(--line-2); font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text); font-variant-numeric: tabular-nums; }
.pal-f.role { flex: 1; max-width: 190px; }
.pal-acts { display: flex; align-items: center; gap: 2px; margin-left: auto; align-self: center; margin-top: 16px; }
.pal-grip { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; color: var(--subtle); cursor: grab; }
.pal-grip:hover { background: var(--surface-2); color: var(--text-2); }
.pal-rgb { margin-top: -2px; font-variant-numeric: tabular-nums; }
.pal-cmyk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pal-card.is-cmyk-missing .pal-cmyk .form-control { border-style: dashed; }
.pal-calc { grid-column: 1 / -1; justify-self: start; margin-left: -8px; color: var(--lav-ink) !important; }
.pal-card:not(.is-cmyk-missing) .pal-calc { display: none; }
.pal-row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 560px) {
    .pal-strip { flex-basis: 100%; max-width: none; }
    .pal-card { flex-direction: column; }
    .pal-sw { width: 100%; height: 72px; flex-direction: row; align-items: flex-end; box-shadow: inset 0 -1px 0 var(--line); }
    .pal-sw .i { opacity: .8; }
    .pal-row1 { flex-wrap: wrap; }
    .pal-f.hex { width: 104px; }
}

/* ---- Settings boxes (add/edit manual, manual font, mockup page editor) ------ */
.man-sec { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.man-sech { display: flex; flex-direction: column; gap: 4px; }
.man-sech h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 600; }
.man-name { max-width: 560px; }
.man-name .mb-3 { margin-bottom: 0 !important; }
.man-formbox { max-width: 720px; }
.man-formbox .mb-3:last-of-type { margin-bottom: 0 !important; }
.man-formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 16px; }
.man-formfoot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .man-sec { padding: 16px; } }

/* ---- Mockup pages list (prototype .man-pages / .man-pg) --------------------- */
.man-hint { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding-right: 8px; }
.man-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.man-pages:empty { display: none; }
.man-pg { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); min-width: 0; transition: border-color .15s, opacity .15s; }
.man-pg:hover { border-color: var(--line-3); }
.man-pg.gu-transit { opacity: .45; }
.man-pg.gu-mirror { border-color: var(--lav); box-shadow: 0 0 0 3px var(--lav-glow); }
.man-pgh { display: flex; align-items: center; gap: 8px; min-width: 0; }
.man-grip { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--subtle); cursor: grab; }
.man-grip:hover { color: var(--text-2); }
.man-pgn { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.man-pgh h3 { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.man-att { display: inline-flex; color: var(--muted); flex: none; }
.man-pgv { display: block; border-radius: 14px; overflow: hidden; text-decoration: none; }
.man-pgv:focus-visible { outline: 2px solid var(--lav-ink); outline-offset: 3px; }
.man-pgv:hover .mockup-slot img { filter: brightness(1.06); }
/* The shared page render (_mockup_page.html.twig) on a dark card: the empty
   slot placeholders follow the theme instead of the manual's light grey. */
.man-pg .mockup-slot { background: var(--surface-2); }
.man-pg .mockup-slot-placeholder { background: var(--surface-2); color: var(--subtle); }
@media (max-width: 560px) { .man-hint { display: none; } }

/* Content pages P2: the list mixes mockup pages and custom content pages —
   a kind pill per card and the content page thumbnail
   (_manual_content_page_thumb.html.twig) on the same canonical grid. */
.man-kind { flex: none; }
@media (max-width: 420px) { .man-pgh .man-kind:not(.pch) { display: none; } }
.mcp-thumb-text { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: max(3px, 1.2cqw); padding: 0 12%; }
.mcp-thumb-text span { display: block; height: max(2px, .9cqw); border-radius: 999px; background: var(--line-3); }
.mcp-thumb-text span.h { height: max(4px, 2cqw); width: 62%; margin-bottom: max(2px, .6cqw); background: var(--muted); }
.mcp-thumb-text span.s { width: 72%; }
.man-add-content { gap: 10px; }
.man-add-content .form-label { margin: 0; font-weight: 600; }
.man-add-content .cap { margin: 0 0 6px; }

/* ---- Mockup page editor chrome (_mockup_page_form_editor) ------------------- */
.man-editor { display: flex; flex-direction: column; gap: 16px; }
.man-editor .mockup-layout-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.man-editor .mockup-layout-option { align-items: center; gap: 8px; padding: 12px 12px 10px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--text-2); box-shadow: none; transition: border-color .15s, background .15s; }
.man-editor .mockup-layout-option:hover { border-color: var(--line-3); }
.man-editor .mockup-layout-option:has(.mockup-layout-radio:checked) { border-color: var(--lav); background: var(--lav-deep); color: var(--lav-ink); box-shadow: none; }
.man-editor .mockup-layout-option:has(.mockup-layout-radio:focus-visible) { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.man-editor .mockup-mini-grid { width: 100%; }
.man-editor .mockup-mini-grid > span { background: var(--surface-3); border-radius: 4px; }
.man-editor .mockup-layout-option:has(.mockup-layout-radio:checked) .mockup-mini-grid > span { background: color-mix(in oklab, var(--lav) 55%, transparent); }
.man-editor .mockup-mini-grid > span.is-filled { background: var(--lav); }
.man-editor .mockup-layout-count { color: inherit; font-size: 12px; font-weight: 600; }
.man-editor .mockup-layout-option-static { width: 140px; }
.man-fixed-layout { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.man-editor .mockup-editor-desk { padding: 16px; border-radius: 16px; background: var(--bg); }
.man-editor .mockup-editor-stage-container { border-radius: 12px; box-shadow: var(--shadow-2); }
.man-editor .mockup-editor-slot { border-color: #c9c3d6; }
.man-editor .mockup-editor-slot:hover, .man-editor .mockup-editor-slot.is-dragover { border-color: var(--lav); background: #f1edfb; }
.man-editor .mockup-editor-slot-empty { color: #6b6772; }
.man-editor .mockup-editor-slot-empty .i { width: 22px; height: 22px; color: #6d55b8; margin-bottom: 4px; }
/* Phones (P10b): the scaled page leaves ~90 px slots — the empty-state copy
   collided with the slot number and the file strip; keep just the icon. */
@media (max-width: 600px) {
    .man-editor .mockup-editor-desk, .man-editor .mockup-editor-stage-container { padding: 8px; }
}
@container (max-width: 520px) {
    .man-editor .mockup-editor-slot-empty strong, .man-editor .mockup-editor-slot-dims { display: none; }
    .man-editor .mockup-editor-slot-file { font-size: 10px; }
}
.man-editor .mockup-editor-slot-removed .i { width: 22px; height: 22px; }
.man-editor .mockup-editor-slot-chip .i, .man-editor .mockup-editor-slot-file .i { width: 14px; height: 14px; }
.man-editor .mockup-editor-slot-actions .btn { --bs-btn-padding-x: 12px; min-height: 32px; height: 32px; font-size: 12px; }
.man-editor .mockup-editor-slot-file.has-file { background: color-mix(in oklab, var(--mnt) 92%, transparent); color: #10241C; }
.man-editor .mockup-editor-no-layout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.man-editor .mockup-editor-no-layout.d-none { display: none; }
.man-editor .mockup-editor-no-layout .i { width: 30px; height: 30px; }

.man-att-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 16px; border: 1px solid var(--line-2); }
.man-editor .mockup-page-file { margin: 0; background: transparent; border-color: var(--line-2); border-radius: 16px; font-size: 13px; }
.man-editor .mockup-page-file-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text); }
.man-editor .mockup-page-file-state { color: var(--subtle); }
.man-editor .mockup-page-file-state.has-file { color: var(--text-2); }
.man-editor .mockup-page-file-state.is-removed { color: var(--rose-ink); }
.man-editor .mockup-page-file-actions { align-items: center; }

.man-editor .mockup-editor-savebar { margin: 0; padding: 10px 10px 10px 18px; border-radius: 999px; background: color-mix(in oklab, var(--surface-2) 92%, transparent); border-color: var(--line-2); box-shadow: var(--shadow-3); }
.man-editor .mockup-editor-dirty { color: var(--pch-ink); }
.man-editor .mockup-editor-dirty-dot { background: var(--pch); }
@media (max-width: 560px) {
    .man-editor .mockup-layout-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .man-editor .mockup-layout-option { padding: 8px 6px; }
    .man-editor .mockup-editor-desk { padding: 6px; }
    .man-editor .mockup-editor-stage-container { padding: 8px; }
    .man-editor .mockup-editor-savebar { border-radius: 18px; flex-wrap: wrap; }
}
.man-drop.man-drop-sm { min-height: 150px; }
/* Add / edit manual form: where the intro picture went (content pages P4). */
.man-formhint { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--lav-deep); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.man-formhint > .i { flex: none; margin-top: 3px; color: var(--lav-ink); }
.man-formhint a { color: var(--lav-ink); font-weight: 600; text-underline-offset: 3px; }
/* A missing file (local storage) must not print its alt text over the card. */
.man-pg .mockup-slot img { color: transparent; font-size: 0; }

/* ---- Manual content pages — intro editor (manual_intro_page.html.twig,
   manual_content_editor_controller.js). The stage is "paper": the manual is
   always light, so the paper re-scopes the light tokens for the element
   chrome inside it in both themes; the content itself is styled by the
   shared `.mcp-*` rules in app.css (same as the public render). ---------- */
.mce-toolbar { position: sticky; top: 8px; z-index: 15; display: none; margin: 2px 0 10px; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.mce-toolbar.is-open { display: flex; }
.mce-toolbar.is-idle .mce-tb, .mce-toolbar.is-idle .mce-tb-font, .mce-toolbar.is-idle .mce-tb-size, .mce-toolbar.is-idle .mce-tb-colors { opacity: .45; }
.mce-tb { font-size: 15px; font-weight: 600; }
.mce-tb b, .mce-tb i, .mce-tb u { font-size: 15px; line-height: 1; }
.mce-tb-ol { font-size: 13px; font-variant-numeric: tabular-nums; }
.mce-tb.on { background: var(--lav-deep); color: var(--lav-ink); }
.mce-tb-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--line-2); }
.mce-tb-font { width: 210px; max-width: 100%; }
.mce-tb-size { width: 150px; max-width: 100%; }
.mce-tb-font { position: relative; }
.mce-tb-fontbtn { width: 100%; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.mce-tb-fontbtn:disabled { cursor: default; }
.mce-tb-fontlabel { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mce-fontmenu { top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 320px; overflow-y: auto; }
.mce-fontitem { font-size: 15px; white-space: nowrap; }
/* The inert stand-in every text element shows while not edited (same box as
   the live bar → no jump on focus). Pressing it focuses that text. */
.mce-toolbar-ghost { position: static; cursor: text; }
.mce-toolbar-ghost[hidden] { display: none; }
.mce-toolbar-ghost > * { pointer-events: none; }
.mce-toolbar-ghost .mce-swatch:disabled, .mce-toolbar-ghost select:disabled { opacity: 1; }
.mce-tb-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 4px; }
.mce-swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line-3); background: var(--sw, transparent); cursor: pointer; transition: box-shadow .15s, transform .12s; }
.mce-swatch:hover { transform: scale(1.08); }
.mce-swatch.on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--lav); }
.mce-swatch:disabled { cursor: default; transform: none; }
.mce-swatch-none { background: linear-gradient(135deg, transparent 45%, var(--rose) 45%, var(--rose) 55%, transparent 55%), var(--surface); }
.mce-tb-hint { margin-left: auto; }
.mce-link { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.mce-link .inp { flex: 1 1 260px; }

.mce-paper {
    --bg: #F6F4F8; --surface: #FFFFFF; --surface-2: #F1EEF5; --surface-3: #E8E4EE;
    --line: #E6E2EC; --line-2: #DAD5E1; --line-3: #C6C0CF;
    --text: #17151B; --text-2: #3A3640; --muted: #5E5966; --subtle: #6B6673;
    --lav-deep: #EEE8FC; --lav-ink: #5B47A8; --lav-glow: rgba(91,71,168,.16); --lav-line: rgba(91,71,168,.32);
    --rose-deep: #FCE4E8; --rose-ink: #A3334B;
    color-scheme: light;
    padding: 28px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: #313a46;
}
/* Sideways scroll only where three columns cannot fit: any overflow here also
   clips the "Přidat prvek" menu. */
@media (max-width: 767.98px) {
    .mce-paper { overflow-x: auto; }
    .mce-stage { min-width: 640px; }
}
/* The editing page starts at the manual's 845 px and grows only if the editing
   chrome needs it, so no element can end up out of reach. */
@media (min-width: 768px) {
    .mce-paper .mcp-page { height: auto; min-height: var(--mcp-h); overflow: visible; }
    .mce-paper .mcp-grid { height: auto; min-height: var(--mcp-h); grid-template-rows: repeat(2, minmax(min-content, 1fr)); }
    .mce-paper .mcp-seg { overflow: visible; }
}
.mce-seg { gap: 10px; padding: 10px; border-radius: 12px; outline: 1.5px dashed #D3D8E5; outline-offset: -1px; min-height: 140px; }
.mce-seg:hover, .mce-seg:focus-within { outline-color: #B9B0E3; }
.mce-els { display: flex; flex-direction: column; gap: 1.25rem; min-height: 56px; }
.mcp-va-center > .mce-els { margin-block: auto; }
.mcp-va-bottom > .mce-els { margin-top: auto; }
.mce-seg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.mcp-va-center > .mce-seg-foot { margin-top: 0; }
.mce-add-btn { color: var(--lav-ink); }
.mce-align { display: flex; gap: 2px; }
.mce-align .btn[aria-pressed="true"] { background: var(--lav-deep); color: var(--lav-ink); }
/* Painted page (colour / gradient / picture background): the editing chrome
   sits on frosted white chips so it reads on any background. */
.mce-has-bg .mce-el-bar { align-self: stretch; padding: 0 4px; border-radius: 8px; background: rgba(255,255,255,.88); box-shadow: 0 1px 2px rgba(23,21,27,.12); opacity: 1; }
.mce-has-bg .mce-add-btn, .mce-has-bg .mce-align { border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: 0 1px 2px rgba(23,21,27,.12); }
.mce-has-bg .mce-align { padding: 2px; }
.mce-has-bg .mce-seg { outline-color: rgba(255,255,255,.75); }
.mce-has-bg .mce-seg:hover, .mce-has-bg .mce-seg:focus-within { outline-color: #B9B0E3; }

.mce-el { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; margin: -6px -8px -8px; border-radius: 10px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.mce-el:hover, .mce-el:focus-within { border-color: var(--line-2); background: #FCFBFE; }
.mce-el-bar { display: flex; align-items: center; gap: 6px; min-height: 28px; color: var(--muted); font-size: 12px; font-weight: 600; opacity: .6; transition: opacity .15s; }
.mce-el:hover .mce-el-bar, .mce-el:focus-within .mce-el-bar { opacity: 1; }
@media (hover: none) { .mce-el-bar { opacity: 1; } }
.mce-grip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 26px; border-radius: 6px; color: var(--subtle); cursor: grab; }
.mce-grip:hover { background: var(--surface-3); color: var(--text); }
.mce-el-kind { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.mce-el-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.mce-el-del { color: var(--rose-ink); }
.mce-el .seg { padding: 2px; gap: 2px; }
.mce-el .seg button { height: 24px; padding: 0 9px; font-size: 12px; border-radius: 999px; }
.mce-el .seg.soft button.on { background: var(--lav-deep); color: var(--lav-ink); }

.mce-heading { display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; resize: none; overflow: hidden; background: transparent; color: inherit; font-family: inherit; outline: none; }
.mce-heading::placeholder { color: #B5BBC8; }
.mce-rt .ProseMirror { min-height: 1.6em; outline: none; white-space: pre-wrap; word-wrap: break-word; font-variant-ligatures: none; }
.mce-rt .ProseMirror > :first-child { margin-top: 0; }
.mce-rt .ProseMirror > :last-child { margin-bottom: 0; }
.mce-rt .ProseMirror li { position: relative; }
.mce-rt .ProseMirror-hideselection *::selection { background: transparent; }
.mce-rt .ProseMirror-selectednode { outline: 2px solid var(--lav); }
.mce-el-richText:not(:focus-within) .ProseMirror:has(> p:only-child > br:only-child)::before { content: 'Napište text…'; position: absolute; color: #B5BBC8; pointer-events: none; }
.mce-alt { height: 32px; font-size: 13px; background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--line-2) !important; }
.mce-uploading { padding: 14px; border-radius: 10px; border: 1.5px dashed var(--lav-line); color: var(--lav-ink); font-size: 13px; font-weight: 600; text-align: center; }
.mce-ghost { opacity: .4; }
.mce-drag { background: #fff; border-color: var(--lav) !important; box-shadow: 0 12px 32px rgba(23,21,27,.18); }


@media (max-width: 560px) {
    .mce-paper { padding: 14px; }
    .mce-tb-hint { display: none; }
    .mce-tb-font { width: 100%; }
}

/* Content page background bar ("Pozadí:", above the paper) — kind pills
   + that kind's controls in one full-width row (design 2026-11-11). */
.mce-bg { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 64px; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mce-bg-label { font-size: 14px; font-weight: 700; color: var(--text); }
.mce-bg .seg { padding: 3px; gap: 2px; }
.mce-bg .seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.mce-bg .seg button:disabled { opacity: .45; cursor: default; }
.mce-bg .seg.soft button.on { background: var(--lav-deep); color: var(--lav-ink); }
.mce-bg-pane { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.mce-bg-pane[hidden] { display: none; }
.mce-bg-sep { flex: none; width: 1px; height: 28px; background: var(--line-2); }
.mce-bg-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mce-bg .mce-swatch { width: 32px; height: 32px; }
.mce-bg-gradprev { flex: none; width: 64px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); }
.mce-bg-end { margin-left: auto; }
.mce-bg-end[hidden] { display: none; }
.mce-bg .btn.mce-bg-end, .mce-bg-change { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); }
.mce-bg-drop { display: flex; flex: 1 1 260px; align-items: center; gap: 14px; min-height: 52px; padding: 6px 14px 6px 6px; border-radius: 12px; border: 1.5px dashed var(--line-3); background: transparent; color: var(--muted); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.mce-bg-drop:hover, .mce-bg-drop.is-over { border-color: var(--lav); background: var(--lav-deep); color: var(--text); }
.mce-bg-drop-ico { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 40px; border-radius: 8px; background: var(--lav-deep); color: var(--lav-ink); }
.mce-bg-thumb { flex: none; width: 64px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2) center / cover no-repeat; }
.mce-bg-meta { flex: 1 1 140px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.mce-bg-del { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--rose-ink); }
.mce-bg-pop { position: absolute; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); }
.mce-bg-pop[hidden] { display: none; }
.mce-bg-pop-colors { max-width: 260px; }
.mce-bg-pop-angle { flex-direction: column; width: 260px; }
.mce-bg-angle-row { display: flex; align-items: center; gap: 10px; }
.mce-bg-angle-row input { flex: 1; }
.mce-bg-angle-val { min-width: 42px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
.mce-bg-angle-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mce-bg-pop-center { display: grid; grid-template-columns: repeat(3, 32px); gap: 4px; }
.mce-bg-center { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.mce-bg-center:hover { border-color: var(--line-3); }
.mce-bg-center-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.mce-bg-center.on { border-color: var(--lav); }
.mce-bg-center.on .mce-bg-center-dot { background: var(--lav); }
.mce-bg-note, .mce-bg .mce-uploading { flex-basis: 100%; margin-top: 0; }
.mce-bg .mce-uploading { padding: 8px; }
@media (max-width: 767.98px) {
    .mce-bg-sep { display: none; }
    .mce-bg-pane { flex-basis: 100%; }
    .mce-bg-kinds { display: flex; flex: 1 1 100%; min-width: 0; box-sizing: border-box; }
    .mce-bg-kinds button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 4px; font-size: 12.5px; }
    .mce-bg-fit { margin-left: 0; }
}

/* Content pages P3 — gallery picker in the manual editors. */
.mce-img-unavailable { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); font-size: 12.5px; font-weight: 600; }
.mockup-editor-slot-gallery { margin-top: 8px; pointer-events: auto; }
