/* Build tools (Build/build-tools.js) */
.bt-btn { height: 34px; padding: 0 14px; border: 1px solid #30353b; border-radius: 9px; background: #1f2226; color: #e3e8ee; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.bt-btn:hover { border-color: #4a525b; }
.bt-btn.primary { border-color: transparent; background: var(--lime, #2e8bff); color: #fff; }
.bt-btn:focus-visible { outline: 2px solid var(--lime, #2e8bff); outline-offset: 2px; }

/* modal */
.bt-modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0; border: 1px solid #30353b; border-radius: 16px; background: #16181b; color: #e3e8ee; box-shadow: 0 30px 80px #000c; }
.bt-modal::backdrop { background: #000a; backdrop-filter: blur(2px); }
.bt-modal[open] { display: flex; flex-direction: column; }
.bt-modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.bt-modal h2 { margin: 0; font-family: var(--teko, "Teko", sans-serif); font-size: 28px; font-weight: 600; line-height: 1; }
.bt-modal h3 { margin: 16px 0 6px; color: #8d97a3; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bt-x { width: 32px; height: 32px; border: 1px solid #30353b; border-radius: 8px; background: #1f2226; color: #c9d0d8; cursor: pointer; }
.bt-body { overflow: auto; padding: 0 18px 8px; }
.bt-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; }
.bt-foot:empty { display: none; }
.bt-small { color: #7f8995; font-size: 11.5px; }
.bt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bt-table th, .bt-table td { padding: 8px 6px; border-bottom: 1px solid #ffffff10; text-align: left; vertical-align: top; }
.bt-table thead th { color: #7f8995; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.bt-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bt-table td a { color: #8fc0ff; }
.bt-table tfoot td { border: 0; padding-top: 12px; font-weight: 800; font-size: 15px; }
.bt-table tr.bt-tbc td { color: #8d97a3; }
.bt-table tr.bt-bike td:first-child { font-weight: 800; }
.bt-notes { margin: 0; padding-left: 18px; color: #ffcf8a; font-size: 12.5px; line-height: 1.5; }

/* compare */
.bt-picks { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.bt-picks select { min-width: 0; height: 36px; padding: 0 8px; border: 1px solid #30353b; border-radius: 9px; background: #111316; color: #e3e8ee; font: inherit; font-size: 13px; }
.bt-vs { color: #7f8995; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.bt-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bt-thumbs figure { margin: 0; padding: 6px; border: 1px solid #ffffff10; border-radius: 10px; background: #111316; text-align: center; }
.bt-thumbs img { width: 100%; height: 120px; object-fit: contain; }
.bt-thumbs figcaption { color: #c9d0d8; font-size: 12px; font-weight: 800; }
.bt-cmp { margin-top: 10px; table-layout: fixed; }
.bt-cmp th { width: 26%; color: #8d97a3; font-size: 12px; font-weight: 700; }
.bt-cmp td.better { color: #7dffb0; font-weight: 800; }
.bt-cmp tr.diff td { color: #ffd27a; }
.bt-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bt-diff ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.55; }

/* range readout reuses .cx-weight */
.cx-range { margin-left: 6px; }

/* fit notes */
.bt-fit { position: absolute; z-index: 6; top: 20px; left: 24px; display: inline-flex; gap: 6px; align-items: center; height: 30px; padding: 0 12px; border: 1px solid #6b5420; border-radius: 99px; background: #2a2210e6; color: #ffd27a; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.bt-fit.bad { border-color: #7a2a2a; background: #2c1414e6; color: #ff9b9b; }
.bt-fit[hidden], .bt-fit-pop[hidden] { display: none; }
.bt-fit-pop { position: absolute; z-index: 7; top: 58px; left: 24px; width: min(380px, calc(100% - 48px)); max-height: 50%; overflow: auto; padding: 12px 14px; border: 1px solid #30353b; border-radius: 12px; background: #16181b; color: #e3e8ee; box-shadow: 0 20px 50px #000b; }
.bt-fit-pop h3 { margin: 0 0 8px; font-family: var(--teko, "Teko", sans-serif); font-size: 22px; font-weight: 600; }
.bt-fit-pop ul { margin: 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.45; }
.bt-fit-pop li { padding: 6px 0; border-top: 1px solid #ffffff10; }
.bt-fit-pop li.incompatible b { color: #ff9b9b; } .bt-fit-pop li.unverified b, .bt-fit-pop li.warn b { color: #ffd27a; } .bt-fit-pop li.need b { color: #8fc0ff; }

/* share extras */
.bt-share-extra { display: flex; gap: 8px; margin-top: 10px; }

/* settings */
.bt-settings { display: flex; gap: 8px; flex-wrap: wrap; }

/* photo mode: just the bike */
html.bt-photo .topbar, html.bt-photo .sidebar, html.bt-photo aside, html.bt-photo .stage-top, html.bt-photo .angle-count, html.bt-photo .stage-bottom, html.bt-photo .bt-fit, html.bt-photo .bt-fit-pop, html.bt-photo .sx-hud, html.bt-photo .m-bar, html.bt-photo .panel-toggle, html.bt-photo .toast { display: none !important; }
html.bt-photo .stage { position: fixed !important; inset: 0 !important; z-index: 50; width: 100vw !important; height: 100vh !important; height: 100dvh !important; margin: 0 !important; border-radius: 0 !important; }
.bt-photo-bar { position: fixed; z-index: 60; bottom: 22px; left: 50%; display: flex; gap: 8px; padding: 8px; border: 1px solid #30353b; border-radius: 14px; background: #16181bdd; backdrop-filter: blur(8px); transform: translateX(-50%); }
.bt-photo-bar[hidden] { display: none; }

/* tour */
.bt-tour-ring { position: fixed; z-index: 90; border: 2px solid var(--lime, #2e8bff); border-radius: 12px; box-shadow: 0 0 0 9999px #0009; pointer-events: none; transition: all .25s ease; }
.bt-tour-card { position: fixed; z-index: 91; padding: 14px 16px; border: 1px solid #30353b; border-radius: 14px; background: #16181b; color: #e3e8ee; box-shadow: 0 20px 50px #000c; transition: left .25s ease, top .25s ease; }
.bt-tour-card h3 { margin: 2px 0 6px; font-family: var(--teko, "Teko", sans-serif); font-size: 24px; font-weight: 600; line-height: 1; }
.bt-tour-card p { margin: 0; color: #b6bfca; font-size: 13px; line-height: 1.45; }
.bt-tour-card .bt-tour-step { color: #7f8995; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.bt-tour-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* light theme */
html[data-theme="light"] .bt-modal, html[data-theme="light"] .bt-fit-pop, html[data-theme="light"] .bt-tour-card, html[data-theme="light"] .bt-photo-bar { border-color: #d6dade; background: #fff; color: #16202c; }
html[data-theme="light"] .bt-btn:not(.primary), html[data-theme="light"] .bt-x, html[data-theme="light"] .bt-picks select { border-color: #d0d5db; background: #f6f7f9; color: #16202c; }
html[data-theme="light"] .bt-thumbs figure { background: #f6f7f9; }
html[data-theme="light"] .bt-table td a { color: #0b4fae; }
html[data-theme="light"] .bt-cmp td.better { color: #138a3d; }
html[data-theme="light"] .bt-cmp tr.diff td, html[data-theme="light"] .bt-notes { color: #9a5b00; }
html[data-theme="light"] .bt-tour-card p { color: #4a5360; }

/* print only the parts list */
@media print {
  html.bt-printing body > *:not(dialog.bt-parts) { display: none !important; }
  html.bt-printing dialog.bt-parts { position: static; width: 100%; max-height: none; border: 0; box-shadow: none; background: #fff; color: #000; }
  html.bt-printing .bt-x, html.bt-printing .bt-foot { display: none; }
  html.bt-printing .bt-table td a { color: #000; }
}

@media (max-width: 760px) {
  .bt-fit { top: auto; bottom: 110px; left: 12px; }
  .bt-fit-pop { top: auto; bottom: 146px; left: 12px; width: calc(100% - 24px); }
  .cx-range { margin-left: 0; }
  .bt-diff { grid-template-columns: 1fr; }
}
/* plain fit notes */
.bt-fit-pop .bt-note-h { margin: 10px 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8fc0ff; }
.bt-fit-pop .bt-note-h.incompatible { color: #ff9b9b; } .bt-fit-pop .bt-note-h.unverified { color: #ffd27a; } .bt-fit-pop .bt-note-h.tip { color: #8d97a3; }
.bt-fit-pop li { padding: 5px 0 5px 14px; position: relative; }
.bt-fit-pop li::before { content: "•"; position: absolute; left: 2px; color: #5b6570; }
.bt-fit-pop li.tip { color: #9aa4b0; font-size: 12px; }
html[data-theme="light"] .bt-fit-pop .bt-note-h { color: #0b4fae; }
.bt-fit-pop a.bt-note-link, .bt-notes a.bt-note-link { color: #8fc0ff; font-weight: 700; }
html[data-theme="light"] a.bt-note-link { color: #0b4fae; }
/* light theme: divider lines (the dark-theme ones are near-white) */
html[data-theme="light"] .bt-fit-pop li { border-top-color: #e3e6ea; }
html[data-theme="light"] .bt-fit-pop li::before { color: #9aa3ad; }
html[data-theme="light"] .bt-fit-pop .bt-note-h.unverified { color: #9a5b00; }
html[data-theme="light"] .bt-fit-pop .bt-note-h.incompatible { color: #b42020; }
html[data-theme="light"] .bt-fit-pop li.tip { color: #5a616b; }
html[data-theme="light"] .bt-table th, html[data-theme="light"] .bt-table td { border-bottom-color: #e3e6ea; }
html[data-theme="light"] .bt-thumbs figure { border-color: #e3e6ea; }
html[data-theme="light"] .bt-modal h3, html[data-theme="light"] .bt-table thead th, html[data-theme="light"] .bt-cmp th { color: #5a616b; }
