/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #ffffff;
  --bg2:         #f7f7f8;
  --bg3:         #ededef;
  --border:      #e0e0e3;
  --text:        #1a1a1c;
  --text2:       #5a5a6a;
  --accent:      #7c3aed;
  --accent-dim:  #f5f3ff;
  --green:       #16a34a;
  --red:         #dc2626;
  --radius:      6px;
  --shadow:      0 1px 3px rgba(0,0,0,.08);
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:   'SF Mono', 'Fira Mono', 'Consolas', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg:         #18181b;
    --bg2:        #1f1f23;
    --bg3:        #2a2a30;
    --border:     #3a3a44;
    --text:       #e8e8ee;
    --text2:      #8888a0;
    --accent:     #a78bfa;
    --accent-dim: #1e1a2e;
    --green:      #22c55e;
    --red:        #f87171;
  }
}
[data-theme='dark'] {
  --bg: #18181b; --bg2: #1f1f23; --bg3: #2a2a30;
  --border: #3a3a44; --text: #e8e8ee; --text2: #8888a0;
  --accent: #a78bfa; --accent-dim: #1e1a2e;
  --green: #22c55e; --red: #f87171;
}

html, body { height: 100%; }
html { font-family: var(--font); font-size: 14px; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
input, select { font: inherit; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.page { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 44px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-brand { font-weight: 700; font-size: 15px; margin-right: 4px; }
.topbar-brand span { color: var(--accent); }
.topbar-brand-sub { color: var(--text2); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 4px 8px; border-radius: var(--radius);
  font-size: 13px; color: var(--text2);
  transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg3); color: var(--text); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.store-switcher { position: relative; }
.store-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; color: var(--text);
}
.store-btn:hover { background: var(--bg3); }
.store-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 130px; z-index: 200; overflow: hidden;
}
.store-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px;
}
.store-dropdown a:hover { background: var(--bg3); }
.store-dropdown.open { display: block; }
.store-dropdown a.active { font-weight: 600; color: var(--accent); }

.theme-btn {
  padding: 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; color: var(--text2);
}
.theme-btn:hover { background: var(--bg3); color: var(--text); }

/* Topbar menus (Stores + Language) */
.menu { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; color: var(--text);
}
.menu-btn:hover { background: var(--bg3); }
.menu-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 150px; z-index: 200; overflow: hidden; padding: 4px;
}
.menu-dropdown.open { display: block; }
.menu-group {
  display: block; padding: 6px 10px 2px; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text2);
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; font-size: 13px; color: var(--text);
  background: none; border: none; text-align: left; border-radius: 4px;
}
.menu-item:hover { background: var(--bg3); }
.menu-item.active { font-weight: 600; color: var(--accent); }
.menu-item.prusa { color: #fa6831; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* Comparators hover menu (nav) */
.nav-drop { position: relative; }
.nav-drop-btn { padding: 4px 8px; border-radius: var(--radius); font-size: 13px; color: var(--text2); }
.nav-drop:hover .nav-drop-btn { background: var(--bg3); color: var(--text); }
.nav-drop-menu { display: none; position: absolute; left: 0; top: 100%;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 160px; z-index: 200; padding: 4px; }
.nav-drop:hover .nav-drop-menu { display: block; }
.nav-drop-menu a, .nav-drop-sub-btn { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 10px; font-size: 13px; color: var(--text); border-radius: 4px; }
.nav-drop-menu a:hover, .nav-drop-sub:hover > .nav-drop-sub-btn { background: var(--bg3); }
.nav-drop-prusa { color: #fa6831; }
.nav-drop-sub { position: relative; }
.nav-drop-sub-menu { display: none; position: absolute; left: 100%; top: -4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 150px; padding: 4px; }
.nav-drop-sub:hover .nav-drop-sub-menu { display: block; }

/* ── Main content ─────────────────────────────────────────────────────────── */
main { flex: 1; display: flex; }
.content { display: flex; flex: 1; }

/* ── Filter panel ─────────────────────────────────────────────────────────── */
.filter-panel {
  width: 210px; flex-shrink: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  position: sticky; top: 44px; align-self: flex-start;
  max-height: calc(100vh - 44px); overflow-y: auto;
}

.filter-toggle-btn {
  display: none; width: 100%; padding: 8px 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text);
  text-align: left;
}

.filter-section { margin-bottom: 14px; }
.filter-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text2); margin-bottom: 6px;
}

.filter-list { list-style: none; }
.filter-item {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 4px; border-radius: 4px; cursor: pointer;
  font-size: 12.5px; line-height: 1.4;
  user-select: none;
}
.filter-item:hover { background: var(--bg3); }
.filter-item input[type=checkbox] { width: 13px; height: 13px; accent-color: var(--accent); flex-shrink: 0; }
.filter-item.excluded { opacity: .5; text-decoration: line-through; }
.filter-item.included { color: var(--accent); font-weight: 500; }
.filter-count { margin-left: auto; font-size: 11px; color: var(--text2); }

.color-swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--border); flex-shrink: 0;
}

.filter-show-more {
  display: block; width: 100%; margin-top: 4px;
  background: none; border: none;
  font-size: 11px; color: var(--accent); text-align: left;
  padding: 2px 4px;
}
.filter-show-more:hover { text-decoration: underline; }

.range-inputs { display: flex; gap: 4px; align-items: center; }
.range-inputs input[type=number] {
  width: 72px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-size: 12px;
}
.range-inputs span { color: var(--text2); font-size: 12px; }

.rating-input { display: flex; align-items: center; gap: 6px; }
.rating-input input[type=range] { flex: 1; accent-color: var(--accent); }
.rating-input .rating-val { font-size: 12px; width: 24px; }

.filter-actions { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.btn-reset {
  flex: 1; padding: 5px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  font-size: 12px; color: var(--text2);
}
.btn-reset:hover { background: var(--bg3); color: var(--text); }

.show-counts-label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text2); }

/* ── Table area ───────────────────────────────────────────────────────────── */
.table-area { flex: 1; overflow-x: auto; }

.col-picker { position: relative; }
.col-picker-btn {
  padding: 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; color: var(--text2);
}
.col-picker-btn:hover { background: var(--bg3); }
.col-picker-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px 8px; z-index: 100; min-width: 140px;
}
.col-picker:hover .col-picker-dropdown,
.col-picker:focus-within .col-picker-dropdown { display: block; }
.col-picker-dropdown label {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; font-size: 12px; cursor: pointer;
}

/* ── Data table ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 8px 10px; text-align: left;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-weight: 600; font-size: 12px;
  position: sticky; top: 44px;
}
thead th a {
  display: flex; align-items: center; gap: 4px; color: var(--text2);
}
thead th a:hover { color: var(--text); }
thead th.sorted a { color: var(--accent); }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg2); }
tbody td { padding: 7px 10px; vertical-align: middle; }

.col-brand   { min-width: 150px; max-width: 180px; }
.brand-cell  { display: flex; align-items: center; gap: 7px; }
.product-thumb {
  width: 36px; height: 36px; flex-shrink: 0;
  object-fit: contain; border-radius: 4px;
  background: var(--bg2); border: 1px solid var(--border);
}
.product-thumb-placeholder {
  display: inline-block;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 4px; background: var(--bg3);
}
.col-mat     { white-space: nowrap; }
.col-color   { min-width: 80px; }
.col-weight  { text-align: right; white-space: nowrap; }
.col-price   { text-align: right; white-space: nowrap; font-weight: 600; }
.col-ppkg    { text-align: right; white-space: nowrap; color: var(--text2); }
.col-rating  { white-space: nowrap; }
.col-stock   { text-align: center; }
.col-link    { text-align: center; white-space: nowrap; }
.col-report  { text-align: center; width: 28px; }

.brand-name  { font-weight: 500; }
.product-title { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.tag { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 11px; background: var(--bg3); color: var(--text2); margin: 1px 1px 0 0; }

.color-chips { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.color-chip  { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0; }
.pack-badge  { font-size: 10px; font-weight: 600; color: var(--text2); background: var(--bg3); border-radius: 3px; padding: 0 4px; line-height: 15px; }

.star { color: #f59e0b; }
.review-count { font-size: 11px; color: var(--text2); }

.in-stock    { color: var(--green); font-size: 11px; }
.out-stock   { color: var(--red);   font-size: 11px; }

.btn-amazon {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius);
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 500; border: none;
  transition: opacity .15s;
}
.btn-amazon:hover { opacity: .88; }

.btn-report {
  background: none; border: none; padding: 2px 4px;
  color: var(--text2); font-size: 13px; border-radius: 3px;
  opacity: .4;
}
.btn-report:hover { opacity: 1; color: var(--red); background: var(--bg3); }

.no-results {
  padding: 48px; text-align: center;
  color: var(--text2); font-size: 14px;
}

/* ── Bundle rows ──────────────────────────────────────────────────────────── */

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  padding: 10px 16px; font-size: 11px; color: var(--text2);
  border-top: 1px solid var(--border); background: var(--bg2);
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .filter-panel {
    position: fixed; left: 0; top: 44px; bottom: 0;
    z-index: 50; background: var(--bg);
    transform: translateX(-100%); transition: transform .2s;
    width: 240px; height: calc(100vh - 44px);
  }
  .filter-panel.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .filter-toggle-btn { display: block; margin: 8px; }
  .col-color, .col-ppkg, .col-rating { display: none; }
  .table-area { padding-top: 0; }
}

/* ══ Content pages (hub + material guides) ══════════════════════════════════ */
/* Scrollable shell variant — overrides the fixed 100vh app-shell. */
.page--content { height: auto; min-height: 100vh; overflow: visible; }
.main--content { display: block; overflow: visible; min-height: 0; }

.page--content footer { flex-direction: column; align-items: stretch; gap: 0; }
.footer-legal {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px;
}
.page--content .footer-legal { border-top: 1px solid var(--border); }

/* Rich internal-link footer */
.footer-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto; width: 100%;
  padding: 28px 24px 8px;
}
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text2); margin-bottom: 2px;
}
.footer-col a { color: var(--text2); font-size: 13px; }
.footer-col a:hover { color: var(--accent); }
.footer-col-about { gap: 8px; }
.footer-brand { font-weight: 700; font-size: 15px; }
.footer-brand span { color: var(--accent); }
.footer-tagline { font-size: 12px; color: var(--text2); line-height: 1.5; }

/* ── Hub ──────────────────────────────────────────────────────────────────── */
.hub { max-width: 1100px; margin: 0 auto; padding: 8px 24px 48px; width: 100%; }

.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
.hero-sub {
  max-width: 620px; margin: 12px auto 0; font-size: 15px;
  color: var(--text2); line-height: 1.55;
}
/* AI assistant teaser card */
.hero-assistant {
  max-width: 600px; margin: 28px auto 0; padding: 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--accent-dim);
}
.hero-assistant-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.hero-badge {
  font-size: 12px; font-weight: 700; color: var(--accent);
  letter-spacing: .01em;
}
.hero-soon {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text2); background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px;
}
.hero-prompt { display: flex; gap: 8px; }
.hero-prompt input {
  flex: 1; padding: 12px 16px; font-size: 15px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
.hero-prompt input:disabled { cursor: not-allowed; color: var(--text2); }
.hero-prompt button {
  padding: 12px 22px; font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff;
}
.hero-prompt button:disabled { opacity: .5; cursor: not-allowed; }
.hero-prompt button { cursor: pointer; }
.hero-prompt button:hover { filter: brightness(1.05); }
.hero-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hero-example {
  font-size: 12px; color: var(--text2); cursor: pointer;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px;
}
.hero-example:hover { border-color: var(--accent); color: var(--text); }
.hero-note { font-size: 12px; color: var(--text2); margin-top: 10px; text-align: left; }

/* Assistant response */
.assistant-result { margin-top: 14px; text-align: left; }
.assistant-msg { font-size: 14px; color: var(--text2); }
.assistant-explain { font-size: 14.5px; line-height: 1.55; }
.assistant-picks-title {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text2); margin: 14px 0 8px;
}
.assistant-picks { display: grid; gap: 8px; }
.assistant-pick {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: inherit; text-decoration: none;
}
.assistant-pick:hover { border-color: var(--accent); }
.assistant-pick img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; border-radius: 6px; background: #fff; }
.assistant-pick-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.assistant-pick-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-pick-price { font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.assistant-cta {
  display: inline-block; margin-top: 14px; padding: 10px 18px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  border-radius: var(--radius); text-decoration: none;
}
.assistant-cta:hover { filter: brightness(1.05); }

.hub-section { margin-top: 44px; }
.hub-section > h2 { font-size: 20px; letter-spacing: -.01em; }
.hub-section-intro { margin: 6px 0 16px; color: var(--text2); font-size: 14px; }

/* Materials cheat sheet */
.cheat-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.cheat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cheat-table thead th {
  position: static; text-align: left; padding: 10px 12px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.cheat-table tbody tr { border-bottom: 1px solid var(--border); }
.cheat-table tbody tr:last-child { border-bottom: none; }
.cheat-table tbody tr:hover { background: var(--bg2); }
.cheat-table td { padding: 10px 12px; vertical-align: middle; }
.cheat-mat { display: flex; flex-direction: column; }
.cheat-mat a { font-weight: 600; color: var(--accent); }
.cheat-mat a:hover { text-decoration: underline; }
.cheat-fullname { font-size: 11px; color: var(--text2); }
.cheat-use { color: var(--text2); }
.diff-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.diff-1 { background: rgba(22,163,74,.14); color: var(--green); }
.diff-2 { background: rgba(245,158,11,.16); color: #b45309; }
.diff-3 { background: rgba(220,38,38,.13); color: var(--red); }

/* Featured brands */
.brand-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.brand-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2);
  transition: border-color .15s, transform .1s;
}
.brand-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.brand-card-name { font-weight: 600; font-size: 14px; }
.brand-card-meta { font-size: 12px; color: var(--text2); }
.hub-more { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--accent); font-weight: 500; }
.hub-more:hover { text-decoration: underline; }

/* Stores */
.stores-row { display: flex; flex-wrap: wrap; gap: 32px; }
.stores-group { display: flex; flex-direction: column; gap: 8px; }
.stores-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text2);
}
.stores-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.store-chip {
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2); font-size: 13px;
}
.store-chip:hover { border-color: var(--accent); }
.store-chip.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.store-chip.prusa { border-color: #fa6831; color: #fa6831; align-self: flex-start; }
.stores-prusa-desc { font-size: 12px; color: var(--text2); max-width: 320px; }

/* Tool CTA */
.hub-cta {
  margin-top: 44px; padding: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--accent-dim);
}
.hub-cta h2 { font-size: 18px; }
.hub-cta p { margin-top: 4px; color: var(--text2); font-size: 14px; max-width: 520px; }
.cta-btn {
  padding: 11px 20px; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.cta-btn:hover { opacity: .9; }

/* ── Material landing page ──────────────────────────────────────────────────── */
.material-page {
  max-width: 1080px; margin: 0 auto; padding: 20px 24px 48px; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas: "head head" "main side";
  column-gap: 40px; align-items: start;
}
.mat-header { grid-area: head; margin-bottom: 18px; }
.mat-main { grid-area: main; min-width: 0; }
.mat-aside { grid-area: side; min-width: 0; }
.mat-back { display: inline-block; font-size: 13px; color: var(--text2); margin-bottom: 16px; }
.mat-back:hover { color: var(--accent); }
.mat-header h1 { font-size: 28px; letter-spacing: -.01em; }
.mat-fullname { color: var(--text2); font-size: 14px; margin-top: 2px; }

/* Permanent spec block (right sidebar) */
.mat-specs {
  position: sticky; top: 76px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); padding: 16px 18px;
  display: grid; gap: 15px;
}
.mat-specs-title {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text2);
}
.mat-spec { display: flex; align-items: center; gap: 12px; }
.mat-spec-ic { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); }
.mat-spec-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mat-spec-label { font-size: 11.5px; color: var(--text2); }
.mat-spec-value { font-size: 14.5px; font-weight: 600; }

/* Compact per-store price cards in the sidebar */
.mat-lenses {
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); padding: 16px 18px; display: grid; gap: 8px;
}
.mat-lenses .mat-specs-title { margin-bottom: 2px; }
.lens-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: inherit; text-decoration: none;
}
.lens-card:hover { border-color: var(--accent); }
.lens-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.lens-card-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lens-card-store { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.lens-card-n { font-size: 11px; color: var(--text2); }
.lens-card-vals { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; flex-shrink: 0; }
.lens-card-avg { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lens-card-range { font-size: 11px; color: var(--text2); font-variant-numeric: tabular-nums; }
.mat-lenses .lens-unit { margin-top: 2px; }

/* ── Cluster pages (/materiaux, /brands): card grid + brand chip cloud ── */
.content-page { max-width: 1000px; margin: 0 auto; padding: 24px 24px 56px; width: 100%; }
.cluster-header { margin-bottom: 22px; }
.cluster-header h1 { font-size: 28px; letter-spacing: -.01em; }
.cluster-intro { color: var(--text2); font-size: 15px; margin-top: 4px; }
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cluster-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2);
  color: inherit; text-decoration: none; transition: border-color .12s, transform .12s;
}
.cluster-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cluster-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cluster-card-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cluster-card-sub { font-size: 12.5px; color: var(--text2); }
.cluster-card-desc { font-size: 13.5px; line-height: 1.55; color: var(--text); margin: 4px 0 0; }
.brand-card-cnt { font-size: 12px; color: var(--text2); white-space: nowrap; }
.cluster-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cc-chip {
  padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); font-size: 11.5px;
}
.cc-chip b { color: var(--text2); font-weight: 600; margin-right: 3px; }

/* ── FAQ page ── */
.faq-page { max-width: 800px; }
.faq-disclosure { color: var(--text2); font-size: 13px; margin-top: 6px; font-style: italic; }
.faq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.faq-entry {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); padding: 16px 18px;
}
.faq-entry dt { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.faq-entry dd { margin: 0; }
.faq-entry dd p { font-size: 14px; line-height: 1.6; color: var(--text); margin: 0; }
.faq-extra { margin-top: 10px !important; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.faq-endpoint {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.faq-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.faq-link:hover { text-decoration: underline; }

.brand-tail { margin-top: 36px; }
.brand-tail h2 { font-size: 16px; margin-bottom: 12px; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg2);
  color: inherit; text-decoration: none; font-size: 13px;
}
.brand-chip:hover { border-color: var(--accent); }
.brand-chip-cnt {
  font-size: 11px; color: var(--text2); background: var(--bg3);
  padding: 0 6px; border-radius: 999px; font-variant-numeric: tabular-nums;
}

.mat-body { margin-top: 28px; }
.mat-body section { margin-top: 28px; }
.mat-body h2 { font-size: 19px; margin-bottom: 10px; letter-spacing: -.01em; }
.mat-body h3.mat-settings-h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text2); }
.mat-body p { font-size: 15px; line-height: 1.65; color: var(--text); }
.mat-intro { font-size: 15.5px; line-height: 1.7; }
.mat-list { margin: 0; padding-left: 20px; }
.mat-list li { font-size: 14.5px; line-height: 1.7; }

.mat-settings { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.mat-settings tr { border-bottom: 1px solid var(--border); }
.mat-settings th { text-align: left; padding: 8px 10px; font-weight: 500; color: var(--text2); width: 50%; }
.mat-settings td { padding: 8px 10px; font-weight: 600; }

/* DB-driven per-store lenses */
.mat-stats { margin-top: 32px; }
.mat-stats > h2 { font-size: 19px; margin-bottom: 12px; }
.lens { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lens-head, .lens-row {
  display: grid; grid-template-columns: 1.5fr .8fr 1fr 1fr 1fr 1.4fr;
  align-items: center; gap: 8px; padding: 9px 14px;
}
.lens-head {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text2);
}
.lens-row { border-bottom: 1px solid var(--border); font-size: 14px; transition: background .12s; }
.lens-row:last-child { border-bottom: none; }
.lens-row:hover { background: var(--bg2); }
.lens-row.active { background: var(--accent-dim); }
.lens-store { font-weight: 600; }
.lens-num { text-align: right; font-variant-numeric: tabular-nums; }
.lens-avg { font-weight: 600; }
.lens-go { text-align: right; font-size: 12px; color: var(--accent); font-weight: 500; opacity: 0; transition: opacity .12s; }
.lens-row:hover .lens-go { opacity: 1; }
.lens-unit { margin-top: 6px; font-size: 11px; color: var(--text2); text-align: right; }

/* Brand comparison chart */
.mat-brands { margin-top: 36px; }
.mat-brands > h2 { font-size: 19px; margin-bottom: 4px; }
.bchart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bchart-head > div { min-width: 0; }
.bchart-store { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bchart-store label { font-size: 12.5px; color: var(--text2); white-space: nowrap; }
.bchart-store select {
  font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text); cursor: pointer;
}
.bchart { margin-top: 14px; display: grid; gap: 8px; }
.bchart-row {
  display: grid; grid-template-columns: 120px 1fr 74px 62px; align-items: center; gap: 12px;
  padding: 4px 6px; border-radius: var(--radius); color: inherit; text-decoration: none;
}
.bchart-row:hover { background: var(--bg2); }
/* Prusa (first-party Prusament) shown as a comparable brand bar, in orange to match the vertical. */
.bchart-row--prusa { --bchart-accent: #ea580c; }
.bchart-row--prusa .bchart-name { color: #ea580c; }
.bchart-row--prusa .bchart-range { background: color-mix(in srgb, #ea580c 28%, transparent); }
.bchart-row--prusa .bchart-avg { background: #ea580c; }
.bchart-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 0-based axis: range bar from min→max, with a marker at the average. */
.bchart-track { position: relative; height: 16px; background: var(--bg3); border-radius: 999px; }
.bchart-range {
  position: absolute; top: 0; bottom: 0; min-width: 3px;
  background: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px;
}
.bchart-avg {
  position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px;
  background: var(--accent); border-radius: 2px;
}
.bchart-range-val { text-align: right; display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bchart-range-val b { font-weight: 700; font-size: 13px; }
.bchart-range-val small { font-size: 11px; color: var(--text2); }
.bchart-meta { text-align: right; font-size: 12px; color: var(--text2); white-space: nowrap; }
/* Axis tick row aligned under the tracks */
.bchart-axis { display: grid; grid-template-columns: 120px 1fr 74px 62px; gap: 12px; margin-top: 2px; }
.bchart-axis-track { position: relative; height: 14px; }
.bchart-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 10.5px; color: var(--text2); font-variant-numeric: tabular-nums;
}
.bchart-tick::before {
  content: ''; position: absolute; left: 50%; top: -6px; height: 4px; width: 1px; background: var(--border);
}
.bchart-legend-range::before {
  content: ''; display: inline-block; width: 14px; height: 8px; margin-right: 3px; vertical-align: middle;
  background: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px;
}
.bchart-legend-avg::before {
  content: ''; display: inline-block; width: 3px; height: 11px; margin: 0 4px 0 8px; vertical-align: middle;
  background: var(--accent); border-radius: 2px;
}

/* Variant breakdown */
.mat-variants { margin-top: 12px; display: grid; gap: 10px; }
.mat-variant { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: baseline; }
.mat-variant dt { font-weight: 600; font-size: 14px; }
.mat-variant dd { margin: 0; font-size: 14px; color: var(--text2); line-height: 1.6; }

.mat-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.mat-pros, .mat-cons { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.mat-pros { background: rgba(22,163,74,.06); }
.mat-cons { background: rgba(220,38,38,.05); }
.mat-pros h2, .mat-cons h2 { font-size: 15px; }

@media (max-width: 900px) {
  .material-page { grid-template-columns: 1fr; grid-template-areas: "head" "side" "main"; }
  .mat-header { margin-bottom: 12px; }
  .mat-aside { margin-bottom: 8px; }
  .mat-specs { position: static; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .mat-specs-title { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 24px; }
  .mat-proscons { grid-template-columns: 1fr; }
  .bchart-head { align-items: stretch; }
  .mat-variant { grid-template-columns: 1fr; gap: 2px; }
  .lens-head, .lens-row { grid-template-columns: 1.3fr .6fr 1fr 1fr 1fr; gap: 6px; padding: 9px 10px; font-size: 13px; }
  .lens-go { display: none; }
  .bchart-row, .bchart-axis { grid-template-columns: 84px 1fr 66px; }
  .bchart-meta { display: none; }
}
