:root {
  --paper: #F5F3EF;
  --card: #FFFFFF;
  --ink: #2B2825;
  --muted: #7A756D;
  --line: #E2DDD3;
  --accent: #35509E;
  --c-natural-single: #4F6B34;
  --c-natural-blend: #7E9A52;
  --c-mixed: #C08A3E;
  --c-synthetic: #A34A9E;
  --c-unknown: #9A948C;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, #count { font-family: "Fraunces", Georgia, serif; }

header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
h1 { font-size: 24px; font-weight: 650; margin: 0; letter-spacing: -0.02em; }
h1::after { content: "."; color: var(--c-synthetic); }
#search {
  flex: 1;
  max-width: 420px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  font: inherit;
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#count { margin-left: auto; font-size: 15px; color: var(--muted); }
select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.layout { display: flex; align-items: flex-start; }

#filters { width: 230px; flex-shrink: 0; }
#filters > summary { display: none; }
aside {
  padding: 16px 18px 40px;
  position: sticky;
  top: 53px;
  max-height: calc(100vh - 53px);
  overflow-y: auto;
}
aside h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 18px 0 8px;
}
aside section:first-child h2 { margin-top: 0; }
aside label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  cursor: pointer;
}
aside label .n { color: var(--muted); margin-left: auto; font-size: 12px; }
aside label.zero { opacity: .45; }
#fibersList label.zero { display: none; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.swatch { border: 1px solid rgba(43,40,37,.25); }
.card .colr { text-transform: capitalize; }
.rangeval { font-family: system-ui, sans-serif; font-size: 12px; font-weight: 400; color: var(--muted); }

.minmax { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.minmax input {
  width: 70px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.minmax input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#reset {
  width: 100%;
  padding: 7px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#reset:hover { border-color: var(--accent); }
#reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 16px 20px 60px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 4px 14px rgba(43,40,37,.13); transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--accent); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper); }
.noimg { width: 100%; aspect-ratio: 1; background: var(--paper); }

/* signature: fiber composition bar */
.bar { display: flex; height: 7px; }
.bar span { height: 100%; }

.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .name { font-weight: 600; font-size: 13px; }
.card .comp { color: var(--muted); font-size: 12px; }
.card .specs {
  display: flex;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin-top: auto;
  padding-top: 6px;
}
.card .specs b { font-weight: 650; }
.card .meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.badge {
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.oos { color: #A03D2E; font-weight: 600; }
#empty { grid-column: 1 / -1; color: var(--muted); font-size: 15px; padding: 40px 0; text-align: center; }

@media (max-width: 720px) {
  header { flex-wrap: wrap; padding: 10px 12px; }
  #count { margin-left: 0; }
  .layout { display: block; }
  #filters { width: auto; }
  #filters > summary {
    display: block;
    padding: 10px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    cursor: pointer;
  }
  aside { position: static; max-height: none; }
  main { padding: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
