@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Space+Grotesk:wght@400;500;600&display=swap');

/* Filamentra Material Workbench — product-led refinement following unslop.
   Source: https://github.com/heydamir/unslop (Damir Sokolovsky, CC BY 4.0) */
:root {
  color-scheme: dark;
  --bg: #121514;
  --rail: #151817;
  --panel: #1b1e1c;
  --raised: #242826;
  --stroke: rgba(237, 243, 235, .09);
  --stroke-strong: rgba(237, 243, 235, .17);
  --text: #f0f2ed;
  --secondary: #b6beb6;
  --muted: #909c92;
  --accent: #c6e79e;
  --accent-soft: #29392b;
  --shadow: 0 12px 32px rgba(0, 0, 0, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 'DM Sans', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
[hidden] { display: none !important; }

.topbar {
  min-height: 68px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 12px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--stroke); background: var(--bg);
}
.brandmark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 9px; background: var(--accent); color: #18251a;
  font: 600 24px/.9 'Space Grotesk', sans-serif; letter-spacing: -.07em;
}
.mark .accent { color: #617d4c; }
.brand-name { font: 600 17px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.025em; }
.brand-name small { display: block; margin-top: 4px; color: var(--muted); font: 400 11px/1.25 'DM Sans', sans-serif; letter-spacing: 0; }
.topbar nav { display: flex; align-items: center; gap: 28px; color: var(--secondary); font-size: 13px; }
.topbar nav a { transition: color 150ms var(--ease); }
.topbar nav a:hover { color: var(--accent); }
.main { max-width: 1640px; margin: 0 auto; }

.hero { padding: clamp(48px, 5vw, 80px) clamp(24px, 4vw, 64px); border-bottom: 1px solid var(--stroke); }
.hero-content { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); align-items: center; gap: clamp(40px, 5vw, 96px); }
.hero-main { max-width: 680px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .01em; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.slash { color: #68746c; margin: 0 8px; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 500; }
h1 { margin: 24px 0 20px; font-size: clamp(42px, 4.3vw, 68px); line-height: 1.07; letter-spacing: -.035em; }
h1 span { color: var(--secondary); }
.hero p { max-width: 590px; margin: 0; color: var(--secondary); font-size: 16px; line-height: 1.65; }
.hero-action {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 44px; margin-top: 28px; padding: 0 18px; border-radius: 9px;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.hero-action:hover { background: #dae0d7; color: var(--bg); }
.hero-action:active { transform: scale(.98); }
.hero-action span { font-size: 18px; font-weight: 400; line-height: 1; }
.stats { display: flex; align-items: flex-start; gap: clamp(24px, 3vw, 48px); margin-top: 52px; }
.stats div { min-width: 84px; }
.stats strong { display: block; font: 500 29px/1.2 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.hero-preview { min-width: 0; padding: 20px; border: 1px solid var(--stroke-strong); border-radius: 18px; background: var(--panel); }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; color: var(--secondary); font-size: 13px; font-weight: 500; }
.preview-head span:last-child { color: var(--muted); font: 400 11px/1.4 ui-monospace, 'SFMono-Regular', Consolas, monospace; }
.hero-samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-sample { min-width: 0; padding: 6px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--raised); }
.hero-sample-pigment { height: 76px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; background: #444; }
.hero-sample-name, .hero-sample-meta { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hero-sample-name { margin: 8px 3px 0; color: var(--text); font-size: 12px; font-weight: 500; }
.hero-sample-meta { margin: 3px 3px 2px; color: var(--muted); font-size: 10px; }
.preview-loading { grid-column: 1/-1; min-height: 200px; display: grid; place-items: center; text-align: center; }
.hero-preview .preview-foot { max-width: none; margin: 16px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.workspace { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; min-height: 65vh; }
.sidebar {
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 32px 24px 40px; background: var(--rail); border-right: 1px solid var(--stroke);
  scrollbar-color: #414943 transparent; scrollbar-width: thin;
}
.sidebar-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 28px; font: 500 16px/1.3 'Space Grotesk', sans-serif; }
.sidebar-title span { color: var(--muted); font: 400 11px/1.4 ui-monospace, 'SFMono-Regular', Consolas, monospace; }
.mobile-filter-toggle { display: none; }
label, .filter-heading { display: block; margin: 0 0 10px; color: var(--secondary); font-size: 12px; font-weight: 500; }
.filter-heading { display: flex; justify-content: space-between; align-items: center; }
.filter-heading span { color: var(--muted); font-variant-numeric: tabular-nums; }
.search-wrap { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 1px solid var(--stroke-strong); border-radius: 9px; background: var(--raised); color: var(--muted); }
.search-wrap:focus-within { border-color: rgba(198, 231, 158, .7); }
.search-wrap svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-wrap input::placeholder { color: var(--muted); opacity: 1; }
.filter-section { border-bottom: 1px solid var(--stroke); padding: 24px 0; }
.segmented { display: flex; gap: 4px; border: 1px solid var(--stroke); border-radius: 10px; padding: 4px; background: var(--bg); }
.segmented button { flex: 1; min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--secondary); font-size: 12px; font-weight: 500; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.segmented button:hover { background: var(--raised); }
.segmented button.active { background: var(--accent); color: #152018; }
.brands { display: flex; flex-direction: column; gap: 3px; max-height: 320px; overflow-y: auto; }
.brand-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--secondary); text-align: left; font-size: 12px; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.brand-option:hover { background: var(--raised); }
.brand-option.active { background: var(--accent-soft); color: var(--text); border-color: rgba(198, 231, 158, .18); }
.brand-option .letter { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--stroke); border-radius: 6px; background: var(--raised); color: var(--secondary); font-size: 11px; font-weight: 500; }
.brand-option.active .letter { border-color: rgba(198, 231, 158, .24); color: var(--accent); }
.brand-option .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--stroke-strong); border-radius: 9px; background: var(--raised); color: var(--text); font-size: 12px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; color: var(--secondary); line-height: 1.5; font-size: 12px; font-weight: 400; cursor: pointer; }
.checkbox-row:last-child { margin-bottom: 0; }
.checkbox-row input { margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.reset { display: inline-flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 7px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 500; }
.reset:hover { color: var(--text); }
.sidebar-foot { margin-top: 36px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.catalog { min-width: 0; padding: 32px clamp(24px, 3vw, 48px) 64px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.section-head .eyebrow { color: var(--muted); }
h2 { margin: 8px 0 0; font-size: clamp(26px, 2.7vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.catalog-meta { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bullet { margin: 0 8px; color: #5f6b61; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; padding: 16px 0; border-block: 1px solid var(--stroke); color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { flex: none; display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.source { background: #94b68b; }
.legend-dot.approximation { background: #c5a46e; }
.legend-dot.missing { background: #6c7970; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(174px, 1fr)); gap: 12px; }
.swatch-card { min-width: 0; padding: 8px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--panel); color: var(--text); text-align: left; overflow: hidden; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.swatch-card:hover { border-color: var(--stroke-strong); background: var(--raised); }
.swatch { display: block; position: relative; height: 132px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 7px; overflow: hidden; background-color: var(--raised); }
.checker { background-image: linear-gradient(45deg, #333a35 25%, transparent 25%), linear-gradient(-45deg, #333a35 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #333a35 75%), linear-gradient(-45deg, transparent 75%, #333a35 75%); background-color: #505a52; background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.swatch .pigment { position: absolute; inset: 0; }
.no-swatch { display: grid; place-items: center; height: 100%; padding: 12px; background: var(--raised); color: var(--muted); font-size: 12px; text-align: center; }
.chip { position: absolute; bottom: 8px; left: 8px; padding: 4px 7px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 5px; background: rgba(16, 19, 17, .87); color: #f0f2ed; font-size: 10px; line-height: 1.25; font-weight: 500; }
.card-body { min-width: 0; padding: 12px 4px 5px; }
.card-overline { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.card-name { overflow: hidden; margin-top: 5px; color: var(--text); font: 500 15px/1.35 'Space Grotesk', sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.card-bottom .code { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 10px/1.4 ui-monospace, 'SFMono-Regular', Consolas, monospace; color: var(--secondary); text-align: right; }
.load-more { display: grid; place-items: center; grid-column: 1/-1; min-height: 60px; border: 1px solid var(--stroke-strong); border-radius: 10px; background: var(--panel); color: var(--secondary); font-size: 13px; transition: background-color 150ms var(--ease); }
.load-more:hover { background: var(--raised); color: var(--text); }
.empty { margin: 64px 0; padding: 32px 16px; color: var(--secondary); text-align: center; }
.empty strong { font: 500 23px/1.3 'Space Grotesk', sans-serif; }
.empty p { margin-top: 8px; }
.catalog-footer { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--stroke); color: var(--muted); font-size: 12px; line-height: 1.65; }

.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .7); }
.details { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(480px, 100vw); max-width: 100%; padding: 40px 32px; border-left: 1px solid var(--stroke-strong); background: var(--panel); overflow-y: auto; transform: translateX(102%); transition: transform 250ms var(--ease); box-shadow: var(--shadow); }
.details.open { transform: translateX(0); }
.details .eyebrow { margin-top: 8px; }
.close { position: absolute; top: 24px; right: 24px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--stroke-strong); border-radius: 9px; background: var(--raised); color: var(--secondary); font: 400 22px/1 'DM Sans', sans-serif; }
.close:hover { color: var(--text); }
.details h3 { margin: 24px 0 8px; font-size: 34px; line-height: 1.1; letter-spacing: -.02em; }
.detail-sub { margin: 0 0 20px; color: var(--secondary); font-size: 13px; }
.detail-swatch { position: relative; height: 224px; margin: 24px 0 16px; border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; }
.detail-status { padding: 12px 14px; border: 1px solid var(--stroke); border-left: 2px solid var(--accent); border-radius: 8px; background: var(--raised); color: var(--secondary); font-size: 12px; line-height: 1.55; }
.detail-status.missing { border-left-color: var(--muted); }
.spec { margin-top: 24px; }
.spec-row { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--stroke); font-size: 12px; }
.spec-row span { color: var(--muted); }
.spec-row strong { max-width: 60%; overflow-wrap: anywhere; color: var(--text); font-weight: 500; text-align: right; }
.source-link { display: block; margin-top: 16px; padding: 11px 14px; border: 1px solid var(--stroke-strong); border-radius: 9px; background: var(--raised); color: var(--text); font-size: 12px; font-weight: 500; text-align: center; transition: background-color 150ms var(--ease); }
.source-link:hover { background: #303630; }
.details .caution { margin-top: 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }

footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding: 24px clamp(24px, 4vw, 64px); border-top: 1px solid var(--stroke); color: var(--muted); font-size: 12px; }
footer i { color: var(--accent); font-style: normal; }
footer a { color: var(--secondary); }
footer a:hover { color: var(--text); }
.footer-separator { margin: 0 12px; }

@media (max-width: 1100px) {
  .hero-content { grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); gap: 32px; }
  .workspace { grid-template-columns: 240px minmax(0, 1fr); }
  .sidebar { padding-inline: 18px; }
  .catalog { padding-inline: 24px; }
  .swatch-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
  .swatch { height: 116px; }
}
@media (max-width: 820px) {
  .hero-content { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-main { max-width: 700px; }
  .hero-preview { max-width: 680px; }
  .hero-sample-pigment { height: 96px; }
  .stats { margin-top: 36px; }
}
@media (max-width: 700px) {
  .topbar { min-height: 60px; padding: 10px 20px; }
  .topbar nav { gap: 12px; font-size: 12px; }
  .topbar nav a:first-child { display: none; }
  .hero { padding: 44px 20px 40px; }
  h1 { font-size: clamp(36px, 9vw, 46px); margin: 20px 0 16px; }
  .hero p { font-size: 14px; }
  .hero-action { margin-top: 24px; }
  .hero-preview { padding: 12px; border-radius: 14px; }
  .hero-samples { gap: 6px; }
  .hero-sample { padding: 4px; border-radius: 8px; }
  .hero-sample-pigment { height: 64px; }
  .hero-sample-name { font-size: 11px; }
  .hero-sample-meta { font-size: 10px; }
  .stats { justify-content: space-between; gap: 12px; margin-top: 32px; }
  .stats div { min-width: 0; }
  .stats strong { font-size: 26px; }
  .stats span { font-size: 11px; }
  .workspace { display: block; }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 20px; border-right: 0; border-bottom: 1px solid var(--stroke); }
  .sidebar-title { margin-bottom: 14px; }
  .mobile-filter-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 0 14px; border: 1px solid var(--stroke-strong); border-radius: 9px; background: var(--raised); color: var(--text); text-align: left; font-weight: 500; }
  .mobile-filter-toggle span { color: var(--muted); font-size: 19px; }
  .filters-panel { display: none; padding-top: 20px; }
  .filters-panel.is-open { display: block; }
  .filter-section { padding: 18px 0; }
  .brands { max-height: 220px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-option .count { display: none; }
  .sidebar-foot { margin-top: 20px; }
  .catalog { padding: 28px 20px 48px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .catalog-meta { text-align: left; }
  .legend { gap: 8px 16px; font-size: 11px; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .swatch-card { padding: 6px; }
  .swatch { height: 114px; }
  .card-body { padding: 10px 3px 5px; }
  .card-name { font-size: 13px; }
  .card-overline { font-size: 10px; }
  .card-bottom { flex-wrap: wrap; gap: 4px; margin-top: 10px; font-size: 10px; }
  .details { padding: 32px 24px; }
  .details h3 { font-size: 29px; }
  footer { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Material specimen preview — unslop: quiet chrome, real catalog colors as the focus.
   The preview is procedural, not a color-calibrated photograph of a printed part. */
.swatch .material-render,
.detail-swatch .material-render {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #181e1b;
}
.swatch .pigment.pigment-strip,
.detail-swatch .pigment.pigment-strip {
  position: absolute;
  inset: auto 10px 10px auto;
  width: 38px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
  z-index: 1;
}
.detail-swatch .pigment.pigment-strip { width: 52px; height: 14px; bottom: 16px; right: 16px; }
.hero-sample-pigment { position: relative; overflow: hidden; }
.hero-sample-render { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.material-stage { position: relative; height: 264px; margin: 24px 0 12px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 12px; background: #181e1b; }
.material-stage .detail-swatch { height: 100%; margin: 0; border: 0; border-radius: 0; }
.material-viewer-host { position: absolute; inset: 0; overflow: hidden; background: #1b211d; }
.material-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.material-canvas:active { cursor: grabbing; }
.material-viewer-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.viewer-note { color: var(--muted); font-size: 11px; line-height: 1.5; flex: 1; min-width: 170px; }
.viewer-shapes { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--stroke); border-radius: 8px; }
.shape-choice { min-height: 28px; padding: 4px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--secondary); font-size: 11px; }
.shape-choice.active { background: var(--raised); color: var(--text); }
.shape-choice:hover { color: var(--text); }
.swatch-card .swatch { background-color: #181e1b; }
@media (max-width: 700px) {
  .material-stage { height: 248px; margin-top: 20px; }
  .viewer-note { min-width: 100%; }
}

/* Filamentra UX workbench — catalog usability, compare, touch and keyboard navigation. */
.search-block { margin-bottom: 20px; }
.hero-sample { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hero-sample:hover, .hero-sample:focus-visible { border-color: var(--accent); }
.catalog-controls {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; margin-bottom: 20px;
}
.catalog-controls label { margin: 0; min-width: 210px; font-size: 12px; }
.catalog-controls select { display: block; margin-top: 6px; }
.view-control { display: flex; gap: 4px; padding: 4px; background: var(--rail); border: 1px solid var(--stroke); border-radius: 10px; }
.view-choice { min-height: 38px; padding: 6px 13px; color: var(--secondary); border: 0; border-radius: 7px; background: transparent; font-size: 12px; }
.view-choice.active { background: var(--raised); color: var(--text); }
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.active-filter { max-width: 100%; border: 1px solid var(--stroke-strong); border-radius: 18px; background: var(--raised); color: var(--secondary); padding: 5px 10px; font-size: 11px; overflow-wrap: anywhere; }
.active-filter-clear { padding: 5px 10px; border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.swatch-item { position: relative; min-width: 0; }
.swatch-item .swatch-card { width: 100%; height: 100%; display: flex; flex-direction: column; }
.swatch-item .card-body { flex: 1; display: flex; flex-direction: column; }
.swatch-item .card-bottom { margin-top: auto; padding-top: 12px; }
.compare-add {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.3); border-radius: 9px;
  background: rgba(20,24,21,.88); color: #fff; font-size: 22px; line-height: 1;
  backdrop-filter: blur(8px);
}
.compare-add.selected { background: var(--accent); border-color: var(--accent); color: #152018; }
.compare-add:hover { border-color: var(--accent); }
.quality-text { margin-top: 6px; color: var(--muted); font-size: 11px; }
.swatch-grid.grouped { display: block; }
.swatch-group { margin: 0 0 34px; }
.swatch-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--stroke); }
.swatch-group-head h3 { margin: 0; font-size: 18px; }
.swatch-group-head p, .group-count { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.swatch-group-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(174px,1fr)); gap: 12px; }
.grouped .load-more { display: grid; width: 100%; }
.compare-tray {
  position: fixed; z-index: 15; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: min(980px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--stroke-strong); border-radius: 14px;
  background: #252b26; box-shadow: 0 15px 55px rgba(0,0,0,.45);
}
.compare-tray-caption { display: flex; flex-direction: column; flex: none; font-size: 12px; }
.compare-tray-caption span { color: var(--muted); font-size: 11px; }
.compare-selected { display: flex; flex: 1; gap: 6px; min-width: 0; overflow-x: auto; }
.selected-chip { flex: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 9px; border: 1px solid var(--stroke-strong); border-radius: 7px; background: var(--raised); color: var(--text); font-size: 11px; }
.compare-clear { flex: none; border: 0; background: transparent; color: var(--secondary); padding: 8px; }
.compare-open { flex: none; min-height: 42px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #152018; font-weight: 600; }
.compare-open:disabled { opacity: .48; cursor: not-allowed; }
.compare-dialog {
  width: min(1180px, calc(100vw - 32px)); max-width: 100%; max-height: min(90vh, 950px);
  padding: 30px; background: var(--panel); color: var(--text);
  border: 1px solid var(--stroke-strong); border-radius: 16px; overflow: auto;
  box-shadow: var(--shadow);
}
.compare-dialog::backdrop { background: rgba(0,0,0,.78); }
.compare-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.compare-heading h2 { margin-top: 6px; }
.close-compare { flex: none; width: 44px; height: 44px; border-radius: 9px; border: 1px solid var(--stroke-strong); background: var(--raised); color: var(--text); font-size: 25px; }
.compare-intro { margin: 12px 0 20px; color: var(--secondary); font-size: 12px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(205px,1fr)); gap: 12px; }
.comparison-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--rail); border: 1px solid var(--stroke); border-radius: 12px; }
.comparison-card .detail-swatch { margin: 0 0 7px; height: 180px; }
.comparison-brand { color: var(--muted); font-size: 11px; }
.comparison-card h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.comparison-specs { margin: 8px 0 4px; }
.comparison-specs .spec-row { gap: 12px; padding: 7px 0; font-size: 11px; }
.comparison-link { display: block; min-height: 36px; margin-top: 6px; padding: 7px 10px; border: 1px solid var(--stroke-strong); border-radius: 7px; background: var(--raised); color: var(--text); text-align: center; font-size: 12px; }
button.comparison-link { width: 100%; cursor: pointer; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.detail-action { min-height: 40px; padding: 8px 12px; border: 1px solid var(--stroke-strong); border-radius: 8px; background: var(--raised); color: var(--text); font-size: 12px; }
.detail-action:hover { border-color: var(--accent); }
.technical-details { margin: 24px 0 0; border: 1px solid var(--stroke); border-radius: 10px; }
.technical-details summary { padding: 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
.technical-details .spec { margin: 0; padding: 0 14px 12px; }
.technical-details .spec-row:last-child { border-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
  .swatch-group-grid { grid-template-columns: repeat(auto-fill,minmax(156px,1fr)); }
}
@media (max-width: 700px) {
  .search-block { margin-bottom: 14px; }
  .search-wrap { height: 46px; }
  .search-wrap input { font-size: 16px; }
  .catalog-controls { align-items: stretch; }
  .catalog-controls label { flex: 1; }
  .view-control { align-self: end; }
  .swatch-group-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .swatch-group-head h3 { font-size: 15px; }
  .compare-add { top: 12px; right: 12px; width: 44px; height: 44px; }
  .compare-tray { flex-wrap: wrap; gap: 8px; bottom: 8px; }
  .compare-tray-caption { width: 90px; }
  .compare-selected { flex-basis: calc(100% - 100px); }
  .compare-clear { margin-left: auto; }
  .compare-open { flex: 1; }
  .compare-dialog { width: calc(100vw - 16px); padding: 20px 14px; }
  .compare-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .comparison-card { padding: 8px; }
  .comparison-card .detail-swatch { height: 135px; }
  .comparison-card h3 { font-size: 15px; }
  .comparison-card .spec-row { flex-wrap: wrap; gap: 4px; }
  .comparison-card .spec-row strong { max-width: 100%; text-align: left; }
  .details { width: 100vw; }
}
