/* Chainsaw Bar Finder v1.0. Uses the BHH theme's tokens when present, with fallbacks. */
.csf {
	--csf-ink: var(--ink, #181818);
	--csf-red: var(--red, #E51B2B);
	--csf-red-700: var(--red-700, #B91C1C);
	--csf-canvas: var(--canvas, #F5F1E8);
	--csf-rule: var(--rule, #DDD6C8);
	--csf-muted: var(--steel-700, #575D62);
	--csf-display: var(--display, "Helvetica Neue", Arial, sans-serif);
	--csf-mono: var(--mono, ui-monospace, Menlo, monospace);
	--csf-r: var(--r-card, 4px);
	color: var(--csf-ink);
	margin: 0 0 48px;
}
.csf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.csf-head { margin-bottom: 24px; }
.csf-eyebrow { font-family: var(--csf-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--csf-red-700); margin: 0 0 8px; }
.csf-title { font-family: var(--csf-display); font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); line-height: 1.08; margin: 0 0 8px; }
.csf-lede { color: var(--csf-muted); max-width: 60ch; margin: 0; }

/* Steps */
.csf-steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .csf-steps { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.csf-step { background: #fff; border: 1px solid var(--csf-rule); border-top: 3px solid var(--csf-ink); border-radius: var(--csf-r); padding: 16px; transition: opacity .15s; }
.csf-step.is-disabled { opacity: 0.45; pointer-events: none; border-top-color: var(--csf-rule); }
.csf-step.is-done { border-top-color: #15803d; }
.csf-step-label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--csf-display); font-weight: 700; font-size: 1.05rem; }
.csf-step-label span { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--csf-ink); color: #fff; font-size: 0.85rem; }
.csf-step.is-done .csf-step-label span { background: #15803d; }
.csf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.csf-chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--csf-ink); border-radius: 3px; background: #fff; color: var(--csf-ink); font: inherit; font-weight: 600; cursor: pointer; }
.csf-chip:hover { background: var(--csf-canvas); }
.csf-chip[aria-pressed="true"] { background: var(--csf-ink); color: #fff; }
.csf-model input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--csf-muted); border-radius: 2px; font: inherit; }
.csf-model input:focus { outline: none; border-color: var(--csf-ink); box-shadow: 0 0 0 3px var(--yellow, #FFD400); }
.csf-model-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--csf-rule); border-radius: 2px; }
.csf-model-list:empty { display: none; }
.csf-model-opt { display: flex; justify-content: space-between; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--csf-rule); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.csf-model-opt span { color: var(--csf-muted); font-family: var(--csf-mono); font-size: 0.8rem; }
.csf-model-opt:hover { background: var(--csf-canvas); }
.csf-model-opt[aria-pressed="true"] { background: var(--csf-ink); color: #fff; }
.csf-model-opt[aria-pressed="true"] span { color: #ddd; }
.csf-loading, .csf-empty, .csf-error { color: var(--csf-muted); padding: 8px 0; margin: 0; list-style: none; font-size: 0.95rem; }
.csf-error { color: var(--csf-red-700); }
.csf-model-list .csf-loading, .csf-model-list .csf-empty, .csf-model-list .csf-error { padding: 10px 12px; }

/* Results */
.csf-results:empty { display: none; }
.csf-results { margin-bottom: 24px; }
.csf-results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--csf-ink); padding-bottom: 8px; margin-bottom: 16px; }
.csf-results-head h2 { font-family: var(--csf-display); font-size: 1.5rem; margin: 0; }
.csf-results-head h2 span { font-size: 1rem; color: var(--csf-muted); font-weight: 500; margin-left: 6px; }
.csf-results-head p { margin: 0; color: var(--csf-muted); font-size: 0.95rem; }
.csf-section { margin-bottom: 28px; }
.csf-section h3 { font-family: var(--csf-display); font-size: 1.2rem; margin: 0 0 8px; }
.csf-section h3 span { font-family: var(--csf-mono); font-size: 0.8rem; color: var(--csf-muted); margin-left: 4px; }
.csf-note { color: var(--csf-muted); font-size: 0.92rem; margin: 0 0 12px; }
.csf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .csf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .csf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.csf-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--csf-rule); border-radius: var(--csf-r); padding: 12px; }
.csf-card-img { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.csf-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.csf-card-name { font-size: 0.95rem; font-weight: 500; line-height: 1.35; margin: 0 0 6px; font-family: inherit; }
.csf-card-name a { color: inherit; text-decoration: none; }
.csf-card-name a:hover { text-decoration: underline; }
.csf-specline { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.csf-specline span { font-family: var(--csf-mono); font-size: 0.72rem; background: var(--csf-canvas); border-radius: 2px; padding: 2px 6px; }
.csf-price { font-family: var(--csf-display); font-weight: 700; font-size: 1.1rem; margin: auto 0 4px; }
.csf-price span { font-family: inherit; font-weight: 400; font-size: 0.85rem; color: var(--csf-muted); }
.csf-price del { color: var(--csf-muted); font-weight: 500; font-size: 0.9rem; }
.csf-price ins { text-decoration: none; color: var(--csf-red-700); }
.csf-est { font-family: var(--csf-mono); font-size: 0.75rem; color: var(--csf-muted); margin: 0 0 6px; }
.csf-card .bhh-stock { margin: 4px 0; }
.csf-aisle { font-size: 0.8rem; color: var(--csf-muted); margin: 2px 0 0; }
.csf-cut { font-size: 0.85rem; font-weight: 600; margin: 4px 0; }
.csf-card-action { margin-top: 10px; }
.csf-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 0 14px; border: 2px solid var(--csf-ink); border-radius: 3px; background: var(--csf-ink); color: #fff; font-family: var(--csf-display); font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; }
.csf-btn:hover { background: #000; color: #fff; }
.csf-add { background: var(--csf-red); border-color: var(--csf-red); }
.csf-add:hover { background: var(--csf-red-700); border-color: var(--csf-red-700); }
.csf-btn-outline { background: #fff; color: var(--csf-ink); }
.csf-btn-outline:hover { background: var(--csf-ink); color: #fff; }
.csf-btn:disabled { opacity: 0.6; cursor: wait; }
.csf-added { margin: 0; font-size: 0.9rem; font-weight: 600; color: #15803d; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.csf-none { background: var(--csf-canvas); border-radius: var(--csf-r); padding: 20px; }
.csf-none p { margin: 0 0 6px; }

/* More ways */
.csf-more { display: grid; gap: 8px; }
.csf-panel { background: #fff; border: 1px solid var(--csf-rule); border-radius: var(--csf-r); }
.csf-panel summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; font-family: var(--csf-display); font-weight: 600; }
.csf-panel summary::-webkit-details-marker { display: none; }
.csf-panel summary::after { content: "+"; font-size: 1.3rem; color: var(--csf-red-700); }
.csf-panel[open] summary::after { content: "–"; }
.csf-panel-body { padding: 0 16px 16px; }
.csf-help svg { width: 100%; max-width: 560px; height: auto; color: var(--csf-ink); display: block; margin-bottom: 8px; }
.csf-help p { margin: 0; max-width: 70ch; }
.csf-specs { display: grid; gap: 12px; align-items: end; }
@media (min-width: 700px) { .csf-specs { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; } }
.csf-specs label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.csf-specs select { min-height: 44px; border: 1px solid var(--csf-muted); border-radius: 2px; padding: 0 10px; font: inherit; background: #fff; }
.csf-specs .csf-btn { width: auto; }
.csf-ai { display: flex; flex-wrap: wrap; gap: 8px; }
.csf-ai input { flex: 1 1 240px; min-height: 44px; border: 1px solid var(--csf-muted); border-radius: 2px; padding: 0 12px; font: inherit; }
.csf-ai .csf-btn { width: auto; }
.csf-ai-answer { flex-basis: 100%; }
.csf-ai-answer .csf-btn { width: auto; margin-top: 4px; }

/* Server-rendered fallback list (replaced by the widget when JS runs) */
.csf-static ul { padding-left: 1.2em; }

/* Browse by saw */
.csf-index { margin: 48px 0 0; }
.csf-index h2 { font-family: var(--csf-display, "Helvetica Neue", Arial, sans-serif); font-size: 1.5rem; margin: 0 0 16px; }
.csf-index-grid { display: grid; gap: 24px; }
@media (min-width: 700px) { .csf-index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.csf-index h3 { font-size: 1.05rem; margin: 0 0 8px; border-bottom: 2px solid var(--ink, #181818); padding-bottom: 4px; }
.csf-index ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; font-size: 0.92rem; }
.csf-index li { padding: 3px 0; break-inside: avoid; }
.csf-index a[aria-current="page"] { font-weight: 700; color: var(--ink, #181818); }
