:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --border: #d8dee9;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #15803d;
    --danger: #b91c1c;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    min-height: 100vh;
    padding: 0 0 32px 0;
}
.app-header {
    margin: 0 auto 28px;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 18px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.app-brand,
.app-nav-link {
    text-decoration: none;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 10px 4px 4px;
    color: var(--text);
    font-weight: 800;
}

.app-brand:hover {
    color: var(--text);
}

.app-brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.app-brand-text {
    white-space: nowrap;
}

.app-nav-list {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    margin: 0;
    list-style: none;
    border-radius: 999px;
    background: #e5edff;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    color: #1741a6;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: var(--panel);
    color: var(--text);
}

.app-nav-link.active {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.wrap {
    max-width: 1440px;
    margin: 0 auto;
}

.documents-page .template-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
}

.documents-page .document-template-workspace {
    display: grid;
    gap: 18px;
}

.documents-page .rjs-form {
    display: grid;
    gap: 0;
}

.documents-page .rjs-form > .card {
    margin-bottom: 18px;
}

.documents-page .rjs-entity-card {
    padding: 0;
    overflow: hidden;
}

.documents-page .rjs-form .identity-head h3 {
    margin: 0;
}

.documents-page .rjs-form textarea {
    min-height: 112px;
}

.documents-page .rjs-form .readonly-grid textarea {
    min-height: 82px;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.documents-page .compact-actions {
    margin-top: 12px;
}

.documents-page .compact-actions button {
    width: auto;
    min-width: 190px;
}

.documents-page .rjs-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.documents-page .rjs-toggle input {
    width: 16px;
    min-height: 16px;
    margin: 0;
}

.documents-page .rjs-inflection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.documents-page .representation-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.documents-page .representation-mode-option.is-active {
    border-color: rgba(21, 128, 61, 0.48);
    background: #ecfdf5;
    color: #166534;
}

.documents-page .representation-mode-option input {
    width: 14px;
    min-height: 14px;
    margin: 0;
}

.documents-page .rjs-card-inflection {
    display: block;
    grid-column: 1 / -1;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.documents-page .rjs-card-inflection .rjs-inflection-options {
    margin-top: 0;
}

.documents-page .signer-control-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.documents-page .signer-control-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.documents-page .signer-instrumental {
    display: block;
    margin-top: 10px;
}

.documents-page .signer-instrumental input {
    margin-top: 5px;
}

.documents-page .share-parts-list {
    display: grid;
    gap: 8px;
}

.documents-page .owner-holdings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid rgba(124, 58, 237, 0.2);
}

.documents-page .share-part-row {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.documents-page .share-part-row-title {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.documents-page .statutory-panel {
    margin-top: 0;
}

.documents-page .statutory-card {
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

@media (max-width: 720px) {
    .documents-page .template-grid {
        grid-template-columns: 1fr;
    }

    .documents-page .compact-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .documents-page .compact-actions button {
        width: 100%;
    }

}

h1 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.15;
}

.intro {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 18px;
}

.card h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

form {
    display: grid;
    gap: 14px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 180px 120px;
    gap: 12px;
    align-items: end;
}

    .row.single {
        grid-template-columns: 1fr 120px;
    }

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

input,
select,
button,
.button-link,
.output {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 16px;
    min-height: 48px;
}

input,
select {
    padding: 12px 14px;
    color: var(--text);
    background: #fff;
}

    input:focus,
    select:focus {
        outline: 2px solid rgba(37, 99, 235, 0.15);
        border-color: var(--accent);
    }

button,
.button-link {
    cursor: pointer;
    border: none;
    padding: 12px 16px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    transition: background 0.15s ease;
}

    button.button-danger {
        border: 1px solid #fecaca;
        background: #fef2f2;
        color: #991b1b;
    }

        button.button-danger:hover {
            background: #fee2e2;
        }

    button.button-compact {
        width: auto;
        min-width: 2rem;
        min-height: 2rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.78rem;
    }

    button:hover,
    .button-link:hover {
        background: var(--accent-hover);
    }

    button.secondary {
        background: #e5edff;
        color: #1741a6;
        border: 1px solid #c7d6ff;
    }

        button.secondary:hover {
            background: #dbe7ff;
        }

    button:disabled {
        cursor: not-allowed;
        opacity: 0.55;
    }

.result-wrap {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
    align-items: start;
}

.output {
    padding: 14px 16px;
    background: #f8fafc;
    line-height: 1.5;
    border-style: dashed;
    display: flex;
    align-items: center;
    word-break: break-word;
}

.status {
    min-height: 20px;
    font-size: 14px;
    color: var(--muted);
}

    .status.success {
        color: var(--success);
    }

    .status.error {
        color: var(--danger);
    }

.hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: -4px;
}

.muted {
    color: var(--muted);
    font-size: 0.84rem;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.button-link:hover {
    background: var(--accent-hover);
    color: #fff;
}

.file-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font-weight: 700;
}

.file-pill small {
    flex: 0 0 auto;
    font-weight: 500;
}

@media (max-width: 720px) {
    .app-header {
        margin-bottom: 20px;
    }

    .app-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .app-brand {
        justify-content: center;
    }

    .app-nav-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .app-nav-link {
        padding: 0 10px;
        text-align: center;
    }

    .row,
    .row.single,
    .result-wrap {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 22px;
    }

    .card {
        padding: 18px;
    }
}
/*dokumenty*/
.documents-page.wrap {
    max-width: 1440px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.document-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: stretch;
}

.card.is-secondary {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
}

.card.is-primary {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.12);
}

.section-heading,
.identity-summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

    .section-heading p,
    .subsection-heading p,
    .identity-summary p,
    .hint,
    .status {
        margin: 0;
        color: var(--muted);
        line-height: 1.5;
    }

.eyebrow {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-source {
    display: grid;
    gap: 18px;
}

.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: #e5edff;
    min-width: 310px;
}

    .mode-switch button {
        min-height: 42px;
        border-radius: 999px;
        background: transparent;
        color: #1741a6;
        box-shadow: none;
    }

        .mode-switch button:hover,
        .mode-switch button.active {
            background: var(--panel);
            color: var(--text);
        }

.source-panel {
    padding-top: 4px;
}

.subsection-heading {
    margin-bottom: 12px;
}

    .subsection-heading h3 {
        margin: 0 0 3px;
        font-size: 17px;
    }

.template-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.template-button {
    min-height: 104px;
    padding: 14px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--text);
    box-shadow: none;
}

    .template-button:hover,
    .template-button.active {
        background: #e5edff;
        border-color: #93b4ff;
        color: var(--text);
        transform: translateY(-1px);
    }

    .template-button strong,
    .template-button span {
        display: block;
    }

    .template-button strong {
        margin-bottom: 5px;
        font-size: 14px;
    }

    .template-button span {
        color: var(--muted);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.35;
    }

.field-block {
    display: block;
}

.compact-select {
    margin-top: 14px;
    max-width: 420px;
}

.upload-box {
    display: none;
}

    .upload-box.active {
        display: block;
    }

.dropzone {
    display: grid;
    min-height: 120px;
    place-items: center;
    border: 1px dashed #9aa9c3;
    border-radius: 14px;
    background-color: #e7f3ff;
    color: var(--muted);
    text-align: center;
    cursor: pointer;
}

.dropzone:hover {
    border-color: var(--accent);
    background: #84d7ff;
    color: #333;
}

.is-invalid .dropzone {
    border-color: var(--danger);
    background: #fef2f2;
}

.identity-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: #e5edff;
    color: #1741a6;
    font-size: 13px;
    font-weight: 700;
}

.identity-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.identity-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.identity-card.requires-lookup,
.identity-card.requires-manual {
    border-color: rgba(37, 99, 235, 0.35);
}

.identity-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

    .identity-head h3 {
        margin: 0 0 4px;
        font-size: 18px;
    }

    .identity-head p {
        margin: 0;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.4;
    }

.identity-type {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid #c7d6ff;
    border-radius: 999px;
    background: #e5edff;
    color: #1741a6;
    font-size: 12px;
    font-weight: 700;
}

.identity-fields {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.interaction-box {
    padding: 14px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 14px;
    background: #eef4ff;
}

.ares-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px;
    gap: 12px;
    align-items: end;
}

.ico-field input {
    min-height: 58px;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: 0.06em;
}

.ares-button {
    min-height: 58px;
}

.manual-grid,
.readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

    .readonly-grid .wide,
    .manual-grid .wide {
        grid-column: 1 / -1;
    }

    .readonly-grid input,
    .readonly-grid textarea {
        background: #f3f4f6;
        color: #4b5563;
    }

textarea {
    width: 100%;
    min-height: 86px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    color: var(--text);
    background: #fff;
    font: inherit;
    resize: vertical;
}

    textarea:focus {
        outline: 2px solid rgba(37, 99, 235, 0.15);
        border-color: var(--accent);
    }

.page-header .intro,
.identity-head p,
.card.is-secondary p,
.muted-heading h3,
.muted-heading p {
    color: var(--muted);
}

.field-block,
.ico-field,
.manual-grid label,
.ares-row label {
    color: var(--text);
    font-weight: 750;
}

.readonly-panel {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.72);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

    .readonly-panel label {
        color: #4b5563;
        font-weight: 650;
    }

.identity-card.is-filled,
.readonly-panel.is-filled {
    border-color: rgba(21, 128, 61, 0.38);
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.08);
    }

        .readonly-panel.is-filled input,
        .readonly-panel.is-filled textarea {
            border-color: rgba(21, 128, 61, 0.32);
            background: #ffffff;
            color: var(--text);
        }

.interaction-box.is-loading {
    border-color: rgba(148, 163, 184, 0.35);
    background: #f8fafc;
    box-shadow: none;
}

    .interaction-box.is-loading .ico-field input,
    .interaction-box.is-filled .ico-field input {
        border-color: var(--border);
        background: #f8fafc;
        color: #64748b;
        box-shadow: none;
    }

        .interaction-box.is-loading .ico-field input:focus,
        .interaction-box.is-filled .ico-field input:focus {
            outline: none;
            border-color: var(--border);
        }

.statutory-panel textarea {
    min-height: 112px;
}

.actions {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

.stats-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stats-page .stats-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.stats-page .stats-card h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.stats-page dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.stats-page dl div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.stats-page dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.stats-page dd {
    margin: 0;    
    font-weight: 600;
}

.stats-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.stats-table th:first-child,
.stats-table td:first-child {
    text-align: left;
}

.stats-table thead th {
    font-size: 13px;
}

@media (max-width: 1060px) {
    .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-page .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .section-heading,
    .identity-summary,
    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-page .stats-grid {
        grid-template-columns: 1fr;
    }

    .mode-switch {
        min-width: 0;
        width: 100%;
    }

    .template-grid,
    .manual-grid,
    .readonly-grid,
    .ares-row {
        grid-template-columns: 1fr;
    }

    .actions .download {
        max-width: none;
    }
}

/* dokumenty: kompaktní krok 2 + ARES */
.identities-card {
    padding: 20px;
}

.identity-list {
    gap: 12px;
}

.identity-card:not(.is-filled) {
    background: rgba(248, 250, 252, 0.82);
}

.identity-head {
    padding: 12px 16px;
    align-items: center;
}

    .identity-head h3 {
        font-size: 16px;
    }

.identity-fields {
    gap: 10px;
    padding: 12px 14px 14px;
}

    .identity-fields input,
    .identity-fields textarea,
    .identity-fields button {
        min-height: 40px;
        border-radius: 10px;
        font-size: 14px;
    }

.interaction-box {
    padding: 12px;
}

.ares-row {
    grid-template-columns: minmax(170px, 260px) 140px;
}

.ico-field input {
    min-height: 42px;
    font-size: 16px;
    font-weight: 750;
}

.ares-button {
    min-height: 42px;
    padding: 10px 12px;
}

.manual-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

    .manual-grid .wide {
        grid-column: span 2;
    }

.readonly-panel {
    padding: 12px;
}

.readonly-summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 10px;
}

    .readonly-summary strong,
    .readonly-summary span {
        display: block;
    }

    .readonly-summary strong {
        font-size: 14px;
    }

    .readonly-summary span {
        max-width: 680px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
    }

.readonly-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
}

    .readonly-grid label {
        font-size: 12px;
        margin: 0;
    }

    .readonly-grid .col-1 {
        grid-column: span 1;
    }

    .readonly-grid .col-2 {
        grid-column: span 2;
    }

    .readonly-grid .col-3 {
        grid-column: span 3;
    }

    .readonly-grid .col-4 {
        grid-column: span 4;
    }

    .readonly-grid .col-5 {
        grid-column: span 5;
    }

    .readonly-grid .wide {
        grid-column: 1 / -1;
    }

    .readonly-grid input,
    .readonly-grid textarea {
        margin-top: 5px;
        background: #f8fafc;
        color: #64748b;
    }

.readonly-panel.is-filled label.has-value input,
.readonly-panel.is-filled label.has-value textarea {
    border-color: rgba(21, 128, 61, 0.34);
    background: #ffffff;
    color: var(--text);
}

.readonly-panel.is-filled label:not(.has-value) input,
.readonly-panel.is-filled label:not(.has-value) textarea {
    border-style: dashed;
    background: #f8fafc;
    color: #94a3b8;
}

.ares-lookup-panel.is-loading,
.ares-lookup-panel.is-filled {
    border-color: rgba(148, 163, 184, 0.34);
    background: #f8fafc;
    box-shadow: none;
}

    .ares-lookup-panel.is-loading .ico-field input,
    .ares-lookup-panel.is-filled .ico-field input {
        border-color: var(--border);
        background: #f1f5f9;
        color: #64748b;
        box-shadow: none;
    }

        .ares-lookup-panel.is-loading .ico-field input:focus,
        .ares-lookup-panel.is-filled .ico-field input:focus {
            outline: none;
            border-color: var(--border);
        }

.statutory-panel {
    margin-top: -2px;
}

.statutory-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.statutory-card {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: start;
    min-height: auto;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
}

    .statutory-card input {
        width: 16px;
        min-height: 16px;
        margin: 2px 0 0;
    }

    .statutory-card strong,
    .statutory-card small,
    .statutory-card em {
        display: block;
    }

    .statutory-card strong {
        margin-bottom: 2px;
        font-size: 14px;
    }

    .statutory-card small,
    .statutory-card em {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
    }

    .statutory-card em {
        margin-top: 4px;
        font-style: normal;
    }

    .statutory-card.selected {
        border-color: rgba(21, 128, 61, 0.48);
        background: #f0fdf4;
        box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.08);
    }

.statutory-empty {
    padding: 10px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1060px) {
    .readonly-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .readonly-grid .wide {
        grid-column: 1 / -1;
    }

    .readonly-grid .col-4,
    .readonly-grid .col-5 {
        grid-column: span 3;
    }
}

@media (max-width: 720px) {
    .identity-head,
    .readonly-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .manual-grid,
    .readonly-grid,
    .ares-row,
    .statutory-list {
        grid-template-columns: 1fr;
    }
}

/* dokumenty: mobilni zobrazeni */
@media (max-width: 720px) {
    body {
        padding: 12px 6px;
    }

    .documents-page.wrap {
        width: 100%;
        max-width: none;
    }

    .documents-page .page-header {
        gap: 10px;
        margin-bottom: 12px;
    }

    .documents-page .intro {
        margin-bottom: 14px;
        font-size: 14px;
        line-height: 1.45;
    }

    .documents-page .card {
        padding: 12px 10px;
        margin-bottom: 12px;
        border-radius: 14px;
    }

    .documents-page .identities-card {
        padding: 10px 8px;
    }

    .documents-page .section-heading,
    .documents-page .identity-summary {
        gap: 8px;
        margin-bottom: 12px;
    }

        .documents-page .section-heading h2,
        .documents-page .card h2 {
            font-size: 19px;
        }

    .documents-page .identity-count {
        align-self: flex-start;
        padding: 5px 8px;
        font-size: 12px;
    }

    .documents-page .template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .documents-page .template-button {
        min-height: 84px;
        padding: 10px;
        border-radius: 12px;
    }

        .documents-page .template-button strong {
            font-size: 13px;
        }

        .documents-page .template-button span {
            font-size: 12px;
            line-height: 1.3;
        }

    .documents-page .identity-list {
        gap: 8px;
    }

    .documents-page .identity-card {
        border-radius: 12px;
    }

    .documents-page .identity-head {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        padding: 9px 10px;
    }

        .documents-page .identity-head h3 {
            font-size: 15px;
        }

        .documents-page .identity-head p {
            font-size: 12px;
            line-height: 1.35;
        }

    .documents-page .identity-type {
        padding: 4px 7px;
        font-size: 11px;
        white-space: nowrap;
    }

    .documents-page .identity-fields {
        gap: 8px;
        padding: 9px 8px 10px;
    }

    .documents-page .interaction-box,
    .documents-page .readonly-panel {
        padding: 9px 8px;
        border-radius: 12px;
    }

    .documents-page .ares-row {
        grid-template-columns: minmax(0, 1fr) minmax(112px, 132px);
        gap: 8px;
    }

    .documents-page .manual-grid,
    .documents-page .readonly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

        .documents-page .manual-grid .wide,
        .documents-page .readonly-grid .wide,
        .documents-page .readonly-grid .col-1,
        .documents-page .readonly-grid .col-2,
        .documents-page .readonly-grid .col-3,
        .documents-page .readonly-grid .col-4,
        .documents-page .readonly-grid .col-5 {
            grid-column: 1 / -1;
        }

        .documents-page label,
        .documents-page .readonly-grid label {
            font-size: 12px;
            margin-bottom: 4px;
        }

    .documents-page .identity-fields input,
    .documents-page .identity-fields textarea,
    .documents-page .identity-fields button,
    .documents-page input,
    .documents-page select,
    .documents-page button {
        min-height: 39px;
        border-radius: 10px;
        font-size: 14px;
    }

    .documents-page input,
    .documents-page select,
    .documents-page textarea {
        padding: 9px 10px;
    }

    .documents-page textarea {
        min-height: 72px;
    }

    .documents-page .ico-field input,
    .documents-page .ares-button {
        min-height: 43px;
    }

    .documents-page .ico-field input {
        font-size: 17px;
    }

    .documents-page .readonly-summary {
        gap: 4px;
        margin-bottom: 8px;
    }

        .documents-page .readonly-summary strong {
            font-size: 13px;
        }

        .documents-page .readonly-summary span {
            font-size: 12px;
        }

    .documents-page .statutory-panel {
        margin-top: 0;
    }

    .documents-page .statutory-list {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .documents-page .statutory-card {
        padding: 8px;
        border-radius: 10px;
    }

    .documents-page .actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        gap: 8px;
        margin: 12px -10px -12px;
        padding: 8px 10px 10px;
        border-top: 1px solid rgba(148, 163, 184, 0.35);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(10px);
    }

        .documents-page .actions .download {
            max-width: none;
        }
}

@media (max-width: 420px) {
    body {
        padding: 8px 4px;
    }

    .documents-page .card {
        padding: 10px 8px;
    }

    .documents-page .identities-card {
        padding: 8px 6px;
    }

    .documents-page .identities-card {
        padding: 8px 6px;
    }

    .documents-page .identity-card {
        border: none;
        padding: 0;
    }

    .documents-page .template-grid {
        grid-template-columns: 1fr;
    }

    .documents-page .identity-head {
        flex-direction: column;
        align-items: stretch;
    }

    .documents-page .identity-type {
        align-self: flex-start;
    }

    .documents-page .ares-row,
    .documents-page .manual-grid,
    .documents-page .readonly-grid {
        grid-template-columns: 1fr;
    }

    .documents-page .actions {
        margin-right: -8px;
        margin-left: -8px;
    }
}

/* StrojOrig */
.notarial-upload-page {
    max-width: 68rem;
}

.notarial-upload-page .upload-form {
    margin-bottom: 0;
}

.notarial-upload-page .form-content {
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.notarial-upload-page .upload-form.is-processing .form-content {
    opacity: 0.42;
    filter: grayscale(0.75);
    pointer-events: none;
    user-select: none;
}

.notarial-upload-page .upload-form.has-results .form-content {
    opacity: 0.58;
    filter: saturate(0.55);
}

.notarial-upload-page .upload-form.has-results .form-content:focus-within,
.notarial-upload-page .upload-form.has-results .form-content:hover {
    opacity: 0.82;
    filter: saturate(0.8);
}

.notarial-upload-page .upload-description {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
}

.notarial-upload-page .upload-list {
    display: grid;
    gap: 0.75rem;
}

.notarial-upload-page .upload-row {
    display: grid;
    grid-template-columns: minmax(7rem, 0.3fr) minmax(15rem, 1fr) minmax(10rem, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.notarial-upload-page .file-preview {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.notarial-upload-page .file-preview-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.notarial-upload-page .form-message {
    padding: 0.75rem 0.9rem;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    white-space: pre-wrap;
}

.notarial-upload-page .process-area {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.notarial-upload-page .process-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.notarial-upload-page .process-heading h2 {
    margin: 0.15rem 0 0;
    font-size: 1.2rem;
}

.notarial-upload-page .process-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.notarial-upload-page .output-option {
    min-height: 4.5rem;
    padding: 0.75rem 0.85rem;
}

.notarial-upload-page .option-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.notarial-upload-page .converter-control {
    display: grid;
    grid-template-columns: minmax(7rem, 0.55fr) minmax(10rem, 1fr);
    align-items: center;
    gap: 0.75rem;
}

.notarial-upload-page .select-control {
    position: relative;
}

.notarial-upload-page .select-control::after {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    color: #475569;
    content: "⌄";
    pointer-events: none;
    transform: translateY(-55%);
}

.notarial-upload-page .converter-control select {
    min-height: 2.65rem;
    padding: 0.55rem 2.1rem 0.55rem 0.75rem;
    border-radius: 7px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 650;
    appearance: none;
}

.notarial-upload-page .process-status {
    text-align: right;
}

.notarial-upload-page .toggle-control {
    display: inline-flex;
    align-items: center;
    justify-content: end;
    gap: 0.65rem;
    cursor: pointer;
}

.notarial-upload-page .toggle-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.notarial-upload-page .toggle-switch {
    position: relative;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 1.45rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.notarial-upload-page .toggle-switch::after {
    position: absolute;
    top: 0.16rem;
    left: 0.16rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    content: "";
    transition: transform 0.15s ease;
}

.notarial-upload-page .toggle-control input:checked + .toggle-switch {
    border-color: var(--accent);
    background: var(--accent);
}

.notarial-upload-page .toggle-control input:checked + .toggle-switch::after {
    transform: translateX(1.15rem);
}

.notarial-upload-page .toggle-control input:focus-visible + .toggle-switch {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.notarial-upload-page .toggle-control input:disabled + .toggle-switch,
.notarial-upload-page .toggle-control:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.58;
}

.notarial-upload-page .process-submit {
    display: flex;
    justify-content: flex-end;
}

.notarial-upload-page .process-button {
    display: inline-flex;
    width: auto;
    min-width: 15rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.notarial-upload-page .download-panel {
    display: grid;
    gap: 1.15rem;
    margin: 1.5rem -1px -1px;
    padding: 1.4rem;
    border: 1px solid rgba(21, 128, 61, 0.35);
    border-radius: 8px;
    background: #f0fdf4;
    box-shadow: 0 14px 32px rgba(21, 128, 61, 0.12);
}

.notarial-upload-page .download-panel:focus {
    outline: none;
}

.notarial-upload-page .result-warnings {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    background: #fffbeb;
    color: #713f12;
}

.notarial-upload-page .warning-mark {
    display: grid;
    width: 1.6rem;
    height: 1.6rem;
    place-items: center;
    border-radius: 50%;
    background: #d97706;
    color: #fff;
    font-weight: 800;
}

.notarial-upload-page .result-warnings ul {
    margin: 0.45rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.notarial-upload-page .machine-readable-summary {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.notarial-upload-page .machine-readable-summary header {
    color: var(--text);
}

.notarial-upload-page .machine-readable-additions {
    display: grid;
    gap: 0.55rem;
}

.notarial-upload-page .machine-readable-addition {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(12rem, 0.55fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.notarial-upload-page .machine-readable-addition:last-child {
    border-bottom: 0;
}

.notarial-upload-page .addition-source {
    overflow-wrap: anywhere;
    color: var(--muted);
    line-height: 1.45;
}

.notarial-upload-page .addition-arrow {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 700;
}

.notarial-upload-page .addition-result {
    overflow-wrap: anywhere;
    color: var(--text);
    font-style: italic;
}

.notarial-upload-page .download-file {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 240px;
    min-height: 2.9rem;
    gap: 0.65rem;
}

.notarial-upload-page .download-file:hover {
    border-color: #93b0ff;
    background: #eef4ff;
    color: #12358a;
}

.notarial-upload-page .format-label {
    min-width: 3.15rem;
    max-width: fit-content;
    padding: 0.2rem 0.4rem;
    border-radius: 5px;
    background: #e5edff;
    color: #1741a6;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
}

.notarial-upload-page .format-label.docx {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.notarial-upload-page .result-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(21, 128, 61, 0.18);
}

.notarial-upload-page .download-actions {
    flex-direction: column;
    align-items: center;
    padding: 2rem 0 0.5rem;
}

.notarial-upload-page .restart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 2.6rem;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
}

@media (max-width: 780px) {
    .notarial-upload-page .machine-readable-addition {
        grid-template-columns: 1fr;
    }

    .notarial-upload-page .addition-arrow {
        transform: rotate(90deg);
        transform-origin: center;
        justify-self: start;
    }

    .notarial-upload-page .upload-row {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .notarial-upload-page .process-status {
        text-align: left;
    }

    .notarial-upload-page .process-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .notarial-upload-page .process-options {
        grid-template-columns: 1fr;
    }

    .notarial-upload-page .converter-control {
        grid-template-columns: 1fr;
    }

    .notarial-upload-page .process-button,
    .notarial-upload-page .restart-button {
        width: 100%;
    }

    .notarial-upload-page .file-preview-item {
        grid-template-columns: 1fr;
    }
}
