/* ==========================================================================
   Bolt Science - Torque Unit Converter  (torque-calc.css)
   All rules are scoped under .bs-torque-calc so they cannot affect the rest
   of the site. Fonts are inherited from the page (boltscience.css BODY).
   To change the look, edit the variables in the first block only.
   ========================================================================== */

.bs-torque-calc {
  --bs-tc-accent: #0000FF;   /* site blue: buttons, unit labels, focus ring  */
  --bs-tc-title:  #FF0000;   /* site red: headings (as .newstitle/.topictitle) */
  --bs-tc-hover-bg: #C0C0C0; /* as .submitbuttonon                            */
  --bs-tc-ok:     #009900;   /* "Copied" state (site visited-link green)      */
  --bs-tc-error:  #FF0000;
  --bs-tc-text:   #000000;
  --bs-tc-muted:  #666666;
  --bs-tc-border: #CCCCCC;
  --bs-tc-panel:  #F4F4F8;
  --bs-tc-bg:     #FFFFFF;

  max-width: 750px;          /* matches the site's .container width */
  margin: 16px auto;
  padding: 14px 16px 12px;
  border: 1px solid #000000;
  background: var(--bs-tc-bg);
  color: var(--bs-tc-text);
  font: inherit;
  text-align: left;
}

.bs-torque-calc *,
.bs-torque-calc *::before,
.bs-torque-calc *::after { box-sizing: border-box; }

/* Headings - styled like the site's .newstitle / .topictitle */
.bs-torque-calc .bs-tc-title {
  margin: 0 0 10px;
  color: var(--bs-tc-title);
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
}
.bs-torque-calc .bs-tc-subtitle {
  margin: 4px 0 6px;
  color: var(--bs-tc-title);
  font-size: 12px;
  font-weight: bold;
}

/* ---- Input panel ------------------------------------------------------- */
.bs-torque-calc .bs-tc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  padding: 10px;
  background: var(--bs-tc-panel);
  border: 1px solid var(--bs-tc-border);
}
.bs-torque-calc .bs-tc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bs-torque-calc .bs-tc-field--value { flex: 1 1 150px; }
.bs-torque-calc .bs-tc-field--unit  { flex: 2 1 220px; }
.bs-torque-calc .bs-tc-field--sf    { flex: 0 1 130px; }
.bs-torque-calc .bs-tc-field label  { font-size: 12px; font-weight: bold; }

.bs-torque-calc .bs-tc-input,
.bs-torque-calc .bs-tc-select {
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 3px 6px;
  border: 1px solid #000000;
  border-radius: 0;
  background: #FFFFFF;
  color: #000000;
  font: normal 13px Arial, Verdana, sans-serif;   /* as .shadeform */
}
.bs-torque-calc .bs-tc-input { font-size: 15px; }
.bs-torque-calc .bs-tc-input[aria-invalid="true"] {
  border-color: var(--bs-tc-error);
  background: #FFF0F0;
}
.bs-torque-calc .bs-tc-msg {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: var(--bs-tc-error);
  font-size: 12px;
}

/* ---- Results ----------------------------------------------------------- */
.bs-torque-calc .bs-tc-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 6px;
}
.bs-torque-calc .bs-tc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 6px 5px 8px;
  border: 1px solid var(--bs-tc-border);
  border-left: 3px solid var(--bs-tc-accent);
  background: #FFFFFF;
}
.bs-torque-calc .bs-tc-row[hidden] { display: none; }
.bs-torque-calc .bs-tc-row-unit {
  flex: 0 0 4.4em;
  color: var(--bs-tc-accent);
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 0;
  cursor: help;
}
.bs-torque-calc .bs-tc-row-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font: normal 14px Arial, Verdana, sans-serif;
  font-variant-numeric: tabular-nums;
}
.bs-torque-calc .bs-tc-row-value sup { font-size: 0.72em; line-height: 0; }

/* Copy button - styled like the site's .submitbutton / .submitbuttonon */
.bs-torque-calc .bs-tc-copy {
  flex: 0 0 auto;
  height: 22px;
  min-width: 52px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid #000000;
  border-radius: 0;
  background: var(--bs-tc-accent);
  color: #FFFFFF;
  font: bold 8pt Arial, Verdana, Helvetica, sans-serif;
  cursor: pointer;
}
.bs-torque-calc .bs-tc-copy:hover:not(:disabled) {
  background: var(--bs-tc-hover-bg);
  color: var(--bs-tc-accent);
}
.bs-torque-calc .bs-tc-copy.is-copied,
.bs-torque-calc .bs-tc-copy.is-copied:hover {
  background: var(--bs-tc-ok);
  color: #FFFFFF;
}
.bs-torque-calc .bs-tc-copy:disabled { opacity: 0.4; cursor: default; }

/* Visible keyboard focus */
.bs-torque-calc .bs-tc-input:focus-visible,
.bs-torque-calc .bs-tc-select:focus-visible,
.bs-torque-calc .bs-tc-copy:focus-visible,
.bs-torque-calc summary:focus-visible,
.bs-torque-calc a:focus-visible {
  outline: 2px solid var(--bs-tc-accent);
  outline-offset: 2px;
}

/* ---- Reference table and footnote -------------------------------------- */
.bs-torque-calc .bs-tc-details { margin-top: 10px; font-size: 12px; }
.bs-torque-calc .bs-tc-details summary {
  color: var(--bs-tc-accent);
  font-weight: bold;
  cursor: pointer;
}
.bs-torque-calc .bs-tc-table-wrap { overflow-x: auto; margin-top: 6px; }
/* Overrides the site-wide TABLE rule (grey, italic, justified) */
.bs-torque-calc .bs-tc-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--bs-tc-text);
  font: normal 12px Arial, Verdana, sans-serif;
  text-align: left;
}
.bs-torque-calc .bs-tc-table th,
.bs-torque-calc .bs-tc-table td {
  padding: 3px 6px;
  border: 1px solid var(--bs-tc-border);
  vertical-align: top;
}
.bs-torque-calc .bs-tc-table thead th { background: var(--bs-tc-panel); }
.bs-torque-calc .bs-tc-table tbody th { color: var(--bs-tc-accent); white-space: nowrap; }
.bs-torque-calc .bs-tc-num { white-space: nowrap; font-variant-numeric: tabular-nums; }

.bs-torque-calc .bs-tc-note {
  margin: 8px 0 0;
  color: var(--bs-tc-muted);
  font-size: 11px;
}
/* Stops the site-wide a:hover rule changing the font size inside the widget */
.bs-torque-calc a:hover { font: inherit; }

.bs-torque-calc .bs-tc-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 480px) {
  .bs-torque-calc { padding: 12px 10px 10px; margin: 12px 0; }
  .bs-torque-calc .bs-tc-field--value,
  .bs-torque-calc .bs-tc-field--unit { flex-basis: 100%; }
  .bs-torque-calc .bs-tc-field--sf { flex: 1 1 100%; }
  .bs-torque-calc .bs-tc-results { grid-template-columns: 1fr; }
  .bs-torque-calc .bs-tc-table tr > :nth-child(3) { display: none; }  /* hide Derivation column */
}
