/* Common filaments page. Shares the header from home3.css; fixed type sizes, 0 letter spacing, radius <= 8px. */
.spec-page .top { position: relative; background: var(--paper); border-bottom: 1px solid var(--line); }
.spec { padding-top: 64px; padding-bottom: 96px; }
.spec [hidden] { display: none !important; }
.spec-head h1 { font-size: 56px; line-height: 1.15; font-weight: 600; letter-spacing: 0; }
.spec-intro { max-width: 40em; margin-top: 20px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.spec-layout { display: grid; grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); gap: 56px; align-items: start; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--ink); }

.step-no { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border: 1px solid var(--ink); border-radius: 50%; font-size: 13px; font-weight: 600; line-height: 1; }
.spec-steps { display: grid; gap: 32px; min-width: 0; position: sticky; top: 24px; }
.spec-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.spec-step legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 16px; font-weight: 600; }
.spec-step legend small { font-size: 13px; font-weight: 400; color: var(--muted); }

.choice { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice-label { min-width: 0; overflow-wrap: anywhere; }
.choice-meta { margin-left: auto; flex: none; font-size: 13px; color: var(--muted); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:disabled) { cursor: default; color: var(--muted); }

.material-options { display: flex; flex-wrap: wrap; gap: 8px; }
.material-options .choice { padding: 0 14px; border: 1px solid #7A848D; border-radius: 4px; background: var(--white); font-weight: 500; }
.material-options .choice:hover { border-color: var(--ink); }
.material-options .choice:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--white); }

.brand-options { display: grid; border-top: 1px solid var(--line); }
.brand-options .choice { padding: 6px 12px 6px 14px; border-bottom: 1px solid var(--line); font-weight: 500; }
.brand-options .choice::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: transparent; }
.brand-options .choice:hover:not(:has(input:disabled)) { background: var(--white); }
.brand-options .choice:has(input:checked) { background: var(--white); color: var(--accent); }
.brand-options .choice:has(input:checked)::before { background: var(--accent); }
.brand-options .choice svg { flex: none; width: 18px; height: 18px; visibility: hidden; }
.brand-options .choice:has(input:checked) svg { visibility: visible; }
.brand-options .choice:has(input:checked) .choice-meta { color: var(--accent); }

.text-action { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.text-action svg { width: 18px; height: 18px; flex: none; }
.text-action:hover { color: var(--accent); }

.spec-results { min-width: 0; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-bottom: 16px; scroll-margin-top: 16px; }
.results-head h2 { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 24px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.results-count { font-size: 14px; color: var(--muted); }

.spec-state { display: flex; gap: 16px; align-items: flex-start; padding: 32px 24px; border: 1px dashed #7A848D; border-radius: 6px; }
.spec-state > svg { flex: none; width: 24px; height: 24px; margin-top: 2px; color: var(--muted); }
.spec-state[data-kind="loading"] > svg { animation: spec-spin 1s linear infinite; }
.spec-state[data-kind="error"] { border-style: solid; border-color: #B42318; }
.spec-state[data-kind="error"] > svg { color: #B42318; }
.state-title { font-size: 17px; font-weight: 600; }
.state-text { margin-top: 4px; font-size: 15px; color: var(--muted); }
.spec-state .text-action { margin-top: 8px; }
@keyframes spec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spec-state[data-kind="loading"] > svg { animation: none; } }

.grade-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.grade { border-bottom: 1px solid var(--line); }
.grade > .grade-id { padding: 20px 0; }
.grade-summary { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 1.4fr) auto; gap: 24px; align-items: center; min-height: 72px; padding: 16px 0; cursor: pointer; list-style: none; }
.grade-summary::-webkit-details-marker { display: none; }
.grade-summary:hover h3 { color: var(--accent); }
.grade-id { min-width: 0; }
.grade-id h3 { font-size: 18px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.grade-meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.grade-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.grade-preview .swatch { width: 22px; height: 22px; }
.grade-preview .more { font-size: 13px; color: var(--muted); margin-left: 4px; }
.grade-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.grade-toggle svg { width: 18px; height: 18px; transition: transform 160ms ease; }
details[open] .grade-toggle svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .grade-toggle svg { transition: none; } }

.swatch { display: block; position: relative; overflow: hidden; border-radius: 3px; border: 1px solid rgba(29,36,42,.25); background: repeating-conic-gradient(#e5e5e5 0 25%, #fff 0 50%) 0 / 10px 10px; }
.swatch::after { content: ''; position: absolute; inset: 0; background: var(--swatch); }
.grade-colors { padding: 4px 0 28px; }
.color-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 20px 16px; }
.color-item { min-width: 0; }
.color-item .swatch { height: 56px; margin-bottom: 8px; border-radius: 4px; }
.color-item b { display: block; font-size: 14px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.color-item small { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.colors-note { margin-top: 20px; font-size: 13px; color: var(--muted); }

.spec-page .foot-in > span { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1199px) {
  .spec-layout { gap: 40px; grid-template-columns: minmax(260px, 5fr) minmax(0, 7fr); }
  .grade-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .grade-preview { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 899px) {
  .spec { padding-top: 36px; padding-bottom: 64px; }
  .spec-head h1 { font-size: 36px; }
  .spec-intro { font-size: 16px; }
  .spec-layout { grid-template-columns: 1fr; gap: 36px; margin-top: 32px; padding-top: 24px; }
  .spec-steps { position: static; }
  .results-head h2 { font-size: 21px; }
  .spec-state { padding: 24px 16px; }
}
@media (max-width: 399px) {
  .spec-head h1 { font-size: 32px; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .grade-summary { gap: 12px 16px; }
}
