/* ==========================================
   STRUCTURAL CALC – společný vzhled
   ========================================== */

.structural-calc {
    --sc-bg: #f1f3f5;
    --sc-panel: #ffffff;
    --sc-border: #cbd3db;
    --sc-text: #25313d;
    --sc-muted: #64748b;
    --sc-accent: #356b9b;
    --sc-accent-light: #eaf2f9;

    color: var(--sc-text);
    background: var(--sc-bg);
    padding: 20px;
    border-radius: 10px;
    max-width: 1000px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

/* ==========================================
   1. Rozbalovací panely
   ========================================== */

.structural-calc .sc-box {
    background: var(--sc-panel);
    border: 1px solid var(--sc-border);
    border-radius: 7px;
    margin-bottom: 8px;
    overflow: hidden;
}

.structural-calc .sc-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    color: var(--sc-text);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.structural-calc .sc-box__header:hover {
    background: #f5f8fb;
}

.structural-calc .sc-box__header[aria-expanded="true"] {
    background: var(--sc-accent-light);
    border-bottom: 1px solid var(--sc-border);
}

.structural-calc .sc-box__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.structural-calc .sc-box__heading strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--sc-text);
}

.structural-calc .sc-box__heading small {
    font-size: 13px;
    font-weight: 400;
    color: var(--sc-muted);
}

.structural-calc .sc-box__arrow {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--sc-accent);
    transition: transform 0.2s ease;
}

.structural-calc .sc-box__header[aria-expanded="true"] .sc-box__arrow {
    transform: rotate(180deg);
}

.structural-calc .sc-box__content {
    padding: 16px;
    background: var(--sc-panel);
}

.structural-calc .sc-box__content[hidden] {
    display: none;
}

/* ==========================================
   2. Univerzální tabulky vlastností
   ========================================== */

.structural-calc .sc-properties {
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--sc-border);
    border-radius: 5px;
    overflow: hidden;
}

/* Jeden řádek vlastností */

.structural-calc .sc-property {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 45px;
    align-items: center;
    min-height: 38px;
    border-bottom: 1px solid #e2e6ea;
}

/* Střídání řádků v tabulkách bez skupin */

.structural-calc .sc-properties > .sc-property:nth-child(even) {
    background: #f7f9fb;
}

.structural-calc .sc-properties > .sc-property:last-child {
    border-bottom: none;
}

/* Popisky */

.structural-calc .sc-property label {
    padding: 7px 10px;
    font-size: 13px;
}

/* Vstupy a výstupy */

.structural-calc .sc-property input,
.structural-calc .sc-property output,
.structural-calc .sc-property select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--sc-border);
    border-radius: 3px;
    background: #fff;
    color: var(--sc-text);
    font: inherit;
    font-size: 13px;
}

.structural-calc .sc-property input,
.structural-calc .sc-property output {
    text-align: right;
}

.structural-calc .sc-property select {
    padding: 6px 4px;
    cursor: pointer;
}

.structural-calc .sc-property input:focus,
.structural-calc .sc-property select:focus {
    outline: 2px solid var(--sc-accent);
    outline-offset: -1px;
}

.structural-calc .sc-property output {
    display: block;
    background: #eef1f4;
    border-color: transparent;
}

.structural-calc .sc-property__unit {
    padding: 0 6px;
    color: var(--sc-muted);
    font-size: 12px;
    text-align: center;
}

/* ==========================================
   2a. Univerzální skupiny vlastností
   ========================================== */

/* Oddělení sousedních skupin */

.structural-calc .sc-property-group + .sc-property-group {
    border-top: 1px solid var(--sc-border);
}

/* Nadpis skupiny */

.structural-calc .sc-property-group > h4 {
    margin: 0;
    padding: 10px 12px;
    background: var(--sc-accent-light);
    color: var(--sc-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Střídání barev řádků uvnitř skupiny */

.structural-calc .sc-property-group > .sc-property:nth-of-type(even) {
    background: #f7f9fb;
}

/* Poslední řádek skupiny */

.structural-calc .sc-property-group > .sc-property:last-of-type {
    border-bottom: none;
}

/* Vysvětlující poznámky */

.structural-calc .sc-property-group > .sc-property__note {
    margin: 0;
    padding: 8px 12px 10px;
    background: #f7f9fb;
    color: var(--sc-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Needitovatelné hodnoty */

.structural-calc .sc-property-group select:disabled,
.structural-calc .sc-property-group input:read-only {
    background: #eef1f4;
    color: var(--sc-muted);
    cursor: default;
    opacity: 1;
}

/* ==========================================
   3. Univerzální rozložení formuláře
      a doplňujícího obsahu
   ========================================== */

.structural-calc .sc-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.structural-calc .sc-form-layout > * {
    min-width: 0;
}

/* ==========================================
   4. Univerzální nápovědní box
   ========================================== */

.structural-calc .sc-help-box {
    padding: 16px 18px;
    background: #f5f8fc;
    border: 1px solid #dce5ef;
    border-radius: 8px;
    color: #334155;
    font-size: 12px;
    line-height: 1.4;
}

.structural-calc .sc-help-box__title {
    font-weight: 600;
    margin-bottom: 10px;
}

.structural-calc .sc-help-box__content > :first-child {
    margin-top: 0;
}

.structural-calc .sc-help-box__content > :last-child {
    margin-bottom: 0;
}

.structural-calc .sc-help-box__content img,
.structural-calc .sc-help-box__content svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.structural-calc .sc-section-help__image {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 12px;
}

.structural-calc .sc-section-help p {
    margin: 0 0 8px;
    font-size: 13px;
}

/* ==========================================
   5. Grafický souhrn statického schématu
   ========================================== */

.structural-calc .sc-box__visual-summary {
    display: block;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.structural-calc .sc-beam-summary {
    display: block;
    width: 100%;
    height: auto;
}

.structural-calc .sc-box:has(.sc-beam-summary) .sc-box__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}

.structural-calc .sc-box:has(.sc-beam-summary) .sc-box__header {
    align-items: stretch;
}

/* Popisky diagramů */

.structural-calc .sc-diagram__load {
    fill: #356b9b;
    font-size: 12px;
}

.structural-calc .sc-diagram__dimension {
    fill: #25313d;
    font-size: 12px;
}

/* ==========================================
   6. Výsledky statického posouzení
   ========================================== */

.structural-calc .sc-results {
    font-size: 13px;
    line-height: 1.5;
}

.structural-calc .sc-results-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.structural-calc #sc-print-results {
    padding: 7px 12px;
    border: 1px solid var(--sc-border);
    border-radius: 4px;
    background: var(--sc-panel);
    color: var(--sc-text);
    font: inherit;
    cursor: pointer;
}

.structural-calc #sc-print-results:hover:not(:disabled) {
    background: var(--sc-accent-light);
}

.structural-calc #sc-print-results:focus-visible {
    outline: 2px solid var(--sc-accent);
    outline-offset: 2px;
}

.structural-calc #sc-print-results:disabled {
    opacity: 0.5;
    cursor: default;
}

.sc-print-frame {
    position: fixed;
    width: 0;
    height: 0;
    border: 0;
    left: 0;
    bottom: 0;
}

.structural-calc .sc-results h3 {
    margin: 28px 0 12px;
    padding: 14px 0 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--sc-border);
    border-radius: 0;
    color: var(--sc-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.structural-calc .sc-results > h3:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.structural-calc .sc-results .sc-properties {
    margin-bottom: 20px;
}

.structural-calc .sc-results-case {
    display: block;
    margin-top: 3px;
    color: var(--sc-muted);
    font-size: 0.88em;
    font-weight: 400;
}

.structural-calc .sc-uls-cases-heading {
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.structural-calc .sc-uls-cases-table {
    margin-bottom: 10px;
}

.structural-calc .sc-uls-cases-table thead th {
    white-space: nowrap;
}

.structural-calc #sc-results-message {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--sc-muted);
}

.structural-calc #sc-design-status:empty {
    display: none;
}

.structural-calc #sc-design-status {
    margin-bottom: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.structural-calc .sc-result-status {
    padding: 10px 14px;
    border-left: 4px solid #b7791f;
    border-radius: 4px;
    background: #fff8e8;
    color: var(--sc-text);
}

.structural-calc .sc-result-status--error {
    border-left-color: #b42318;
    background: #fff1f0;
}

.structural-calc #sc-design-status p {
    margin: 0;
}

.structural-calc #sc-design-status ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.sc-results-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.sc-results-table {
    width: 100%;
    border-collapse: collapse;
    /* font-size: 0.95rem; */
	font-size: inherit;
    font-variant-numeric: tabular-nums;
}

.sc-results-table th,
.sc-results-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #ddd;
}

.sc-results-table thead th {
    text-align: right;
    font-weight: 600;
    background: rgba(128, 128, 128, 0.08);
}

.sc-results-table thead th:first-child,
.sc-results-table tbody th {
    text-align: left;
}

.sc-results-table tbody th {
    font-weight: 400;
}

.sc-results-table tbody td {
    text-align: right;
    white-space: nowrap;
}

.sc-combination-summary thead th,
.sc-combination-summary tbody td {
    text-align: left;
    white-space: normal;
}

.sc-results-table output {
    font-weight: 600;
}

/* Dvojice hodnot v jedné buňce výsledkové tabulky. */
.structural-calc .sc-results-table .sc-results-value,
.structural-calc .sc-results-table .sc-results-secondary {
    display: block;
}

.structural-calc .sc-results-table .sc-results-secondary {
    margin-top: 3px;
    font-size: 0.88em;
    color: var(--sc-muted);
}

.structural-calc .sc-results-table .sc-results-secondary output {
    font-weight: 400;
}

.sc-results-table tr.sc-results-detail th,
.sc-results-table tr.sc-results-detail td {
    font-size: 0.88em;
    color: var(--sc-text-muted, #777);
}

.sc-results-table tr.sc-results-detail th {
    font-weight: 400;
    padding-left: 1.2rem;
}


.sc-util-pass {
    color: #237a43;
    font-weight: 600;
}

.sc-util-fail {
    color: #c62828;
    font-weight: 700;
}

.sc-util-unknown {
    color: #888;
}


.sc-results-chart {
    margin: 1.5rem 0;
}

.structural-calc .sc-results-chart > h4 {
    margin: 0 0 10px;
    color: var(--sc-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.sc-results-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.sc-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    font-size: 0.9em;
}


/* ==========================================
   7. Responzivní zobrazení
   ========================================== */

@media (max-width: 760px) {
    .structural-calc .sc-form-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .structural-calc {
        padding: 10px;
    }

    .structural-calc .sc-box__header {
        padding: 11px 12px;
    }

    .structural-calc .sc-box__heading {
        flex-direction: column;
        gap: 3px;
    }

    .structural-calc .sc-box__content {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .structural-calc .sc-property {
        grid-template-columns: minmax(0, 1fr) 85px 38px;
    }

    .structural-calc .sc-property label {
        padding: 6px;
    }

    .structural-calc .sc-box__visual-summary {
        max-width: 100%;
    }
}

/* Společná buňka pro přepínatelné hodnoty */
.structural-calc .sc-property__value {
    min-width: 0;
}

/* Skryté vstupy a výstupy nesmí zabírat místo */
.structural-calc .sc-property [hidden] {
    display: none !important;
}


/* ==========================================
   8. Přepínač režimu výpočtu
   ========================================== */

.structural-calc .sc-mode-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 18px 0 20px;
}

.structural-calc .sc-mode-switch__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--sc-text);
}

.structural-calc .sc-mode-switch__options {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--sc-border);
    border-radius: 7px;
    background: #e7ebef;
}

.structural-calc .sc-mode-switch__options label {
    position: relative;
    display: block;
    cursor: pointer;
}

.structural-calc .sc-mode-switch__options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.structural-calc .sc-mode-switch__options label {
    padding: 8px 22px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sc-text);
    transition: background 0.15s, color 0.15s;
}

.structural-calc .sc-mode-switch__options label:has(input:checked) {
    background: var(--sc-accent);
    color: #fff;
}

.structural-calc .sc-mode-switch__options label:has(input:focus-visible) {
    outline: 2px solid var(--sc-accent);
    outline-offset: 3px;
}

.structural-calc .sc-mode-switch__options label:not(:has(input:checked)):hover {
    background: #f5f8fb;
}


/* Zaškrtávací pole v tabulce vlastností */

.structural-calc .sc-property--checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    padding: 0;
    accent-color: var(--sc-accent);
    cursor: pointer;
}

.structural-calc .sc-property--checkbox .sc-property__value {
    display: flex;
    align-items: center;
    justify-content: center;
}

.structural-calc .sc-property--checkbox label {
    cursor: pointer;
}

/* Tiskový dokument otevíraný tlačítkem Tisk / PDF. */
@media print {
    @page {
        size: A4 portrait;
        margin: 14mm;
    }

    html:has(.sc-print-document),
    body:has(.sc-print-document) {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }

    .structural-calc.sc-print-document {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: #fff;
        color: #000;
        font-size: 9.5pt;
        line-height: 1.4;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .sc-print-document > h1 {
        margin: 0 0 8pt;
        font-size: 16pt;
        line-height: 1.2;
    }

    .structural-calc.sc-print-document .sc-results {
        font-size: 9.5pt;
        line-height: 1.35;
    }

    .structural-calc.sc-print-document .sc-results h3 {
        margin: 12pt 0 7pt;
        padding-top: 8pt;
        font-size: 11pt;
        break-after: avoid;
        page-break-after: avoid;
    }

    .structural-calc.sc-print-document .sc-results > h3:first-of-type {
        margin-top: 12pt;
        padding-top: 0;
        border-top: 0;
    }

    .sc-print-document p {
        margin: 0 0 4pt;
        orphans: 3;
        widows: 3;
    }

    .sc-print-document .sc-results-toolbar {
        display: none;
    }

    .sc-print-document .sc-results-table-wrap {
        overflow: visible;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sc-print-document .sc-results-table {
        font-size: inherit;
    }

    .sc-print-document .sc-results-table:has(thead th:nth-child(4)):not(:has(thead th:nth-child(5))) {
        table-layout: fixed;
    }

    .sc-print-document .sc-results-table:has(thead th:nth-child(4)):not(:has(thead th:nth-child(5))) th:first-child {
        width: 40%;
    }

    .sc-print-document .sc-results-table th,
    .sc-print-document .sc-results-table td {
        padding: 5pt;
    }

    .sc-print-document thead {
        display: table-header-group;
    }

    .sc-print-document tr,
    .sc-print-document li,
    .sc-print-document .sc-result-status {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sc-print-document .sc-results-chart {
        max-width: 150mm;
        margin: 10pt auto;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sc-print-document .sc-results-chart > h4 {
        font-size: 10pt;
    }

    .sc-print-document .sc-uls-cases-heading {
        margin-top: 8pt;
        font-size: 10pt;
        break-after: avoid;
    }

    .sc-print-document #sc-design-output {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
