/* ============================================
   Interactive / animated infographics for blog articles
   Progressive enhancement: the article text carries the same facts; scripts add interaction.
   ============================================ */
.bt {
  margin: 38px 0; padding: 28px 28px 24px; border-radius: 20px; position: relative;
  border: 1px solid var(--glass-border);
  background: radial-gradient(70% 90% at 100% 0%, rgba(203,31,44,0.16), transparent 65%), #151515;
  box-shadow: 0 30px 60px -38px rgba(0,0,0,0.9);
}
.bt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.bt h3 { font-size: 1.28rem; margin: 0 0 6px; line-height: 1.25; color: #fff; }
.bt-pill { flex: none; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; color: var(--accent); border: 1px solid rgba(203,31,44,0.5); background: rgba(203,31,44,0.12); white-space: nowrap; }
.bt-sub { font-size: 0.92rem; color: var(--muted); margin: 0 0 20px; line-height: 1.6; }
.bt-note { font-size: 0.78rem; color: var(--muted); margin: 16px 0 0; line-height: 1.55; }
.bt-noscript { font-size: 0.85rem; color: var(--muted); }

/* Sliders */
.bt-ctl { display: grid; gap: 20px; margin-bottom: 22px; }
.bt-field label { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 0.86rem; font-weight: 600; color: #e2e2e2; margin-bottom: 8px; }
.bt-field output { font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 1.02rem; white-space: nowrap; }
.bt input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(255,255,255,0.14) var(--p, 50%)); outline: none; cursor: pointer; margin: 6px 0; }
.bt input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 0 0 5px rgba(203,31,44,0.2); cursor: grab; }
.bt input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 0 0 5px rgba(203,31,44,0.2); cursor: grab; }
.bt input[type="range"]:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,0.35); }
.bt-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* Bars */
.bt-rows { display: grid; gap: 14px; }
.bt-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 118px; gap: 14px; align-items: center; font-size: 0.86rem; color: #d6d6d6; }
.bt-row .lab b { display: block; color: #fff; font-weight: 600; }
.bt-row .lab em { display: block; font-style: normal; font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.bt-track { position: relative; height: 16px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.bt-fill { position: absolute; top: 0; bottom: 0; left: var(--l, 0%); width: var(--w, 0%); min-width: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); transition: left .5s var(--ease-out), width .5s var(--ease-out); transform-origin: left center; }
.bt-fill.grey { background: linear-gradient(90deg, #5c5c5c, #8a8a8a); }
.bt-fill.mute { background: linear-gradient(90deg, #4a4a4a, #6a6a6a); }
.bt-val { text-align: right; font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 0.86rem; }
.bt-val small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.bt.bt-anim .bt-fill.bt-onscroll { transform: scaleX(0); }
.bt.bt-anim.is-in .bt-fill.bt-onscroll { transform: scaleX(1); transition: transform 1s var(--ease-out), left .5s var(--ease-out), width .5s var(--ease-out); }
.bt-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.6); left: var(--x, 0%); transition: left .4s var(--ease-out); }
.bt-axis { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); margin: 8px 0 0 184px; padding-right: 132px; }

/* Output panels */
.bt-out { padding: 18px 20px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.bt-out.hl { border-color: rgba(203,31,44,0.5); background: rgba(203,31,44,0.1); }
.bt-out b.big { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.55rem; color: #fff; line-height: 1.15; }
.bt-out p { margin: 6px 0 0; font-size: 0.9rem; line-height: 1.6; color: #d2d2d2; }
.bt-out ul { margin: 10px 0 0; display: grid; gap: 6px; }
.bt-out li { font-size: 0.86rem; color: #d2d2d2; line-height: 1.5; padding-left: 16px; position: relative; }
.bt-out li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.bt-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bt-stack { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,0.07); margin: 6px 0 8px; }
.bt-stack i { display: block; height: 100%; width: var(--w, 0%); transition: width .5s var(--ease-out); }
.bt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.74rem; color: var(--muted); }
.bt-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c, var(--accent)); vertical-align: -1px; }

/* Meter (learning phase) */
.bt-meter { position: relative; height: 26px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; margin: 8px 0 6px; }
.bt-meter .fillm { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); border-radius: 999px; background: linear-gradient(90deg, #6a6a6a, var(--accent)); transition: width .5s var(--ease-out); }
.bt-meter .thr { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; left: var(--t, 50%); }
.bt-meter-lab { position: relative; height: 18px; font-size: 0.7rem; color: var(--muted); }
.bt-meter-lab span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* Decision tool */
.bt-q { border: 0; padding: 0; margin: 0 0 20px; }
.bt-q legend { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 10px; padding: 0; line-height: 1.4; }
.bt-q legend span { color: var(--accent); margin-right: 6px; }
.bt-opts { display: grid; gap: 8px; }
.bt-opt { position: relative; }
.bt-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bt-opt span { display: block; padding: 11px 14px 11px 40px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); font-size: 0.88rem; color: #dcdcdc; line-height: 1.4; position: relative; transition: border-color .2s, background .2s; }
.bt-opt span::before { content: ""; position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; margin-top: -8px; border-radius: 50%; border: 2px solid #777; }
.bt-opt input:checked + span { border-color: var(--accent); background: rgba(203,31,44,0.14); color: #fff; }
.bt-opt input:checked + span::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.bt-opt input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.bt-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 18px; }
.bt-progress i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); transition: width .4s var(--ease-out); }

/* Checklist */
.bt-checks { display: grid; gap: 10px; margin-bottom: 16px; }
.bt-check { position: relative; }
.bt-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bt-check span { display: block; padding: 12px 14px 12px 46px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); font-size: 0.9rem; color: #dcdcdc; line-height: 1.5; position: relative; transition: border-color .2s, background .2s; }
.bt-check span b { color: #fff; font-weight: 600; }
.bt-check span::before { content: ""; position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #777; }
.bt-check span::after { content: ""; position: absolute; left: 20px; top: 17px; width: 6px; height: 11px; border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg) scale(0); transition: transform .2s var(--ease-out); }
.bt-check input:checked + span { border-color: rgba(203,31,44,0.6); background: rgba(203,31,44,0.1); }
.bt-check input:checked + span::before { background: var(--accent); border-color: var(--accent); }
.bt-check input:checked + span::after { transform: rotate(45deg) scale(1); }
.bt-check input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.bt-score { font-size: 0.85rem; color: #dcdcdc; font-weight: 600; margin: 0 0 8px; }

/* Week loop (animated) */
.bt-loop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; }
.bt-steps { display: grid; gap: 10px; counter-reset: st; }
.bt-step { text-align: left; font: inherit; cursor: pointer; padding: 12px 14px 12px 50px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); color: #cfcfcf; font-size: 0.9rem; font-weight: 600; position: relative; transition: border-color .25s, background .25s, color .25s, transform .25s; counter-increment: st; overflow: hidden; }
.bt-step::before { content: counter(st); position: absolute; left: 12px; top: 50%; margin-top: -14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 800; background: rgba(255,255,255,0.1); color: #fff; }
.bt-step::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.bt-step.on { border-color: var(--accent); background: rgba(203,31,44,0.14); color: #fff; transform: translateX(4px); }
.bt-step.on::before { background: var(--accent); }
.bt-loop.playing .bt-step.on::after { width: 100%; transition: width 3.6s linear; }
.bt-panel { padding: 24px; border-radius: 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); min-height: 210px; }
.bt-panel h4 { font-size: 1.1rem; margin: 0 0 10px; color: #fff; font-family: var(--font-head); }
.bt-panel p { font-size: 0.95rem; line-height: 1.7; margin: 0; color: #d2d2d2; }
.bt-panel .fade { animation: btFade .45s var(--ease-out); }
@keyframes btFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tabs */
.bt-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.bt-tab { font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 9px 16px; border-radius: 999px; color: #d6d6d6; background: var(--glass-bg); border: 1px solid var(--glass-border); transition: background .2s, border-color .2s; }
.bt-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.bt-tabpanel[hidden] { display: none; }
.bt-tabpanel { animation: btFade .4s var(--ease-out); }

@media (max-width: 760px) {
  .bt { padding: 22px 18px 20px; }
  .bt-row { grid-template-columns: 1fr 100px; }
  .bt-row .bt-track { grid-column: 1 / -1; grid-row: 2; }
  .bt-axis { margin-left: 0; padding-right: 0; }
  .bt-two, .bt-loop { grid-template-columns: minmax(0, 1fr); }
  .bt-head { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-fill, .bt-stack i, .bt-meter .fillm, .bt-marker, .bt-progress i, .bt-step, .bt-check span::after { transition: none !important; }
  .bt.bt-anim .bt-fill.bt-onscroll { transform: none !important; }
  .bt-panel .fade, .bt-tabpanel { animation: none; }
  .bt-loop.playing .bt-step.on::after { transition: none; width: 100%; }
}
