/* ==========================================================================
   Intivise — základ: písma, tokeny, typografie, formuláře a komponenty
   Sdílí ho web, helpdesk i administrace.
   ========================================================================== */

/* IBM Plex — SIL Open Font License 1.1, uloženo lokálně (žádný požadavek na cizí server). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --paper: #f7f6f2;
    --paper-2: #efede7;
    --paper-3: #e6e3db;
    --white: #ffffff;
    --ink: #15171b;
    --ink-2: #3b3f46;
    --ink-3: #62666e;
    --ink-4: #9a9ca1;
    --line: #dedbd3;
    --line-2: #cbc7bd;

    --accent: #e2531f;
    --accent-strong: #c7471a;
    --accent-ink: #b0400f;
    --accent-soft: #fbe9e1;

    --night: #121418;
    --night-2: #1b1e23;
    --night-line: #2c3037;
    --night-text: #eceae4;
    --night-muted: #a3a6ab;

    --ok: #2d7a4f;
    --ok-soft: #e4f1e9;
    --warn: #8a5a00;
    --warn-soft: #f7ecd6;
    --danger: #b3261e;
    --danger-soft: #f8e3e1;
    --info: #1f5fbf;
    --info-soft: #e3ecf8;

    --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgb(21 23 27 / 0.06);
    --shadow: 0 1px 2px rgb(21 23 27 / 0.05), 0 12px 32px -16px rgb(21 23 27 / 0.22);

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

    --container: 1200px;
    --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
    --header-h: 64px;
    --section-y: clamp(3.5rem, 2.2rem + 4.2vw, 6.5rem);

    --text-xl: clamp(1.6rem, 1.25rem + 1.4vw, 2.25rem);
    --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
    --text-3xl: clamp(2.4rem, 1.5rem + 3.6vw, 4.1rem);
}

/* == Reset ================================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* Obnovení pozice po odeslání formuláře: bez animace a bez bliknutí nahoře. */
html.is-restoring { scroll-behavior: auto; }
html.is-restoring body { visibility: hidden; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

img, svg, video { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
    border-radius: 2px;
}

main:focus { outline: none; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* == Pomocné ============================================================= */

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow { max-width: calc(760px + var(--gutter) * 2); }

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus { top: 1rem; }

.mono { font-family: var(--font-mono); font-feature-settings: "zero" 0; }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-muted { color: var(--ink-3); }
.text-danger { color: var(--danger); font-weight: 500; }
.text-warn { color: var(--warn); display: inline-flex; align-items: center; gap: 0.375rem; }

.icon {
    width: 1.125em;
    height: 1.125em;
    flex: none;
    vertical-align: -0.2em;
}

.label {
    margin: 0 0 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.fineprint {
    margin: 1.5rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-3);
}

.lang-tag {
    display: inline-block;
    padding: 0 0.3rem;
    border: 1px solid var(--line-2);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--ink-3);
    vertical-align: 0.1em;
}

/* == Tlačítka a odkazy =================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms var(--ease-out);
}

.btn:active { transform: scale(0.97); }
.btn .icon { width: 1rem; height: 1rem; }

.btn--primary { background: var(--ink); color: var(--paper); }
.btn--secondary { background: var(--white); color: var(--ink); border-color: var(--line-2); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--accent { background: var(--accent-strong); color: #fff; }
.btn--danger-ghost { background: var(--white); color: var(--danger); border-color: #e7bdb8; }

.btn--sm { min-height: 2.25rem; padding: 0.4375rem 0.875rem; font-size: 0.875rem; }
.btn--lg { min-height: 3.125rem; padding: 0.75rem 1.375rem; font-size: 1rem; }
.btn--block { width: 100%; }

.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.link-button .icon { width: 1em; height: 1em; }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: color 160ms ease;
}

.text-link .icon { width: 1rem; height: 1rem; transition: transform 200ms var(--ease-out); }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-3);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.icon-button:active { transform: scale(0.94); }
.icon-button--dark { color: var(--night-muted); }

@media (hover: hover) and (pointer: fine) {
    .btn--primary:hover { background: #2b2e34; }
    .btn--secondary:hover { border-color: var(--ink-3); }
    .btn--ghost:hover { background: var(--paper-2); color: var(--ink); }
    .btn--accent:hover { background: #ad3d15; }
    .btn--danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
    .link-button:hover { color: var(--ink); text-decoration: underline; }
    .text-link:hover { color: var(--accent-ink); }
    .text-link:hover .icon { transform: translateX(3px); }
    .icon-button:hover { background: var(--paper-2); color: var(--ink); }
    .icon-button--dark:hover { background: var(--night-line); color: var(--night-text); }
}

/* == Formuláře ============================================================ */

.form--stack { display: grid; gap: 1.125rem; }

.form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem 1.25rem;
}

.form__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.form--inline { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form--inline .input { flex: 1 1 12rem; width: auto; }

.field { display: grid; gap: 0.375rem; min-width: 0; align-content: start; }
fieldset.field { margin: 0; padding: 0; border: 0; }
.field--full { grid-column: 1 / -1; }

.field__label { font-size: 0.875rem; font-weight: 600; color: var(--ink); padding: 0; }
.field__req { color: var(--accent-ink); }
.field__hint { margin: 0; font-size: 0.8125rem; color: var(--ink-3); }
.field__error { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--danger); }
.field__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.field__row .field__hint { margin-left: auto; white-space: nowrap; }

.input, .select, .textarea {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input::placeholder, .textarea::placeholder { color: var(--ink-4); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgb(21 23 27 / 0.1);
}

.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(179 38 30 / 0.14); }

.input[readonly] { background: var(--paper-2); color: var(--ink-3); }

.select {
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2362666e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    cursor: pointer;
}

.select--sm { min-height: 2rem; padding: 0.25rem 2rem 0.25rem 0.5rem; font-size: 0.875rem; background-position: right 0.5rem center; }

.textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--ink-2);
    cursor: pointer;
}

.check input { flex: none; width: 1.125rem; height: 1.125rem; margin: 0.15rem 0 0; }
.check a { color: var(--accent-ink); }
.check__hint { display: block; margin-top: 0.125rem; color: var(--ink-3); font-size: 0.8125rem; }
.check--inline { align-items: center; }
.check--inline input { margin: 0; }
.check--inline span { display: inline-flex; align-items: center; gap: 0.375rem; }

.switch {
    appearance: none;
    position: relative;
    flex: none;
    width: 2.5rem;
    height: 1.5rem;
    margin: 0;
    border-radius: 999px;
    background: var(--line-2);
    cursor: pointer;
    transition: background-color 200ms ease;
}

.switch::before {
    content: "";
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
    transition: transform 200ms var(--ease-out);
}

.switch:checked { background: var(--ink); }
.switch:checked::before { transform: translateX(1rem); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.switch-row__text { display: grid; gap: 0.125rem; }
.switch-row__text strong { font-size: 0.9375rem; font-weight: 600; }
.switch-row__text small { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-3); }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); }

.input-group__button {
    display: grid;
    place-items: center;
    width: 2.75rem;
    flex: none;
    border: 1px solid var(--line-2);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--white);
    color: var(--ink-3);
    cursor: pointer;
}

.input-prefix {
    display: flex;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
}

.input-prefix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(21 23 27 / 0.1); }

.input-prefix > span {
    display: flex;
    align-items: center;
    max-width: 50%;
    padding: 0 0.625rem;
    border-right: 1px solid var(--line);
    background: var(--paper-2);
    font-size: 0.75rem;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-prefix .input { border: 0; border-radius: 0; box-shadow: none; }

/* Honeypot mimo obrazovku — robot ho vyplní, člověk nevidí. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* == Štítky, stavy ======================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.0625rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--paper-3);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink-2);
    white-space: nowrap;
}

.badge .icon { width: 0.8rem; height: 0.8rem; }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--neutral { background: var(--paper-3); color: var(--ink-2); }

.dot { display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink-4); }
.dot--info { background: var(--info); }
.dot--accent { background: var(--accent); }
.dot--warn { background: #c98a00; }
.dot--ok { background: var(--ok); }
.dot--danger { background: var(--danger); }
.dot--neutral { background: var(--ink-4); }

.priority {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}

/* Tři dílky „signálu“ — čitelné i bez barvy. */
.priority::before {
    content: "";
    width: 0.875rem;
    height: 0.625rem;
    flex: none;
    background:
        linear-gradient(currentColor, currentColor) 0 100% / 0.1875rem 40% no-repeat,
        linear-gradient(var(--p2, var(--line-2)), var(--p2, var(--line-2))) 0.34rem 100% / 0.1875rem 70% no-repeat,
        linear-gradient(var(--p3, var(--line-2)), var(--p3, var(--line-2))) 0.68rem 100% / 0.1875rem 100% no-repeat;
}

.priority--low { color: var(--ink-3); }
.priority--normal { color: var(--info); --p2: currentColor; }
.priority--high { color: var(--warn); --p2: currentColor; --p3: currentColor; }
.priority--urgent { color: var(--danger); font-weight: 600; --p2: currentColor; --p3: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }

.chip {
    padding: 0.1875rem 0.5rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-2);
}

/* == Upozornění =========================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.alert p { margin: 0; }
.alert .icon { margin-top: 0.15rem; }
.alert a { color: inherit; font-weight: 600; }

.alert--success { background: var(--ok-soft); border-color: #bcdcc8; color: #1d5537; }
.alert--error { background: var(--danger-soft); border-color: #efc2bd; color: #8c1d17; }
.alert--info { background: var(--info-soft); border-color: #c3d5ef; color: #174a95; }
.alert--warn { background: var(--warn-soft); border-color: #ebd29f; color: #664200; }

.note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 2rem;
    padding: 1rem 1.125rem;
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--paper-2);
    font-size: 0.9375rem;
    color: var(--ink-2);
}

.note p { margin: 0; }
.note .icon { margin-top: 0.2rem; color: var(--ink-3); }

/* == Tabulky ============================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }

.table th {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-3);
    text-align: left;
    white-space: nowrap;
}

.table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.table--compact { font-size: 0.875rem; }
.table--compact th { padding: 0.5rem 0.75rem; }
.table--compact td { padding: 0.625rem 0.75rem; }

/* == Navigace po stránkách, přepínače ==================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination__pages { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }

.pagination__page {
    display: grid;
    place-items: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    text-decoration: none;
}

.pagination__page[aria-current] { background: var(--ink); color: var(--paper); }

.pagination__step {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.875rem;
    color: var(--ink-2);
    text-decoration: none;
}

.pagination__gap { align-self: center; padding: 0 0.25rem; color: var(--ink-4); }

.segmented {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.125rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar { display: none; }

.segmented__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
}

.segmented__item[aria-current] { border-color: var(--line-2); background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

.segmented__count {
    padding: 0 0.375rem;
    border-radius: 3px;
    background: var(--paper-3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-3);
}

.tabs { display: flex; gap: 0.25rem; }

.tabs__tab {
    position: relative;
    padding: 0.75rem 0.875rem;
    border: 0;
    background: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: color 160ms ease;
}

.tabs__tab[aria-selected="true"] { color: var(--night-text); }

.tabs__tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 0.875rem;
    right: 0.875rem;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
}

.tabs--small .tabs__tab { padding: 0.375rem 0.625rem; color: var(--ink-3); }
.tabs--small .tabs__tab[aria-selected="true"] { color: var(--ink); }
.tabs--small .tabs__tab[aria-selected="true"]::after { left: 0.625rem; right: 0.625rem; bottom: 0; }

@media (hover: hover) and (pointer: fine) {
    .pagination__page:not([aria-current]):hover, .pagination__step:hover { background: var(--paper-2); color: var(--ink); }
    .segmented__item:not([aria-current]):hover { background: var(--paper-2); color: var(--ink); }
}

/* == Drobnosti ============================================================ */

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.crumbs li + li::before { content: "/"; margin-right: 0.375rem; color: var(--ink-4); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.check-list { display: grid; gap: 0.625rem; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 0.625rem; color: var(--ink-2); }
.check-list .icon { margin-top: 0.2rem; color: var(--ok); }
.check-list--rows { gap: 0; }
.check-list--rows li { padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.check-list--rows li:first-child { border-top: 1px solid var(--line); }

.facts { display: grid; gap: 0.875rem; margin: 0; }
.facts > div { display: grid; gap: 0.125rem; min-width: 0; }
.facts dt { font-size: 0.75rem; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd a { color: var(--ink-2); font-weight: 400; }
.facts--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.facts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts__big { font-size: 1.75rem; font-weight: 500 !important; letter-spacing: -0.02em; line-height: 1.1; }

.empty {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 4rem 1.5rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--paper-2);
    color: var(--ink-3);
}

.empty__icon .icon { width: 1.375rem; height: 1.375rem; }
.empty__title { margin: 0; font-size: 1.125rem; font-weight: 600; }
.empty__text { max-width: 28rem; margin: 0 0 1rem; color: var(--ink-3); }
.empty--panel { border: 0; padding: 3rem 1.5rem; }

.disclosure { margin-top: 0.5rem; font-size: 0.8125rem; }
.disclosure summary { cursor: pointer; color: var(--ink-3); width: max-content; max-width: 100%; }
.disclosure p { margin: 0.5rem 0 0; color: var(--ink-2); }

.meta-json {
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 0.75rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--paper-3);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.avatar--xs { width: 1.375rem; height: 1.375rem; font-size: 0.625rem; }
.avatar--staff { background: var(--ink); color: var(--paper); }

/* == Text článků a právních stránek ====================================== */

.prose { max-width: 68ch; color: var(--ink-2); line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: 1.375rem; color: var(--ink); }
.prose h3 { margin: 2rem 0 0.5rem; font-size: 1.125rem; color: var(--ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose li::marker { color: var(--ink-4); }
.prose a { color: var(--accent-ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 2px solid var(--accent); color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose code { padding: 0.1em 0.35em; border-radius: 3px; background: var(--paper-2); font-family: var(--font-mono); font-size: 0.875em; }
.prose pre { padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--night); color: var(--night-text); overflow-x: auto; }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose img { border-radius: var(--radius); }
.prose .table-wrap { margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }

/* == Oznámení (toasty) ==================================================== */

.toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 120;
    display: grid;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.9375rem;
    box-shadow: var(--shadow);
    pointer-events: auto;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

@starting-style {
    .toast { opacity: 0; transform: translateY(8px); }
}

.toast--error { background: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }

/* == Postupné zobrazení při posunu =======================================
   Třídu reveal-ready přidá skript až ve chvíli, kdy umí prvky zase ukázat —
   bez JavaScriptu nebo při chybě zůstává obsah vždy viditelný. */

.reveal-ready .reveal:not(.is-visible) { opacity: 0; transform: translateY(14px); }

.reveal-ready .reveal {
    transition: opacity 520ms var(--ease-out), transform 620ms var(--ease-out);
    transition-delay: calc(var(--delay, 0) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .reveal-ready .reveal:not(.is-visible) { transform: none; }
}

/* == Tisk ================================================================ */

@media print {
    .site-header, .site-footer, .consent, .toasts, .cta, .skip-link,
    .app-sidebar, .app-topbar, .codes-actions, .auth__aside, .auth__footer { display: none !important; }

    body { background: #fff; }
    .app { display: block; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 640px) {
    .form__grid { grid-template-columns: minmax(0, 1fr); }
}
