/* DQT Network Responsiveness Test — page styles.
   Builds on /css/styles.css (tokens, buttons, cards); everything here is
   page-scoped under .bb-*. Numeric readouts use tabular numerals. */

.bb-nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 12px 22px;
  background: rgba(7, 6, 4, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.bb-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 15px var(--font-head); color: var(--text); }
.bb-brand img { height: 30px; width: auto; }
.bb-nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.bb-pill {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 600; transition: 0.2s;
}
.bb-pill:hover { border-color: var(--accent); color: var(--accent); }

.bb-wrap { max-width: 1060px; margin: 0 auto; padding: 40px 22px 70px; }
.bb-hero { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.bb-hero h1 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: -0.5px; margin: 10px 0 12px; }
.bb-hero .kicker { display: inline-block; }
.bb-hero p { color: var(--muted); font-size: 15.5px; line-height: 1.7; }

.bb-num { font-variant-numeric: tabular-nums; font-family: var(--font-head); }
.bb-mono { font-family: Consolas, "Cascadia Mono", monospace; font-variant-numeric: tabular-nums; }

/* pre-test facts row */
.bb-facts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 6px; }
.bb-fact {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  background: var(--surface);
}
.bb-fact svg { width: 14px; height: 14px; flex: none; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; }

/* mode picker */
.bb-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 22px auto 0; }
.bb-mode { position: relative; cursor: pointer; }
.bb-mode input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bb-mode > div {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  background: var(--surface); transition: 0.2s; height: 100%;
}
.bb-mode b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.bb-mode span { color: var(--faint); font-size: 12.5px; line-height: 1.5; display: block; }
.bb-mode:hover > div { border-color: rgba(227, 179, 65, 0.45); }
.bb-mode input:checked + div { border-color: var(--accent); background: rgba(227, 179, 65, 0.06); box-shadow: 0 0 0 1px var(--accent); }
.bb-mode input:focus-visible + div { outline: 2px solid var(--accent); outline-offset: 2px; }

.bb-server { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 16px; }
.bb-server b { color: var(--muted); font-weight: 600; }
.bb-server .bb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-inline-end: 5px; vertical-align: 1px; }
.bb-server .bb-dot.err { background: var(--danger); }

.bb-start { text-align: center; margin-top: 22px; }
.bb-start .btn { min-width: 230px; }
.bb-how { display: block; margin-top: 12px; color: var(--faint); font-size: 13px; text-decoration: underline; }
.bb-how:hover { color: var(--accent); }
.bb-tips { max-width: 560px; margin: 26px auto 0; color: var(--faint); font-size: 13px; line-height: 1.8; text-align: center; }
.bb-warn {
  max-width: 560px; margin: 16px auto 0; padding: 10px 16px; border-radius: 12px;
  border: 1px solid rgba(227, 179, 65, 0.4); background: rgba(227, 179, 65, 0.07);
  color: var(--accent); font-size: 13px; text-align: center;
}

/* live test panel */
.bb-live { max-width: 760px; margin: 0 auto; }
.bb-phase { text-align: center; margin-bottom: 18px; }
.bb-phase-label { font: 700 17px var(--font-head); color: var(--text); }
.bb-phase-sub { color: var(--faint); font-size: 13px; margin-top: 4px; }
.bb-progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 16px 0 22px; }
.bb-progress i { display: block; height: 100%; width: 0; background: var(--accent-grad); border-radius: 4px; transition: width 0.3s linear; }
.bb-live-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.bb-live-stat {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; text-align: center; display: grid; gap: 2px;
}
.bb-live-stat span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.bb-live-stat b { font-size: 21px; color: var(--accent); }
.bb-cancel { text-align: center; margin-top: 18px; }

/* chart */
.bb-chart-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); padding: 14px 16px; }
.bb-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.bb-chart-head h3, .bb-chart-head h4 { font-size: 14px; }
.bb-chart-head span { color: var(--faint); font-size: 12px; }
.bb-chart-wrap { direction: ltr; }
.bb-chart { width: 100%; height: 190px; display: block; }
.bb-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; direction: ltr; }
.bb-legend span { color: var(--faint); font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; }
.bb-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* results */
.bb-results { display: grid; gap: 18px; }
.bb-grade-card { text-align: center; padding: 34px 24px; }
.bb-grade {
  width: 108px; height: 108px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center;
  font: 800 44px var(--font-head); color: var(--on-gold);
  background: var(--accent-grad); box-shadow: 0 10px 40px rgba(227, 179, 65, 0.3);
}
.bb-grade.warn { background: linear-gradient(135deg, #ffd75e, #ef7d44); }
.bb-grade.bad { background: linear-gradient(135deg, #ef7d44, #d64545); color: #fff; }
.bb-grade.na { background: var(--surface-2); color: var(--muted); box-shadow: none; border: 1px solid var(--border); }
.bb-grade-status { font: 700 20px var(--font-head); margin-bottom: 6px; }
.bb-grade-diag { color: var(--muted); font-size: 14.5px; max-width: 560px; margin: 0 auto; }
.bb-reliability { margin-top: 12px; font-size: 12.5px; color: var(--faint); }
.bb-reliability.bad { color: var(--danger); }

.bb-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bb-metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bb-metric {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; text-align: center; display: grid; gap: 3px;
}
.bb-metric span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; }
.bb-metric b { font-size: 22px; color: var(--text); }
.bb-metric b em { font-style: normal; font-size: 13px; color: var(--faint); }
.bb-metric.hot b { color: var(--accent); }
.bb-metric .plus-ok { color: var(--success); }
.bb-metric .plus-warn { color: var(--accent); }
.bb-metric .plus-bad { color: var(--danger); }
.bb-toggle-row { display: flex; justify-content: center; margin-top: 10px; }
.bb-toggle {
  background: none; border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  color: var(--faint); font-size: 12px; padding: 5px 14px; transition: 0.2s;
}
.bb-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* readiness matrix */
.bb-ready { display: grid; gap: 8px; }
.bb-ready-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.bb-ready-row > span { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 13.5px; font-weight: 600; }
.bb-ready-row svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bb-ready-state { font-size: 12px; font-weight: 800; padding: 3px 11px; border-radius: 999px; letter-spacing: 0.4px; }
.bb-ready-state.s-exc { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.bb-ready-state.s-good { background: rgba(227, 179, 65, 0.14); color: var(--accent); }
.bb-ready-state.s-issue { background: rgba(239, 125, 68, 0.15); color: #ef9d6c; }
.bb-ready-state.s-bad { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.bb-ready-state.s-na { background: var(--surface); color: var(--faint); }

/* detailed stats */
.bb-details summary {
  cursor: pointer; list-style: none; color: var(--accent); font-size: 13.5px; font-weight: 600;
  padding: 4px 0; display: inline-flex; align-items: center; gap: 6px;
}
.bb-details summary::-webkit-details-marker { display: none; }
.bb-details summary::after { content: "▾"; font-size: 11px; transition: transform 0.25s; }
.bb-details[open] summary::after { transform: rotate(180deg); }
.bb-table-wrap { overflow-x: auto; margin-top: 12px; }
.bb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.bb-table th, .bb-table td { padding: 7px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.bb-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.bb-table td { color: var(--text); font-variant-numeric: tabular-nums; }
.bb-table td:first-child, .bb-table th:first-child { text-align: start; color: var(--muted); }

/* diagnosis + recommendations */
.bb-reco ol { margin: 10px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.bb-reco li { color: var(--muted); font-size: 14px; line-height: 1.6; }
.bb-reco li b { color: var(--text); }
.bb-disclaimer { margin-top: 14px; color: var(--faint); font-size: 12.5px; }

/* actions + CTA */
.bb-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bb-cta { text-align: center; padding: 30px 24px; }
.bb-cta h2 { font-size: 24px; margin-bottom: 10px; }
.bb-cta p { color: var(--muted); font-size: 14.5px; max-width: 560px; margin: 0 auto 18px; }

/* error panel */
.bb-error { text-align: center; padding: 34px 24px; }
.bb-error h2 { font-size: 21px; margin-bottom: 8px; color: var(--danger); }
.bb-error p { color: var(--muted); font-size: 14.5px; max-width: 520px; margin: 0 auto 18px; }

/* education section */
.bb-edu { max-width: 760px; margin: 60px auto 0; display: grid; gap: 26px; }
.bb-edu h2 { font-size: 22px; }
.bb-edu h3 { font-size: 16.5px; margin-bottom: 8px; }
.bb-edu p { color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.bb-edu p + p { margin-top: 10px; }
.bb-faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.bb-faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14.5px; list-style: none; }
.bb-faq summary::-webkit-details-marker { display: none; }
.bb-faq p { padding: 0 18px 14px; }

.bb-footer {
  border-top: 1px solid var(--border); margin-top: 70px; padding: 22px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--faint); font-size: 13px;
}
.bb-footer a { color: var(--muted); }
.bb-footer a:hover { color: var(--accent); }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .bb-modes { grid-template-columns: 1fr; }
  .bb-live-grid { grid-template-columns: 1fr 1fr; }
  .bb-grid-2 { grid-template-columns: 1fr; }
  .bb-metric-row { grid-template-columns: 1fr; }
  .bb-metric { display: flex; align-items: baseline; justify-content: space-between; text-align: start; }
  .bb-chart { height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .bb-progress i { transition: none; }
  .bb-details summary::after { transition: none; }
}
