/* ══ Brakes tab (redesign) — .bt-* ══════════════════════════════════════════
   Axle home view + car-shaped measurement sheet for Consumables ▸ Brakes.   */

/* ── Scope bar ── */
.bt-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.bt-seg {
  display: inline-flex; background: #0f1318; border: 1px solid #2a3040;
  border-radius: 7px; padding: 2px; gap: 2px;
}
.bt-seg-btn {
  border: none; background: transparent; border-radius: 5px; padding: 6px 14px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #7a8a9b;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.bt-seg-btn:hover { color: #dce3ed; }
.bt-seg-btn.active { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.bt-seg-btn .material-symbols-outlined { font-size: 16px; }

.bt-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 13px 'Barlow', sans-serif; color: #dce3ed;
  background: #141820; border: 1px solid #2a3545; border-radius: 9px;
  padding: 8px 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.bt-btn:hover { background: #1a2030; }
.bt-btn.primary { background: var(--accent); border-color: var(--accent); color: #000; }
.bt-btn.primary:hover { filter: brightness(1.05); }
.bt-btn:disabled { opacity: 0.55; cursor: default; }
.bt-btn .material-symbols-outlined { font-size: 16px; }
.bt-linklike {
  background: none; border: none; padding: 0; color: var(--accent);
  font: inherit; cursor: pointer; text-decoration: underline;
}

/* ── Axle panels ── */
.bt-axles { display: flex; flex-direction: column; gap: 14px; }
.bt-axle { background: #101318; border: 1px solid #1f2530; border-radius: 12px; overflow: hidden; }
.bt-axle-head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid #1f2530;
  background: #141820; flex-wrap: wrap;
}
.bt-axle:has(.bt-axle-head:last-child) .bt-axle-head { border-bottom: none; }
.bt-axle-name {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; color: #dce3ed;
}
.bt-axle-meta { color: #7a8a9b; font-size: 12px; margin-left: auto; display: flex; gap: 12px; align-items: center; }
.bt-axle-meta b { color: #dce3ed; font-weight: 600; }

.bt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px 'Barlow', sans-serif; border-radius: 999px; padding: 3px 10px;
  background: #141820; border: 1px solid #2a3545; color: #dce3ed;
}
.bt-chip small { color: #7a8a9b; font-weight: 500; }
.bt-chip .material-symbols-outlined { font-size: 14px; }
.bt-chip.kit { border-color: rgba(var(--accent-rgb), 0.35); }
.bt-chip.kit .material-symbols-outlined { color: var(--accent); }
.bt-chip.warn { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
.bt-chip.bt-spare { color: #7a8a9b; border-style: dashed; }
.bt-chip.bt-spare .material-symbols-outlined { font-size: 13px; }
.bt-chip.bt-state { cursor: pointer; }
.bt-chip.bt-state.pending { color: #f59e0b; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.08); }
.bt-cnt { color: #7a8a9b; font-weight: 500; margin-left: 4px; }
.bt-kit-state { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; border: 1px solid; }
.bt-kit-state.pending { color: #f59e0b; border-color: rgba(245, 158, 11, 0.45); }
.bt-kit-state.ready { color: #22c55e; border-color: rgba(34, 197, 94, 0.45); }
/* Removable-bell "no bell mounted" flag — LIFE row + title-bar chip. */
.bt-bell-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.bt-bell-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.bt-bell-warn { display: inline-flex; align-items: center; gap: 4px; color: #ef4444; font-weight: 600; }
.bt-bell-warn .material-symbols-outlined { font-size: 15px; }
.bt-bell-chip { display: inline-flex; align-items: center; color: #ef4444; cursor: help; }
.bt-bell-chip .material-symbols-outlined { font-size: 17px; }
body.light-mode .bt-bell-warn, body.light-mode .bt-bell-chip { color: #dc2626; }

.bt-axle-body { display: grid; grid-template-columns: 1fr 1px 1fr; }
.bt-vline { background: #1f2530; }
.bt-corner { padding: 12px 16px; min-width: 0; }
.bt-corner-tag {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 8px;
}
.bt-corner-empty { color: #566274; font-size: 12.5px; padding: 4px 0; }

.bt-mrow {
  display: grid; grid-template-columns: 16px minmax(84px, auto) 78px 1fr;
  align-items: center; gap: 10px; padding: 5px 6px; margin: 0 -6px;
  border-radius: 8px; cursor: pointer;
}
.bt-mrow:hover, .bt-mrow:focus-visible { background: #161b23; outline: none; }
.bt-glyph { color: #7a8a9b; display: inline-flex; }
.bt-gdisc {
  width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%;
  position: relative; display: inline-block;
}
.bt-gdisc::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.bt-gpad { width: 13px; height: 9px; border: 2px solid currentColor; border-radius: 3px; display: inline-block; }
.bt-pname { font-size: 13px; color: #dce3ed; white-space: nowrap; }
.bt-pname small { display: block; color: #7a8a9b; font-size: 11px; }
.bt-val {
  font: 600 15px 'Barlow', sans-serif; font-variant-numeric: tabular-nums;
  text-align: right; color: #dce3ed; white-space: nowrap;
}
.bt-val small { font-size: 11px; color: #7a8a9b; font-weight: 500; margin-left: 2px; }
.bt-val.warn { color: #ef4444; }
.bt-val.low { color: #f59e0b; }

.bt-bar-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bt-wbar { position: relative; height: 6px; border-radius: 4px; background: #1a1f28; overflow: hidden; flex: 1; }
.bt-wbar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.bt-min { font-size: 10.5px; color: #7a8a9b; white-space: nowrap; }

.bt-axle-foot {
  padding: 8px 16px; border-top: 1px solid #1f2530; color: #7a8a9b;
  font-size: 12px; display: flex; gap: 18px; flex-wrap: wrap;
}
.bt-axle-foot b { color: #dce3ed; font-weight: 600; }

/* ── Empty / loading ── */
.bt-loading { color: #7a8a9b; font-size: 13px; padding: 24px 4px; }
.bt-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 20px; text-align: center;
  background: #101318; border: 1px dashed #2a3545; border-radius: 12px;
}
.bt-empty .material-symbols-outlined { font-size: 40px; color: #566274; }
.bt-empty-title { font-size: 15px; font-weight: 600; color: #dce3ed; }
.bt-empty-sub { color: #7a8a9b; font-size: 13px; max-width: 420px; }
.bt-empty .bt-btn { margin-top: 8px; }

/* ── Measurement sheet ── */
.bt-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(4, 6, 9, 0.72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; overflow-y: auto;
}
.bt-sheet {
  background: #101318; border: 1px solid #2a3545; border-radius: 14px;
  width: 780px; max-width: 100%; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.bt-sheet-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-bottom: 1px solid #1f2530; background: #141820;
}
.bt-sheet-head h4 { font-size: 15px; font-weight: 600; color: #dce3ed; margin: 0; }
.bt-sheet-order { color: #7a8a9b; font-size: 12px; }
/* mm ⟷ % switch for the disc rows (BrakeSettings.disc_wear_mode default). Sits
   right of the sheet subtitle; .bt-x keeps its margin-left:auto so this never
   pushes the close button off. */
.bt-dmode {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 4px;
  padding: 2px; border: 1px solid #262d3a; border-radius: 8px; background: #10141b;
}
.bt-dmode-lbl {
  color: #7a8a9b; font-size: 10px; letter-spacing: .6px; text-transform: uppercase;
  padding: 0 6px 0 4px;
}
.bt-dmode-btn {
  background: none; border: none; cursor: pointer; color: #8a9ab0;
  font: 600 12px 'Barlow', sans-serif; padding: 3px 10px; border-radius: 6px;
}
.bt-dmode-btn:hover { color: #dce3ed; background: #1a212c; }
/* Same "selected segment" language as the stock board's .bsc-seg controls. */
.bt-dmode-btn.on { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
body.light-mode .bt-dmode { background: #fff; border-color: #e6eaf2; }
body.light-mode .bt-dmode-btn { color: #55637a; }
body.light-mode .bt-dmode-btn.on { background: rgba(90, 122, 0, 0.12); color: #4a6600; }
.bt-x {
  margin-left: auto; background: none; border: none; color: #7a8a9b;
  cursor: pointer; display: inline-flex; padding: 4px; border-radius: 7px;
}
.bt-x:hover { color: #dce3ed; background: #1a2030; }
.bt-x .material-symbols-outlined { font-size: 18px; }

.bt-qfront {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 0 2px; color: #7a8a9b;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.bt-qfront .material-symbols-outlined { font-size: 14px; }
.bt-qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 16px 6px; }
.bt-qcell { background: #090b0e; border: 1px solid #2a3545; border-radius: 10px; padding: 10px 12px; }
.bt-qcell[data-corner="FL"] { border-radius: 16px 10px 10px 10px; }
.bt-qcell[data-corner="FR"] { border-radius: 10px 16px 10px 10px; }
.bt-qcell[data-corner="RL"] { border-radius: 10px 10px 10px 16px; }
.bt-qcell[data-corner="RR"] { border-radius: 10px 10px 16px 10px; }
.bt-qname {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b;
  padding-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.bt-qdone { color: #22c55e; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0; text-transform: none; }
.bt-qdone.bad { color: #ef4444; }
.bt-qrow { display: grid; grid-template-columns: 1fr 84px 52px; align-items: center; gap: 8px; padding: 4px 0; }
.bt-qpn { font-size: 12.5px; color: #dce3ed; }
.bt-qpn small { color: #7a8a9b; font-size: 11px; display: block; }

.bt-inp {
  font: 600 15px 'Barlow', sans-serif; font-variant-numeric: tabular-nums;
  color: #dce3ed; background: #090b0e; border: 1px solid #2a3545;
  border-radius: 9px; padding: 6px 8px; width: 100%; text-align: right;
}
.bt-inp::placeholder { color: #3d4756; font-weight: 500; }
.bt-inp:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18); }
.bt-inp.bad { border-color: #ef4444; color: #ef4444; }
.bt-qcell .bt-inp { background: #101318; }
/* Hide number spinners — values are typed from calipers */
.bt-inp::-webkit-outer-spin-button, .bt-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bt-inp[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.bt-delta { font: 600 11.5px 'Barlow', sans-serif; font-variant-numeric: tabular-nums; color: #7a8a9b; }
.bt-delta.neg { color: #f59e0b; }
.bt-delta.bad { color: #ef4444; }

.bt-sheet-meta {
  display: flex; gap: 14px; padding: 8px 16px 14px; flex-wrap: wrap; align-items: flex-end;
}
.bt-sheet-meta label {
  display: flex; flex-direction: column; gap: 4px;
  color: #7a8a9b; font-size: 11.5px;
}
.bt-inp-meta { text-align: left; font-size: 13px; font-weight: 500; width: 150px; }
.bt-meta-note { flex: 1; min-width: 180px; }
.bt-meta-note .bt-inp-meta { width: 100%; }

.bt-sheet-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-top: 1px solid #1f2530; background: #141820;
}
.bt-sheet-stat { color: #7a8a9b; font-size: 12.5px; margin-right: auto; }

/* Set-scoped sheet: a flat list, narrower than the car grid */
.bt-sheet-set { width: 480px; }
.bt-qset { padding: 12px 18px 4px; display: flex; flex-direction: column; gap: 2px; }
.bt-qset .bt-qrow { grid-template-columns: 1fr 96px 60px; }

/* ── Swap-a-pad picker (single position, from stock) ── */
.bt-swap-gname { font: 700 11px 'Barlow Condensed', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; padding: 10px 0 6px; }
.bt-swap-pos { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-swap-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 9px; padding: 9px 11px; color: #dce3ed; font: 600 13px 'Barlow', sans-serif; cursor: pointer; }
.bt-swap-row:hover { background: #141820; border-color: #2a3545; }
.bt-swap-sub { color: #7a8a9b; font-weight: 500; font-size: 12px; }
.bt-swap-empty { color: #7a8a9b; font-size: 12.5px; padding: 12px 4px; }
body.light-mode .bt-swap-row { color: #1a2030; }
body.light-mode .bt-swap-row:hover { background: #f0f3f8; border-color: #dde2ec; }

/* ── Responsive (app mobile breakpoint) ── */
@media (max-width: 900px) {
  .bt-axle-body { grid-template-columns: 1fr; }
  .bt-vline { height: 1px; width: 100%; }
  .bt-qgrid { grid-template-columns: 1fr; }
  /* Stacked quadrants follow the Enter walk order (FL → FR → RR → RL), not the
     2×2 DOM order — the phone in your hand matches the corner you're at. */
  .bt-qcell[data-corner="FL"] { order: 1; }
  .bt-qcell[data-corner="FR"] { order: 2; }
  .bt-qcell[data-corner="RR"] { order: 3; }
  .bt-qcell[data-corner="RL"] { order: 4; }
  .bt-sheet-backdrop { padding: 0; align-items: stretch; }
  .bt-sheet { border-radius: 0; width: 100%; min-height: 100%; border: none; }
  .bt-mrow { grid-template-columns: 16px minmax(72px, auto) 70px 1fr; }
}

/* ── Per-axle icon buttons (in axle head meta) ── */
.bt-icon-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: #7a8a9b; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.bt-icon-btn:hover { background: #1a2030; color: #dce3ed; }
.bt-icon-btn .material-symbols-outlined { font-size: 17px; }

/* ══ Detail drawer ══ */
.bt-drawer-backdrop {
  position: fixed; inset: 0; z-index: 1320;
  background: rgba(4, 6, 9, 0.72);
  display: flex; justify-content: flex-end;
}
.bt-drawer {
  background: #101318; border-left: 1px solid #2a3545;
  width: 460px; max-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.55);
  animation: bt-drawer-in 0.18s ease;
}
@keyframes bt-drawer-in { from { transform: translateX(20px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.bt-dr-head {
  position: relative;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid #1f2530; background: #141820; flex-shrink: 0;
}
/* Compound colour as a left accent on the title bar (redesign #6). */
.bt-dr-head::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cc, var(--accent));
}
/* Typed disc / pad glyph, tinted by the compound colour. */
.bt-dr-typeglyph {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--cc, var(--accent)) 16%, transparent);
  color: var(--cc, var(--accent));
}
.bt-tg-ico {
  width: 18px; height: 18px; display: block; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* Icon action cluster, right side of the title bar. */
.bt-dr-actions { display: flex; align-items: center; gap: 1px; flex-shrink: 0; margin-left: auto; }
.bt-dr-div { width: 1px; height: 18px; background: #29313b; margin: 0 3px; flex-shrink: 0; }
.bt-icon-btn.danger { color: #ef4444; }
.bt-icon-btn.danger:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
body.light-mode .bt-dr-div { background: #dde2ec; }
/* Title + subtitle share one line when the labels are short, and the subtitle
   drops to its own line (still ellipsised) when they aren't. */
.bt-dr-titles { min-width: 0; flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 9px; }
.bt-dr-titles h4 { font-size: 15px; font-weight: 600; color: #dce3ed; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-dr-sub { flex: 1 1 auto; min-width: 0; color: #7a8a9b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-dr-body { overflow-y: auto; padding: 4px 0 8px; flex: 1; }
.bt-dr-group { padding: 12px 16px; }
.bt-dr-group + .bt-dr-group { border-top: 1px solid #1f2530; }
.bt-dr-gname {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7a8a9b; margin-bottom: 8px;
}
.bt-dr-hero { padding: 2px 0; }
.bt-dr-val { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; color: #dce3ed; }
.bt-dr-val small { font-size: 14px; color: #7a8a9b; margin-left: 4px; font-weight: 500; }
.bt-dr-meta { color: #7a8a9b; font-size: 12.5px; margin: 4px 0 8px; }
.bt-dr-proj { color: #7a8a9b; font-size: 12px; margin-top: 7px; }
.bt-dr-proj b { color: #dce3ed; }
.bt-dr-note { color: #7a8a9b; font-size: 11px; margin-top: 4px; }
.bt-trend { padding: 2px 0 4px; }

/* pad-set tiles */
.bt-pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
/* Disc sets have two sides (L/R) — two wider tiles rather than four. */
.bt-pgrid.bt-pgrid-2 { grid-template-columns: repeat(2, 1fr); }
.bt-ptile { background: #090b0e; border: 1px solid #1f2530; border-radius: 10px; padding: 8px 10px; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.bt-ptile:hover { border-color: #2f3a4a; }
.bt-ptile.worst { border-color: rgba(245, 158, 11, 0.45); }
/* Focused via ←/→ or a click — the pad the hero + trend are zoomed into. */
.bt-ptile.focused { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bt-ptile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bt-pl { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 10.5px; color: #7a8a9b; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 4px; white-space: nowrap; }
.bt-pv { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: #dce3ed; }
.bt-pv small { font-size: 10.5px; color: #7a8a9b; font-weight: 500; }
.bt-ptile .bt-wbar { margin-top: 7px; }

/* measurement rows */
.bt-meas-row { display: grid; grid-template-columns: 46px 1fr auto auto 20px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; color: #dce3ed; }
.bt-meas-row .bt-md { color: #7a8a9b; }
.bt-meas-row .bt-mv { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.bt-meas-row .bt-mdel { color: #7a8a9b; font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; min-width: 40px; }
.bt-meas-row .bt-mdel.neg { color: #f59e0b; }
.bt-warnclr { color: #f59e0b; }

/* pad-set measurement log — one row per walk-around, one column per position */
.bt-pmeas-head, .bt-pmeas-row {
  display: grid; grid-template-columns: 46px 1fr repeat(var(--bt-pmeas-cols, 4), 42px) 18px;
  gap: 6px; align-items: center; padding: 4px 0; font-size: 12.5px; color: #dce3ed;
}
.bt-pmeas-head {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 10px;
  letter-spacing: 0.5px; text-transform: uppercase; color: #566274; padding-bottom: 1px;
}
.bt-pmeas-head span { text-align: right; }
.bt-pmeas-row .bt-md { color: #7a8a9b; }
.bt-pmeas-row .bt-mv { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; }
.bt-pmeas-row .bt-mv-low  { color: #f59e0b; }
.bt-pmeas-row .bt-mv-bad  { color: #ef4444; }
.bt-pmeas-row .bt-mv-none { color: #3d4756; font-weight: 500; }

/* life rows */
.bt-life-row { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; font-size: 12.5px; color: #7a8a9b; }
.bt-life-row b { color: #dce3ed; font-weight: 600; }
.bt-lk { width: 86px; flex-shrink: 0; font-size: 11px; color: #566274; text-transform: uppercase; letter-spacing: 0.5px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }

/* per-row measurement delete — stays quiet until the row is hovered */
.bt-meas-del {
  background: none; border: none; padding: 0; cursor: pointer; color: #3d4756;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.bt-meas-del .material-symbols-outlined { font-size: 15px; }
.bt-meas-del:hover, .bt-meas-del:focus-visible { color: #ef4444; }
.bt-meas-row:hover .bt-meas-del, .bt-pmeas-row:hover .bt-meas-del { color: #566274; }
.bt-meas-row:hover .bt-meas-del:hover, .bt-pmeas-row:hover .bt-meas-del:hover { color: #ef4444; }

/* QR — collapsed by default so the drawer leads with wear, not logistics */
.bt-qr-det > summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  list-style: none; margin-bottom: 0;
}
.bt-qr-det > summary::-webkit-details-marker { display: none; }
.bt-qr-det > summary::after {
  content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s ease;
}
.bt-qr-det[open] > summary { margin-bottom: 10px; }
.bt-qr-det[open] > summary::after { transform: rotate(-135deg); }
.bt-qr-row { display: flex; gap: 14px; align-items: center; }
.bt-qr { border-radius: 6px; flex-shrink: 0; }
.bt-qr-meta { color: #7a8a9b; font-size: 12px; }

.bt-dr-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid #1f2530; background: #141820; flex-shrink: 0;
}
.bt-btn.danger { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.bt-btn.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* ══ History scope ══
   Timeline on the left, insight rail on the right. The rail is fixed-width so
   the bars stay comparable between cards; the timeline takes the rest. */
.bt-hist-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }

.bt-tl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bt-tl-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 2px; }
.bt-tl-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: #4a5a6b;
}
.bt-tl-filters { display: flex; gap: 8px; margin-left: auto; }
.bt-tl-select {
  background: #101318; border: 1px solid #1f2530; border-radius: 7px; color: #9fb0c3;
  font: 500 11px 'Barlow', sans-serif; padding: 4px 8px; cursor: pointer; max-width: 150px;
}
.bt-tl-select:focus { outline: none; border-color: #2f3a4a; color: #dce3ed; }

.bt-tl-item { display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: start; }
.bt-tl-item.clickable .bt-tl-card { cursor: pointer; }
.bt-tl-item.clickable:hover .bt-tl-card { background: #161b23; border-color: #2a3240; }
.bt-tl-date {
  justify-self: start; margin-top: 12px; padding: 2px 8px; border-radius: 6px;
  background: #161b23; border: 1px solid #1f2530; color: #9fb0c3;
  font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bt-tl-card {
  background: #101318; border: 1px solid #1f2530; border-radius: 10px;
  padding: 10px 14px; min-width: 0;
}
.bt-tl-title { font-size: 14px; font-weight: 600; color: #dce3ed; }
.bt-tl-title small { color: #7a8a9b; font-weight: 500; }
.bt-tl-sub { margin-top: 2px; font-size: 12px; color: #7a8a9b; line-height: 1.6; }
.bt-tl-sub i { margin: 0 6px; font-style: normal; color: #3a4553; }
.bt-tl-bit.warn { color: #f59e0b; }
.bt-tl-empty {
  background: #101318; border: 1px dashed #1f2530; border-radius: 10px;
  padding: 22px; text-align: center; color: #7a8a9b; font-size: 13px;
}

.bt-insights { display: flex; flex-direction: column; gap: 12px; }
.bt-ins { background: #101318; border: 1px solid #1f2530; border-radius: 12px; padding: 12px 14px 14px; }
.bt-ins-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.bt-ins-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: #dce3ed;
}
.bt-ins-unit { margin-left: auto; font-size: 10px; color: #4a5a6b; text-align: right; }
.bt-ins-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; padding: 4px 0; }
.bt-ins-row.cost { grid-template-columns: 8px 1fr auto auto; gap: 8px; }
.bt-ins-dot { width: 8px; height: 8px; border-radius: 50%; }
.bt-ins-name { font-size: 12px; color: #dce3ed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-ins-note { font-size: 11px; color: #7a8a9b; white-space: nowrap; }
.bt-ins-bar { height: 6px; border-radius: 3px; background: #1b212b; overflow: hidden; }
.bt-ins-bar i { display: block; height: 100%; border-radius: 3px; }
.bt-ins-val {
  font: 600 13px 'Barlow', sans-serif; font-variant-numeric: tabular-nums;
  color: #dce3ed; white-space: nowrap; min-width: 46px; text-align: right;
}
.bt-ins-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid #1a1f28; font-size: 10px; color: #4a5a6b; line-height: 1.5; }
.bt-ins-empty { font-size: 12px; color: #7a8a9b; line-height: 1.6; }

@media (max-width: 1100px) {
  .bt-hist-wrap { grid-template-columns: 1fr; }
  .bt-insights { flex-direction: row; flex-wrap: wrap; }
  .bt-ins { flex: 1 1 280px; }
}

@media (max-width: 900px) {
  .bt-drawer { width: 100%; border-left: none; }
  .bt-pgrid { grid-template-columns: repeat(2, 1fr); }
  .bt-tl-head { flex-wrap: wrap; }
  .bt-tl-filters { margin-left: 0; width: 100%; }
  .bt-tl-select { flex: 1; max-width: none; }
  .bt-tl-item { grid-template-columns: 52px 1fr; gap: 8px; }
}

/* ── Light mode ── */
body.light-mode .bt-seg { background: #f0f3f8; border-color: #dde2ec; }
body.light-mode .bt-seg-btn { color: #8899aa; }
body.light-mode .bt-seg-btn:hover { color: #1a2030; }
body.light-mode .bt-seg-btn.active { background: rgba(90, 122, 0, 0.12); color: #5a7a00; }
body.light-mode .bt-btn { background: #fff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .bt-btn:hover { background: #f0f3f8; }
body.light-mode .bt-btn.primary { background: var(--accent); border-color: var(--accent); color: #000; }
body.light-mode .bt-axle, body.light-mode .bt-empty { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-axle-head, body.light-mode .bt-axle-foot { background: #f7f9fc; border-color: #e6eaf2; }
body.light-mode .bt-axle-name, body.light-mode .bt-pname, body.light-mode .bt-val,
body.light-mode .bt-empty-title, body.light-mode .bt-sheet-head h4, body.light-mode .bt-qpn { color: #1a2030; }
body.light-mode .bt-vline { background: #e6eaf2; }
body.light-mode .bt-mrow:hover, body.light-mode .bt-mrow:focus-visible { background: #f0f3f8; }
body.light-mode .bt-wbar { background: #e6eaf2; }
body.light-mode .bt-chip { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .bt-sheet { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-sheet-head, body.light-mode .bt-sheet-foot { background: #f7f9fc; border-color: #e6eaf2; }
body.light-mode .bt-qcell { background: #f7f9fc; border-color: #dde2ec; }
body.light-mode .bt-inp, body.light-mode .bt-qcell .bt-inp { background: #fff; border-color: #dde2ec; color: #1a2030; }
body.light-mode .bt-inp::placeholder { color: #b9c2d0; }
body.light-mode .bt-icon-btn { color: #8899aa; }
body.light-mode .bt-icon-btn:hover { background: #f0f3f8; color: #1a2030; }
body.light-mode .bt-drawer { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-dr-head, body.light-mode .bt-dr-foot { background: #f7f9fc; border-color: #e6eaf2; }
body.light-mode .bt-dr-titles h4, body.light-mode .bt-dr-val, body.light-mode .bt-pv,
body.light-mode .bt-meas-row, body.light-mode .bt-pmeas-row, body.light-mode .bt-life-row b,
body.light-mode .bt-hname, body.light-mode .bt-hval { color: #1a2030; }
/* History: timeline + insight rail */
body.light-mode .bt-tl-card, body.light-mode .bt-ins { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-tl-item.clickable:hover .bt-tl-card { background: #f7f9fc; border-color: #c9d3e2; }
body.light-mode .bt-tl-date { background: #f0f3f8; border-color: #dde2ec; color: #6a7a8b; }
body.light-mode .bt-tl-select { background: #fff; border-color: #dde2ec; color: #6a7a8b; }
body.light-mode .bt-tl-empty { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-tl-title, body.light-mode .bt-ins-title,
body.light-mode .bt-ins-name, body.light-mode .bt-ins-val { color: #1a2030; }
body.light-mode .bt-tl-sub i { background: none; color: #c3cad6; }
body.light-mode .bt-ins-bar { background: #e6eaf2; }
body.light-mode .bt-ins-foot { border-color: #e6eaf2; }
body.light-mode .bt-pmeas-row .bt-mv-none { color: #b9c2d0; }
body.light-mode .bt-meas-del { color: #c3cad6; }
body.light-mode .bt-meas-row:hover .bt-meas-del, body.light-mode .bt-pmeas-row:hover .bt-meas-del { color: #8a95a6; }
body.light-mode .bt-meas-del:hover, body.light-mode .bt-meas-row:hover .bt-meas-del:hover,
body.light-mode .bt-pmeas-row:hover .bt-meas-del:hover { color: #ef4444; }
body.light-mode .bt-dr-group + .bt-dr-group, body.light-mode .bt-dr-head, body.light-mode .bt-dr-foot { border-color: #e6eaf2; }
body.light-mode .bt-ptile { background: #f7f9fc; border-color: #dde2ec; }
body.light-mode .bt-ptile:hover { border-color: #c9d3e2; }
body.light-mode .bt-ptile.focused { border-color: var(--accent); }
body.light-mode .bt-hist { background: #fff; border-color: #dde2ec; }
body.light-mode .bt-hrow { border-color: #f0f3f8; }
body.light-mode .bt-hrow:hover { background: #f7f9fc; }

/* The mm/% switch riding on the disc drawer's headline — smaller than the
   sheet's, and pushed to the right edge so it never crowds the number. The
   headline becomes a baseline-aligned flex row only where the switch exists,
   so a pad hero keeps its original inline rendering. */
.bt-dr-val:has(.bt-dmode) { display: flex; align-items: baseline; gap: 4px; }
.bt-dr-val .bt-dmode { margin-left: auto; align-self: center; }
.bt-dr-val .bt-dmode-btn { font-size: 11px; padding: 2px 8px; }
