/**
 * Frontend styly modulu Připomínkování.
 *
 * Sjednoceno s entangle-styles.css (--font-*, --space-*, --color-*) — barvy a
 * typografie přebírají z hlavního pluginu (.entangle-container__holder definuje
 * tokens). Lokální fallbacky pro plugin-specific koncepty (muted, hover bg).
 *
 * Typografie OBSAHU dokumentu (uvnitř .ent-consultation__active-section-content)
 * je úmyslně CSS-fallback only — šablona si může h2/h3/p/ul nastavit vlastní
 * velikosti / fonty a my je nepřepíšeme.
 */

/* WP admin bar height — pro logged-in uživatele. Body.admin-bar je class kterou WP přidává. */
body.admin-bar { --wp-admin-bar-height: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar { --wp-admin-bar-height: 46px; }
}

/* The size of the host's own text as a LENGTH (entangle-core registers the same name; said here too, because this
   sheet also stands on pages where core's does not load). See entangle-styles.css, "The type scale". */
@property --entangle-em {
    syntax: "<length>";
    inherits: true;
    initial-value: 16px;
}

/* What every root of this module shares — the consultation itself, the public table of resolutions and the archive
   (which may stand alone on a page), a document. The TYPE is in steps of the host's text (--entangle-em: on a page
   set at 19px the consultation was a 15px island, 13. 11.), and the NEUTRALS are the family of the other widgets:
   a theme names them once (--entangle-surface, --entangle-line, --entangle-muted) and this module follows; without
   a theme they fall back to what stood here before. */
.ent-consultation,
.ent-resolution-table-wrap,
.ent-document {
    --entangle-em: var(--entangle-font-size, 1em);
    --ent-c-bg:        var(--color-contrast, #fff);
    --ent-c-fg:        var(--color-base, #222);
    --ent-c-muted:     var(--entangle-muted, color-mix(in srgb, var(--color-base, #222) 68%, transparent));
    --ent-c-border:    var(--entangle-line, var(--color-neutral-300, #ccc));
    --ent-c-border-strong: var(--entangle-line-strong, color-mix(in srgb, var(--color-base, #222) 45%, transparent));
    --ent-c-surface:   var(--entangle-surface, var(--color-neutral-100, #f5f5f5));
    --ent-c-accent:    var(--color-primary, #2271b1);
    --ent-c-accent-fg: var(--color-contrast, #fff);
}

.ent-consultation {
    --ent-c-success:  #00a32a;
    --ent-c-error:    #d63638;
    --ent-c-warning-bg: #fef8ee;
    --ent-c-warning-fg: #ad6800;

    background: var(--ent-c-bg);
    color: var(--ent-c-fg);
    max-width: 1920px;
    margin: 0 auto;
    padding: var(--space-4, 1rem);
    /* The host's size, and NOT var(--font-base): the scale is measured from this element. */
    font-size: max(1em, 14px);
    line-height: var(--line-height-base, 1.5);
}

.ent-consultation__notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: var(--ent-c-warning-bg);
    color: var(--ent-c-warning-fg);
    border-left: 3px solid var(--ent-c-warning-fg);
    border-radius: 4px;
}

/* Modrý infobox — např. výzva „prohlédněte si existující připomínky".
   Margin: 0 0 1.5rem — infobox je „kontext před akcí" (search + list níže),
   pattern zdůrazňuje že patří k content, ne k header nahoře. */
.ent-consultation__infobox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0.875rem 1.125rem;
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    font-size: calc(var(--entangle-em) * 0.9);
    line-height: 1.5;
}
.ent-consultation__infobox-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #2563eb;
}

/* ─── Header ─────────────────────────────────────────── */

.ent-consultation__header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: nowrap;         /* single-row layout, overflow řídíme ellipsis */
    align-items: center;
    gap: 0.75rem;
    /* Negativní margin přebíjí padding parent `.ent-consultation` —
       header (i jeho shadow) se táhne přes celou šířku kontejneru a
       přisedne k top viewportu bez mezery. Bottom = 0, sidebar i obsah
       jsou nalepené přímo na header (viz .ent-consultation__layout). */
    margin: calc(-1 * var(--space-4, 1rem)) calc(-1 * var(--space-4, 1rem)) 0;
    padding: 0.5rem var(--space-4, 1rem);
    background: var(--ent-c-bg);
    /* Dvouvrstvá shadow — subtilní 2px linka pro definici + měkký spread. */
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.05);
    min-height: 3.5rem;         /* baseline ~56px na desktopu */
}
/* Brand = obal logo + title, klikatelný odkaz na intro.
   Přebijeme theme underline (často aplikované přes `text-decoration` nebo
   `background: linear-gradient(...)` na `<a>` v .entry-content). */
.ent-consultation__brand,
.ent-consultation__brand:hover,
.ent-consultation__brand:focus,
.ent-consultation__brand:active {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-width: 0;               /* KRITICKÉ — umožní ellipsis na title */
    text-decoration: none !important;
    background: none !important;
    color: inherit;
    cursor: pointer;
    box-shadow: none !important;
}
.ent-consultation__brand .ent-consultation__title {
    text-decoration: none !important;
    background: none !important;
}
/* Přihlášený uživatel má admin bar (32/46 px) — header pod ním. */
body.admin-bar .ent-consultation__header { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .ent-consultation__header { top: 46px; }
}
.ent-consultation__logo {
    max-height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}
.ent-consultation__title {
    margin: 0;
    font-size: calc(var(--entangle-em) * 1.15);
    line-height: 1.25;
    font-weight: 600;           /* pevnější hierarchie */
    letter-spacing: -0.01em;    /* jemné zúžení pro delší názvy */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ent-consultation__date {
    color: var(--ent-c-muted);
    font-size: calc(var(--entangle-em) * 0.9);
    white-space: nowrap;
    flex-shrink: 0;
}
/* Prázdný date span (šablona ho nerenderuje, ale safety net). */
.ent-consultation__date:empty { display: none; }

/* „Zpět na web" — vždy úplně vpravo. margin-inline-start je RTL-friendly. */
.ent-consultation__back {
    margin-inline-start: auto;
    color: var(--ent-c-accent);
    text-decoration: none;
    font-size: calc(var(--entangle-em) * 0.95);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 6px;
}
.ent-consultation__back:hover {
    text-decoration: underline;
}
/* SVG šipka — přebírá barvu z parent (stroke="currentColor" v markupu).
   Explicit width/height jistí velikost napříč prohlížeči (bez toho by SVG
   dostalo default 300×150). Block display + flex-shrink zabrání deformaci. */
.ent-consultation__back-arrow {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}
/* Focus-visible — kritické pro klávesnicové uživatele (WCAG 2.4.7).
   Aktuální browser default outline mohl být resetován theme CSS-em. */
.ent-consultation__brand:focus-visible,
.ent-consultation__back:focus-visible {
    outline: 2px solid var(--ent-c-accent);
    outline-offset: 2px;
    border-radius: 6px;
}
.ent-consultation__status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    font-size: calc(var(--entangle-em) * 0.75);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}
.ent-consultation__status--open     { background: #d1f4d8; color: #126e1d; }
.ent-consultation__status--closed   { background: #fcf0e3; color: #8a4a14; }
.ent-consultation__status--resolved { background: #e2e9ff; color: #1a3a8a; }

/* ─── Header responzivita ────────────────────────────── */

/* Tablet a menší monitory (≤900px) — kompaktnější spacing, datum se skryje
   (je zobrazen v content area níže v intro textu). */
@media (max-width: 900px) {
    .ent-consultation__header { gap: 0.5rem; padding: 0.5rem 0.75rem; min-height: 3.25rem; }
    .ent-consultation__brand  { gap: 0.5rem; }
    .ent-consultation__logo   { max-height: 32px; }
    .ent-consultation__title  { font-size: calc(var(--entangle-em) * 1); }
    .ent-consultation__date   { display: none; }
}

/* Mobile (≤600px) — title i status se zalamují, ne truncují.
   Header narůstá vertikálně (align-items: center → items zůstanou centrované). */
@media (max-width: 600px) {
    .ent-consultation__header { gap: 0.4rem; padding: 0.5rem 0.5rem; min-height: 3rem; align-items: center; }
    .ent-consultation__logo   { max-height: 28px; }
    .ent-consultation__title  {
        font-size: calc(var(--entangle-em) * 0.85);
        line-height: 1.25;
        white-space: normal;         /* přebíjí desktop nowrap */
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;     /* dělí extra dlouhá slova (URL apod.) */
    }
    .ent-consultation__status {
        font-size: calc(var(--entangle-em) * 0.6);
        padding: 2px 6px;
        letter-spacing: 0.02em;
        white-space: normal;
        line-height: 1.15;
        text-align: center;
        /* max-width limituje šířku pill; text uvnitř wrapuje na mezerách.
           break-word (ne `anywhere`) = dělí uvnitř slova jen jako fallback
           když slovo samo přesáhne šířku. `Probíhá sběr připomínek` wrapuje
           na 2 řádky na mezerách; `Vypořádáno` (single word) zůstane 1 řádek. */
        max-width: 9em;
        overflow-wrap: break-word;
        flex-shrink: 1;
    }
    /* Icon-only back link — text skrytý, SVG šipka zvětšená a centrovaná.
       Background pro vizuální oddělení + min 44×44 tap target (Apple HIG). */
    .ent-consultation__back-text  { display: none; }
    .ent-consultation__back-arrow { width: 22px; height: 22px; }
    .ent-consultation__back {
        background: rgba(0, 0, 0, 0.04);
        border-radius: 8px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        /* Center SVG v obou osách — flex parent + align-items:center (base rule)
           + justify-content:center = SVG přesně uprostřed 44×44 tap targetu. */
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
    .ent-consultation__back:hover {
        background: rgba(0, 0, 0, 0.08);
        text-decoration: none;
    }
}

/* Extra small (≤380px) — kompaktnější padding, pill i title zůstávají celé
   (zalamují se, netruncují). Header narůstá vertikálně dle obsahu. */
@media (max-width: 380px) {
    .ent-consultation__header { padding: 0.4rem 0.4rem; gap: 0.3rem; }
    .ent-consultation__title  { font-size: calc(var(--entangle-em) * 0.8); }
    .ent-consultation__status { font-size: calc(var(--entangle-em) * 0.55); padding: 2px 5px; max-width: 8em; }
}

/* ─── Layout ─────────────────────────────────────────── */

.ent-consultation__layout {
    display: grid;
    grid-template-columns: 373px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* WP admin bar height — CSS var pro reliable calc s viewport offsets. */
:root { --wp-admin-bar-height: 0px; }
body.admin-bar { --wp-admin-bar-height: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar { --wp-admin-bar-height: 46px; }
}

/* Sticky header height — realistický fallback pro první paint před tím, než JS
   změří skutečnou výšku a přepíše var. Hodnota odpovídá:
   min-height 3.5rem + padding-Y 0.5rem × 2 = 4.5rem (desktop).
   Bez tohoto fallbacku sidebar top skočí z 5rem na ~4.5rem po JS boot = layout shift. */
:root { --ent-header-height: 4.5rem; }
@media (max-width: 900px) { :root { --ent-header-height: 4.25rem; } }
/* Mobile fallback = 2 řádky title (0.85rem × 1.25 × 2 = ~34px) + padding 1rem + logo/status
   margin — realistický odhad pro předpokládaný title. JS override skutečnou hodnotou. */
@media (max-width: 600px) { :root { --ent-header-height: 5rem; } }
@media (max-width: 380px) { :root { --ent-header-height: 5.25rem; } }

/* Screen-reader only utility. */
.ent-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ent-consultation__sidebar {
    position: sticky;
    /* Sidebar top musí respektovat sticky header nad ním (jinak by se překrývaly).
       Fallback 5rem, JS aktualizuje --ent-header-height podle skutečné výšky. */
    top: var(--ent-header-height, 5rem);
    align-self: start;
    /* Sidebar sahá až ke dnu viewportu (header margin-bottom je 0).
       Fallback vh pro Safari <15.4. */
    max-height: calc(100vh - var(--ent-header-height, 5rem));
    max-height: calc(100dvh - var(--ent-header-height, 5rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 0.75rem;                  /* Y padding sjednocený s .ent-consultation__main */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
    min-height: 0;
}
body.admin-bar .ent-consultation__sidebar {
    top: calc(32px + var(--ent-header-height, 5rem));
    max-height: calc(100vh - 32px - var(--ent-header-height, 5rem));
    max-height: calc(100dvh - 32px - var(--ent-header-height, 5rem));
}
@media screen and (max-width: 782px) {
    body.admin-bar .ent-consultation__sidebar {
        top: calc(46px + var(--ent-header-height, 5rem));
        max-height: calc(100vh - 46px - var(--ent-header-height, 5rem));
        max-height: calc(100dvh - 46px - var(--ent-header-height, 5rem));
    }
}
/* WebKit scrollbar — thumb 0.35 opacity (dřív 0.2 = neviditelný, WCAG 1.4.11). */
.ent-consultation__sidebar::-webkit-scrollbar { width: 6px; }
.ent-consultation__sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 3px;
}
.ent-consultation__sidebar::-webkit-scrollbar-track { background: transparent; }

.ent-consultation__sidebar-head {
    display: none; /* skrytý na desktop — obsahuje jen mobile close button */
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ent-consultation__sidebar-close {
    background: transparent;
    border: 0;
    font-size: calc(var(--entangle-em) * 1.75);
    line-height: 1;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--ent-c-fg);
    /* WCAG 2.5.5 tap target — min 44×44 na mobile. */
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
}
.ent-consultation__sidebar-close:hover { background: rgba(0, 0, 0, 0.05); }
.ent-consultation__sidebar-close:focus-visible {
    outline: 2px solid var(--ent-c-accent);
    outline-offset: 2px;
}
/* Backdrop — fade transition (namísto display swap = žádná animace). */
.ent-consultation__sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ent-consultation__main {
    display: grid;
    gap: 1.5rem;
    /* Y padding je na child .ent-consultation__interactive — duplicitní padding
       tady by způsobil 3rem odsazení. Sidebar (sibling grid item) má vlastní
       padding: 1.5rem 0.75rem pro symetrii. */
    /* min-width/min-height: 0 — nutné, jinak grid item defaultně dostane
       min-height: auto, což může způsobit vlastní scrollbar když parent grid
       row je limitován sticky sidebarem. */
    min-width: 0;
    min-height: 0;
}

/* ─── Mobile trigger (bottom-fixed) ──────────────────── */
.ent-consultation__mobile-trigger {
    display: none; /* zobrazí se na mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    /* Safe area pro iPhone home indicator. */
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)) 20px;
    background: var(--ent-c-accent);
    color: var(--ent-c-accent-fg);
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--ent-c-accent) 80%, black);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    min-height: 56px;
}
.ent-consultation__mobile-trigger:focus-visible {
    outline: 2px solid var(--ent-c-accent-fg);
    outline-offset: -4px;
}
.ent-consultation__mobile-trigger-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

/* ─── Responsive: <=900px = mobile offcanvas ─────────── */
@media (max-width: 900px) {
    .ent-consultation__layout {
        grid-template-columns: 1fr;
    }

    .ent-consultation {
        /* Safe area — prostor pro fixed trigger + iPhone home indicator. */
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .ent-consultation__mobile-trigger {
        display: block;
    }

    .ent-consultation__sidebar {
        position: fixed;
        /* Pod WP admin barem (pokud přihlášený) — díky CSS var funguje spolehlivě. */
        top: var(--wp-admin-bar-height, 0px);
        left: 0;
        z-index: 999;
        width: min(85vw, 360px);
        /* 100dvh = dynamic viewport (respektuje iOS Safari address bar).
           100vh = fallback pro starší prohlížeče. calc() odečte admin bar. */
        height: calc(100vh - var(--wp-admin-bar-height, 0px));
        height: calc(100dvh - var(--wp-admin-bar-height, 0px));
        max-height: none;
        background: var(--ent-c-bg);
        padding: 1rem 1rem calc(80px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        overscroll-behavior: contain;
        /* KRITICKÉ — přebijí `touch-action: none` z html:has() scroll-locku
           (jinak by iOS na sidebaru neregistroval touch scroll). */
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    .ent-consultation__sidebar.is-open {
        transform: translateX(0);
    }
    /* Backdrop existuje vždy v mobile viewport, jen se fade-uje opacita. */
    .ent-consultation__sidebar-backdrop { display: block; }
    .ent-consultation__sidebar.is-open ~ .ent-consultation__sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    /* Na mobile zobraz header (s close button uvnitř). */
    .ent-consultation__sidebar-head {
        display: flex;
    }
}

/* RTL — offcanvas z pravé strany. */
[dir="rtl"] .ent-consultation__sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}
[dir="rtl"] .ent-consultation__sidebar.is-open { transform: translateX(0); }

/* Prefers reduced motion — respektuj OS preferenci. */
@media (prefers-reduced-motion: reduce) {
    .ent-consultation__sidebar,
    .ent-consultation__sidebar-backdrop { transition: none; }
}

/* iOS/modern scroll lock když je sidebar otevřený — `overflow: hidden`
   na body nefunguje na iOS Safari. `html:has()` je robustnější řešení.
   POZOR: `touch-action: none` nesmí být na html (blokovalo by scroll
   uvnitř sidebar přes CSS inheritance). Sidebar má explicit `touch-action: pan-y`
   a `overscroll-behavior: contain` — scroll uvnitř bez leaku do documentu. */
html:has(.ent-consultation__sidebar.is-open) {
    overflow: hidden;
}
html:has(.ent-consultation__sidebar.is-open) body {
    overflow: hidden;
}

/* ─── Section tree ───────────────────────────────────── */

.ent-section-tree,
.ent-section-tree--children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ent-section-tree--children {
    /* Logické properties = RTL-friendly. Solid border místo dashed (méně wireframe). */
    margin-inline-start: 0.75rem;
    border-inline-start: 1px solid var(--ent-c-border);
    padding-inline-start: 0.75rem;
}
.ent-section-node {
    margin: 0.125rem 0;
}
.ent-section-node__btn {
    font-family: inherit;
    appearance: none;
    background: transparent;
    border: none;
    /* Reserved místo pro active indikátor — zabraňuje layout jump při klik. */
    border-left: 2px solid transparent;
    text-align: start;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
    color: var(--ent-c-fg);
    width: 100%;
    font-size: calc(var(--entangle-em) * 0.95);
    line-height: 1.35;
    transition: background 0.15s, border-color 0.15s;
    /* Long labels bez mezer (české slova s pomlčkami) — force wrap. */
    overflow-wrap: anywhere;
    hyphens: auto;
    min-height: 36px;
}
/* Hover jen na hover-capable zařízeních (ne na touch → nelepí). */
@media (hover: hover) {
    .ent-section-node__btn:hover { background: var(--ent-c-surface); }
}
.ent-section-node__btn:focus-visible {
    outline: 2px solid var(--ent-c-accent);
    outline-offset: 2px;
}
/* Aktivní stav: subtilní tinted bg + border-left indikátor (namísto full-fill).
   Match aria-current="page" i legacy .is-active class. */
.ent-section-node__btn.is-active,
.ent-section-node__btn[aria-current="page"] {
    background: color-mix(in srgb, var(--ent-c-accent) 12%, transparent);
    color: var(--ent-c-accent);
    border-left-color: var(--ent-c-accent);
    font-weight: 600;
}
/* Typography scale — širší spread + reálné weight/color steps místo opacity
   (opacity fail WCAG kontrast). */
.ent-section-node--level-1 > .ent-section-node__btn { font-size: calc(var(--entangle-em) * 0.95); font-weight: 600; }
.ent-section-node--level-2 > .ent-section-node__btn { font-size: calc(var(--entangle-em) * 0.9);  font-weight: 500; }
.ent-section-node--level-3 > .ent-section-node__btn { font-size: calc(var(--entangle-em) * 0.85); color: var(--ent-c-muted); }
.ent-section-node--level-4 > .ent-section-node__btn { font-size: calc(var(--entangle-em) * 0.8);  color: var(--ent-c-muted); }
.ent-section-node--level-5 > .ent-section-node__btn { font-size: calc(var(--entangle-em) * 0.78); color: var(--ent-c-muted); }

/* ─── Accordion — jen jedna L1 sekce může být otevřená naráz.
   Children default hidden; `.is-expanded` je zobrazí. JS řídí toggle.
   Chevron indikátor jen když L1 skutečně má children (`:has()` selector). */
.ent-section-node--level-1 > .ent-section-tree--children {
    display: none;
}
.ent-section-node--level-1.is-expanded > .ent-section-tree--children {
    display: block;
}
/* Flex layout na L1 button, aby chevron šel do pravého kraje. */
.ent-section-node--level-1:has(> .ent-section-tree--children) > .ent-section-node__btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Chevron — CSS-only přes border, ▶ default, ▼ pro expanded. */
.ent-section-node--level-1:has(> .ent-section-tree--children) > .ent-section-node__btn::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    margin-inline-start: auto;
    flex-shrink: 0;
    opacity: 0.55;
}
.ent-section-node--level-1.is-expanded:has(> .ent-section-tree--children) > .ent-section-node__btn::after {
    transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
    .ent-section-node--level-1 > .ent-section-node__btn::after { transition: none; }
}

/* Mobile: bigger tap targets (WCAG 2.5.5 AAA + Apple HIG) + redukce indent. */
@media (max-width: 900px) {
    .ent-section-node__btn,
    .ent-section-node__btn--intro,
    .ent-section-node__btn--free {
        min-height: 44px;
        padding: 0.75rem;
    }
    .ent-section-tree--children {
        margin-inline-start: 0.5rem;
        padding-inline-start: 0.5rem;
    }
    /* Off-canvas sidebar má hodně vertikálního prostoru → všechny L1 sekce
       s children rozbalené vždy. Bez toho by uživatel musel tapnout 2× (jednou
       na L1 expand, podruhé na cílovou podsekci). Accordion (jedna otevřená
       naráz) má smysl jen na desktop sidebar. */
    .ent-section-node--level-1 > .ent-section-tree--children {
        display: block;
    }
    /* Chevron na L1 → dolů (:has expanded selector se používá i bez .is-expanded). */
    .ent-section-node--level-1:has(> .ent-section-tree--children) > .ent-section-node__btn::after {
        transform: rotate(45deg);
    }
}

/* Horní sekce sidebar: Úvodní stránka (+ volitelně volná připomínka). */
.ent-section-tree__top {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ent-c-border);
}
/* Volná připomínka pod stromem sekcí (default umístění). */
.ent-section-tree__bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ent-c-border);
}
.ent-section-node__btn--free {
    color: var(--ent-c-accent);
    font-weight: 500;
    /* Dashed border container = viditelně tlačítko, ne text link. */
    border: 1px dashed var(--ent-c-accent);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    text-align: center;
    /* Zruší reservované border-left aby nebyl zdvojnásobený. */
    border-left-width: 1px;
}
.ent-section-node__btn--intro {
    font-weight: 600;
}
/* Ikona v HTML jako <span aria-hidden="true"> — přesun z ::before pro SR compat. */
.ent-section-node__btn--intro .ent-section-node__icon {
    margin-inline-end: 6px;
}
.ent-section-tree__empty {
    font-size: calc(var(--entangle-em) * 0.9);
    color: var(--ent-c-muted);
    margin: 0.5rem 0;
    padding: 0.5rem;
}

/* ─── Document (Gutenberg HTML / PDF object) ────────── */

.ent-consultation__document {
    padding: 1.5rem 0;
}
.ent-consultation__document .ent-section {
    scroll-margin-top: 1rem;
    transition: background 0.3s;
    padding: 0.5rem;
    border-radius: 4px;
}
.ent-consultation__document .ent-section.is-highlighted {
    background: #fff8db;
    box-shadow: 0 0 0 2px #f0c33c;
}
.ent-pdf-viewer-wrap {
    border-radius: var(--ent-c-radius);
    overflow: hidden;
}
.ent-pdf-fallback {
    padding: 2rem;
    text-align: center;
    background: var(--ent-c-surface);
}

/* ─── Interactive (search-first wizard) ──────────────── */

.ent-consultation__interactive {
    /* Top padding 2.5rem = ~40px vzduchu pod sticky headerem (dost pro rytmus
       + neschovává obsah pod shadow, ne zbytečně velké pro browsing view).
       Horizontal 0 — outer `.ent-consultation` padding (1rem = 16px) je jediná
       vrstva side spacingu na mobile (grid `.active-section-content` má
       zkolabované outer columns na mobile), takže text má standardních 16px
       od okraje viewportu. Na desktopu grid dělá full/wide breakout. */
    padding: 2.5rem 0 1.5rem;
}
@media (min-width: 640px) {
    .ent-consultation__interactive { padding: 4rem 0 1.5rem; }
}
/* Centrované step containery s čitelnou max-šířkou (65ch ≈ 600px, best-practice
   45-75 znaků na řádek). Platí pro intro, obsah sekce i komentáře.
   Constraint je na PER-CHILD úrovni (ne na containeru), aby wide/full aligned
   Gutenberg bloky (např. entangle/enhanced-table) mohly break-outnout širší. */
.ent-consultation__step {
    margin-left: auto;
    margin-right: auto;
    /* Container width = přirozená šířka (100% .interactive parent). */
}
/* Content clamp platí pro VŠECHNY direct children KROMĚ active-section-content,
   který má vlastní grid layout definovaný níže (řízený subgridem, potřebuje full
   width parenta aby wide/full breakout fungoval). */
.ent-consultation__step > *:not(.ent-consultation__active-section-content) {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}
/* Wide/Full alignment support — pro Gutenberg bloky s align="wide" / "full".
   Blok obvykle dostane class alignwide/alignfull na svém wrapping elementu. */
.ent-consultation__step > .alignwide {
    max-width: 1200px;
}
.ent-consultation__step > .alignfull {
    max-width: 100%;
}
.ent-consultation__hint {
    margin: 0;
    color: var(--ent-c-muted);
    font-style: italic;
}
.ent-consultation__intro {
    margin: 0;
    color: var(--ent-c-fg);
    line-height: 1.6;
}
.ent-consultation__intro p  { margin: 0 0 0.75rem; }
.ent-consultation__intro p:last-child { margin-bottom: 0; }
.ent-consultation__intro a  { color: var(--ent-c-accent); }
.ent-consultation__intro h2 { margin: 1.25rem 0 0.5rem; font-size: calc(var(--entangle-em) * 1.25); font-weight: 700; }
.ent-consultation__intro h3 { margin: 1.25rem 0 0.5rem; font-size: calc(var(--entangle-em) * 1.1);  font-weight: 700; }
.ent-consultation__intro h4 { margin: 1rem 0 0.5rem;    font-size: calc(var(--entangle-em) * 1);    font-weight: 600; }
.ent-consultation__intro ul,
.ent-consultation__intro ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
}
.ent-consultation__intro ul { list-style: disc; }
.ent-consultation__intro ol { list-style: decimal; }
.ent-consultation__intro li { margin: 0 0 0.25rem; }
.ent-consultation__intro blockquote {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--ent-c-border);
    color: var(--ent-c-muted);
    font-style: italic;
}
.ent-consultation__intro > *:first-child { margin-top: 0; }
.ent-consultation__intro > *:last-child  { margin-bottom: 0; }

/* Mobile intro — sladěno s .active-section-content mobile typografií.
   Stejná redukce (15px, line-height 1.5) → jednotný reading rytmus napříč
   celou konzultací (Instrukce + browsing sekce). */
@media (max-width: 600px) {
    .ent-consultation__intro,
    .ent-consultation__intro p,
    .ent-consultation__intro li,
    .ent-consultation__intro ul,
    .ent-consultation__intro ol,
    .ent-consultation__intro blockquote {
        font-size: calc(var(--entangle-em) * 0.9375);
        line-height: 1.5;
    }
}
.ent-consultation__browsing-header {
    margin: 0 0 1rem;
}
/* Selected label — clamp() škáluje font od 1.25rem (mobile) po 1.6rem (desktop).
   text-wrap: balance ostatní řádky na optimální lomení. */
.ent-consultation__selected-label {
    margin: 0;
    font-size: clamp(calc(var(--entangle-em) * 1.25), calc(var(--entangle-em) * 1.1) + 1.2vw, calc(var(--entangle-em) * 1.6));
    font-weight: 600;
    line-height: 1.25;
    text-wrap: balance;
    overflow-wrap: anywhere;
    hyphens: auto;
}
/* Active section content — full-bleed grid container.
   Typography scale sjednocena na 1.25 ratio (major third):
   1.6 (selected) → 1.28 (h2/comments h3) → 1.024 (content h3) → 1rem (h4/h5).

   ─── Full-bleed grid layout pro Gutenberg content ────────────────────
   Grid je definovaný na PARENTU (active-section-content), protože ten je stable
   direct child .ent-consultation__main (1fr grid item se známou šířkou ~1139px).
   Section pak dědí kolony přes `subgrid` a její children se mapují na main/wide/full.

     [full-start] [wide-start] [main-start] MAIN [main-end] [wide-end] [full-end]
      ← plná ───────────────────────────────────────────────────────── plná →
                   ← 1200px ─────────────────────────────── 1200px →
                                 ← 65ch ─────── 65ch →

   Default child → grid-column: main = 65ch čtecí šířka
   .alignwide     → grid-column: wide = 1200px
   .alignfull     → grid-column: full = 100 % containeru

   Root cause fix: Předchozí pattern měl grid na section, která byla škrcená
   parentem (.step > * clamp = 65ch). Grid tracks resolvovaly proti 656px místo
   full 1139px, takže main track = 624px (65ch v malém boxu). Teď grid žije na
   parentu, který NENÍ clampnutý (výše: :not(active-section-content)), a section
   pouze zdědí tracks přes subgrid. Žádné !important, žádné width kalkulace. */
.ent-consultation__active-section-content {
    margin: var(--space-4, 1rem) 0 var(--space-6, 2rem);
    line-height: 1.6;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: anywhere;

    display: grid;
    grid-template-columns:
        [full-start] minmax(1rem, 1fr)
        [wide-start] minmax(0, calc((1200px - 65ch) / 2))
        [main-start] min(65ch, 100% - 2rem) [main-end]
        minmax(0, calc((1200px - 65ch) / 2)) [wide-end]
        minmax(1rem, 1fr) [full-end];
    /* Grid slouží jen pro column-level layout (main/wide/full breakout).
       Vertikální spacing řídí margin-top na children přes lobotomized owl
       (viz níže .active-section-content > section > * + *). Grid row-gap = 0
       aby se nesčítal s margins (v grid margins nekolabují). */
    row-gap: 0;
}
/* Default track pro non-section direct children (např. div.ent-consultation__free-intro
   který se renderuje pro volnou připomínku bez anchor sekce). Bez tohoto pravidla by
   grid auto-place umístil element do prvního tracku (minmax(1rem, 1fr)) = 1rem šířky
   → text se rozpadne na jeden znak na řádek. Section rule níže má stejnou specifitu,
   ale díky cascade order (později v CSS) overrides na full-start/full-end. */
.ent-consultation__active-section-content > * {
    grid-column: main-start / main-end;
    min-width: 0;
}
.ent-consultation__active-section-content > section {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: full-start / full-end;
    row-gap: 0;  /* margins řídí spacing (viz owl pattern níže) */
}
.ent-consultation__active-section-content > section > * {
    grid-column: main-start / main-end;
    /* Grid item defaultně dostane min-width: auto, což může způsobit overflow
       s dlouhými nezalomitelnými nadpisy. Reset na 0 zajistí wrap. */
    min-width: 0;
}
.ent-consultation__active-section-content > section > .alignwide {
    grid-column: wide-start / wide-end;
}
.ent-consultation__active-section-content > section > .alignfull {
    grid-column: full-start / full-end;
}

/* Embed HTML bloky s vizuálním obsahem širším než čtecí sloupec (grafy, mapy,
   custom SVG dashboards atd.) — auto-detekce podle common class prefixů.
   `.rvn-chart` je custom SVG graf z Gutenberg wp:html blocku (autor ho neoznačil
   explicitně align="wide", ale semanticky sem patří). Necháváme mu vlastní
   max-width (definuje si ho embed sám) a jen ho mapujeme na wide grid track. */
.ent-consultation__active-section-content > section > .rvn-chart {
    grid-column: wide-start / wide-end;
    justify-self: center;
    width: 100%;
    /* Containment — brání SVG uvnitř `.rvn-scroll` overflowu způsobit horizontal
       scroll celého viewportu na mobile. min-width: 0 na grid itemu už je set výše,
       ale content-visibility zajišťuje že layout containeru nedeformuje intrinsic
       size dětí (SVG s min-width: 760px). */
    max-width: 100%;
    overflow: hidden;    /* clip SVG expansion — .rvn-scroll uvnitř má vlastní overflow-x: auto */
}

/* ─── Prev/Next chapter navigation ───────────────────── */
.ent-consultation__chapter-nav {
    display: flex;
    gap: var(--space-3, 0.75rem);
    margin: var(--space-5, 1.5rem) 0;
}
.ent-consultation__chapter-nav-btn {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    background: var(--ent-c-bg);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius, 0.5rem);
    color: var(--ent-c-fg);
    cursor: pointer;
    font: inherit;
    text-align: left;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.15s, transform 0.15s;
}
.ent-consultation__chapter-nav-btn:hover {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.04);
}
.ent-consultation__chapter-nav-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}
.ent-consultation__chapter-nav-btn:focus-visible {
    outline: 2px solid var(--ent-c-accent);
    outline-offset: 2px;
}
.ent-consultation__chapter-nav-btn--next {
    text-align: right;
}
.ent-consultation__chapter-nav-dir {
    font-size: var(--font-xs, calc(var(--entangle-em) * 0.8125));
    color: var(--ent-c-accent);
    font-weight: 500;
}
/* Label = 2-řádkový line-clamp (nowrap + ellipsis ztrácely kontext delších názvů). */
.ent-consultation__chapter-nav-label {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
/* Solo next tlačítko (první sekce) — neroste na 100 %, drží se vpravo. */
.ent-consultation__chapter-nav-btn--prev[hidden] + .ent-consultation__chapter-nav-btn--next {
    margin-inline-start: auto;
    flex: 0 1 auto;
    max-width: 60%;
}
/* Bump breakpoint z 480 na 640 — mezi 481-640px byly cards moc úzké, ellipsis. */
@media (max-width: 640px) {
    .ent-consultation__chapter-nav { flex-direction: column; }
    .ent-consultation__chapter-nav-btn { flex: 1 1 auto; }
    .ent-consultation__chapter-nav-btn--next { text-align: left; }
    .ent-consultation__chapter-nav-btn--prev[hidden] + .ent-consultation__chapter-nav-btn--next {
        max-width: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .ent-consultation__chapter-nav-btn { transition: none; }
    .ent-consultation__chapter-nav-btn:active { transform: none; }
}
.ent-consultation__active-section-content > section[id] {
    padding: 0;
    margin: 0;
}

/* Typography sizing — override dedene h2..h5 z tématu (invertovaná hierarchie
   by dominovala nad selected-label a comments). Sjednocená 1.25 modular scale.
   BEZ margins — spacing řídí owl pattern níže. */
.ent-consultation__active-section-content h2 {
    font-size: calc(var(--entangle-em) * 1.28);
    font-weight: 600;
    line-height: 1.3;
}
.ent-consultation__active-section-content h3 {
    font-size: calc(var(--entangle-em) * 1.024);
    font-weight: 600;
    line-height: 1.35;
}
.ent-consultation__active-section-content h4,
.ent-consultation__active-section-content h5 {
    font-size: calc(var(--entangle-em) * 1);
    font-weight: 600;
    line-height: 1.4;
}
.ent-consultation__active-section-content p,
.ent-consultation__active-section-content li,
.ent-consultation__active-section-content blockquote {
    /* Explicit font-size přebíjí theme (body/`.wp-block-paragraph` z theme.json).
       Bez toho by consultation content zdědil theme reading size, který bývá
       nastavený štědře pro landing/blog čitelnost (18-20px) a na malém viewportu
       zabírá zbytečně místa. 1rem = 16px = WCAG minimum + standardní reading size. */
    font-size: calc(var(--entangle-em) * 1);
    line-height: 1.6;
}
.ent-consultation__active-section-content ul,
.ent-consultation__active-section-content ol {
    padding-inline-start: 1.5rem;
    font-size: calc(var(--entangle-em) * 1);
}

/* Mobile: kompaktnější typografie — víc obsahu per screen bez ztráty čitelnosti.
   15px je stále nad WCAG minimem a odpovídá native iOS/Android reading.
   Zahrnuty i tabulky (klasické + `.ent-enhanced-table__table`) pro jednotný rytmus. */
@media (max-width: 600px) {
    .ent-consultation__active-section-content p,
    .ent-consultation__active-section-content li,
    .ent-consultation__active-section-content ul,
    .ent-consultation__active-section-content ol,
    .ent-consultation__active-section-content blockquote,
    .ent-consultation__active-section-content table,
    .ent-consultation__active-section-content th,
    .ent-consultation__active-section-content td {
        font-size: calc(var(--entangle-em) * 0.9375);
        line-height: 1.5;
    }
    /* Caption je subtitle nad tabulkou — trochu menší (14px) pro vizuální hierarchii. */
    .ent-consultation__active-section-content .ent-enhanced-table__caption {
        font-size: calc(var(--entangle-em) * 0.875);
    }
    /* Tabulkové buňky mají obvykle těsnější padding — snížení font-size uvolní
       horizontální místo, ale padding zredukujeme ještě víc pro kompaktní grid. */
    .ent-consultation__active-section-content .ent-enhanced-table__table th,
    .ent-consultation__active-section-content .ent-enhanced-table__table td {
        padding: 0.375rem 0.5rem;
        line-height: 1.35;
    }
}

/* ─── Vertical rhythm — hierarchická typografie ─────────────────
   Owl pattern (`* + *`) s hierarchickými overrides. Cascade order řídí přechody:

   Přechod                    | Mezera | Důvod
   ───────────────────────────┼────────┼─────────────────────────────────
   :first-child (owl skip)    | 0      | Žádný předchozí sourozenec
   content → content          | 1rem   | Base rhythm mezi odstavci/seznamy
   content → nadpis           | 2rem   | Nová sub-sekce dýchá
   nadpis → nadpis            | 1.5rem | Sub-hierarchie (H4 → H5)
   nadpis → content           | 0.5rem | Content patří k nadpisu (unit)
   list item → list item      | 0.25rem| Kompaktní rhythm uvnitř seznamu

   Cascade specificity: všechna owl pravidla mají (0,2,1) nebo (0,2,2).
   Pořadí v CSS řídí kdo vyhrává mezi selektory se stejnou specificity —
   later rules win, proto seřazení base → generic → specific. */

/* Reset — margins řídí explicitně owl (default browser margins by přebily). */
.ent-consultation__active-section-content > section > * {
    margin-block: 0;
}

/* Base — 1rem mezi sourozeneckými bloky. Owl `+` selector přirozeně skipne
   :first-child (nemá předchozího sourozence), takže první element sekce
   nemá extra top margin. */
.ent-consultation__active-section-content > section > * + * {
    margin-block-start: 1rem;
}

/* Nadpis po čemkoli = větší vzduch (nová sub-sekce). */
.ent-consultation__active-section-content > section > * + :is(h2, h3, h4, h5, h6) {
    margin-block-start: 2rem;
}

/* Nadpis po nadpisu = MENŠÍ mezera (sub-heading pod parent heading tvoří
   hierarchickou skupinu, ne oddělenou sekci). Cascade order: tento selektor
   je specific-er (2 :is), later v CSS, wins over previous rule. */
.ent-consultation__active-section-content > section > :is(h2, h3, h4, h5, h6) + :is(h2, h3, h4, h5, h6) {
    margin-block-start: 1.5rem;
}

/* Content po nadpisu = TĚSNĚ (heading + first paragraph = unit). Later cascade,
   wins over base 1rem pro non-heading content. */
.ent-consultation__active-section-content > section > :is(h2, h3, h4, h5, h6) + :not(h1, h2, h3, h4, h5, h6) {
    margin-block-start: 0.5rem;
}

/* Lists mají vlastní kompaktní rhythm mezi items. */
.ent-consultation__active-section-content li + li {
    margin-block-start: 0.25rem;
}
/* Overflow safety — obrázky, tabulky, code bloky nesmí přesáhnout 65ch container,
   jinak vytvoří horizontal scroll celé stránky. */
.ent-consultation__active-section-content img,
.ent-consultation__active-section-content figure {
    max-width: 100%;
    height: auto;
}
.ent-consultation__active-section-content table:not(.ent-enhanced-table__table) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
/* Enhanced-table má vlastní responsive scroll wrapper (.ent-enhanced-table__scroll)
   s CSS-only scrolling shadows. `display: block` na table by rozbil colspan/rowspan
   layout — nechme table default `table` display. */
.ent-consultation__active-section-content .ent-enhanced-table__table {
    display: table;
    max-width: 100%;
}
.ent-consultation__active-section-content pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Mobile: kolabuj vnější grid columns aby text měl standardní mobile side
   padding (~16px). Desktop grid má full/wide breakout tracks pro alignwide/
   alignfull bloky — na mobile jsou wide/full = regular width (nemá kam
   breakout-nout), takže je bezpečné je zkolabovat na 0. */
@media (max-width: 600px) {
    .ent-consultation__active-section-content {
        grid-template-columns:
            [full-start] 0
            [wide-start] 0
            [main-start] 100% [main-end]
            0 [wide-end]
            0 [full-end];
    }
}

.ent-consultation__free-intro {
    background: rgba(34, 113, 177, 0.06);
    border-left: 3px solid var(--ent-c-accent);
    padding: 0.75rem 1rem;
    border-radius: 4px;
}
.ent-consultation__free-intro p { margin: 0; color: var(--ent-c-fg); }

/* Section divider = hairline mezi content a comments. Odstraněn — border-top
   na .comments-header je jednodušší, méně DOM, konzistentnější rhythm. */
.ent-consultation__section-divider { display: none; }

.ent-consultation__comments-header {
    margin: 2.5rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
/* Comments h3 — 1.28rem = stejná úroveň jako content h2 (sekce komentářů má stejnou váhu). */
.ent-consultation__comments-header h3 {
    margin: 0 0 0.5rem;
    font-size: calc(var(--entangle-em) * 1.28);
    font-weight: 600;
    line-height: 1.3;
}
.ent-consultation__count-pill {
    color: var(--ent-c-muted);
    font-weight: 400;
    margin-left: 0.25rem;
    font-size: 0.9em;
}
.ent-consultation__hint-strong {
    margin: 0;
    color: var(--ent-c-error);
    font-weight: 500;
    font-size: calc(var(--entangle-em) * 0.95);
    line-height: 1.45;
}
/* Override pro starý browsing label (už nepoužíván jako h3 v aktivní podobě). */
h3.ent-consultation__selected-label {
    margin: 0 0 0.25rem;
    font-size: calc(var(--entangle-em) * 1.1);
    font-weight: 600;
}
.ent-consultation__count {
    margin: 0;
    color: var(--ent-c-muted);
    font-size: calc(var(--entangle-em) * 0.9);
}

/* ─── Search ─────────────────────────────────────────── */

.ent-consultation__search {
    position: relative;
    margin: 0 0 1rem;
}
/* Search icon vlevo (inline SVG přes background) — sjednoceno s entangle input styly:
   bílé pozadí, 1px border var(--color-neutral-300), border-radius. */
.ent-consultation__search-input {
    display: block;
    width: 100%;
    padding: var(--space-2, 0.5rem) 2.5rem var(--space-2, 0.5rem) 2.5rem;
    font-size: var(--font-base, calc(var(--entangle-em) * 1));
    font-family: inherit;
    color: var(--color-base, #222);
    background-color: var(--ent-c-bg);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c8f94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.5' y2='16.5'/></svg>");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 18px 18px;
    border: 1px solid var(--color-neutral-300, #ccc);
    border-radius: var(--border-radius, 0.5rem);
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}
.ent-consultation__search-input:hover {
    border-color: var(--ent-c-border-strong);
}
.ent-consultation__search-input:focus {
    outline: none;
    border-color: var(--color-primary, var(--ent-c-accent));
    box-shadow: none;
}
.ent-consultation__search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--ent-c-border);
    color: var(--ent-c-fg);
    font-size: calc(var(--entangle-em) * 1.2);
    line-height: 1;
    cursor: pointer;
}

/* ─── Comment list / cards ──────────────────────────── */

.ent-comment-list {
    position: relative;
    /* Bez min-height — pro open+0 (empty schovaný) nebude prázdná mezera.
       Loading/empty/no-results mají vlastní padding kdyby se zobrazily. */
}
.ent-comment-list__loading,
.ent-comment-list__empty,
.ent-comment-list__no-results {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--ent-c-muted);
    font-style: italic;
}
.ent-comment-list__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}
.ent-comment-card {
    padding: 1rem 0;
    transition: background 0.15s;
}
.ent-comment-card:hover {
    background: rgba(0, 0, 0, 0.02);
}
.ent-comment-card + .ent-comment-card {
    border-top: 1px solid var(--ent-c-border);
}
.ent-comment-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.5rem;
    gap: 0.75rem;
}
.ent-comment-card__code {
    font-size: calc(var(--entangle-em) * 0.85);
    color: var(--ent-c-muted);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: var(--ent-c-surface);
    padding: 2px 8px;
    border-radius: 4px;
}
/* Když je hlasování vypnuto (settings.enable_voting=false), skryjeme voting UI:
   „X podpor" info + tlačítko „+1 Podpořit tento podnět" na kartě + vote form modal. */
.ent-consultation--no-voting .ent-comment-card__votes,
.ent-consultation--no-voting [data-ent-action="open-vote"],
.ent-consultation--no-voting [data-ent-modal="vote"],
.ent-consultation--no-voting .ent-vote-form {
    display: none !important;
}

.ent-comment-card__votes {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    color: var(--ent-c-accent);
}
.ent-comment-card__votes-label {
    font-weight: 400;
    font-size: calc(var(--entangle-em) * 0.85);
    color: var(--ent-c-muted);
}
.ent-comment-card__body {
    margin: 0 0 0.5rem;
    line-height: 1.45;
    white-space: pre-wrap;
}
.ent-comment-card__rationale {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--ent-c-border);
    color: var(--ent-c-muted);
    font-size: calc(var(--entangle-em) * 0.95);
    white-space: pre-wrap;
}
.ent-comment-card__author {
    margin: 0 0 0.5rem;
    color: var(--ent-c-muted);
    font-size: calc(var(--entangle-em) * 0.9);
    font-style: italic;
}
.ent-comment-card__author::before {
    content: "— ";
}
.ent-comment-card__actions {
    text-align: right;
}

/* ─── Create-new area ────────────────────────────────── */

.ent-consultation__create-new {
    margin: 1.5rem 0 0;
    padding: 1.25rem;
    background: var(--ent-c-surface);
    border-radius: var(--ent-c-radius, 0.5rem);
    text-align: center;
}

/* Stejný layout jako create-new, ale tlumený — sdělení místo akce. */
.ent-consultation__create-locked {
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    background: var(--ent-c-surface);
    border-left: 3px solid var(--ent-c-muted);
    border-radius: var(--ent-c-radius, 0.5rem);
    text-align: center;
}
.ent-consultation__create-locked p {
    margin: 0;
    color: var(--ent-c-fg);
}
.ent-consultation__create-locked strong {
    display: block;
    margin-bottom: 0.25rem;
}
.ent-consultation__create-hint {
    margin: 0 0 0.5rem;
    color: var(--ent-c-muted);
    font-size: calc(var(--entangle-em) * 0.95);
}

/* ─── Buttons ────────────────────────────────────────── */

.ent-consultation__btn {
    appearance: none;
    cursor: pointer;
    padding: 0.55rem 1.25rem;
    border-radius: 4px;
    border: 1px solid var(--ent-c-border);
    background: var(--ent-c-bg);
    color: var(--ent-c-fg);
    font-size: calc(var(--entangle-em) * 0.95);
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    line-height: 1.2;
}
.ent-consultation__btn:hover:not(:disabled) {
    background: var(--ent-c-surface);
    border-color: var(--ent-c-fg);
}
.ent-consultation__btn:disabled,
.ent-consultation__btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}
.ent-consultation__btn--primary {
    background: var(--ent-c-accent);
    color: var(--ent-c-accent-fg);
    border-color: var(--ent-c-accent);
}
.ent-consultation__btn--primary:hover:not(:disabled) {
    background: #135e96;
    border-color: #135e96;
}
.ent-consultation__btn--small {
    padding: 0.35rem 0.85rem;
    font-size: calc(var(--entangle-em) * 0.85);
}
.ent-consultation__btn--lg {
    padding: 0.75rem 1.5rem;
    font-size: calc(var(--entangle-em) * 1.05);
    font-weight: 600;
}
.ent-consultation__btn--ghost {
    background: var(--ent-c-bg);
    color: var(--ent-c-accent);
    border-color: var(--ent-c-border);
}
.ent-consultation__btn--ghost:hover:not(:disabled) {
    background: var(--color-neutral-100, #f5f5f5);
    border-color: var(--ent-c-accent);
}

/* ─── Intro CTA (Začít připomínkovat / Volná) ───────── */
.ent-consultation__intro-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ent-c-border);
}
@media (max-width: 480px) {
    .ent-consultation__intro-cta { flex-direction: column; }
    .ent-consultation__intro-cta .ent-consultation__btn { width: 100%; }
}

/* ─── Modal forms ────────────────────────────────────────
 * Formuláře používají strukturu .entangle-map-modal z entangle-styles.css.
 * Tady jen drobné consultation-specific doplňky:
 *   - .ent-consultation-modal__btn-ghost (secondary „Zrušit" tlačítko)
 *   - .ent-form__error (error message uvnitř modalu)
 *   - .ent-form__quote (preview připomínky v vote modalu)
 *   - .ent-form__title-code (kód „DOP-001" v titulku vote modalu)
 *   - .ent-form__optional (volitelné label)
 */

/* Ghost secondary button — pro „Zrušit" v modal footeru. Stejné rozměry jako
   .entangle-map-add-btn, ale neutral barvy. */
.ent-consultation-modal__btn-ghost {
    background: transparent;
    color: var(--color-base, #222);
    border: 1px solid var(--color-neutral-300, #ccc);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    border-radius: var(--border-radius, 0.5rem);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
}
.ent-consultation-modal__btn-ghost:hover {
    background: var(--color-neutral-200, #e0e0e0);
}

.ent-form__error {
    padding: var(--space-3, 0.65rem) var(--space-4, 1rem);
    background: #fcf0f1;
    border-left: 3px solid var(--ent-c-error);
    color: var(--ent-c-error);
    border-radius: var(--border-radius, 0.5rem);
    font-size: var(--font-sm, calc(var(--entangle-em) * 0.9));
    margin-top: var(--space-3, 0.75rem);
}
.ent-form__quote {
    margin: 0 0 var(--space-4, 1rem);
    padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    background: var(--color-neutral-100, #f5f5f5);
    border-left: 3px solid var(--ent-c-accent);
    border-radius: var(--border-radius, 0.5rem);
    font-style: italic;
    white-space: pre-wrap;
}
.ent-form__title-code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: var(--font-sm, calc(var(--entangle-em) * 0.85));
    color: var(--ent-c-muted);
    font-weight: 400;
    margin-left: var(--space-2, 0.5rem);
}
.ent-form__optional {
    font-weight: 400;
    color: var(--ent-c-muted);
    font-size: var(--font-sm, calc(var(--entangle-em) * 0.85));
}

/* ─── Success state ──────────────────────────────────── */

.ent-consultation__step--success {
    text-align: center;
    padding: 2rem 1rem;
}
.ent-consultation__success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--ent-c-success);
    color: white;
    font-size: calc(var(--entangle-em) * 2);
    display: grid;
    place-items: center;
    line-height: 1;
}
.ent-consultation__success-title {
    margin: 0 0 0.5rem;
    font-size: calc(var(--entangle-em) * 1.25);
}
.ent-consultation__success-body {
    margin: 0 0 1rem;
    color: var(--ent-c-muted);
}

/* ──────────────────────────────────────────────────────────────────
 * Veřejná tabulka vypořádání ([entangle_consultation_resolution])
 * Vlastní namespace `ent-resolution-*` — může stát samostatně bez
 * wrapperu .ent-consultation.
 * ────────────────────────────────────────────────────────────────── */

.ent-resolution-table-wrap {
    --ent-r-border: var(--ent-c-border);
    --ent-r-bg-alt: var(--ent-c-surface);
    --ent-r-muted: var(--ent-c-muted);
    --ent-r-accent: var(--ent-c-accent);

    max-width: 1300px;
    margin: 2rem auto;
    padding: 1rem;
    font-size: max(1em, 14px); /* the host's; the table's own steps are multiples of it */
    line-height: 1.5;
    color: var(--ent-c-fg);
}

.ent-resolution-header {
    margin-bottom: 1.25rem;
}
.ent-resolution-title {
    margin: 0 0 0.25rem;
    font-size: calc(var(--entangle-em) * 1.6);
    line-height: 1.2;
}
.ent-resolution-meta {
    margin: 0;
    color: var(--ent-r-muted);
    font-size: calc(var(--entangle-em) * 0.95);
}

.ent-resolution-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--ent-r-bg-alt);
    border: 1px solid var(--ent-r-border);
    border-radius: 8px;
}
.ent-resolution-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 0 1 auto;
    min-width: 180px;
}
.ent-resolution-filter-search { flex: 1 1 240px; }
.ent-resolution-filter label {
    font-size: calc(var(--entangle-em) * 0.85);
    color: var(--ent-r-muted);
    font-weight: 600;
}
.ent-resolution-filter select,
.ent-resolution-filter input[type="search"] {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--ent-r-border);
    border-radius: 6px;
    background: var(--ent-c-bg);
    font: inherit;
}
.ent-resolution-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.ent-resolution-filter-actions .ent-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}
.ent-resolution-filter-actions .ent-btn-primary {
    background: var(--ent-r-accent);
    color: #fff;
}
.ent-resolution-filter-actions .ent-btn-primary:hover { background: #135e96; }
.ent-resolution-filter-actions .ent-btn-link {
    background: transparent;
    color: var(--ent-r-accent);
    border: none;
    padding: 0.5rem 0.25rem;
}

.ent-resolution-empty {
    padding: 2rem;
    text-align: center;
    color: var(--ent-r-muted);
    background: var(--ent-r-bg-alt);
    border-radius: 8px;
}

.ent-resolution-table-scroll {
    overflow-x: auto;
    border: 1px solid var(--ent-r-border);
    border-radius: 8px;
}
.ent-resolution-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ent-c-bg);
    font-size: calc(var(--entangle-em) * 0.95);
}
.ent-resolution-table thead th {
    background: var(--ent-r-bg-alt);
    text-align: left;
    padding: 0.65rem 0.8rem;
    font-weight: 600;
    border-bottom: 2px solid var(--ent-r-border);
    white-space: nowrap;
}
.ent-resolution-table tbody td {
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid var(--ent-r-border);
    vertical-align: top;
}
.ent-resolution-table tbody tr:last-child td { border-bottom: none; }
.ent-resolution-table tbody tr:nth-child(even) td { background: var(--ent-c-surface); }

.ent-resolution-table .ent-col-code  { width: 90px; white-space: nowrap; }
.ent-resolution-table .ent-col-code code {
    background: var(--ent-r-bg-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: calc(var(--entangle-em) * 0.85);
}
.ent-resolution-table .ent-col-section { width: 200px; color: var(--ent-r-muted); }
.ent-resolution-table .ent-col-body { min-width: 280px; }
.ent-resolution-table .ent-col-votes { width: 70px; text-align: center; font-weight: 600; }
.ent-resolution-table .ent-col-resolution { width: 170px; white-space: nowrap; }
.ent-resolution-table .ent-col-note { min-width: 280px; color: var(--ent-c-muted); }

/* Resolution status badges */
.ent-resolution-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: calc(var(--entangle-em) * 0.85);
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
}
.ent-resolution-unreviewed         { background: #e7e8ea; color: var(--ent-c-muted); }
.ent-resolution-accepted           { background: #d8efdc; color: #1a6b2c; }
.ent-resolution-partially_accepted { background: #fff1cd; color: #8a6300; }
.ent-resolution-rejected           { background: #fbd9d9; color: #962020; }
.ent-resolution-noted              { background: #dde6f1; color: #1c4d80; }

.ent-resolution-table .ent-muted { color: var(--ent-r-muted); font-style: italic; }

/* Odůvodnění (multi-author) — každé jméno + text vlastní odstavec. */
.ent-resolution-note { margin: 0 0 0.5rem; line-height: 1.5; }
.ent-resolution-note:last-child { margin-bottom: 0; }
.ent-resolution-note strong { color: var(--ent-r-muted); font-weight: 600; margin-right: 4px; }

@media (max-width: 720px) {
    .ent-resolution-table thead { display: none; }
    .ent-resolution-table, .ent-resolution-table tbody,
    .ent-resolution-table tr, .ent-resolution-table td {
        display: block;
        width: 100% !important;
    }
    .ent-resolution-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--ent-r-border);
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
    }
    .ent-resolution-table td {
        border-bottom: none;
        padding: 0.35rem 0;
    }
    .ent-resolution-table td::before {
        content: attr(data-label);
        display: block;
        font-size: calc(var(--entangle-em) * 0.75);
        text-transform: uppercase;
        color: var(--ent-r-muted);
        margin-bottom: 0.1rem;
    }
}

/* Char counter — blíží se k limitu → červený, aby uživatel viděl, že
   klientský clamp brzy odřízne další znaky. */
[data-ent-counter].is-near-limit {
    color: var(--ent-c-error, #d63638);
    font-weight: 600;
}

/* ============================================================
   Comment archive ([entangle_archiv_pripominek]) — snapshot table.
   Design language follows the report-cards ("vysvědčení") frontend:
   no boxes, no zebra, no cell backgrounds — hairline row dividers,
   uppercase column headers, bold primary text, color only in text
   (status dot + tinted label instead of pill badges). Everything is
   scoped to .ent-archive so the older /vyporadani/ table keeps its look.
   ============================================================ */

/* Full width — the wrap inherits a 1300px cap from .ent-resolution-table-wrap
   and the theme's constrained layout caps generic children via :where() (zero
   specificity), so this single rule frees the archive to the whole column. */
.ent-archive {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0 0 2rem;
}

/* Summary line — plain text stats, no chips */
.ent-archive__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.75rem;
    align-items: baseline;
    margin: 0 0 1.75rem;
    font-size: calc(var(--entangle-em) * 0.875);
}
.ent-archive__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    font-size: calc(var(--entangle-em) * 0.875);
    color: inherit;
}
.ent-archive__chip--total {
    background: none;
    font-weight: 700;
    color: inherit;
    font-size: calc(var(--entangle-em) * 0.9375);
}

/* Status: colored dot + tinted text instead of a pill */
.ent-archive .ent-resolution-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: none !important;
    font-size: calc(var(--entangle-em) * 0.8125);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    line-height: 1.4;
}
.ent-archive .ent-resolution-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: currentColor;
    opacity: .85;
}
.ent-archive .ent-resolution-unreviewed         { color: inherit; }
.ent-archive .ent-resolution-accepted           { color: #1a6b2c; }
.ent-archive .ent-resolution-partially_accepted { color: #8a6300; }
.ent-archive .ent-resolution-rejected           { color: #962020; }
.ent-archive .ent-resolution-noted              { color: #1c4d80; }
.ent-archive .ent-archive__inc-done             { color: #0f5c5c; }
.ent-archive .ent-archive__inc-not_applicable   { color: inherit; }

/* Filters — no box, slim controls (evy-year-switcher look) */
.ent-archive .ent-resolution-filters {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2.25rem;
    gap: 1rem 1.5rem;
}
.ent-archive .ent-resolution-filter label {
    font-size: calc(var(--entangle-em) * 0.75);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: inherit;
}
.ent-archive .ent-resolution-filter select,
.ent-archive .ent-resolution-filter input[type="search"] {
    padding: 6px 12px;
    border: 1px solid var(--ent-c-border);
    border-radius: 4px;
    font-size: calc(var(--entangle-em) * 0.9375);
    max-width: 320px;
}
.ent-archive .ent-resolution-filter { min-width: 0; }
.ent-archive .ent-resolution-filter-search { flex: 0 1 260px; }

.ent-archive .ent-resolution-empty {
    background: none;
    border-radius: 0;
    padding: 2rem 0;
    text-align: left;
}

/* Table — borderless, hairline dividers only */
.ent-archive .ent-resolution-table-scroll {
    border: none;
    border-radius: 0;
    overflow-x: auto;
}
.ent-archive .ent-resolution-table {
    background: none;
    font-size: calc(var(--entangle-em) * 0.9375);
    color: inherit;
}
.ent-archive .ent-resolution-table thead th {
    background: none;
    font-size: calc(var(--entangle-em) * 0.8125);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 14px 24px 14px 0;
    border-bottom: 2px solid var(--color-neutral-300, #dcdcde);
}
.ent-archive .ent-resolution-table tbody td {
    padding: 24px 24px 24px 0;
    border-bottom: 1px solid var(--color-neutral-200, #d5d6d8);
    background: none;
}
.ent-archive .ent-resolution-table tbody tr:nth-child(even) td { background: none; }
.ent-archive .ent-resolution-table tbody tr:last-child td { border-bottom: 1px solid var(--color-neutral-200, #d5d6d8); }
.ent-archive .ent-resolution-table thead th:last-child,
.ent-archive .ent-resolution-table tbody td:last-child { padding-right: 0; }

/* Cell typography — primary vs secondary, no chips */
.ent-archive .ent-col-code { width: 84px; }
.ent-archive .ent-col-code code {
    background: none;
    padding: 0;
    font-size: calc(var(--entangle-em) * 0.8125);
    color: inherit;
}
.ent-archive .ent-col-section {
    width: 180px;
    font-size: calc(var(--entangle-em) * 0.8125);
    color: inherit;
    line-height: 1.45;
}
.ent-archive .ent-col-body { min-width: 260px; line-height: 1.55; }
.ent-archive__rationale {
    margin-top: 0.5rem;
    font-size: calc(var(--entangle-em) * 0.8125);
    color: inherit;
    line-height: 1.5;
}
.ent-archive .ent-col-author { width: 120px; font-size: calc(var(--entangle-em) * 0.875); font-weight: 600; }
.ent-archive .ent-col-date   { width: 90px; font-size: calc(var(--entangle-em) * 0.8125); }
.ent-archive .ent-col-votes  { width: 70px; font-weight: 700; }
.ent-archive .ent-col-resolution { min-width: 220px; white-space: normal; }
.ent-archive .ent-col-resolution .ent-resolution-badge { margin-bottom: 0.5rem; }
.ent-archive .ent-col-incorporation { min-width: 230px; }
.ent-archive .ent-archive__inc-badge { margin-bottom: 0.5rem; }
.ent-archive .ent-resolution-note {
    font-size: calc(var(--entangle-em) * 0.875);
    line-height: 1.55;
    color: inherit;
    margin: 0 0 0.6rem;
}
.ent-archive .ent-resolution-note:last-child { margin-bottom: 0; }
.ent-archive .ent-resolution-note strong {
    display: block;
    font-size: calc(var(--entangle-em) * 0.75);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: inherit;
    margin: 0 0 2px;
}

.ent-archive__row-highlight td { background: #fffbea !important; }

.ent-archive__footer {
    margin-top: 1rem;
    font-size: calc(var(--entangle-em) * 0.8125);
    color: inherit;
}

/* Mobile cards — one comment = one card. A strong top rule marks where the
   next comment starts (a hairline would be indistinguishable from the field
   dividers), the code becomes the card header, fields inside have no rules. */
@media (max-width: 720px) {
    .ent-archive .ent-resolution-table tr {
        border: none;
        border-top: 3px solid var(--color-text, var(--color-base, #1d2327));
        border-radius: 0;
        padding: 1rem 0 1.9rem;
        margin-bottom: 0;
    }
    .ent-archive .ent-resolution-table tbody td {
        border-bottom: none;
        padding: 0.5rem 0;
    }
    /* Popisky poli v karte = plnobarevne mini-hlavicky (zadne sednuti),
       stejna rec jako thead na desktopu. */
    .ent-archive .ent-resolution-table td::before {
        color: inherit;
        font-weight: 700;
        letter-spacing: .3px;
    }
    /* Kód = hlavička karty (bez popisku KÓD) */
    .ent-archive .ent-col-code::before { display: none; }
    .ent-archive .ent-col-code code {
        font-size: calc(var(--entangle-em) * 1.0625);
        font-weight: 700;
    }
    .ent-archive .ent-col-code,
    .ent-archive .ent-col-section,
    .ent-archive .ent-col-author,
    .ent-archive .ent-col-date,
    .ent-archive .ent-col-votes { width: 100% !important; }
}

/* ============================================================
   Document template — intro buttons (core/buttons in the intro).
   The host theme paints wp-element-button with its own dark bg while
   the site link color (red) bleeds into the label — restyle both
   variants from the site palette: filled = primary red + white,
   outline = neutral border + site ink.
   ============================================================ */
.ent-document .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.75rem;
}
.ent-document .wp-block-button .wp-block-button__link {
    display: inline-block;
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    font-size: calc(var(--entangle-em) * 0.9375);
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: filter .15s, border-color .15s, color .15s;
}
.ent-document .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: var(--color-primary, #c1272d);
    border: 1.5px solid var(--color-primary, #c1272d);
    color: var(--color-contrast, #fff);
}
.ent-document .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    filter: brightness(.88);
    color: var(--color-contrast, #fff);
}
.ent-document .wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 1.5px solid var(--color-neutral-300, #c9ccd1);
    color: var(--color-base, #1d2327);
}
.ent-document .wp-block-button.is-style-outline .wp-block-button__link:hover {
    border-color: var(--color-base, #1d2327);
    color: var(--color-base, #1d2327);
    filter: none;
}

/* Document template: tables span the wide track — the reading column is too
   narrow for multi-column tables (cells hyphenate). Same mapping as .rvn-chart.
   Scoped to .ent-document; the consultation page keeps its original layout. */
.ent-document .ent-consultation__active-section-content > section > .ent-enhanced-table,
.ent-document .ent-consultation__active-section-content > section > .wp-block-table {
    grid-column: wide-start / wide-end;
    width: 100%;
    max-width: 100%;
    justify-self: center;
}
.ent-document .ent-enhanced-table__table th,
.ent-document .ent-enhanced-table__table td {
    -webkit-hyphens: none;
    hyphens: none;
}

/* Appearance settings (Entangle -> Vzhled) print their variables onto the
   participation roots (core SettingsPage::colors_css). Text color cascades
   into the reading surface; unset = theme color via the inherit fallback. */
.ent-consultation { color: var(--color-text, inherit); }
