/* Base layout, matches the site's existing look */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 16px;
    line-height: 1.5;
    color: #1a1a1a;
}

.container {
    max-width: 900px;
    margin: auto;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    text-align: center;
}

h2 {
    font-size: 1.25rem;
    color: #1a1a1a;
    margin: 2rem 0 1rem;
}

.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 0.9375rem;
    margin: 0 0 1.5rem;
}

.last-updated {
    text-align: right;
    color: #94a3b8;
    font-size: 0.8125rem;
}

a {
    color: #0066ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Nav back link ---------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    color: #0066ff;
}

/* ---------- Compatibility checker ---------- */
.checker-section {
    background: #f0f7ff;
    border: 1px solid #cfe3ff;
    border-radius: 12px;
    padding: 20px;
    margin: 1.5rem 0 2.5rem;
}

.checker-section h2 {
    margin-top: 0;
}

.checker-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#checker-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    color: #1a1a1a;
    -webkit-appearance: none;
}

#checker-input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.checker-button {
    padding: 12px 20px;
    background: #0066ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.checker-button:hover {
    background: #0052cc;
}

.checker-result {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
}

.checker-result.show {
    display: block;
}

.checker-result.match {
    background: #ecfdf3;
    border: 1px solid #a7e8c0;
    color: #14532d;
}

.checker-result.multi {
    background: #fffaeb;
    border: 1px solid #fbd38d;
    color: #7c4a03;
}

.checker-result.none {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}

.checker-result strong { display: block; margin-bottom: 4px; font-size: 15px; }

.checker-result ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.checker-result li { margin-bottom: 4px; }

/* ---------- Comparison table ---------- */
.compare-section {
    margin: 2.5rem 0;
}

.compare-note {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0.5rem 0 1rem;
}

.compare-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.compare-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.compare-table th,
.compare-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.compare-table thead th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
}

.compare-table thead th.us {
    background: #e6f0ff;
    color: #0052cc;
}

.compare-table tbody td.us {
    background: #f5f9ff;
    font-weight: 500;
}

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

.compare-table td.row-label {
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

/* ---------- Manufacturer link grid ---------- */
.brand-links-section { margin: 2.5rem 0; }

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 0.75rem;
}

.brand-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    color: #1a1a1a;
    text-decoration: none;
}

.brand-chip:hover {
    background: #f0f7ff;
    border-color: #cfe3ff;
    text-decoration: none;
}

.brand-chip .count {
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.brand-chip.unverified {
    background: #fffaeb;
    border-color: #fbd38d;
    color: #7c4a03;
}

.unverified-note {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.75rem;
}

/* ---------- Full list table ---------- */
.search-container {
    max-width: 100%;
    margin: 16px auto 8px;
}

input#search {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    -webkit-appearance: none;
}

input#search:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    background-color: #ffffff;
}

input#search::placeholder {
    color: #94a3b8;
}

.table-container {
    overflow-x: auto;
    margin: 16px -16px;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}

th {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
}

td {
    border-top: 1px solid #e2e8f0;
}

tr:hover { background-color: #f8fafc; }

.loading-row td,
.no-results-row td {
    text-align: center;
    color: #94a3b8;
    padding: 24px 16px;
}

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0066ff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
    z-index: 1000;
}

/* ---------- CTA ---------- */
.app-cta {
    text-align: center;
    margin: 2rem 0 1rem;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.app-cta p {
    color: #334155;
    font-size: 14px;
    margin: 0 0 12px;
}

.store-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.store-links a {
    display: inline-block;
    padding: 10px 16px;
    background: #0066ff;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.store-links a:hover { background: #0052cc; text-decoration: none; }

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    body { padding: 24px; }
    .container { padding: 32px; }
    h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
    .compare-table { font-size: 12.5px; }
    .checker-form { flex-direction: column; }
    .checker-button { width: 100%; }
}
