﻿.tbr-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}


/* LEFT FILTER AREA */

.tbr-filter-panel {
    background: #f5f8fe;
    border: 1px solid #d6e1ef;
    border-radius: 12px;
    padding: 18px;
    position: sticky;
    top: 15px;
}

.tbr-filter-panel-title {
    color: #123f8d;
    font-size: 19px;
    font-weight: 800;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #d7e0ec;
}

.tbr-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    .tbr-filter label {
        font-size: 13px;
        font-weight: 700;
        color: #26374d;
    }


/* FILTER BUTTONS */

.tbr-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.tbr-search-button,
.tbr-clear-button {
    width: 100%;
    height: 42px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.tbr-search-button {
    background: #074bd8;
    border: 1px solid #074bd8;
    color: white;
}

    .tbr-search-button:hover {
        background: #003cb7;
    }

.tbr-clear-button {
    background: white;
    border: 1px solid #c6ced9;
    color: #374151;
}


/* RESULTS AREA */

.tbr-results-area {
    min-width: 0;
}

.tbr-results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

    .tbr-results-header h2 {
        margin: 0;
        color: #123f8d;
    }

    .tbr-results-header p {
        margin: 5px 0 0;
        color: #667085;
    }

.tbr-found-count {
    white-space: nowrap;
    background: #eef4ff;
    color: #123f8d;
    padding: 9px 16px;
    border-radius: 20px;
    font-weight: 700;
}


/* RESULT CARDS */

.tbr-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.tbr-tier-section {
    margin-bottom: 30px;
}

.tbr-tier-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

    .tbr-tier-heading > span {
        color: #123f8d;
        font-size: 24px;
        font-weight: 800;
    }

    .tbr-tier-heading small {
        color: #667085;
    }


/* RESPONSIVE */

@media (max-width: 1000px) {

    .tbr-layout {
        grid-template-columns: 1fr;
    }

    .tbr-filter-panel {
        position: static;
    }
}



.tyre-image-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px 0;
}

.tyre-image-preview {
    width: 100px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: white;
}

.tyre-image-placeholder {
    width: 100px;
    height: 70px;
    border: 1px dashed #b8b8b8;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
}


.tbr-tyre-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.tbr-tyre-image-placeholder {
    width: 180px;
    height: 140px;
    border: 1px dashed #c8c8c8;
    border-radius: 8px;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 13px;
}

    .tbr-tyre-image-placeholder .k-svg-icon,
    .tbr-tyre-image-placeholder .k-font-icon {
        font-size: 36px;
    }


.tbr-tyre-image-wrapper {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
}

.tbr-tyre-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tbr-tyre-image-placeholder {
    width: 100%;
    height: 100%;
    border: 1px dashed #c8c8c8;
    border-radius: 8px;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 13px;
}


.tbr-tyre-image-wrapper {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 12px 0;
}

.tbr-tyre-image-wrapper {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    overflow: hidden;
}

.tbr-tyre-image {
    width: auto !important;
    height: auto !important;
    max-width: 160px !important;
    max-height: 120px !important;
    object-fit: contain;
    object-position: center;
    display: block;
}

.tbr-tyre-image-placeholder {
    width: 160px;
    height: 120px;
    border: 1px dashed #c8c8c8;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #888;
}


.retread-stars {
    display: inline-flex;
    gap: 1px;
    margin-left: 4px;
}

.retread-star {
    font-size: 18px;
    line-height: 1;
}

    .retread-star.full {
        color: #f5b301;
    }

    .retread-star.empty {
        color: #d3d3d3;
    }

    .retread-star.half {
        color: transparent;
        background: linear-gradient( to right, #f5b301 50%, #d3d3d3 50% );
        -webkit-background-clip: text;
        background-clip: text;
    }


.tyre-image-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
}

.tyre-no-image {
    font-size: 12px;
    color: #888;
}

.tyre-preview-window {
    min-width: 400px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tyre-preview-window-image {
    max-width: 600px;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}


.tbr-result-top {
    margin-bottom: 6px;
}

.tbr-brand {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.tbr-product-descr {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.tbr-pattern {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}



.tp-tyre-card {
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 14px;
}

.tp-tyre-card-active {
    border-color: #9bb7d5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.tp-tyre-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 16px;
    background: #f7f8f9;
}

.tp-position-number {
    font-size: 11px;
    color: #777;
    font-weight: 700;
    letter-spacing: .6px;
}

.tp-position-title {
    margin-top: 3px;
    font-size: 17px;
    font-weight: 700;
}

.tp-capture-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.tp-position-body {
    padding: 14px;
}

.tp-position-section {
    padding: 14px 0;
    border-bottom: 1px solid #ececec;
}

    .tp-position-section:last-child {
        border-bottom: none;
    }

.tp-position-section-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tp-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tp-tread-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tp-field-full {
    grid-column: 1 / -1;
}

.tp-field {
    position: relative;
    min-width: 0;
}

    .tp-field label {
        display: block;
        margin-bottom: 5px;
        font-size: 11px;
        font-weight: 700;
        color: #555;
    }

        .tp-field label small {
            display: block;
            font-size: 9px;
            color: #999;
            font-weight: 400;
        }

.tp-unit {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: #888;
}

.tp-calculated-box {
    min-height: 58px;
    border-radius: 6px;
    border: 1px solid #d8e3ee;
    background: #f4f8fb;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .tp-calculated-box span {
        font-size: 9px;
        text-transform: uppercase;
        color: #777;
    }

    .tp-calculated-box strong {
        margin-top: 3px;
        font-size: 16px;
    }

.tp-photo-area {
    border: 1px dashed #bbb;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.tp-photo-preview {
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    margin-bottom: 10px;
}

.tp-photo-help {
    margin-top: 7px;
    font-size: 10px;
    color: #888;
}


@media (max-width: 700px) {

    .tp-mobile-grid,
    .tp-tread-grid {
        grid-template-columns: 1fr;
    }

    .tp-field-full {
        grid-column: auto;
    }

    .tp-tyre-card-header {
        align-items: flex-start;
    }
}


.tp-axle-config-field .k-dropdownlist,
.tp-axle-config-field .k-picker {
    background: #ffffff !important;
    opacity: 1 !important;
    color: #222222 !important;
    border-color: #b8c0c7 !important;
}

.tp-axle-config-field .k-input-inner {
    color: #222222 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

.tp-axle-config-field .k-input-button {
    color: #333333 !important;
    opacity: 1 !important;
}


.tp-truck-tyre-detail {
    padding: 18px;
    background: #f8fafb;
}

.tp-truck-tyre-section {
    margin-bottom: 22px;
}

    .tp-truck-tyre-section:last-child {
        margin-bottom: 0;
    }

.tp-truck-tyre-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 2px solid #dce3e8;
}

    .tp-truck-tyre-heading strong {
        font-size: 14px;
        letter-spacing: .4px;
    }

.tp-truck-tyre-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #dfe5e9;
}

    .tp-truck-tyre-table th,
    .tp-truck-tyre-table td {
        padding: 9px 10px;
        border-bottom: 1px solid #e7eaed;
        text-align: left;
        font-size: 11px;
        white-space: nowrap;
    }

    .tp-truck-tyre-table th {
        background: #eef3f5;
        font-weight: 700;
    }

.tp-truck-tyre-empty {
    text-align: center !important;
    color: #888;
    padding: 18px !important;
}

@@media (max-width: 900px) {

    .tp-truck-tyre-section {
        overflow-x: auto;
    }

    .tp-truck-tyre-table {
        min-width: 1050px;
    }
}













/* GLOBAL CSS: add this stylesheet once in your Blazor host.
   The report itself is a normal Razor component, not an iframe/API/controller. */
.psr-overlay {
    z-index: 50000;
    position: fixed;
    inset: 0;
    background: #d7dfeb;
    overflow-y: auto;
    font-family: Arial,Helvetica,sans-serif;
    color: #202634;
    font-size: 12px;
}

    .psr-overlay * {
        box-sizing: border-box;
    }

.psr-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #102f88;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: white;
    box-shadow: 0 2px 9px #2225;
}

    .psr-toolbar strong {
        margin-right: auto;
        font-size: 15px;
    }

    .psr-toolbar label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .psr-toolbar select, .psr-toolbar button {
        min-height: 34px;
        border: 1px solid #ccd5e7;
        padding: 6px 14px;
        border-radius: 5px;
        background: white;
        color: #102f88;
        font-weight: bold;
    }

    .psr-toolbar button {
        cursor: pointer;
    }

        .psr-toolbar button.psr-primary {
            background: #00bf45;
            color: #fff;
            border-color: #00bf45;
        }

        .psr-toolbar button:disabled {
            opacity: .4;
            cursor: default;
        }

.psr-message {
    margin: 30px auto;
    background: white;
    padding: 26px;
    max-width: 800px;
    border-radius: 8px;
    font-size: 16px;
}

.psr-error {
    color: #9e1830;
}

.psr-report {
    padding: 15px 0 24px;
}

.psr-page {
    background: #fff;
    position: relative;
    width: 297mm;
    height: 210mm;
    margin: 12px auto;
    overflow: hidden;
    box-shadow: 0 2px 14px #8797ad;
    break-after: page;
    page-break-after: always;
}

    .psr-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

.psr-heading {
    height: 27mm;
    background: #00c13f;
    color: white;
    border-left: 2mm solid #263fa5;
    padding: 6.4mm 7mm;
    font-size: 26pt;
    font-style: italic;
    font-weight: 900;
    letter-spacing: .1mm;
}

.psr-body {
    padding: 0 7mm 15mm;
}

.psr-intro {
    font-size: 11pt;
    color: #243fa3;
    font-style: italic;
    margin: 2.8mm 0 5mm;
}

.psr-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #243fa5;
    color: white;
    height: 9mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6mm;
    font-size: 8pt;
}

.psr-vehicle-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10mm;
}

.psr-blue-title, .psr-green-title {
    font-size: 10pt;
    letter-spacing: 2.5px;
    margin: 0 0 2.5mm;
}

.psr-blue-title {
    color: #243fa5;
}

.psr-green-title {
    color: #00bd45;
}

.psr-field {
    height: 17mm;
    border: 1px solid #dce0e8;
    border-left: 2.5mm solid #233fa7;
    margin-bottom: 2mm;
    padding: 2.6mm 3mm;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

    .psr-field.green {
        border-left-color: #00bb46;
    }

    .psr-field small {
        font-size: 8pt;
        letter-spacing: 1px;
        font-weight: bold;
        color: #586e8d;
    }

    .psr-field b {
        font-size: 12pt;
        overflow-wrap: anywhere;
        line-height: 1.1;
    }

.psr-kpis {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 4mm;
}

.psr-kpi {
    height: 31mm;
    padding: 3mm 3.7mm;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

    .psr-kpi.blue {
        background: #233fa7;
    }

    .psr-kpi.green {
        background: #00bb43;
    }

    .psr-kpi small {
        font-size: 8.5pt;
        font-weight: 800;
        letter-spacing: .7px;
    }

    .psr-kpi b {
        font-size: 19pt;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .psr-kpi i {
        font-size: 8pt;
    }

.psr-section-label {
    letter-spacing: 2px;
    color: #243fa5;
    font-size: 10pt;
    margin: 7mm 0 3.5mm;
}

.psr-mini-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 4mm;
}

    .psr-mini-grid > div {
        height: 20mm;
        background: #f2f5fa;
        border-left: 2mm solid #00c044;
        padding: 3mm;
        font-size: 9pt;
        color: #50607c;
        display: flex;
        flex-direction: column;
        gap: 2.4mm;
        justify-content: center;
    }

    .psr-mini-grid b {
        font-size: 13pt;
        color: #243fa5;
    }

.psr-note {
    font-size: 8.5pt;
    color: #65738f;
    font-style: italic;
    line-height: 1.4;
    margin-top: 4mm;
}

.psr-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 10pt;
}

    .psr-table th {
        background: #233fa7;
        color: white;
        padding: 3.5mm 2.5mm;
        text-align: left;
        white-space: normal;
    }

    .psr-table td {
        border: 1px solid #e2e4ec;
        padding: 3mm 2.5mm;
        overflow-wrap: anywhere;
    }

    .psr-table tr:nth-child(even) td {
        background: #edf1fa;
    }

    .psr-table .psr-cpk {
        color: #233fa7;
        font-weight: 800;
    }

.psr-small-table {
    font-size: 8.3pt;
}

    .psr-small-table th, .psr-small-table td {
        padding: 3mm 1.5mm;
    }

.psr-bars {
    display: flex;
    flex-direction: column;
    gap: 3.3mm;
}

.psr-bar-row {
    display: grid;
    grid-template-columns: 66mm 1fr 31mm;
    align-items: center;
    gap: 4mm;
    min-height: 11.5mm;
    font-size: 9.7pt;
}

    .psr-bar-row > span {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .psr-bar-row > b {
        color: #233fa7;
        text-align: right;
    }

.psr-bar-track {
    background: #eef1f6;
    height: 7.5mm;
    overflow: hidden;
    border-radius: 1mm;
}

.psr-bar-fill {
    height: 100%;
}

    .psr-bar-fill.blue {
        background: #243fa5;
    }

    .psr-bar-fill.green {
        background: #00bd43;
    }

.psr-bars.compact {
    margin-top: 3mm;
    gap: 2mm;
}

    .psr-bars.compact .psr-bar-row {
        min-height: 9.5mm;
    }

.psr-photo-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    grid-template-rows: repeat(2,1fr);
    gap: 5mm;
}

.psr-photo-card {
    border: 1px solid #dde4eb;
    overflow: hidden;
    min-height: 0;
}

.psr-photo-frame {
    height: 50mm;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f4f8;
    color: #c3c8d1;
    font-style: italic;
    font-size: 10pt;
}

    .psr-photo-frame img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.psr-photo-title {
    background: #233fa7;
    color: white;
    padding: 2mm 2.5mm;
    font-size: 9pt;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.psr-photo-caption {
    padding: 2mm 2.5mm;
    height: 11mm;
    font-size: 8pt;
    color: #53617a;
    overflow: hidden;
}

.psr-signoff-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 8mm;
    min-height: 137mm;
}

.psr-green-banner, .psr-signoff h3 {
    color: white;
    background: #00bf43;
    font-size: 11pt;
    letter-spacing: 2px;
    padding: 3.5mm;
    margin: 0;
}

.psr-recommendations {
    padding: 3mm 3mm 3mm 10mm;
    font-size: 11pt;
    line-height: 1.45;
}

    .psr-recommendations li {
        padding: 3.5mm 0;
    }

        .psr-recommendations li::marker {
            color: #00ba43;
            font-weight: 900;
        }

.psr-signoff {
    background: #f3f4f7;
    border: 1px solid #dde2ea;
}

    .psr-signoff h3 {
        background: #233fa7;
        letter-spacing: 1px;
    }

    .psr-signoff label {
        display: block;
        margin: 4mm 3mm 1mm;
        color: #667894;
        font-weight: bold;
        font-size: 9pt;
    }

.psr-signature {
    height: 13mm;
    margin: 0 3mm;
    background: white;
    border: 1px solid #d9dfe8;
    padding: 2mm;
    font-size: 11pt;
}

.psr-dealer {
    background: #243fa5;
    color: white;
    padding: 4mm;
    display: flex;
    justify-content: space-between;
    margin-top: 3mm;
    font-size: 9pt;
    letter-spacing: 1px;
    font-weight: bold;
}
/* COVER */
.psr-cover {
    display: grid;
    grid-template-columns: 42% 58%;
}

.psr-cover-left {
    background: #233fa7;
    color: white;
    border-right: 2.5mm solid #00bf43;
    padding: 8mm 10mm 15mm 12mm;
}

.psr-logo {
    width: 102mm;
    height: auto;
    max-height: 45mm;
    object-fit: contain;
    object-position: left center;
}

.psr-cover-title {
    font-size: 33pt;
    font-weight: 900;
    font-style: italic;
    line-height: 1.12;
    margin-top: 15mm;
}

    .psr-cover-title span {
        color: #00c945;
    }

.psr-cover-subtitle {
    font-size: 11pt;
    letter-spacing: 2.1px;
    margin: 6mm 0;
    color: #cddaff;
}

.psr-cover dl {
    display: grid;
    grid-template-columns: 38% 62%;
    gap: 3mm 1.5mm;
    font-size: 9.7pt;
    margin-top: 7mm;
}

.psr-cover dt {
    font-weight: bold;
    color: #c1d1f4;
}

.psr-cover dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.psr-cover-right {
    padding: 8mm 4.5mm 15mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.psr-cover-feature {
    background: #f2f4f7;
    border: 1px dashed #cbd3df;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4mm;
    height: 138mm;
    color: #516889;
}

    .psr-cover-feature strong {
        font-size: 18pt;
        color: #233fa7;
    }

    .psr-cover-feature span {
        font-size: 13pt;
    }

    .psr-cover-feature small {
        font-style: italic;
    }

.psr-cover-symbol {
    font-size: 65pt;
    color: #b6bfcb;
}

.psr-cover-kpis {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 3mm;
}

    .psr-cover-kpis div {
        height: 35mm;
        background: #233fa7;
        color: white;
        padding: 4mm 3mm;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .psr-cover-kpis small {
        font-size: 8pt;
        font-weight: bold;
        letter-spacing: 1px;
    }

    .psr-cover-kpis b {
        font-size: 16.5pt;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.psr-cover-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #00bf43;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6mm;
    height: 9mm;
    font-size: 8.5pt;
}

/* Printing from the SAME Blazor page. Hide other app UI without hiding any ancestors
   needed to paint the report. :has() supported by current Chromium / Edge / Firefox. */
@page {
    size: A4 landscape;
    margin: 0;
}

@media print {
    html, body {
        width: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

        body *:not(:has(.psr-overlay)):not(.psr-overlay):not(.psr-overlay *) {
            display: none !important;
        }

    .psr-overlay {
        position: absolute !important;
        inset: 0 !important;
        z-index: auto !important;
        background: white !important;
        overflow: visible !important;
    }

    .psr-toolbar {
        display: none !important;
    }

    .psr-report {
        padding: 0 !important;
        margin: 0 !important;
    }

    .psr-page {
        width: 297mm !important;
        height: 210mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
        break-after: page !important;
        page-break-after: always !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

        .psr-page:last-child {
            break-after: auto !important;
            page-break-after: auto !important;
        }
}



/* ===========================================
   TBR TIER GRADIENT SECTIONS
   =========================================== */

.tbr-results {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

/* Filled tier container */
.tbr-tier-section {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(30, 85, 135, 0.12);
    box-shadow: 0 6px 20px rgba(20, 65, 105, 0.09);
    overflow: hidden;
}

    /* ===========================================
   GRADIENT COLOURS
   =========================================== */

    /* Tier 1 - Deep Blue */
    .tbr-tier-section.tbr-tier-1 {
        background: linear-gradient( 120deg, #1050a0 0%, #2779cf 100% );
    }

    /* Tier 2 - Medium Blue */
    .tbr-tier-section.tbr-tier-2 {
        background: linear-gradient( 120deg, #3a80be 0%, #68a8dd 100% );
    }

    /* Tier 3 - Light Blue */
    .tbr-tier-section.tbr-tier-3 {
        background: linear-gradient( 120deg, #81b9e1 0%, #b0d9f2 100% );
    }

    /* Tier 4 - Very Light Blue */
    .tbr-tier-section.tbr-tier-4,
    .tbr-tier-section.tbr-tier-default {
        background: linear-gradient( 120deg, #c3e1f5 0%, #edf7ff 100% );
    }

    /* ===========================================
   TIER HEADER
   =========================================== */

    .tbr-tier-section .tbr-tier-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.35);
        font-size: 22px;
        font-weight: 750;
        letter-spacing: 0.3px;
    }

/* White titles for darker tiers */
.tbr-tier-1 .tbr-tier-heading,
.tbr-tier-2 .tbr-tier-heading {
    color: #ffffff;
}

/* Dark titles for lighter tiers */
.tbr-tier-3 .tbr-tier-heading,
.tbr-tier-4 .tbr-tier-heading,
.tbr-tier-default .tbr-tier-heading {
    color: #174567;
}

/* Product count indicator */
.tbr-tier-section .tbr-tier-count {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 7px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

/* ===========================================
   FOUR TYRES PER ROW
   =========================================== */

.tbr-tier-section .tbr-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

/* ===========================================
   TYRE CARDS
   =========================================== */

.tbr-tier-section .tbr-result-card {
    min-width: 0;
    height: 100%;
    background: #ffffff;
    border: 1px solid rgba(40, 100, 150, 0.1);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(20, 65, 110, 0.09);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .tbr-tier-section .tbr-result-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(20, 65, 110, 0.17);
    }

/* Prevent long product descriptions overflowing */
.tbr-tier-section .tbr-spec-list {
    min-width: 0;
}

    .tbr-tier-section .tbr-spec-list strong {
        overflow-wrap: anywhere;
    }

/* ===========================================
   RESPONSIVE LAYOUT
   =========================================== */

@media (max-width: 1250px) {

    .tbr-tier-section .tbr-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {

    .tbr-tier-section {
        padding: 16px;
        border-radius: 14px;
    }

        .tbr-tier-section .tbr-tier-heading {
            font-size: 19px;
        }

        .tbr-tier-section .tbr-result-grid {
            grid-template-columns: 1fr;
            gap: 14px;
        }
}


/* ==========================================
   TYRE PERFORMANCE - RESPONSIVE WINDOWS
   ========================================== */

/* Ensure long content cannot force page width */
.tp-workspace,
.tp-content-card,
.tp-assessment-body,
.tp-truck-window,
.tp-position-popup,
.tp-position-editor {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.tp-assessment-history-grid,
.tp-truck-tyre-section {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Position editor on larger screens */
.k-window:has(.tp-position-popup) {
    max-width: 1300px;
}

/* Mobile phones */
@media (max-width: 767px) {

    /* Full usable width for tyre position */
    .k-window:has(.tp-position-popup),
    .k-window:has(.tp-truck-window),
    .k-window:has(.tp-edit-wrapper) {
        position: fixed !important;
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
        min-width: 0 !important;
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

        /* Scroll popup contents vertically */
        .k-window:has(.tp-position-popup) .k-window-content,
        .k-window:has(.tp-truck-window) .k-window-content,
        .k-window:has(.tp-edit-wrapper) .k-window-content {
            min-height: 0;
            min-width: 0;
            padding: 10px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }

        .k-window:has(.tp-position-popup) .k-window-titlebar,
        .k-window:has(.tp-truck-window) .k-window-titlebar,
        .k-window:has(.tp-edit-wrapper) .k-window-titlebar {
            padding: 12px !important;
        }

    .k-window-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Fix truck photograph text wrapping */
    .tp-position-editor .tp-truck-photo-banner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

        .tp-position-editor .tp-truck-photo-banner img {
            width: 100%;
            max-width: 100%;
            height: auto;
            max-height: 180px;
            object-fit: contain;
        }

        .tp-position-editor .tp-truck-photo-banner > div {
            min-width: 0;
            width: 100%;
            overflow-wrap: anywhere;
        }

    .tp-position-editor-header {
        padding: 12px;
    }

    /* Single-column tyre fields */
    .tp-position-editor .tp-mobile-grid,
    .tp-position-editor .tp-tread-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .tp-position-editor .tp-field-full {
        grid-column: auto;
    }

    .tp-position-editor .tp-field,
    .tp-position-editor .k-input,
    .tp-position-editor .k-picker {
        min-width: 0;
        max-width: 100%;
    }

        .tp-position-editor .tp-field label {
            font-size: 13px;
        }

    /* Prevent iPhone input-focus zoom */
    .tp-position-editor input,
    .tp-edit-wrapper input,
    .tp-position-editor textarea {
        font-size: 16px;
    }

    /* Copy and clear actions */
    .tp-position-editor .tp-position-quick-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

        .tp-position-editor .tp-position-quick-actions .k-button {
            width: 100%;
            min-width: 0;
            height: auto;
            min-height: 44px;
            white-space: normal;
            overflow-wrap: anywhere;
            text-align: center;
        }

    /* Bottom of tyre-position popup */
    .tp-position-popup {
        display: flex;
        flex-direction: column;
        min-height: 100%;
        padding: 0;
    }

        .tp-position-popup > .tp-window-actions {
            position: sticky;
            bottom: 0;
            z-index: 2;
            background: #ffffff;
            padding: 12px 4px;
            margin-top: auto;
            border-top: 1px solid #e2e8f0;
        }

            .tp-position-popup > .tp-window-actions .k-button {
                width: 100%;
                min-height: 44px;
            }

    /* Truck modal */
    .tp-truck-window {
        padding: 0;
    }

    .tp-window-heading {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

        .tp-window-heading .k-button {
            width: 100%;
            min-height: 44px;
        }

    .tp-truck-tyre-detail {
        min-width: 0;
    }

    .tp-truck-tyre-section {
        -webkit-overflow-scrolling: touch;
    }

    /* Fleet and truck edit forms */
    .tp-edit-wrapper {
        padding: 4px;
    }

    .tp-edit-table {
        width: 100%;
    }

        .tp-edit-table td {
            box-sizing: border-box;
            max-width: 100%;
        }

    .tp-edit-wrapper .tp-window-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .tp-edit-wrapper .tp-window-actions .k-button {
            width: 100%;
            min-height: 44px;
        }

    /* Main page actions */
    .tp-dashboard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

        .tp-dashboard-actions .k-button {
            width: 100%;
            white-space: normal;
            min-height: 46px;
        }

    /* Statistics */
    .tp-stats {
        gap: 8px;
        justify-content: space-between;
    }

    .tp-stat-wrapper {
        flex: 1 1 0;
        min-width: 0;
    }

    .tp-stat-circle {
        width: clamp(72px, 23vw, 105px);
        height: clamp(72px, 23vw, 105px);
        border-width: 4px;
    }

    .tp-stat-caption {
        font-size: 10px;
    }

    /* Card headings */
    .tp-section-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

        .tp-section-header .k-button {
            min-height: 40px;
        }
}
