/* VercaPDF — "úřední podání": cool office grey, ink blue, one red stamp. */

:root {
    --paper: #EDF0F2;
    --surface: #FFFFFF;
    --ink: #12213D;
    --muted: #5B6577;
    --rule: #CDD3DB;
    --stamp: #B4322B;
    --ok: #1F6F50;
    --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
    --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }

code { font-family: var(--mono); font-size: 0.92em; }
pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 0; }

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

/* --- masthead --- */

.masthead { border-bottom: 2px solid var(--ink); padding-bottom: 20px; margin-bottom: 28px; }

.masthead__eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted);
}

.masthead__title {
    font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.1;
    letter-spacing: -0.01em; margin: 6px 0 10px;
}

.masthead__lead { max-width: 64ch; margin: 0; color: var(--muted); }

/* --- two columns --- */

.desk { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; }

@media (max-width: 860px) {
    .desk { grid-template-columns: 1fr; }
    #app { padding: 20px 16px 48px; }
    .masthead__title { font-size: 32px; }
}

/* --- dossier (left): the session's filing cards --- */

.dossier { position: sticky; top: 24px; }

.dossier__title, .panel__title {
    font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); margin: 0;
}

.dossier__title { margin-bottom: 12px; }

.dossier__note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--rule);
    padding: 14px 16px 16px;
    margin-bottom: 12px;
}

.card--ready { border-left-color: var(--ink); }
.card--missing { border-left-color: var(--stamp); border-left-style: dashed; }

.card__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }

.card__name { font-family: var(--mono); font-size: 14px; font-weight: 500; }

.card__status {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ok);
}

.card--missing .card__status { color: var(--stamp); }

.card__hint, .card__error { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.card__error { color: var(--stamp); }

.facts { margin: 0 0 10px; display: grid; gap: 4px; }
.facts > div { display: grid; grid-template-columns: 62px 1fr; gap: 8px; font-size: 13.5px; }
.facts dt { color: var(--muted); margin: 0; }
.facts dd { margin: 0; }
.facts__dim { color: var(--muted); font-size: 12.5px; }

.raw { margin: 0 0 12px; }
.raw summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.raw summary:hover { color: var(--ink); }
.raw pre { margin-top: 8px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule); max-height: 320px; overflow: auto; }

.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.files__item { font-family: var(--mono); font-size: 13px; padding-left: 14px; position: relative; }
.files__item::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; }
.files__item--ok::before { background: var(--ok); }
.files__item--missing::before { background: var(--stamp); }
.files__item .raw { margin: 0; }
.files__item .raw summary { font-family: var(--mono); font-size: 13px; color: var(--ink); list-style: none; }
.files__item .raw summary::-webkit-details-marker { display: none; }
.files__item .raw summary::after { content: " ▸"; color: var(--muted); }
.files__item .raw[open] summary::after { content: " ▾"; }

/* --- work (right) --- */

.panel { background: var(--surface); border: 1px solid var(--rule); padding: 18px 20px 20px; }

.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.empty { margin: 0; color: var(--muted); max-width: 60ch; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: baseline; gap: 8px;
    font-family: var(--mono); font-size: 13px;
    background: var(--paper); border: 1px solid var(--rule); padding: 4px 10px;
}
.chip__meta { color: var(--muted); font-size: 11.5px; }
.chips--outputs { margin-bottom: 14px; }
.chips--outputs .chip { border-color: var(--ok); color: var(--ok); background: var(--surface); }

.action { display: flex; align-items: center; gap: 16px; margin: 20px 0 28px; }
.action__why { font-size: 13.5px; color: var(--muted); }

/* --- buttons --- */

.btn {
    display: inline-block; cursor: pointer; user-select: none;
    font: inherit; font-weight: 500; font-size: 14px; line-height: 1;
    padding: 9px 14px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
    border-radius: 2px;
}
.btn:hover { background: var(--paper); }
.btn:focus-visible, .visually-hidden:focus-visible + .btn { outline: 2px solid var(--stamp); outline-offset: 2px; }

.btn--quiet { border-color: var(--rule); color: var(--ink); }

.btn--primary { background: var(--ink); color: var(--surface); padding: 12px 20px; font-size: 15px; }
.btn--primary:hover { background: #1B2F55; }
.btn--primary:disabled { background: var(--rule); border-color: var(--rule); color: var(--surface); cursor: not-allowed; }

/* --- result: the stamp + protocol --- */

.panel--result { position: relative; }

.stamp {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 18px; margin: 4px 0 16px;
    border: 2px solid var(--ok); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--ok);
    color: var(--ok);
    font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
    transform: rotate(-2deg);
    opacity: 0.92;
}
.stamp__line { font-size: 16px; font-weight: 600; }
.stamp__line--small { font-size: 11px; letter-spacing: 0.1em; }
.stamp--error { border-color: var(--stamp); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--stamp); color: var(--stamp); }

@media (prefers-reduced-motion: no-preference) {
    .stamp { animation: stamp-in 240ms cubic-bezier(.2,.9,.3,1.2) both; }
    @keyframes stamp-in { from { transform: rotate(-2deg) scale(1.25); opacity: 0; } to { transform: rotate(-2deg) scale(1); opacity: 0.92; } }
}

.log {
    padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule);
    max-height: 60vh; overflow: auto;
}

/* --- Blazor defaults kept (error bar, loading) --- */

#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); display: none;
    left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.loading-progress { position: relative; display: block; width: 6rem; height: 6rem; margin: 20vh auto 1rem auto; }
.loading-progress circle { fill: none; stroke: var(--rule); stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--ink); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--muted); inset: calc(20vh + 7rem) 0 auto 0; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Načítám…"); }
