:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #1e1e1e;
  --text: #f2f2f2;
  --muted: #b5b5b5;
  --border: #6a6a6a;
  --link: #4da3ff;
  --input-bg: #f5f5f5;
  --input-text: #111;
  --focus: #8ec5ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.25;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: calc(100% - 20px);
  margin: 0 auto;
}

.site-header,
.site-footer {
  border-color: #3a3a3a;
  background: var(--bg);
}

.site-header {
  border-bottom: 1px solid #3a3a3a;
}

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
}

.site-nav {
  display: flex;
  gap: 9px;
  margin-left: auto;
}

.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.header-inner p,
.text-page p,
.site-footer {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid #3a3a3a;
  padding: 6px 0;
  font-size: 12px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.comparison-shell {
  width: 100%;
  margin: 0;
}

.comparison-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 100vh;
  padding: 7px 8px;
  transition: grid-template-columns 140ms ease;
}

.comparison-layout.sidebar-collapsed {
  grid-template-columns: 40px minmax(0, 1fr);
}

.filter-sidebar {
  position: relative;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  transition: width 140ms ease;
}

.sidebar-toggle,
.mobile-filter-toggle,
.mobile-filter-close {
  border: 1px solid var(--border);
  border-radius: 0;
  background: #232323;
  color: var(--text);
  cursor: pointer;
}

.sidebar-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 28px;
  height: 24px;
  padding: 0;
  line-height: 1;
}

.toggle-icon {
  display: inline-block;
}

.sidebar-content {
  padding-right: 34px;
  min-width: 176px;
}

.comparison-layout.sidebar-collapsed .filter-sidebar {
  width: 40px;
}

.comparison-layout.sidebar-collapsed .sidebar-content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.comparison-layout.sidebar-collapsed .sidebar-toggle {
  left: 6px;
  right: auto;
}

.comparison-layout.sidebar-collapsed .toggle-icon {
  transform: rotate(180deg);
}

.sidebar-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  height: 27px;
  margin-bottom: 3px;
}

.sidebar-brand a {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 4px 7px 6px;
  border: 1px solid var(--border);
  background: transparent;
}

.filter-box {
  display: block;
  margin-bottom: 7px;
}

legend {
  padding: 0 3px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.legend-check,
.check-line,
.input-line {
  display: flex;
  align-items: center;
  min-height: 20px;
  gap: 5px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}

.legend-check {
  min-height: 0;
  font-weight: 700;
}

.input-line {
  justify-content: flex-start;
}

input,
button {
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #d8d8d8;
}

input[type="number"] {
  width: 60px;
  height: 22px;
  border: 1px solid #adadad;
  border-radius: 0;
  padding: 1px 4px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 13px;
}

.sidebar-note {
  margin: 7px 0;
  padding: 5px 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.sidebar-links {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding: 5px 6px;
  border: 1px solid var(--border);
}

.mobile-filter-toggle,
.mobile-filter-close,
.sidebar-backdrop {
  display: none;
}

.results-area {
  min-width: 0;
}

.comparison-intro {
  max-width: 920px;
  padding: 0 0 7px;
}

.comparison-intro h1 {
  margin: 0 0 4px;
  font-size: 18px;
}

.comparison-intro p {
  margin: 0 0 4px;
  color: var(--muted);
}

.affiliate-note {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

.product-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.3;
  background: transparent;
}

.product-table th,
.product-table td {
  padding: 3px 6px;
  border: 0;
  vertical-align: top;
}

.product-table th {
  color: var(--text);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.product-table th button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  text-align: inherit;
}

.product-table th button.sorted-asc::after {
  content: "^";
  color: var(--muted);
  font-size: 11px;
}

.product-table th button.sorted-desc::after {
  content: "v";
  color: var(--muted);
  font-size: 11px;
}

.product-table td {
  color: var(--text);
}

.product-table td:nth-child(1),
.product-table td:nth-child(2),
.product-table td:nth-child(3),
.product-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.product-table td:nth-child(8) {
  width: 100%;
  min-width: 300px;
}

.product-table a {
  line-height: 1.3;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
}

.text-page {
  max-width: 780px;
  padding: 16px 0 28px;
}

.text-page h1 {
  margin: 0 0 10px;
  font-size: 20px;
}

.text-page h2 {
  margin: 16px 0 5px;
  font-size: 15px;
}

.text-page p {
  margin: 0 0 8px;
}

.category-page {
  padding: 10px 0 28px;
}

.category-table {
  min-width: 720px;
}

.category-table td:first-child {
  min-width: 280px;
}

.related-guides {
  max-width: 780px;
  margin-top: 18px;
  color: var(--muted);
}

.related-guides h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
}

.guide-index,
.guide-detail {
  max-width: 860px;
  padding: 16px 0 32px;
}

.guide-grid {
  display: grid;
  gap: 10px;
}

.guide-card,
.guide-cta {
  border: 1px solid var(--border);
  padding: 9px 10px;
}

.guide-card h2 {
  margin: 3px 0 5px;
  font-size: 16px;
}

.guide-card p,
.guide-header p,
.article-body,
.guide-cta p {
  color: var(--muted);
}

.guide-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.guide-header h1 {
  margin: 5px 0 7px;
  font-size: 24px;
  line-height: 1.15;
}

.breadcrumbs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.article-body {
  max-width: 760px;
}

.article-body h2 {
  margin: 22px 0 7px;
  color: var(--text);
  font-size: 18px;
}

.article-body h3 {
  margin: 15px 0 5px;
  color: var(--text);
  font-size: 15px;
}

.article-body p,
.article-body li {
  font-size: 15px;
  line-height: 1.55;
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 12px 0;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.guide-cta,
.guide-detail .related-guides {
  margin-top: 18px;
}

.popular-guides {
  margin: 0 0 8px;
}

.popular-guides h2 {
  margin: 0 0 4px;
  font-size: 14px;
}

.guide-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
}

@media (max-width: 760px) {
  body.mobile-sidebar-open {
    overflow: hidden;
  }

  .mobile-filter-toggle {
    display: inline-block;
    margin: 7px 0 0 6px;
    padding: 4px 8px;
    font-size: 14px;
  }

  .comparison-layout {
    display: block;
    padding: 7px 6px;
    min-height: auto;
  }

  .comparison-layout.sidebar-collapsed {
    display: block;
  }

  .filter-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(82vw, 260px);
    max-width: none;
    margin-bottom: 0;
    padding: 8px;
    background: var(--bg);
    transform: translateX(-105%);
    transition: transform 140ms ease;
    overflow-y: auto;
  }

  body.mobile-sidebar-open .filter-sidebar {
    transform: translateX(0);
  }

  .sidebar-content {
    padding-right: 0;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .comparison-layout.sidebar-collapsed .filter-sidebar {
    width: min(82vw, 260px);
  }

  .comparison-layout.sidebar-collapsed .sidebar-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-toggle {
    display: none;
  }

  .mobile-filter-close {
    display: inline-block;
    margin-left: auto;
    padding: 2px 6px;
    font-size: 13px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0 0 0 min(82vw, 260px);
    z-index: 9;
    background: rgba(0, 0, 0, 0.55);
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    display: block;
  }

  .product-table {
    min-width: 800px;
  }

  .header-inner {
    display: block;
  }

  .site-nav {
    margin-top: 4px;
  }

  .brand {
    display: block;
  }
}
