body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2933;
    background: #f7f8fa;
}

a {
    color: inherit;
}

.container {
    width: min(calc(100% - 32px), 1320px);
    margin: 0 auto;
}

.site-header {
    background: #17202a;
    color: #fff;
    border-bottom: 1px solid #334155;
}

.header-inner {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    text-decoration: none;
}

.top-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-nav a {
    color: #d8e0ea;
    text-decoration: none;
    font-weight: 600;
}

.top-nav a:hover {
    color: #fff;
}

.page {
    padding: 2rem 0 3rem;
}

.intro {
    margin-bottom: 1.4rem;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: #7b341e;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.82rem;
}

h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.subtitle {
    max-width: 760px;
    margin: 0.65rem 0 0;
    color: #52606d;
    font-size: 1.08rem;
}

.counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.counts span {
    border: 1px solid #cfd6e1;
    background: #fff;
    border-radius: 6px;
    padding: 0.42rem 0.62rem;
    font-weight: 700;
    color: #344054;
}

.search-panel {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #d9dee7;
}

.tabs a {
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #475467;
    font-weight: 700;
    border-right: 1px solid #d9dee7;
}

.tabs a.active {
    color: #17202a;
    background: #eef1f5;
}

.search-form {
    padding: 1rem;
}

.search-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.45rem;
    overflow-wrap: anywhere;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.6rem;
}

input,
select,
button {
    max-width: 100%;
    min-width: 0;
    min-height: 42px;
    border-radius: 6px;
    font: inherit;
    box-sizing: border-box;
}

input,
select {
    border: 1px solid #b8c2d1;
    background: #fff;
    padding: 0.5rem 0.7rem;
}

button {
    border: 1px solid #1d4f91;
    background: #1d4f91;
    color: #fff;
    font-weight: 700;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

.results-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.results-heading h2 {
    margin: 0;
    font-size: 1.15rem;
}

.results-heading span,
.muted {
    color: #667085;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.ipl-results-table {
    table-layout: fixed;
    min-width: 1120px;
}

.ipl-results-table th,
.ipl-results-table td {
    box-sizing: border-box;
}

.ipl-results-table th:nth-child(1),
.ipl-results-table td:nth-child(1) {
    width: 170px;
}

.ipl-results-table th:nth-child(2),
.ipl-results-table td:nth-child(2) {
    width: 210px;
}

.ipl-results-table th:nth-child(3),
.ipl-results-table td:nth-child(3) {
    width: 60px;
}

.ipl-results-table th:nth-child(4),
.ipl-results-table td:nth-child(4) {
    width: 300px;
}

.ipl-results-table th:nth-child(5),
.ipl-results-table td:nth-child(5) {
    width: 250px;
}

.ipl-results-table th:nth-child(6),
.ipl-results-table td:nth-child(6) {
    width: 120px;
    text-align: center;
}

.ipl-results-table th:nth-child(7),
.ipl-results-table td:nth-child(7) {
    width: 180px;
}

.ipl-results-table td:nth-child(2),
.ipl-results-table td:nth-child(4),
.ipl-results-table td:nth-child(5) {
    overflow-wrap: anywhere;
    word-break: normal;
}

.ipl-results-table td:nth-child(6) {
    white-space: nowrap;
}

th,
td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid #e5eaf1;
    vertical-align: top;
}

th {
    background: #eef1f5;
    color: #344054;
    font-size: 0.82rem;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f7f9fc;
}

.strong {
    font-weight: 700;
    white-space: nowrap;
}

.action-link {
    color: #1d4f91;
    font-weight: 700;
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: #667085;
    padding: 1.4rem;
}

.part-group {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.part-summary {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5eaf1;
}

.part-summary h3,
.part-summary p {
    margin: 0;
}

.part-summary h3 {
    font-size: 1.35rem;
}

.summary-label,
.description-variants span,
.models-referenced span {
    display: block;
    color: #667085;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.description-variants,
.models-referenced {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e5eaf1;
}

.store-search-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5eaf1;
    background: #f7f9fc;
}

.store-search-callout span {
    display: block;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.store-search-callout p {
    margin: 0;
    color: #667085;
    font-size: 0.92rem;
}

.store-search-button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid #b42318;
    border-radius: 6px;
    background: #b42318;
    color: #fff;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}

.filename-detail {
    color: #667085;
    font-size: 0.86rem;
    margin-top: 0.2rem;
}

.mobile-ipl-cards {
    display: none;
}

.mobile-part-reference-cards {
    display: none;
}

.mobile-ipl-card {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    padding: 1rem;
}

.mobile-part-reference-card {
    background: #fff;
    border-top: 1px solid #e5eaf1;
    padding: 1rem;
}

.mobile-ipl-card + .mobile-ipl-card {
    margin-top: 0.8rem;
}

.mobile-part-reference-card + .mobile-part-reference-card {
    border-top: 1px solid #d9dee7;
}

.mobile-ipl-card h3 {
    margin: 0;
    color: #17202a;
    font-size: 1.2rem;
    line-height: 1.25;
}

.mobile-part-reference-card h4 {
    margin: 0;
    color: #17202a;
    font-size: 1.08rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.mobile-document-title {
    margin: 0.35rem 0 0;
    color: #344054;
    font-weight: 700;
    line-height: 1.35;
}

.mobile-result-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.9rem 0;
}

.mobile-result-meta div {
    min-width: 0;
}

.mobile-result-meta dt {
    color: #667085;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mobile-result-meta dd {
    margin: 0.18rem 0 0;
    color: #17202a;
    font-weight: 700;
}

.mobile-reference-description {
    margin: 0.75rem 0 0;
    color: #475467;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.mobile-filename-detail {
    margin: 0.55rem 0 0.9rem;
    color: #667085;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.mobile-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.mobile-ipl-card .mobile-card-actions {
    margin-top: 0.9rem;
}

.mobile-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid #1d4f91;
    border-radius: 6px;
    background: #1d4f91;
    color: #fff;
    font-weight: 700;
    padding: 0.55rem 0.85rem;
    text-decoration: none;
}

.mobile-secondary-link {
    color: #1d4f91;
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .ipl-table-wrap {
        display: none;
    }

    .part-reference-table-wrap {
        display: none;
    }

    .mobile-ipl-cards {
        display: block;
    }

    .mobile-part-reference-cards {
        display: block;
    }

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

@media (max-width: 900px) and (max-height: 500px) {
    .ipl-table-wrap {
        display: none;
    }

    .part-reference-table-wrap {
        display: none;
    }

    .mobile-ipl-cards {
        display: block;
    }

    .mobile-part-reference-cards {
        display: block;
    }
}

@media (max-width: 720px) {
    body {
        overflow-x: hidden;
    }

    .container {
        width: min(calc(100vw - 32px), 358px);
        max-width: min(calc(100vw - 32px), 358px);
    }

    .intro,
    .search-panel,
    .results,
    .mobile-ipl-card,
    .mobile-part-reference-card {
        box-sizing: border-box;
        max-width: 100%;
    }

    .header-inner,
    .results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 1.55rem;
        line-height: 1.16;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .search-row > * {
        width: 100%;
    }

    h1,
    .subtitle,
    .search-form label,
    .mobile-document-title,
    .mobile-reference-description {
        display: block;
        max-width: min(calc(100vw - 48px), 342px);
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .part-summary {
        grid-template-columns: 1fr;
    }

    .store-search-callout {
        align-items: flex-start;
        flex-direction: column;
    }

    .store-search-button {
        justify-content: center;
        max-width: 100%;
        text-align: center;
        white-space: normal;
    }
}

.admin-panel {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.admin-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-login-panel {
    max-width: 520px;
}

.admin-login-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.admin-alert {
    border: 1px solid #f1b8b1;
    border-radius: 6px;
    background: #fff4f2;
    color: #7a271a;
    margin-top: 1rem;
    padding: 0.75rem;
}

.admin-help {
    color: #667085;
}

.admin-secondary-button {
    border-color: #98a2b3;
    background: #fff;
    color: #344054;
}

.admin-export-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.admin-export-bar span {
    color: #667085;
    font-weight: 700;
}

.admin-export-bar a,
.admin-table-heading a {
    color: #1d4f91;
    font-weight: 700;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-summary-card {
    border: 1px solid #e5eaf1;
    border-radius: 6px;
    padding: 0.8rem;
}

.admin-summary-card span {
    display: block;
    color: #667085;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-summary-card strong {
    display: block;
    margin-top: 0.3rem;
    overflow-wrap: anywhere;
}

.admin-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.admin-table-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-table {
    min-width: 760px;
}

.admin-table td {
    overflow-wrap: anywhere;
}
