* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

button {
    color: inherit;
}

img {
    max-width: 100%;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a, #172554);
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.login-logo {
    width: 52px;
    height: 52px;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 25px;
    font-weight: bold;
}

.login-box h1 {
    margin: 20px 0 5px;
    font-size: 27px;
}

.login-box p {
    margin: 0 0 25px;
    color: #64748b;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-box label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: bold;
}

.login-box input {
    width: 100%;
    padding: 13px;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    outline: none;
}

.login-box input:focus {
    border-color: #2563eb;
}

.login-box button,
.main-button {
    margin-top: 15px;
    padding: 13px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    display: block;
}

.login-box button:hover,
.main-button:hover {
    background: #1d4ed8;
}

.error,
.success {
    padding: 12px;
    margin: 15px 0;
    border-radius: 8px;
    font-size: 14px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.success {
    background: #dcfce7;
    color: #166534;
}

/* SIDEBAR */

.sidebar {
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    height: 74px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-weight: bold;
}

.logo span {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    border-radius: 9px;
    font-size: 20px;
}

.sidebar nav {
    padding: 20px 12px;
}

.sidebar nav a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 4px;
    text-decoration: none;
    color: #cbd5e1;
    border-radius: 7px;
    transition: background .18s ease, color .18s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #1e293b;
    color: #ffffff;
}

.sidebar nav a.active {
    box-shadow: inset 3px 0 0 #3b82f6;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 15px;
}

.sidebar-bottom a {
    display: block;
    text-align: center;
    padding: 11px;
    border: 1px solid #334155;
    border-radius: 7px;
    text-decoration: none;
}

/* MAIN */

.main {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    height: 74px;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid #e5e7eb;
}

.page-name {
    font-size: 18px;
    font-weight: bold;
}

.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.content {
    padding: 30px;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
}

/* SHARED PAGE ELEMENTS */

.page-heading {
    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}

.page-heading p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
    max-width: 900px;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.back-link:hover {
    text-decoration: underline;
}

.is-hidden {
    display: none !important;
}

/* DASHBOARD */

.welcome h1 {
    margin: 0 0 7px;
    font-size: clamp(23px, 3vw, 31px);
}

.welcome p {
    margin: 0;
    color: #64748b;
}

.stats {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.stat span {
    display: block;
    color: #64748b;
    font-size: 14px;
}

.stat strong {
    display: block;
    margin-top: 12px;
    font-size: 30px;
}

.dashboard-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
    gap: 20px;
}

.block {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    min-height: 230px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.block h2 {
    margin: 0 0 20px;
    font-size: 18px;
}

.empty {
    padding: 35px;
    text-align: center;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
}

.quick-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-buttons button {
    padding: 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
}

.quick-buttons button:hover {
    background: #e2e8f0;
}

/* CALCULATION CATEGORIES */

.calculation-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.calculation-category-card {
    position: relative;
    min-height: 190px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.calculation-category-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .09);
}

.calculation-category-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 800;
}

.calculation-category-card h2 {
    margin: 2px 0 8px;
    font-size: 19px;
    line-height: 1.3;
}

.calculation-category-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
    font-size: 14px;
}

.card-arrow {
    position: absolute;
    right: 20px;
    bottom: 18px;
    color: #2563eb;
    font-size: 22px;
    font-weight: 800;
}

.disabled-card {
    opacity: .72;
}

.soon-badge {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 5px 9px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

/* EQUIPMENT CHOOSER */

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.equipment-card {
    width: 100%;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.equipment-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .1);
}

.equipment-image-wrap {
    height: 220px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.equipment-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
}

.equipment-card-body {
    padding: 20px;
}

.equipment-type {
    display: inline-block;
    margin-bottom: 8px;
    padding: 5px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
}

.equipment-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.equipment-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
    font-size: 14px;
}

/* CALCULATOR */

.calculator-workspace {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculator-header,
.customer-price-panel,
.form-section,
.results-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .04);
}

.calculator-header {
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.calculator-header h2 {
    margin: 8px 0 5px;
    font-size: 24px;
}

.calculator-header p {
    margin: 0;
    color: #64748b;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-weight: 700;
}

.calculation-mode-tabs {
    display: inline-flex;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.mode-tab {
    min-width: 145px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    color: #64748b;
}

.mode-tab.active {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.mode-tab.disabled,
.mode-tab:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.customer-price-panel {
    padding: 22px;
}

.customer-price-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.customer-price-panel h3,
.form-section h3,
.results-panel h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.customer-price-panel p,
.form-section-heading p,
.results-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.switch-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.switch-row input {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.customer-price-fields {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 320px));
    gap: 16px;
}

.calculation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    padding: 22px;
}

.form-section-heading {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.form-field label {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    line-height: 1.35;
}

.form-field input,
.form-field select {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-field input:focus,
.form-field select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.form-field small {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.4;
}

/* RESULTS */

.results-panel {
    padding: 22px;
    margin-bottom: 30px;
}

.results-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.pdf-download-button {
    flex: 0 0 auto;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px;
    background: #0f172a;
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    transition: background .18s ease, opacity .18s ease;
}

.pdf-download-button:hover {
    background: #1e293b;
}

.pdf-download-button:disabled {
    opacity: .55;
    cursor: wait;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.result-card {
    min-width: 0;
    padding: 17px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.result-card span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.result-card strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.accent-result {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.accent-result strong {
    color: #1d4ed8;
}

.comparison-result {
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
    line-height: 1.55;
}

.comparison-result.positive {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.comparison-result.negative {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.comparison-result.neutral {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.target-difference {
    margin-top: 10px;
    padding: 13px 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    line-height: 1.5;
}

.result-note {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}


/* PDF EXPORT */

.pdf-export-source {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 760px;
    padding: 34px;
    background: #ffffff;
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}

.pdf-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0f172a;
}

.pdf-brand {
    font-size: 23px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1.4px;
    color: #0f172a;
}

.pdf-document-title {
    margin-top: 8px;
    font-size: 14px;
    color: #64748b;
    font-weight: 700;
}

.pdf-date {
    max-width: 220px;
    text-align: right;
    color: #64748b;
    font-size: 11px;
}

.pdf-equipment {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 20px;
    align-items: center;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.pdf-equipment img {
    width: 145px;
    height: 100px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
}

.pdf-equipment h1 {
    margin: 5px 0 7px;
    font-size: 21px;
    line-height: 1.18;
}

.pdf-equipment p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.pdf-kicker {
    color: #2563eb;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.pdf-section {
    margin-top: 22px;
}

.pdf-section-title {
    margin-bottom: 9px;
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
}

.pdf-table {
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
}

.pdf-table-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 36px;
    border-bottom: 1px solid #e2e8f0;
}

.pdf-table-row:last-child {
    border-bottom: 0;
}

.pdf-table-label,
.pdf-table-value {
    padding: 9px 11px;
}

.pdf-table-label {
    color: #475569;
}

.pdf-table-value {
    border-left: 1px solid #e2e8f0;
    text-align: right;
    font-weight: 800;
    color: #0f172a;
}

.pdf-empty-row {
    padding: 14px;
    color: #94a3b8;
}

.pdf-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pdf-summary-card {
    padding: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.pdf-summary-card span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 10px;
}

.pdf-summary-card strong {
    display: block;
    font-size: 16px;
    color: #0f172a;
}

.pdf-summary-main {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.pdf-summary-main strong {
    color: #1d4ed8;
    font-size: 18px;
}

.pdf-status {
    margin-top: 22px;
    padding: 18px;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
}

.pdf-status-positive {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.pdf-status-negative {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.pdf-status-neutral {
    background: #f8fafc;
    color: #475569;
}

.pdf-status-title {
    font-size: 19px;
    line-height: 1.15;
    font-weight: 900;
}

.pdf-status-text {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.5;
}

.pdf-footer-note {
    margin-top: 24px;
    padding-top: 13px;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 9px;
    line-height: 1.45;
}

.pdf-avoid-break {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* MOBILE MENU */

.menu-toggle {
    display: none;
}

.burger {
    display: none;
    font-size: 25px;
    cursor: pointer;
    margin-right: 15px;
}

.sidebar-overlay {
    display: none;
}

/* LARGE TABLET */

@media (max-width: 1250px) {
    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .calculation-category-grid,
    .equipment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* TABLET */

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* MOBILE NAV */

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .main {
        margin-left: 0;
    }

    .burger {
        display: block;
    }

    .menu-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .menu-toggle:checked ~ .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 90;
    }

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 20px;
    }

    .calculator-header,
    .customer-price-top,
    .results-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-download-button {
        width: 100%;
    }

    .calculation-mode-tabs {
        width: 100%;
    }

    .mode-tab {
        min-width: 0;
        flex: 1;
    }

    .customer-price-fields {
        grid-template-columns: 1fr 1fr;
        max-width: none;
    }

    .calculation-category-grid,
    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .equipment-image-wrap {
        height: 240px;
    }
}

/* SMALL MOBILE */

@media (max-width: 560px) {
    .stats,
    .form-grid,
    .results-grid,
    .customer-price-fields {
        grid-template-columns: 1fr;
    }

    .user-info span {
        display: none;
    }

    .content {
        padding: 14px;
    }

    .login-box {
        padding: 25px 20px;
    }

    .block,
    .calculator-header,
    .customer-price-panel,
    .form-section,
    .results-panel {
        padding: 16px;
    }

    .equipment-image-wrap {
        height: 190px;
    }

    .calculator-header h2 {
        font-size: 21px;
    }

    .calculation-mode-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mode-tab {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
    }

    .result-card strong {
        font-size: 18px;
    }
}


/* =========================================================
   TENDER K7 - PDF / PRINT
   Печатается вся рабочая область расчёта, а не только итог.
   ========================================================= */

.print-report-header {
    display: none;
}

@page {
    size: A4 portrait;
    margin: 10mm;
}

@media print {

    html,
    body {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #111827 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body * {
        visibility: hidden !important;
    }

    #calculatorWorkspace,
    #calculatorWorkspace * {
        visibility: visible !important;
    }

    #calculatorWorkspace {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .print-report-header {
        visibility: visible !important;
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
        margin: 0 0 8mm;
        padding: 0 0 5mm;
        border-bottom: 2px solid #1d4ed8;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-brand {
        font-size: 20pt;
        line-height: 1;
        font-weight: 900;
        letter-spacing: .8px;
        color: #1d4ed8 !important;
    }

    .print-report-title {
        margin-top: 3mm;
        font-size: 11pt;
        font-weight: 700;
        color: #334155 !important;
    }

    .print-report-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 1.5mm;
        max-width: 90mm;
        text-align: right;
        font-size: 8.5pt;
        line-height: 1.35;
        color: #475569 !important;
    }

    .print-report-meta strong {
        color: #111827 !important;
        font-size: 9.5pt;
    }

    .sidebar,
    .topbar,
    .sidebar-overlay,
    .menu-toggle,
    .burger,
    .page-heading,
    #equipmentChooser,
    #changeEquipment,
    .pdf-download-button,
    .text-button {
        display: none !important;
    }

    .calculator-workspace {
        gap: 5mm !important;
    }

    .calculator-header,
    .customer-price-panel,
    .form-section,
    .results-panel {
        display: block !important;
        margin: 0 0 5mm !important;
        padding: 5mm !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 3mm !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .calculator-header {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .calculator-header h2 {
        margin: 0 0 1.5mm !important;
        font-size: 15pt !important;
        color: #111827 !important;
    }

    .calculator-header p {
        font-size: 8.5pt !important;
        color: #64748b !important;
    }

    .calculation-mode-tabs {
        margin-top: 4mm !important;
        display: inline-flex !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
    }

    .mode-tab {
        min-width: 0 !important;
        padding: 2.5mm 5mm !important;
        font-size: 8.5pt !important;
    }

    .mode-tab:not(.active) {
        opacity: .45 !important;
    }

    .customer-price-top {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
    }

    .customer-price-fields {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4mm !important;
        margin-top: 4mm !important;
    }

    .customer-price-fields.is-hidden {
        display: none !important;
    }

    .calculation-form {
        display: block !important;
    }

    .calculation-form.is-hidden {
        display: none !important;
    }

    .form-section-heading {
        margin-bottom: 4mm !important;
    }

    .form-section-heading h3,
    .customer-price-panel h3,
    .results-panel h3 {
        font-size: 11pt !important;
        color: #111827 !important;
    }

    .form-section-heading p,
    .customer-price-panel p,
    .results-heading p {
        font-size: 8pt !important;
        color: #64748b !important;
    }

    .form-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 3.5mm !important;
    }

    .form-field {
        min-width: 0 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .form-field label {
        font-size: 7.7pt !important;
        color: #334155 !important;
    }

    .form-field input,
    .form-field select {
        width: 100% !important;
        height: auto !important;
        padding: 2.6mm 3mm !important;
        border: 1px solid #94a3b8 !important;
        border-radius: 2mm !important;
        background: #ffffff !important;
        color: #111827 !important;
        font-size: 9pt !important;
        box-shadow: none !important;
        appearance: auto !important;
        -webkit-appearance: auto !important;
    }

    .form-field input::placeholder {
        color: #94a3b8 !important;
        opacity: 1 !important;
    }

    .form-field small {
        font-size: 6.7pt !important;
        color: #64748b !important;
    }

    .switch-row {
        font-size: 8pt !important;
    }

    .switch-row input {
        width: 4mm !important;
        height: 4mm !important;
    }

    .results-heading {
        display: block !important;
        margin-bottom: 4mm !important;
    }

    .results-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 3mm !important;
    }

    .result-card {
        padding: 4mm !important;
        border: 1px solid #cbd5e1 !important;
        background: #f8fafc !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .result-card span {
        font-size: 7.5pt !important;
        color: #64748b !important;
    }

    .result-card strong {
        font-size: 12pt !important;
        color: #111827 !important;
    }

    .accent-result {
        background: #eff6ff !important;
        border-color: #93c5fd !important;
    }

    .accent-result strong {
        color: #1d4ed8 !important;
    }

    .comparison-result,
    .target-difference,
    .result-note {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .comparison-result {
        margin-top: 4mm !important;
        padding: 4mm !important;
        font-size: 9pt !important;
    }

    .comparison-result.positive {
        background: #dcfce7 !important;
        color: #166534 !important;
        border-color: #86efac !important;
    }

    .comparison-result.negative {
        background: #fee2e2 !important;
        color: #991b1b !important;
        border-color: #fca5a5 !important;
    }

    .comparison-result.neutral {
        background: #f8fafc !important;
        color: #475569 !important;
    }

    .target-difference {
        padding: 3mm 4mm !important;
        font-size: 8.5pt !important;
        background: #fff7ed !important;
        color: #9a3412 !important;
    }

    .result-note {
        font-size: 7.3pt !important;
        color: #64748b !important;
    }

    .form-section,
    .customer-price-panel {
        break-inside: auto;
        page-break-inside: auto;
    }

    .form-section-heading,
    .customer-price-top {
        break-after: avoid;
        page-break-after: avoid;
    }
}


/* TENDER K7 - одиночный режим расчёта и расчёт доставки */

.calculation-mode-tabs.single-mode {
    display: inline-flex;
}

.calculation-mode-tabs.single-mode .mode-tab[data-mode="hourly"] {
    min-width: 190px;
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.calculated-field .calculated-value {
    min-height: 43px;
    display: flex;
    align-items: center;
    padding: 11px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 800;
}

@media (max-width: 560px) {
    .calculation-mode-tabs.single-mode {
        display: block;
    }

    .calculation-mode-tabs.single-mode .mode-tab[data-mode="hourly"] {
        width: 100%;
        min-width: 0;
    }
}

/* В PDF у LGCE остаётся только активная вкладка "Почасово". */
@media print {
    .calculation-mode-tabs.single-mode {
        display: inline-flex !important;
    }

    .calculation-mode-tabs.single-mode .mode-tab[data-mode="hourly"] {
        display: inline-block !important;
    }

    .calculated-field .calculated-value {
        background: #eff6ff !important;
        border: 1px solid #93c5fd !important;
        color: #1d4ed8 !important;
    }
}
