/* AXLE CONFIGURATION SOLVER: the page's own parts (inputs, ranked list, empty prompt, bar above the card). Linked after the axle checker's
   stylesheets; the layout card itself is the checker's (axle-checker/*.css), untouched. Tokens only: no colour literals; spacing on the
   0/4/8/12/16/24/32 ramp, radii 6/8/12/9999. Sections sit 16px apart on a phone, 24px on a desktop. */

.axc[data-mode="solver"] .page-heading { display: none; }
.axc[data-mode="solver"] { display: flex; flex-direction: column; gap: 16px; }
.axc[data-mode="solver"] { --axs-on: #2563EB; }
.axc[data-mode="solver"] [hidden], .axc-results[hidden] { display: none !important; }

/* ── Inputs (owner, 2026-11-23: "improve this"): the heavy-haul form's family. Each field is a card with its glyph at the left, the title over a big value,
   and the unit as a pill at the right. Desktop: both fields and the button on ONE row, the hint and the common lengths under them. Phone: stacked. ───── */
.axc[data-mode="solver"] .axs-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; }
.axc[data-mode="solver"] .axs-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.axc[data-mode="solver"] .axs-field { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; min-width: 0; min-height: 64px; padding: 8px 12px 8px 16px; box-sizing: border-box; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; cursor: text; }
.axc[data-mode="solver"] .axs-field:hover, .axc[data-mode="solver"] .axs-field:focus-within { border-color: var(--ink); }
.axc[data-mode="solver"] .axs-field:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.axc[data-mode="solver"] .axs-ico { display: inline-flex; color: var(--ink-soft); }
.axc[data-mode="solver"] .axs-field:focus-within .axs-ico { color: var(--ink); }
.axc[data-mode="solver"] .axs-fbody { display: flex; flex-direction: column; min-width: 0; }
.axc[data-mode="solver"] .axs-lab { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.axc[data-mode="solver"] .axs-field input { width: 100%; min-width: 0; height: 32px; margin: 0; padding: 0; box-sizing: border-box; font: inherit; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); background: transparent; border: 0; outline: 0; box-shadow: none; -moz-appearance: textfield; appearance: textfield; }
.axc[data-mode="solver"] .axs-field input::-webkit-outer-spin-button, .axc[data-mode="solver"] .axs-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.axc[data-mode="solver"] .axs-field input::placeholder { color: var(--muted); font-style: italic; font-weight: 500; opacity: 0.7; }
.axc[data-mode="solver"] .axs-unit { padding: 4px 8px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); background: var(--surface-3, var(--surface)); border-radius: 6px; }
.axc[data-mode="solver"] .axs-field input[aria-invalid="true"] { color: var(--warn); }
.axc[data-mode="solver"] .axs-field:has(input[aria-invalid="true"]) { border-color: var(--warn); }
.axc[data-mode="solver"] .axs-sub { display: flex; flex-direction: column; gap: 12px; }
.axc[data-mode="solver"] .axs-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.axc[data-mode="solver"] #axs-errs { display: flex; flex-direction: column; gap: 4px; }
.axc[data-mode="solver"] #axs-errs:empty { display: none; }
.axc[data-mode="solver"] .axs-err { margin: 0; font-size: 13px; line-height: 1.5; color: var(--warn); }
.axc[data-mode="solver"] .axs-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.axc[data-mode="solver"] .axs-preset { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; box-sizing: border-box; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 9999px; }
.axc[data-mode="solver"] .axs-preset:hover { border-color: var(--ink); }
.axc[data-mode="solver"] .axs-preset:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axc[data-mode="solver"] .axs-preset[aria-current="true"] { color: var(--surface); background: var(--axs-on); border-color: var(--axs-on); }
#axc[data-mode="solver"] .axs-form .axc-cta { margin: 0; }
@media (min-width: 961px) {
  .axc[data-mode="solver"] .axs-form { grid-template-columns: minmax(0, 1fr) 240px; column-gap: 16px; row-gap: 12px; align-items: stretch; }
  .axc[data-mode="solver"] .axs-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .axc[data-mode="solver"] #axs-run { min-height: 64px; }
  .axc[data-mode="solver"] .axs-sub { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
  .axc[data-mode="solver"] .axs-presets { grid-template-columns: repeat(4, 96px); }
}

/* ── The empty prompt: the Equipment builder's own rig drawing and one line of help, in a card the size of the list that replaces it ─────────── */
.axs-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; text-align: center; background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; }
.axs-skel { width: 100%; max-width: 560px; }
.axs-skel .axr { display: block; width: 100%; height: auto; }
.axs-empty-h { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.axs-empty-h, .axs-empty-copy p { text-align: center; }
.axs-empty-copy p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ── The ranked list: one compact row per configuration, no drawings ────────────────────────────────────────────────────────── */
.axs-list { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.axs-list[aria-busy="true"] { opacity: 0.6; }
.axs-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.axs-list-head h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.axs-sum.is-over { color: var(--warn); }
/* The result strip: the verdict badge, then the figures as chips. */
.axs-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.axs-sum { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--success); border: 1px solid currentColor; border-radius: 9999px; }
.axs-sum:empty { display: none; }
.axs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.axs-chip { display: flex; flex-direction: column; margin: 0; padding: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.axs-chip dt { font-size: 12px; line-height: 1.4; color: var(--muted); }
.axs-chip dd { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--ink); }
.axs-chip.is-warn dd { color: var(--warn); }
/* The candidates table: scrolls inside its own frame on a phone, the axle-count column stays put. */
.axs-tablewrap { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.axs-tablewrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axs-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--ink); }
.axs-table thead th { padding: 8px 12px; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; color: var(--ink); background: var(--surface); border-bottom: 2px solid var(--border-strong); }
.axs-table td, .axs-table tbody th { padding: 8px 12px; text-align: left; font-weight: 400; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--line); }
.axs-table tbody tr:last-child td, .axs-table tbody tr:last-child th { border-bottom: 0; }
.axs-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); border-right: 1px solid var(--line); }
.axs-row { cursor: pointer; }
.axs-row:hover td { background: var(--surface); }
.axs-row.is-sel td { background: color-mix(in srgb, var(--axs-on) 8%, var(--paper)); }
.axs-row.is-sel th { background: color-mix(in srgb, var(--axs-on) 8%, var(--paper)); box-shadow: inset 4px 0 0 var(--axs-on); }
.axs-c-n { min-width: 120px; }
.axs-pick { padding: 4px 0; min-height: 32px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: none; border: 0; cursor: pointer; }
.axs-pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axs-r-sub { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.axs-r-best { display: inline-block; margin-left: 8px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 1.4; color: var(--ink); border: 1px solid var(--ink); border-radius: 6px; }
.axs-r-badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 1.6; border: 1px solid currentColor; border-radius: 9999px; }
.axs-r-badge.is-ok { color: var(--success); }
.axs-r-badge.is-over { color: var(--warn); }
.axs-ico { width: 16px; height: 16px; flex: none; }
.axs-row.is-over .axs-c-head { color: var(--warn); font-weight: 600; }
.axs-more { align-self: flex-start; min-height: 44px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.axs-more:hover { border-color: var(--ink); }
.axs-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axs-notes { display: flex; flex-direction: column; gap: 8px; }
.axs-note-list { margin: 0; padding: 0 0 0 24px; display: flex; flex-direction: column; gap: 4px; }
.axs-notes:empty { display: none; }
.axs-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.axs-note.is-warn { color: var(--warn); }
.axs-plain { margin: 0; padding-left: 24px; font-size: 14px; line-height: 1.5; }

/* ── The single layout card and the bar above it ────────────────────────────────────────────────────────────────────────────── */
.axs-live { margin-top: 0; }
.axs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.axs-bar-t { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.axs-open { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; box-sizing: border-box; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.axs-open:hover { border-color: var(--ink); }
.axs-open:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axc[data-mode="solver"] .axs-live .axle-panel { margin-top: 16px; }

@media (max-width: 720px) {
  .axs-open { width: 100%; justify-content: center; }
}
@media (min-width: 768px) {
  .axc[data-mode="solver"] { gap: 24px; }
}
@media (max-width: 360px) {
  .axc[data-mode="solver"] .axs-fields { gap: 8px; }
  .axc[data-mode="solver"] .axs-field { padding: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .axs-row td, .axs-row th { transition: background-color 0.12s; }
}
.axc[data-mode="solver"] .axs-empty .axs-empty-copy { width: 100%; text-align: center; }
.axc[data-mode="solver"] .axs-empty .axs-empty-copy h2 { text-align: center; }
