* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    width: 98%;
    max-width: 1800px;
    margin: 40px auto;
}

h1 {
    text-align: center;
    color: #1d3557;
    margin-bottom: 10px;
    font-size: 34px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 17px;
}

#partNumbers {
    width: 100%;
    height: 220px;
    padding: 15px;
    resize: vertical;
    font-size: 16px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    outline: none;
    background: white;
}

#partNumbers:focus {
    border-color: #1976d2;
}

#searchButton {
    display: block;
    width: 220px;
    height: 48px;
    margin: 25px auto 0;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
}

#searchButton:hover {
    background: #1565c0;
}

#searchButton:disabled {
    background: #90a4ae;
    cursor: not-allowed;
}

hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #ddd;
}

h2 {
    color: #1d3557;
    margin-bottom: 20px;
}

#results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-height: 250px;
    padding: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1350px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

thead {
    background: #eef2f6;
}

th {
    padding: 13px 10px;
    text-align: left;
    border-bottom: 2px solid #cfd6de;
    color: #1d3557;
    font-weight: 700;
    vertical-align: middle;
    white-space: normal;
}

td {
    padding: 14px 10px;
    vertical-align: top;
    border-bottom: 1px solid #e1e5ea;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

th:nth-child(1),
td:nth-child(1) {
    width: 12%;
    font-weight: 700;
}

th:nth-child(2),
td:nth-child(2) {
    width: 18%;
}

th:nth-child(3),
td:nth-child(3) {
    width: 24%;
}

th:nth-child(4),
td:nth-child(4) {
    width: 8%;
    text-align: center;
    white-space: nowrap;
}

th:nth-child(5),
td:nth-child(5) {
    width: 22%;
    font-size: 14px;
    line-height: 1.55;
}

th:nth-child(6),
td:nth-child(6) {
    width: 8%;
    text-align: center;
}

th:nth-child(7),
td:nth-child(7) {
    width: 8%;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
}

th:nth-child(8),
td:nth-child(8) {
    width: 10%;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
}

.quantity-input {
    width: 75px;
    height: 36px;
    padding: 6px 8px;
    border: 1px solid #b9c3ce;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    text-align: center;
    outline: none;
}

.quantity-input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.unit-price {
    color: #1d3557;
}

.line-total {
    color: #1b5e20;
}

#estimatedOrderTotal {
    display: inline-block;
    min-width: 130px;
    margin-left: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #eef6ff;
    color: #0d47a1;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 1200px) {
    .container {
        width: 99%;
    }

    #results {
        padding: 12px;
    }

    table {
        min-width: 1250px;
        font-size: 13px;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

.live-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #66717d;
    font-size: 14px;
    white-space: nowrap;
}

.live-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #d6dde5;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: live-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

@keyframes live-spin {
    to {
        transform: rotate(360deg);
    }
}

.fallback-mark {
    display: inline-block;
    margin-left: 4px;
    color: #b26a00;
    font-size: 11px;
    font-weight: 700;
    vertical-align: super;
    cursor: help;
}

.fallback-warning-row td {
    padding-top: 0;
    background: #fffaf0;
}

.fallback-warning {
    padding: 8px 10px;
    color: #8a5600;
    font-size: 14px;
    line-height: 1.4;
}
