/* First bike matchmaker (cbt/first-bike) v1.1.0: CBT Test look.
   Tokens from the CBT Test style guide: ink #1F2A33, surface #FFFFFF, road #EEF1F3, line #D5DBE0, muted #5B6670,
   data colours easier #1565C0 / neutral #6B7580 / harder #C62828, Barlow Condensed headings, Barlow body.
   The bike picture colours and the hi-vis "Start here" tag are scene colours, not guide tokens. */
.cbtfb {
	--ink: #1F2A33;
	--muted: #5B6670;
	--line: #D5DBE0;
	--road: #EEF1F3;
	--surface: #FFFFFF;
	--easier: #1565C0;
	--neutral-data: #6B7580;
	--harder: #C62828;
	--hivis: #FFE14D;
	--radius: 10px;
	--font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
	--font-body: "Barlow", system-ui, sans-serif;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--surface);
	max-width: 820px;
	margin: 0 auto;
	box-sizing: border-box;
	text-align: left;
}
.cbtfb--embed { padding: 8px 16px 16px; }
.cbtfb *, .cbtfb *::before, .cbtfb *::after { box-sizing: border-box; }
.cbtfb [hidden] { display: none !important; }
.cbtfb p { margin: 0 0 12px; }
.cbtfb a { color: var(--ink); text-underline-offset: 3px; }
.cbtfb button, .cbtfb input { font: inherit; }
.cbtfb :focus-visible { outline: 3px solid var(--easier); outline-offset: 2px; }
.cbtfb .cbtfb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cbtfb-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 8vw, 56px); line-height: 1.02; margin: 0 0 10px; color: var(--ink); }
.cbtfb-lede { max-width: 62ch; }
.cbtfb-small { font-size: 13px; color: var(--muted); }
.cbtfb--js .cbtfb-nojs { display: none; }
.cbtfb-nojs { background: var(--road); padding: 12px 14px; border-radius: var(--radius); }

/* Buttons */
.cbtfb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 18px; border-radius: 6px;
	border: 2px solid var(--ink); background: var(--ink); color: var(--surface);
	font-family: var(--font-body); font-weight: 600; font-size: 17px; line-height: 1.2; cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0;
	transition: transform .12s ease;
}
.cbtfb-btn:active { transform: scale(.97); }
.cbtfb-btn:disabled { opacity: .4; cursor: not-allowed; }
.cbtfb-btn--ghost { background: var(--surface); color: var(--ink); }

/* Progress */
.cbtfb-progress { margin: 8px 0 18px; }
.cbtfb-progress-top { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.cbtfb-bar { height: 10px; border-radius: 99px; background: var(--road); overflow: hidden; border: 1px solid var(--line); }
.cbtfb-bar span { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width .35s ease; }

/* Step */
.cbtfb-step { position: relative; background: var(--road); border-radius: var(--radius); padding: 24px 14px 18px; animation: cbtfb-in .3s ease; }
@keyframes cbtfb-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.cbtfb-start {
	position: absolute; top: -16px; left: 14px; z-index: 2;
	background: var(--hivis); color: var(--ink); border: 2px solid var(--ink);
	font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; text-transform: uppercase;
	padding: 3px 14px; border-radius: 999px; box-shadow: 0 0 0 0 rgba(255, 225, 77, .9);
	animation: cbtfb-pulse 1.6s ease-out infinite;
}
.cbtfb-start::after { content: ""; position: absolute; left: 22px; bottom: -9px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
@keyframes cbtfb-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 225, 77, .9); transform: scale(1); } 60% { box-shadow: 0 0 0 14px rgba(255, 225, 77, 0); transform: scale(1.06); } 100% { box-shadow: 0 0 0 0 rgba(255, 225, 77, 0); transform: scale(1); } }
.cbtfb-q { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 6vw, 32px); line-height: 1.1; margin: 0 0 14px; padding: 0; color: var(--ink); }
.cbtfb-q:focus { outline: none; }
.cbtfb-q--sm { font-size: 22px; margin-top: 16px; margin-bottom: 4px; }
.cbtfb-tiles { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.cbtfb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cbtfb-grid--two { margin-bottom: 18px; }
@media (min-width: 640px) { .cbtfb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cbtfb-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cbtfb-tile { position: relative; }
.cbtfb-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cbtfb-tile label {
	display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
	min-height: 112px; height: 100%; padding: 14px 12px; cursor: pointer;
	background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
	color: var(--ink); transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.cbtfb-tile--slim label { min-height: 64px; flex-direction: row; align-items: center; }
.cbtfb-tile label:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 4px 0 var(--line); }
.cbtfb-tile input:checked + label { border-color: var(--ink); border-width: 3px; padding: 13px 11px; box-shadow: 0 4px 0 var(--ink); }
.cbtfb-tile input:checked + label::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.cbtfb-tile input:focus-visible + label { outline: 3px solid var(--easier); outline-offset: 2px; }
.cbtfb-ico { width: 40px; height: 40px; color: var(--ink); flex: none; }
.cbtfb-tl { font-weight: 600; font-size: 17px; line-height: 1.25; }
.cbtfb-ts { font-size: 14px; color: var(--muted); line-height: 1.3; }
.cbtfb-hint { font-size: 15px; color: var(--muted); margin-top: 12px; }

/* Height */
.cbtfb-height { display: grid; grid-template-columns: 1fr; gap: 4px; }
.cbtfb-height .cbtfb-riderbox { order: -1; max-width: 170px; margin: -6px auto 0; }
@media (min-width: 640px) { .cbtfb-height { grid-template-columns: 1fr 190px; gap: 16px; align-items: end; } .cbtfb-height .cbtfb-riderbox { order: 1; max-width: none; margin: 0; } }
.cbtfb-big { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; margin: 0 0 6px; }
.cbtfb-big span { font-family: var(--font-body); font-size: 19px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.cbtfb-big--sm { font-size: 32px; }
.cbtfb-range { -webkit-appearance: none; appearance: none; width: 100%; height: 48px; background: transparent; cursor: pointer; margin: 0; }
.cbtfb-range::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: var(--ink); }
.cbtfb-range::-moz-range-track { height: 10px; border-radius: 99px; background: var(--ink); }
.cbtfb-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%; background: var(--hivis); border: 3px solid var(--ink); }
.cbtfb-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--hivis); border: 3px solid var(--ink); }
.cbtfb-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: -6px; }
.cbtfb-check { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 10px; }
.cbtfb-check input, .cbtfb-pick input { width: 24px; height: 24px; accent-color: var(--ink); margin: 0; }
.cbtfb-check label { font-weight: 600; cursor: pointer; }
.cbtfb-rider { width: 100%; height: auto; display: block; color: var(--muted); }

/* Nav */
.cbtfb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.cbtfb-nav .cbtfb-btn { min-width: 120px; }

/* Results */
.cbtfb-results-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 7vw, 40px); line-height: 1.05; margin: 4px 0 10px; color: var(--ink); }
.cbtfb-results-title:focus { outline: none; }
.cbtfb-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; }
.cbtfb-chips li { font-size: 14px; padding: 3px 10px; border-radius: 99px; background: var(--road); border: 1px solid var(--line); color: var(--ink); margin: 0; }
.cbtfb-learner { background: var(--road); border-left: 4px solid var(--ink); padding: 10px 12px; border-radius: 6px; font-size: 15px; }
.cbtfb-deckbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.cbtfb-count { font-weight: 600; color: var(--muted); }
.cbtfb-arrow { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.cbtfb-arrow:hover { background: var(--road); }
.cbtfb-deck {
	list-style: none; margin: 0 -16px; padding: 4px 16px 14px; display: grid; grid-auto-flow: column; grid-auto-columns: 86%;
	gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
@media (min-width: 640px) { .cbtfb-deck { grid-auto-columns: 46%; } }
.cbtfb-card {
	scroll-snap-align: start; margin: 0; padding: 0 14px 12px; border-radius: var(--radius); overflow: hidden;
	background: var(--surface); border: 2px solid var(--line); border-top: 8px solid var(--cbtfb-style);
	display: flex; flex-direction: column; min-width: 0;
	animation: cbtfb-deal .45s ease both;
}
.cbtfb-card:nth-child(2) { animation-delay: .07s; } .cbtfb-card:nth-child(3) { animation-delay: .14s; } .cbtfb-card:nth-child(4) { animation-delay: .21s; } .cbtfb-card:nth-child(5) { animation-delay: .28s; } .cbtfb-card:nth-child(6) { animation-delay: .35s; }
@keyframes cbtfb-deal { from { opacity: 0; transform: translateY(24px) rotate(-2deg); } to { opacity: 1; transform: none; } }
.cbtfb-card-top { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; }
.cbtfb-rank { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--ink); }
.cbtfb-style { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 10px; border-radius: 99px; background: var(--cbtfb-style); color: var(--ink); }
.cbtfb-pic { margin: 4px -14px; padding: 4px 14px 0; background: linear-gradient(180deg, var(--surface) 0 70%, var(--road) 70%); }
.cbtfb-bike { width: 100%; height: auto; display: block; }
.cbtfb-name { font-family: var(--font-body); font-size: 17px; font-weight: 400; line-height: 1.2; margin: 8px 0 8px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.cbtfb-name strong { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.cbtfb-match { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.cbtfb-mbar { flex: 1; height: 10px; border-radius: 99px; background: var(--road); border: 1px solid var(--line); overflow: hidden; }
.cbtfb-mbar span { display: block; height: 100%; background: var(--ink); border-radius: 99px; animation: cbtfb-grow .8s ease both .2s; transform-origin: left; }
@keyframes cbtfb-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cbtfb-badge { display: inline-block; align-self: flex-start; font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 6px; margin-bottom: 10px; border: 2px solid var(--ink); }
.cbtfb-badge--a1 { background: var(--surface); color: var(--ink); }
.cbtfb-badge--a1::before { content: "L"; display: inline-block; margin-right: 6px; padding: 0 5px; background: #fff; color: #D32F2F; border: 1px solid #D32F2F; font-weight: 700; border-radius: 2px; }
.cbtfb-badge--a2 { background: var(--ink); color: var(--surface); }
.cbtfb-badge--a2r { background: var(--surface); color: var(--ink); border-style: dashed; }
.cbtfb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.cbtfb-stats div { background: var(--road); border-radius: 6px; padding: 8px 10px; }
.cbtfb-stats dt { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cbtfb-stats dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.cbtfb-sub { display: block; font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted); }
.cbtfb-fit { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 600; margin-top: 2px; }
.cbtfb-fit::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.cbtfb-fit--flat { color: var(--easier); } .cbtfb-fit--flat::before { background: var(--easier); }
.cbtfb-fit--tiptoe { color: var(--neutral-data); } .cbtfb-fit--tiptoe::before { background: var(--neutral-data); border-radius: 2px; }
.cbtfb-fit--stretch { color: var(--harder); } .cbtfb-fit--stretch::before { background: var(--harder); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.cbtfb-why-h { font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.cbtfb-why { margin: 0 0 10px; padding-left: 20px; font-size: 15px; }
.cbtfb-why li { margin: 0 0 3px; }
.cbtfb-note { font-size: 14px; color: var(--muted); }
.cbtfb-src { font-size: 13px; color: var(--muted); margin-top: auto; margin-bottom: 4px; }
.cbtfb-src a { color: var(--muted); }
.cbtfb-pick { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); margin-top: 6px; }
.cbtfb-pick label { font-weight: 600; cursor: pointer; }

.cbtfb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.cbtfb-switch { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-right: auto; }
.cbtfb-switch input { -webkit-appearance: none; appearance: none; width: 52px; height: 30px; border-radius: 99px; background: var(--road); border: 2px solid var(--ink); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.cbtfb-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.cbtfb-switch input:checked { background: var(--ink); }
.cbtfb-switch input:checked::after { transform: translateX(22px); background: var(--surface); }
.cbtfb-switch label { font-weight: 600; cursor: pointer; }
.cbtfb-shared { flex-basis: 100%; font-size: 15px; color: var(--ink); word-break: break-all; }
.cbtfb-compare { background: var(--road); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; overflow-x: auto; }
.cbtfb-ctable, .cbtfb-table { width: 100%; border-collapse: collapse; font-size: 15px; color: var(--ink); background: transparent; margin: 0; }
.cbtfb-ctable caption { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 24px; padding-bottom: 6px; }
.cbtfb-ctable th, .cbtfb-ctable td, .cbtfb-table th, .cbtfb-table td { text-align: left; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; background: transparent; color: var(--ink); }
.cbtfb-ctable thead th { font-weight: 700; }

/* All bikes, sources, embed */
.cbtfb-all, .cbtfb-embed { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; margin: 18px 0 0; }
.cbtfb-all summary, .cbtfb-embed summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.cbtfb-all[open], .cbtfb-embed[open] { padding-bottom: 14px; }
.cbtfb-tablewrap { overflow-x: auto; }
.cbtfb-table { min-width: 560px; }
.cbtfb-table thead th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.cbtfb-cc, .cbtfb-wl { font-weight: 400; color: var(--muted); font-size: 13px; }
.cbtfb-foot { margin-top: 18px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.cbtfb-foot .cbtfb-check { font-weight: 600; color: var(--ink); display: block; min-height: 0; margin-top: 0; }
.cbtfb-foot .cbtfb-credit { font-size: 13px; }
.cbtfb-embed textarea { width: 100%; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; margin-bottom: 8px; }

@media (max-width: 480px) { .cbtfb { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) {
	.cbtfb *, .cbtfb *::before, .cbtfb *::after { animation: none !important; transition: none !important; }
}
