:root {
    --ink: #302b27;
    --muted: #625c55;
    --line: #ddd6cb;
    --surface: #f9f6f1;
    --accent: #9a4c35;
    --accent-dark: #71311f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f6f3ee;
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.5;
}

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 24px auto;
    padding: 36px 42px 28px;
    background: #fff;
}

.page-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 24px;
}

.eyebrow, .tagline { margin: 0; }

.eyebrow {
    color: var(--accent-dark);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

h1 {
    margin: 4px 0 0;
    font-family: inherit;
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 650;
    letter-spacing: -.045em;
    line-height: 1.1;
}

.tagline { color: var(--muted); font-size: 1rem; margin-top: 9px; }
.comparison-link { margin: 14px 0 0; font-size: .9rem; font-weight: 600; }
.comparison-link a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.comparison-link a::after { content: '→'; }
.comparison-link a:hover { text-decoration: underline; }

.header-actions { display: grid; justify-items: end; gap: 12px; }
.print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--accent-dark);
    border-radius: 7px;
    background: #fff;
    color: var(--accent-dark);
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    padding: 10px 15px;
}
.print-button:hover, .print-button:focus-visible { background: var(--surface); outline: 3px solid rgb(154 76 53 / 25%); outline-offset: 2px; }
.print-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.country-picker { display: grid; gap: 4px; min-width: 130px; color: var(--muted); font-size: .8rem; }
.country-picker label { font-weight: 700; }
.country-picker select, .country-picker button { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; padding: 6px 9px; }
.country-picker button { display: block; cursor: pointer; background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

.directory { margin: 32px 0 0; }
.directory-section { break-inside: avoid; margin: 0 0 32px; }
.directory-section > h2 { margin-bottom: 16px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 1.125rem; font-weight: 750; letter-spacing: 0; line-height: 1.3; text-transform: none; }
h2 {
    margin: 0 0 8px;
    color: #25211e;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.2;
    padding: 0 0 5px;
    text-transform: uppercase;
}
.resource { break-inside: avoid; padding: 0; }
.resource + .resource { margin-top: 18px; }
.resource h3, .resource p { margin: 0; }
.resource h3 { font-size: 1.05rem; font-weight: 650; line-height: 1.35; }
.resource p { margin-top: 5px; color: var(--muted); font-size: .95rem; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.resource h3 a { color: var(--ink); text-decoration: none; }
.resource h3 a:hover { color: var(--accent-dark); }
a:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.contact { overflow-wrap: anywhere; }
.contact { font-size: .87rem !important; }
.contact span { color: var(--muted); padding: 0 3px; }

.comparison-body { background: #f6f3ee; }
.comparison-page { width: min(1100px, calc(100% - 32px)); margin: 24px auto; padding: 36px 42px; background: #fff; }
.comparison-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--accent); padding-bottom: 20px; }
.comparison-kicker { margin: 0 0 4px; font-size: .86rem; font-weight: 700; }
.comparison-kicker a { text-decoration: none; }
.comparison-header h1 { margin-top: 0; }
.comparison-warning { margin: 22px 0; border-left: 5px solid var(--accent); padding: 12px 14px; background: var(--surface); color: var(--ink); }
.comparison-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.comparison-choice { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); padding: 22px; background: #fff; }
.comparison-choice h2 { border-bottom: 0; margin-bottom: 8px; padding: 0; }
.comparison-choice p { margin: 0; color: var(--muted); }
.comparison-choice-note { margin-top: 12px !important; font-size: .9rem; }
.comparison-choice-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin-top: 18px; border: 2px solid var(--accent-dark); border-radius: 4px; background: var(--accent-dark); color: #fff; font-size: .92rem; font-weight: 700; padding: 9px 14px; text-decoration: none; }
.comparison-choice-button:hover, .comparison-choice-button:focus-visible { background: #4f2013; outline: 3px solid rgb(154 76 53 / 25%); outline-offset: 2px; }
.comparison-search { border: 1px solid var(--line); padding: 20px; }
.comparison-search h2 { border-bottom: 0; margin-bottom: 5px; padding: 0; }
.comparison-search > p { margin: 0 0 14px; color: var(--muted); }
.product-search-form { display: grid; gap: 16px; }
.product-code-field { display: grid; grid-template-columns: 180px minmax(180px, 460px); align-items: center; gap: 10px; }
.product-code-field label, .guided-search-form label { font-size: .9rem; font-weight: 700; }
.product-code-field label span { color: var(--muted); font-weight: 400; }
.product-code-field input { width: 100%; min-height: 42px; border: 1px solid #a7907e; border-radius: 4px; background: #fff; color: var(--ink); font: inherit; padding: 8px 10px; }
.product-search-form > button { justify-self: center; min-height: 42px; border: 2px solid var(--accent-dark); border-radius: 4px; background: var(--accent-dark); color: #fff; cursor: pointer; font: 700 .95rem/1 Arial, Helvetica, sans-serif; padding: 9px 22px; }
.product-search-form > button:hover, .product-search-form > button:focus-visible { background: #4f2013; outline: 3px solid rgb(154 76 53 / 25%); outline-offset: 2px; }
.search-options { min-width: 0; margin: 0; border: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
.search-options legend { padding: 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.guided-search-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.guided-search-form > div { display: grid; gap: 5px; }
.feature-picker { position: relative; }
.feature-picker[open] { z-index: 3; }
.feature-picker summary { display: flex; align-items: center; justify-content: space-between; min-height: 42px; border: 1px solid #a7907e; border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; padding: 8px 10px; }
.feature-picker summary::-webkit-details-marker { display: none; }
.feature-picker summary::after { content: '⌄'; font-size: 1.2rem; line-height: 1; }
.feature-picker[open] summary { border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.feature-options { position: absolute; right: 0; left: 0; display: grid; border: 1px solid #a7907e; border-top: 0; background: #fff; box-shadow: 0 5px 9px rgb(61 52 46 / 12%); }
.feature-options button { min-height: 38px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font: inherit; padding: 7px 10px; text-align: left; }
.feature-options button:first-child { border-top: 0; }
.feature-options button:hover, .feature-options button:focus-visible { background: var(--surface); color: var(--accent-dark); outline: 0; }
.compatibility-search-form { display: grid; gap: 12px; max-width: 460px; }
.similar-product-field { display: grid; gap: 5px; }
.compatibility-search-form label, .guided-search-form label { font-size: .9rem; font-weight: 700; }
.compatibility-search-form input { width: 100%; min-height: 42px; border: 1px solid #a7907e; border-radius: 4px; background: #fff; color: var(--ink); font: inherit; padding: 8px 10px; }
.manufacturer-picker { position: relative; }
.manufacturer-picker[open] { z-index: 2; }
.manufacturer-picker summary { display: flex; align-items: center; justify-content: space-between; min-height: 42px; border: 1px solid #a7907e; border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; padding: 8px 10px; }
.manufacturer-picker summary::-webkit-details-marker { display: none; }
.manufacturer-picker summary::after { content: '⌄'; font-size: 1.2rem; line-height: 1; }
.manufacturer-picker[open] summary { border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.manufacturer-options { position: absolute; right: 0; left: 0; display: grid; border: 1px solid #a7907e; border-top: 0; background: #fff; }
.manufacturer-options button { min-height: 38px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font: inherit; padding: 7px 10px; text-align: left; }
.manufacturer-options button:first-child { border-top: 0; }
.manufacturer-options button:hover, .manufacturer-options button:focus-visible { background: var(--surface); color: var(--accent-dark); outline: 0; }
.compatibility-search-form > button, .product-finder-form > button { min-height: 42px; border: 2px solid var(--accent-dark); border-radius: 4px; background: var(--accent-dark); color: #fff; cursor: pointer; font: 700 .95rem/1 Arial, Helvetica, sans-serif; padding: 9px 18px; }
.compatibility-search-form > button:hover, .compatibility-search-form > button:focus-visible, .product-finder-form > button:hover, .product-finder-form > button:focus-visible { background: #4f2013; outline: 3px solid rgb(154 76 53 / 25%); outline-offset: 2px; }
.compatibility-search-form > button { justify-self: center; }
.product-finder-form { display: grid; gap: 18px; }
.product-finder-form > button { justify-self: center; }
.comparison-results { margin-top: 24px; }
.results-placeholder, .results-message { margin: 0; color: var(--muted); }
.results-error { margin: 0; color: #8b2515; font-weight: 700; }
.results-heading { border-bottom: 2px solid var(--ink); color: var(--ink); font-size: 1.15rem; letter-spacing: .03em; margin-bottom: 12px; }
.search-result { border-top: 2px solid var(--line); margin-top: 20px; padding-top: 18px; }
.search-result:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.product-card { border: 1px solid var(--line); padding: 14px; background: #fff; }
.product-name, .product-title, .product-details, .product-description { margin: 0; }
.product-name { color: var(--ink); font-size: 1.05rem; }
.product-title { margin-top: 3px; font-weight: 700; }
.product-details { margin-top: 7px; color: var(--muted); font-size: .9rem; }
.product-description { margin-top: 7px; color: var(--muted); font-size: .92rem; }
.related-products { margin-top: 14px; }
.related-products h3 { margin: 0 0 7px; font-size: 1rem; }
.related-products > .results-heading { margin: 0 0 12px; }
.related-product-list, .guided-result-list { display: grid; gap: 9px; }
.related-product-list .product-card { padding: 11px; }
.related-product-list .product-name { font-size: .98rem; }
.related-product-list .product-title { font-size: .94rem; }
.compatibility-groups { display: grid; gap: 10px; }
.compatibility-group { break-inside: avoid; border: 1px solid var(--line); padding: 12px; background: #fff; }
.compatibility-group .product-name { margin: 0; font-size: .98rem; }
.compatibility-group .product-details { margin-top: 4px; }
.compatibility-group .product-description { margin-top: 5px; }
.compatibility-table-wrap { overflow-x: auto; margin-top: 10px; }
.compatibility-variants { width: 100%; min-width: 600px; border-collapse: collapse; font-size: .88rem; }
.compatibility-variants th, .compatibility-variants td { border-top: 1px solid var(--line); padding: 8px 7px; text-align: left; vertical-align: middle; }
.compatibility-variants thead th { border-top: 1px solid var(--line); border-bottom: 2px solid var(--ink); color: var(--ink); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.compatibility-variants tbody tr:nth-child(even) { background: #fcf8f3; }
.compatibility-variants th:first-child, .compatibility-variants td:first-child { width: 110px; font-weight: 700; white-space: nowrap; }
.variant-code { color: var(--accent-dark); font-size: .96rem; }
.comparison-cell { white-space: nowrap; }
.comparison-cell-name { min-width: 210px; white-space: normal; }
.comparison-cell-closure { min-width: 210px; white-space: normal; }
.pouch-marker { display: inline-block; width: 11px; height: 14px; margin-right: 5px; border: 1.5px solid currentColor; border-radius: 3px 3px 5px 5px; vertical-align: -2px; }
.pouch-marker-clear { background: #fff; }
.pouch-marker-beige { background: #d8b58a; }
.pouch-marker-opaque { background: #5c5c5c; }
.pouch-marker-other { background: repeating-linear-gradient(135deg, #fff 0 2px, #666 2px 4px); }
.no-results { margin: 0; color: var(--muted); font-size: .92rem; }
.comparison-result-warning { border-top: 2px solid var(--ink); margin: 22px 0 0; padding-top: 10px; font-size: .9rem; font-weight: 700; }
.guided-result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 680px) {
    .page { width: 100%; margin: 0; padding: 24px 20px; box-shadow: none; }
    .page-header { display: block; }
    .header-actions { justify-items: start; margin-top: 18px; }
    .country-picker { max-width: 180px; }
    .directory { max-width: none; }
    .comparison-page { width: 100%; margin: 0; padding: 24px 20px; box-shadow: none; }
    .comparison-header { display: block; }
    .comparison-print { margin-top: 18px; }
    .comparison-choices { grid-template-columns: 1fr; }
    .product-code-field { grid-template-columns: 1fr; align-items: stretch; }
    .compatibility-search-form { grid-template-columns: 1fr; align-items: stretch; }
    .guided-search-form, .guided-result-list { grid-template-columns: 1fr; }
    .compatibility-variants { font-size: .84rem; }
    .compatibility-variants th:first-child, .compatibility-variants td:first-child { width: 88px; white-space: normal; }
}

@page { size: portrait; margin: .35in .42in; }

@media print {
    body { background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 9.7pt; line-height: 1.35; }
    .page { width: auto; margin: 0; padding: 0; box-shadow: none; }
    .page-header { gap: 14pt; border-bottom-width: 2pt; padding-bottom: 8pt; }
    .eyebrow { font-size: 7.3pt; }
    h1 { font-size: 23pt; font-weight: 700; letter-spacing: -.025em; }
    .tagline { font-size: 9pt; margin-top: 3pt; }
    .country-picker { min-width: 100pt; font-size: 7.5pt; }
    .country-picker select { min-height: 0; padding: 3pt 5pt; }
    .directory { columns: 2; column-gap: 20pt; max-width: none; margin-top: 10pt; }
    .directory-section { margin-bottom: 10pt; }
    .directory-section > h2 { margin-bottom: 5pt; border-bottom-color: #555; color: #000; font-size: 9pt; padding-bottom: 3pt; line-height: 1.2; }
    .print-button { display: none; }
    .comparison-link { display: none; }
    h2 { margin-bottom: 4pt; border-bottom-width: 1.5pt; color: #000; font-size: 8pt; padding: 0 0 3pt; }
    .resource { padding: 0; }
    .resource + .resource { margin-top: 6pt; }
    .resource h3 { color: #000; font-size: 10.2pt; font-weight: 700; line-height: 1.2; }
    .resource p { margin-top: 1.5pt; color: #000; font-size: 9pt; line-height: 1.25; }
    .contact { font-size: 8pt !important; }
    a { color: #000; text-decoration: none; }
    .resource h3 a { color: #000; }
    .comparison-body { background: #fff; }
    .comparison-page { width: auto; margin: 0; padding: 0; box-shadow: none; }
    .comparison-header { border-bottom-color: #000; padding-bottom: 8pt; }
    .comparison-header h1 { font-size: 23pt; }
    .comparison-kicker { font-size: 8pt; }
    .comparison-warning { border: 1pt solid #000; border-left-width: 3pt; margin: 10pt 0; padding: 7pt; background: #fff; font-size: 9pt; }
    .comparison-search { display: none; }
    .comparison-results { margin-top: 0; }
    .product-card { border-color: #777; padding: 7pt; }
    .compatibility-group { border-color: #777; padding: 7pt; }
    .compatibility-table-wrap { overflow: visible; }
    .compatibility-variants { min-width: 0; font-size: 7.3pt; }
    .compatibility-variants th, .compatibility-variants td { padding: 4pt 3pt; }
    .compatibility-variants thead th { border-bottom-color: #000; }
    .compatibility-variants tbody tr:nth-child(even) { background: #fff; }
    .search-result { margin-top: 12pt; padding-top: 9pt; }
    .product-description { font-size: 8.5pt; }
    .guided-result-list { grid-template-columns: 1fr; }
}
