.rail-article { line-height: 1.8; }
.rail-article h2, .rail-article h3 { margin: 1.8rem 0 .7rem; font-size: 1.2rem; line-height: 1.45; color: var(--text-dark); }
.rail-article p { margin: .8rem 0; }
.rail-article .rail-note, .rail-article figcaption { font-size: .84rem; color: var(--text-muted); line-height: 1.6; }
.rail-article figure { margin: 1rem 0; }
.rail-article figure img { width: 100%; height: auto; border-radius: 12px; }
.rail-table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border-color, #475569); border-radius: 10px; }
.rail-article table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: .83rem; font-variant-numeric: tabular-nums; }
.rail-article caption { padding: .7rem; text-align: left; font-weight: 700; }
.rail-article th, .rail-article td { padding: .7rem .65rem; text-align: left; border-bottom: 1px solid var(--border-color, #475569); }
.rail-article th { background: rgba(2,132,199,.12); white-space: nowrap; }
.rail-article td:first-child { font-weight: 700; white-space: nowrap; }
.rail-article tbody tr:last-child td { border-bottom: 0; }
.rail-article a { color: var(--primary); text-decoration: underline; overflow-wrap: anywhere; }
.rail-sources { padding-left: 1.5rem; font-size: .85rem; }
.rail-calculator { padding: 1.25rem; border: 1px solid var(--border-color, #475569); border-radius: 16px; background: rgba(2,132,199,.05); }
.rail-calc-fields, .rail-calc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rail-calc-fields label { font-size: .9rem; font-weight: 600; }
.rail-calc-fields select, .rail-calc-fields input { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: .4rem; padding: .7rem; border: 1px solid #64748b; border-radius: 8px; background: var(--surface-white); color: var(--text-dark); font: inherit; }
.rail-calculator :focus-visible, .rail-table-wrap:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
.rail-total { font-size: clamp(1.5rem, 5vw, 2.2rem); color: var(--text-dark); }
.rail-calc-pair { padding-top: 1rem; border-top: 1px solid #64748b; }
.rail-calc-pair span, .rail-calc-pair strong { display: block; }
.rail-calc-pair strong { font-size: 1.25rem; color: var(--text-dark); }
#railCalcError { color: #dc2626; }
.rail-calculator button:disabled { opacity: .5; cursor: not-allowed; }
@media(max-width: 520px) { .rail-calc-fields, .rail-calc-pair { grid-template-columns: 1fr; } .rail-calculator { padding: .85rem; } }

/* Wire-rope comparison: user-entered certificate data and catalogue mass. */
.rope-tool { margin: 2rem 0; padding: 1.25rem; border: 1px solid var(--border-light); border-radius: 16px; background: rgba(2,132,199,.04); }
.rope-tool > h2:first-child, .rope-tool > h3:first-child { margin-top: 0; }
.rope-fields, .rope-mass-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rope-fields fieldset { min-width: 0; padding: 1rem; border: 1px solid var(--border-light); border-radius: 12px; }
.rope-fields legend { font-weight: 700; padding: 0 .4rem; color: var(--text-dark); line-height: 1.5; }
.rope-tool label { display: block; margin: .6rem 0; font-size: .84rem; font-weight: 600; }
.rope-tool input, .rope-tool select { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: .35rem; padding: .65rem .75rem; font: inherit; font-size: 1rem; border: 1px solid #64748b; border-radius: 8px; background: var(--surface-white); color: var(--text-dark); }
.rope-tool :focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
.rope-tool td { overflow-wrap: anywhere; max-width: 240px; }
.rope-tool td:first-child { white-space: normal; }
.rope-summary { padding: 1rem; border-left: 3px solid #0284c7; background: rgba(2,132,199,.09); }
.rope-tool tr[data-state="below"] td:last-child, .rope-tool tr[data-state="invalid"] td:last-child { color: var(--primary); font-weight: 700; }
.rope-mass-pair { padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.rope-mass-pair span, .rope-mass-pair strong { display: block; }
.rope-mass-pair strong { font-size: 1.25rem; color: var(--text-dark); font-variant-numeric: tabular-nums; }
.rope-tool button { white-space: normal; }
@media (max-width: 600px) {
  .rope-fields, .rope-mass-pair { grid-template-columns: minmax(0, 1fr); }
  .rope-tool { padding: 1rem; }
  .rope-fields fieldset { padding: .85rem; }
}
