:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #555555;
    --border: #dddddd;
    --accent: #0055ff;
    --table-header-bg: #f7f7f7;
    --table-row-stripe: #fafafa;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
}

.page { width: 100%; margin: 0; padding: 14px 18px 24px; }

.site-header h1 { margin: 0 0 8px; font-size: 24px; }
.site-header .subtitle { margin: 0 0 14px; color: var(--muted); max-width: 920px; }
.compact-header { margin-bottom: 18px; }
.site-name { color: var(--text); font-size: 18px; font-weight: 700; text-decoration: none; }

.intro-text { max-width: 1080px; margin-bottom: 14px; color: var(--muted); }
.intro-text p { margin: 0 0 8px; }

.main-grid {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.sidebar {
    width: auto;
    min-width: 0;
}

.results {
    flex: 1 1 auto;
    min-width: 0;
}

.filters {
    border: 1px solid var(--border);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fcfcfc;
    position: sticky;
    top: 10px;
    max-height: none;
    overflow: visible;
}

.filters-sidebar .filters-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.filters-header { display: flex; justify-content: space-between; align-items: baseline; }
.filters-toggle { display: none; }
.filters-panel[hidden] { display: none !important; }

.filter-block { display: flex; flex-direction: column; gap: 4px; }
.filter-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.filter-block label { font-size: 12px; display: flex; gap: 6px; align-items: baseline; }
.filter-block input[type="text"] {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 13px;
}
.hint { color: var(--muted); font-size: 11px; }

.scroll-box {
    max-height: 146px;
    overflow: auto;
    border: 1px solid var(--border);
    background: #fff;
    padding: 6px;
}

.filters-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.filters-actions button {
    padding: 4px 10px;
    border-radius: 2px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}
.filters-actions button:hover { background: #0040c0; }
.reset-link { font-size: 12px; color: var(--muted); }

.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 2px;
    font-size: 12px;
    color: var(--muted);
}

.table-section { border: 1px solid var(--border); background: #fff; width: 100%; }
.table-scroll { overflow: auto; width: 100%; }
.products-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 1050px;
}
.products-table th,
.products-table td {
    border-bottom: 1px solid var(--border);
    padding: 6px 7px;
    text-align: left;
    font-size: 12px;
}
.products-table thead th {
    background: var(--table-header-bg);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 var(--border);
}
.products-table thead th:first-child {
    width: 20px;
}
.products-table tbody tr:nth-child(even) { background: var(--table-row-stripe); }
.products-table tbody tr:hover { background: #f2f6ff; }
.products-table a { color: var(--accent); text-decoration: none; }
.products-table a:hover { text-decoration: underline; }
.products-table .numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.products-table .price-cell,
.products-table .value-cell { font-weight: 650; }
.features-cell { min-width: 135px; color: var(--muted); }
.product-link-cell { min-width: 330px; max-width: 560px; }
.product-brand { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.price-status { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.prose-section {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 13px;
    max-width: 980px;
}
.prose-section h2 { font-size: 18px; margin: 0 0 8px; }
.prose-section p { margin: 7px 0; }
.faq-preview details { border-bottom: 1px solid var(--border); padding: 7px 0; }
.faq-preview summary { cursor: pointer; font-weight: 650; }
.faq-preview details p { color: var(--muted); }
.affiliate-note { color: var(--muted); font-size: 12px; }

.static-page { max-width: 820px; }
.static-page h1 { font-size: 24px; margin: 0 0 12px; }
.static-page h2 { font-size: 17px; margin: 22px 0 6px; }
.static-page p, .static-page li { line-height: 1.6; }

.site-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}
.site-footer p { margin: 4px 0 0; }
.footer-links { display: flex; gap: 12px; margin-bottom: 4px; }
.footer-links a { color: var(--accent); }

@media (max-width: 768px) {
    .page { padding: 8px; }
    .main-grid { display: block; }
    .filters {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    .filters.is-collapsible .filters-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 12px;
        border: 0;
        background: #f7f7f7;
        color: var(--text);
        font: inherit;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }
    .filters.is-collapsible .filters-panel { border-top: 1px solid var(--border); }
    .filters.is-collapsible .filters-form { padding: 10px 12px 12px; }
    .filters-toggle-meta { display: inline-flex; align-items: center; gap: 8px; }
    .filters-active-count {
        min-width: 20px;
        padding: 1px 6px;
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        font-size: 11px;
        text-align: center;
    }
    .filters-toggle-icon { font-size: 18px; font-weight: 400; line-height: 1; }
    .products-table { font-size: 11px; }
}

/* Admin */
.admin-layout { max-width: 1100px; margin: 0 auto; padding: 16px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-nav a { margin-right: 8px; font-size: 13px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: left; }
.admin-flash { padding: 6px; margin-bottom: 8px; border-radius: 2px; font-size: 12px; }
.admin-flash-success { background: #e1f4e5; border: 1px solid #a3d1af; }
.admin-flash-error { background: #fde4e7; border: 1px solid #f2a5b0; }
.form-control { width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 2px; font-size: 13px; }
.btn { padding: 4px 8px; border-radius: 2px; border: 1px solid var(--border); background: #f5f5f5; font-size: 12px; cursor: pointer; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
