/* ===== Wagenbemerkungen und tabellarische Wagenzusammenfassung ===== */

.remarksInput {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    color: #222;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
    overflow-y: hidden;
}

.remarksInput:disabled {
    background: #f5f7f9;
    color: #333;
    opacity: 1;
}

.counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.counterValue {
    min-width: 0;
}

/* Specific override for the global button rules in style.css. */
#wagonView .counter .summaryButton {
    box-sizing: border-box;
    flex: 0 0 52px;
    width: 52px;
    min-width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #172C40 !important;
    color: #fff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 25px;
    font-weight: normal;
    line-height: 1;
}

#wagonView .counter .summaryButton:hover,
#wagonView .counter .summaryButton:focus-visible {
    background: #172C40 !important;
    filter: brightness(1.2);
}

.summaryOverlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow: auto;
    padding: 18px;
    background: rgba(18, 28, 38, 0.72);
}

.summaryPanel {
    width: min(100%, 1500px);
    min-height: 100%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    color: #111;
}

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

.summaryHeader h2 {
    margin: 0;
}

.summaryClose {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: #e5e9ed;
    color: #111;
    font-size: 20px;
}

.summaryWarning {
    margin: 8px 0 16px;
    color: #c00;
    font-weight: bold;
    line-height: 1.4;
}

.summaryTableScroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.summaryTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12px;
}

.summaryTable th,
.summaryTable td {
    border: 1px solid #222;
    padding: 6px 5px;
    text-align: right;
    vertical-align: top;
    overflow-wrap: anywhere;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: inherit;
    font-style: normal;
    letter-spacing: normal;
}

.summaryTable th {
    background: #f0f0f0;
    font-weight: bold;
    text-align: center;
}

.summaryTable th:nth-child(1),
.summaryTable td:nth-child(1),
.summaryTable th:nth-child(3),
.summaryTable td:nth-child(3),
.summaryTable th:nth-child(10),
.summaryTable td:nth-child(10) {
    text-align: left;
}

.summaryTable th:nth-child(2),
.summaryTable td:nth-child(2) {
    white-space: nowrap;
}

.summaryTable .summaryTotal td {
    background: #e8edf2;
    font-weight: bold;
}

@media (max-width: 600px) {
    .summaryOverlay {
        padding: 0;
    }

    .summaryPanel {
        min-height: 100%;
        padding: 14px;
        border-radius: 0;
    }

    .summaryTable {
        width: 1200px;
        font-size: 12px;
    }

    .summaryTable th,
    .summaryTable td {
        padding: 7px 6px;
    }
}

@media print {
    body:has(#summaryOverlay:not(.hidden)) * {
        visibility: hidden;
    }

    #summaryOverlay,
    #summaryOverlay * {
        visibility: visible;
    }

    #summaryOverlay {
        position: absolute;
        inset: 0;
        padding: 0;
        overflow: visible;
        background: white;
    }

    .summaryPanel {
        width: 100%;
        padding: 0;
    }

    .summaryClose {
        display: none;
    }

    .summaryTable {
        width: 100%;
        font-size: 9px;
    }
}
