/* Grade comparison (/grade-comparison.html) and cut tolerances (/cut-tolerances.html).
   Builds on tools.css (.tool, .tool-card, .calc-form, tables) and styles.css tokens. */
/* styles.css sets td to nowrap for the data tables; these cells hold sentences. */
.tool .gc-all td, .tool .ct-all td, .tool .gc-cmp td { white-space: normal; }
.tool .gc-all td.num { white-space: nowrap; }

/* Picker */
.gc-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.gc-hint { margin-top: 12px; color: var(--hot2); }

/* Side by side: one column per picked metal */
.tool .gc-cmp { table-layout: fixed; }
.gc-cmp .gc-corner { width: 22%; border-top: 0; }
.tool .gc-cmp thead th { font: 700 clamp(1.0625rem, 2vw, 1.375rem)/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--text); vertical-align: bottom; white-space: normal; overflow-wrap: anywhere; }
.tool .gc-cmp tbody th { white-space: normal; font: 600 .71875rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--hot2); }
.tool .gc-cmp td { color: var(--text); font-size: .90625rem; line-height: 1.45; overflow-wrap: anywhere; }
.tool .gc-cmp td.num { text-align: left; white-space: normal; }
.gc-none { color: var(--dim); }
.tool a.gc-quote { display: inline-flex; align-items: center; min-height: 44px; color: var(--hot2); border-bottom: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tool a.gc-quote:hover { color: var(--text); }

/* Every grade */
.gc-all th[scope="row"] { white-space: normal; min-width: 9.5em; }
.gc-all td[data-k="tempers"] { min-width: 10em; }
.gc-all td[data-k="shapes"] { min-width: 20em; }
.gc-shapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .875rem; line-height: 1.4; }
.gc-shapes b { color: var(--text); font-weight: 600; }
.gc-shapes b::after { content: ":"; }
.ct-all td { line-height: 1.45; }

/* The wide grade table stacks earlier than the other tool tables. */
@media (max-width: 900px) {
  .tool .gc-all, .tool .gc-all tbody, .tool .gc-all tr, .tool .gc-all th, .tool .gc-all td { display: block; }
  .tool .gc-all thead { display: none; }
  .tool .gc-all tr { padding: 14px 0; border-top: 1px solid var(--line); }
  .tool .gc-all th, .tool .gc-all td { border: 0; padding: 3px 0; min-width: 0; }
  .tool .gc-all tbody th { font-size: 1.0625rem; margin-bottom: 4px; }
  .tool .gc-all td[data-label]::before { content: attr(data-label) "  "; font: 600 .6875rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
  .tool .gc-all .num { text-align: left; }
  .gc-shapes { margin-top: 6px; }
}

/* Phones: the row label sits above its two or three values, so nothing scrolls sideways. */
@media (max-width: 760px) {
  .gc-pick { grid-template-columns: minmax(0, 1fr); }
  .tool .gc-cmp, .tool .gc-cmp thead, .tool .gc-cmp tbody { display: block; }
  .tool .gc-cmp tr { display: grid; gap: 0 12px; padding: 10px 0; border-top: 1px solid var(--line); }
  .tool .gc-n1 tr { grid-template-columns: minmax(0, 1fr); }
  .tool .gc-n2 tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool .gc-n3 tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool .gc-cmp th, .tool .gc-cmp td { display: block; border: 0; padding: 3px 0; }
  .tool .gc-cmp tbody th { grid-column: 1 / -1; margin: 0 0 2px; font-size: .6875rem; }
  .tool .gc-cmp thead tr { border-top: 0; position: sticky; top: 0; z-index: 2; background: var(--card); border-bottom: 1px solid var(--line2); }
  .tool .gc-cmp .gc-corner { display: none; }
  .tool .gc-cmp thead th { font-size: 1rem; padding: 8px 0; }
  .tool .gc-cmp td { font-size: .84375rem; }
  .tool .gc-n3 thead th { font-size: .875rem; }
}
