/* bolt torque chart — on top of calc.css */
main.tq { max-width: 1380px; --pitch: var(--clamp); --thr: var(--x-6d4fb3, #6d4fb3); --head: var(--warn); }

/* ---------- controls ---------- */
.tq-ctl { padding: 0 16px 10px; display: grid; gap: 10px; }
.tq-tools { margin: 0 -16px; padding: 8px 12px 8px 16px; }   /* the stage-bar toolbar: hint left, Examples and undo/redo right */
.tq-tools .hint { font-size: 12.5px; color: var(--text-3); text-align: left; }
.tq-tbtns { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.tq-g { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tq-l { font-size: 12px; color: var(--text-3); }
.tq-fine { padding: 0; font-size: 12.5px; }
.tq-cond { align-items: flex-start; }
.tq-pre select { width: auto; max-width: 100%; min-width: 250px; }
.tq-mus { gap: 6px 22px; }
.tqf { display: flex; align-items: center; gap: 6px; padding: 0; }
.tqf > label { display: flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tqf > label i { font-style: normal; color: var(--text); font-weight: 500; }
.tqf > label i sub { font-size: .72em; vertical-align: -.25em; line-height: 0; }
.tqf > label span { color: var(--text-3); font-size: 12px; overflow: visible; }
.tqf em { font-style: normal; font-size: 12px; color: var(--text-3); }
.tqf em.tq-sc { margin-left: 6px; }
.tq-n input { padding: 5px 8px; text-align: right; }
.fpick-btn { margin-left: 4px; }
.tq-desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); max-width: 125ch; }
.tq-desc a { color: var(--text-2); }

/* ---------- the chart ---------- */
.tq-chart { padding: 14px 16px 12px; }
.tq-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.tq-chart-head .note { margin: 3px 0 0; }
.tq-chart-head .note b { color: var(--text); font-weight: 600; }
.tq-chart-head .note .p { color: var(--text-3); }
.tq-gpick { display: none; }
.tq-tablewrap { margin: 0 -4px; }
table.tqt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.tqt col.c-sz { width: 108px; }
.tqt thead th { position: sticky; top: var(--fb-top, 0px); z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line-2); padding: 8px 8px 6px; text-align: right; font-weight: 500; vertical-align: bottom; }
.tqt thead th b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.tqt thead th small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tqt thead th .tu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; font-size: 11px; }
.tqt thead th .tu i { font-style: normal; color: var(--text-2); }
.tqt thead th .tu i + i { color: var(--text-3); }
.tqt thead th.sz { text-align: left; }
.tqt th[scope=row] { position: sticky; left: 0; z-index: 1; background: inherit; text-align: left; font-weight: 600; padding: 0 8px; white-space: nowrap; }
.tqt th[scope=row] small { font-weight: 400; color: var(--text-3); font-size: 11px; margin-left: 6px; }
.tqt tbody tr { background: var(--surface); }
.tqt tbody tr:nth-child(even) { background: var(--surface-2); }
.tqt tbody tr.fine th[scope=row] span { font-weight: 500; color: var(--text-2); }
.tqt td { padding: 0 8px; height: 28px; border-left: 1px solid var(--fill-1); cursor: pointer; display: table-cell; }
.tqt td { text-align: right; }
.tqt td .t, .tqt td .p { display: inline-block; width: calc(50% - 4px); text-align: right; }
.tqt td .t { font-weight: 600; color: var(--text); }
.tqt td .p { color: var(--text-3); margin-left: 8px; }
.tqt td.ex .t, .tqt td.ex .p { color: var(--text-3); font-style: italic; font-weight: 400; }
.tqt td.na { color: var(--faint); text-align: center; cursor: default; }
/* cross-hair: row on hover, column via .hx */
.tqt tbody tr:hover th[scope=row], .tqt tbody tr:hover td { background: var(--steel-50); }
.tqt .hx { background: var(--steel-50); }
.tqt thead th.hx { background: var(--x-eef2fa, #eef2fa); }
.tqt tbody tr:hover td.hx { background: var(--moment-bg); }
.tqt td:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; }
.tqt td.sel { box-shadow: inset 0 0 0 2px var(--sel); background: var(--sel-bg); }
.tqt td.sel .t { color: var(--sel); }
.tq-foot { margin: 10px 0 0; line-height: 1.5; }
.ex-key { color: var(--text-3); font-style: italic; }

/* ---------- detail ---------- */
.tq-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; scroll-margin-top: 12px; }
.tq-dhead { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 12px 16px; flex-wrap: wrap; }
.tq-dtitle { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.tq-dtitle h2 { font-size: 16px; }
.tq-dsel { display: flex; gap: 8px; }
.tq-dsel select { width: auto; }
.tq-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tq-stats .stat .v { font-size: 17px; font-weight: 600; }
.tq-stats .stat.bad .v { color: var(--bad); }
.tq-dgrid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
#bolt { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
#tp { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.tq-bar { margin-top: 8px; }
.tq-sbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--fill-1); }
.tq-sbar i { display: block; height: 100%; transition: width .35s ease-out; }
.tq-sbar i + i { border-left: 2px solid var(--surface); }
.tq-sleg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tq-sleg > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 6px; align-items: baseline; }
.tq-sleg .b { grid-row: span 3; width: 19px; height: 19px; border: 1.4px solid; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; align-self: start; }
.tq-sleg b { font-size: 17px; font-weight: 600; }
.tq-sleg .nm { font-size: 12.5px; color: var(--text); }
.tq-sleg .v { font-size: 12px; color: var(--text-3); }
.tq-sum { margin: 12px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }

.tq-tpctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 6px; }
.tq-sel, .tq-in { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.tq-sel select { width: auto; max-width: 330px; }
.tq-in .num { width: 64px; }
.tq-in.tq-tgt .num { width: 112px; }
.tq-in input { padding-top: 5px; padding-bottom: 5px; padding-left: 8px; }
.tq-mnote { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.tq-mnote a { color: var(--text-2); }
.tq-rev { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.tq-rev p { margin: 4px 0; }
.tq-rev b { color: var(--text); font-weight: 600; }
.tq-rev .ok { color: var(--good); }
.tq-rev .bad, .tq-wi-lead .bad { color: var(--bad); }
.tq-rev .warn { color: var(--warn); }

.tq-wi-lead { margin: 0 0 10px; font-size: 14px; line-height: 1.55; max-width: 100ch; }
.tq-wi tbody tr { cursor: default; }
.tq-wi tr.cur td { background: var(--bg); }
.tq-wi td small { font-size: 11.5px; }
.tq-wi .ms { min-width: 0; white-space: nowrap; }                       /* 'yields the bolt' stays on one line */
.tq-src li { scroll-margin-top: 80px; }
.tq-src li:target { background: var(--warn-bg); }
.sec-tag { font-style: normal; font-size: 11px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.step .where { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }

@media (max-width: 1100px) {
  .tq-dgrid { grid-template-columns: minmax(0, 1fr); }
  #tp { max-width: 700px; margin: 0 auto; }
  #bolt { max-width: 400px; }
  .tq-stats .stat { padding: 12px 14px; }
}
@media (max-width: 900px) {
  .tqt col.c-sz { width: 92px; }
  .tqt td { padding: 0 5px; }
  .tqt td .p { margin-left: 4px; }
}
/* phones: one grade at a time, picked above the table */
@media (max-width: 760px) {
  .tq-chart-head { flex-direction: column; }
  .tq-gpick { display: flex; flex-wrap: wrap; width: 100%; }               /* wraps: no sideways scroll */
  .tq-gpick button { padding: 5px 9px; flex: 1 0 auto; }
  .tqt td { height: 32px; }
  .tqt td .t, .tqt td .p { font-size: 14px; }
  .tq-pre select { min-width: 0; width: 100%; }
  .tq-pre { width: 100%; }
  .tq-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tq-stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .tq-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .tq-stats .stat:first-child, .tq-stats .stat:nth-child(2) { border-top: 0; }
  .tq-sleg { grid-template-columns: minmax(0, 1fr); }
  .tq-dsel { flex-wrap: wrap; }
  .tq-dsel select { max-width: 100%; }
  .tq-wi th:nth-child(2), .tq-wi td:nth-child(2) { display: none; }
  .tq-wi td, .tq-wi th { white-space: normal; padding-left: 4px; padding-right: 4px; }
  .tq-sel select { max-width: 100%; }
  .tq-sel { width: 100%; }
  .tq-sel select { flex: 1; min-width: 0; }
  .tq-sel { flex-wrap: wrap; row-gap: 4px; }     /* the method names are long: the select gets its own full-width line */
  .tq-sel > span { flex-basis: 100%; }
}
@media (max-width: 420px) {
  .tq-mus { gap: 6px 12px; }
  .tqf .tq-n { width: 56px !important; }
}

/* ---------- which bolt do I have ---------- */
.tq-ident { padding: 14px 16px 10px; min-width: 0; }
.tq-ihead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 10px; }
.tq-ihead .note { margin: 0; flex: 1 1 320px; }
/* a wrapping grid of tiles (no sideways scroll at any width), each family under its own heading */
.tq-istrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; padding: 2px 2px 8px; }
.tq-ifam { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 4px 2px 0; }
.tq-idt { min-width: 0; display: grid; justify-items: center; align-content: start; gap: 1px; padding: 8px 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: center; scroll-snap-align: start; font: inherit; color: inherit; }
.tq-idt:hover { border-color: var(--line-2); background: var(--surface-2); }
.tq-idt.on { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel); background: var(--sel-bg); }
.tq-idt svg { display: block; margin-bottom: 3px; }
.tq-idt b { font-size: 13px; font-weight: 600; }
.tq-idt small { font-size: 11px; color: var(--text-3); }
.tq-idt span { font-size: 11.5px; line-height: 1.35; color: var(--text-2); margin-top: 3px; }

/* ---------- grade chooser and highlighted column ---------- */
.tq-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 8px; }
.tq-cols .tq-l { margin-right: 4px; }
.tq-cols .chip { padding: 2px 9px; }
.tq-cols .chip.on { border-color: var(--text-2); color: var(--text); background: var(--surface); font-weight: 500; }
.tq-cols .chip.hl { border-color: var(--sel); color: var(--sel); }
.tqt .hc { background: var(--x-fdf6e6, #fdf6e6); }
.tqt thead th.hc { background: var(--x-fbecc9, #fbecc9); }
.tqt tbody tr:hover td.hc { background: var(--x-f8e9c4, #f8e9c4); }
@media (max-width: 760px) { .tq-cols { display: none; } }

/* head marking beside each grade name in the column header */
.tqt thead th .th-id { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.tqt thead th .th-nm { display: grid; min-width: 0; text-align: left; }
.tqt thead th .th-nm b, .tqt thead th .th-nm small { text-align: left; }
.tqt thead th .th-ico { flex: none; display: block; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 6px; }
.tqt thead th .th-ico:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
.tqt thead th .th-ico.none { width: 0; }
.tqt thead th .tu { text-align: right; }
.tq-idt.flash { border-color: var(--sel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel) 18%, transparent); }
.lin { font-style: normal; font-size: 10px; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: .02em; }
.tq-tablewrap.scroll { overflow-x: auto; scrollbar-width: thin; }
.tq-tablewrap.scroll + .tq-foot::before { content: "Scroll the table sideways for the other grades. "; }
.tq-wi .tq-out { display: inline-flex; vertical-align: middle; margin-right: 6px; border-radius: 6px; }
/* phones: three tiles a row, the long note only in the tile's label (screen readers); after the base rules above */
@media (max-width: 760px) {
  .tq-istrip { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
  .tq-idt { padding: 6px 8px 7px; }
  .tq-idt span { display: none; }
}

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-5b6168: #8c9198; --x-6d4fb3: #ab96ed; --x-6e7177: #85827f; --x-a4a6aa: #5c5a56; --x-a9afb6: #50555a;
    --x-c7d3dc: #363e44; --x-cfd5dc: #373b40; --x-d8c39a: #7d6e4f; --x-eef2fa: #26292d; --x-f8e9c4: #362c13;
    --x-fbecc9: #342a13; --x-fdf6e6: #2a261c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-5b6168: #8c9198; --x-6d4fb3: #ab96ed; --x-6e7177: #85827f; --x-a4a6aa: #5c5a56; --x-a9afb6: #50555a;
    --x-c7d3dc: #363e44; --x-cfd5dc: #373b40; --x-d8c39a: #7d6e4f; --x-eef2fa: #26292d; --x-f8e9c4: #362c13;
    --x-fbecc9: #342a13; --x-fdf6e6: #2a261c;
  }
}
/* theme-auto:end */
