/* Load calculator page (loaded only on /calculator). Uses the site colours from :root in site.css. */
.lc-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: clamp(22px, 3vw, 44px); align-items: start; }
.lc-in { position: sticky; top: calc(var(--head-h) + 16px); }
.lc-panel { box-shadow: 0 18px 50px rgba(2, 6, 30, 0.14); }
.lc-tabs { display: flex; border-bottom: 2px dashed var(--line); }
.lc-tabs button { flex: 1; padding: 16px 10px; font-weight: 700; font-size: 0.95rem; line-height: 1.25; color: var(--mute); border-bottom: 4px solid transparent; margin-bottom: -2px; transition: color 0.2s; }
.lc-tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--red); }
.lc-tabs button:hover { color: var(--ink); }
.lc-pbody { padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 22px; }
.lc-pbody [hidden] { display: none !important; }
.lc-with-unit { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.lc-with-unit select { border: 0; border-bottom: 2px solid var(--line); background: transparent; padding: 9px 4px 10px; font-weight: 600; cursor: pointer; }
#lc-pane-simple { display: grid; gap: 18px; }
.lc-in .field input { font-size: 1.25rem; font-family: var(--f-data); font-weight: 600; }
.lc-help { font-size: 0.82rem; color: var(--mute); line-height: 1.45; }
.lc-pack { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.lc-pack legend { font-size: 0.8rem; font-weight: 600; color: var(--mute); padding: 0; margin-bottom: 8px; }
.lc-seg { display: grid; gap: 6px; }
.lc-seg label { position: relative; cursor: pointer; }
.lc-seg input { position: absolute; opacity: 0; inset: 0; }
.lc-seg span { display: block; padding: 10px 14px; border: 2px solid var(--line); border-radius: 4px; font-size: 0.9rem; font-weight: 500; transition: border-color 0.2s, background 0.2s; }
.lc-seg input:checked + span { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, #fff); font-weight: 700; }
.lc-seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--red) 70%, #fff); outline-offset: 2px; }
.lc-seg-2 { grid-template-columns: 1fr 1fr; }
.lc-seg-2 span { height: 100%; }
.lc-ex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--mute); }
.lc-ex button { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 99px; font-size: 0.82rem; font-weight: 600; color: var(--ink); background: #fff; transition: border-color 0.2s, background 0.2s; }
.lc-ex button:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, #fff); }
.lc-ex .lc-clear { margin-left: auto; border-color: transparent; color: var(--mute); text-decoration: underline; padding-inline: 4px; background: transparent; }

/* box-size lines */
.lc-line { display: grid; grid-template-columns: 0.9fr repeat(3, 1fr) 1.2fr 28px; gap: 6px; align-items: center; margin-bottom: 8px; }
.lc-line input { width: 100%; min-width: 0; border: 0; border-bottom: 2px solid var(--line); padding: 8px 2px; background: transparent; font-family: var(--f-data); font-size: 1rem; border-radius: 0; }
.lc-line input:focus { outline: 0; border-bottom-color: var(--blue); }
.lc-line-h span { font-size: 0.68rem; font-weight: 600; color: var(--mute); line-height: 1.15; }
.lc-rm { width: 28px; height: 28px; border-radius: 50%; font-size: 1.3rem; line-height: 1; color: var(--mute); }
.lc-rm:hover { background: color-mix(in srgb, var(--red) 12%, #fff); color: var(--red); }
.lc-add { font-weight: 700; font-size: 0.9rem; color: var(--blue); padding: 6px 0; }
.lc-add:hover { color: var(--red); }
.lc-total { min-height: 1.4em; font-size: 0.95rem; font-weight: 600; color: var(--ink); }

/* results */
.lc-out { min-width: 0; display: grid; gap: 22px; }
.lc-out > * { min-width: 0; }
.lc-nojs { color: var(--mute); }
.lc-empty { text-align: center; padding: clamp(28px, 5vw, 64px) 16px; border: 2px dashed var(--line); border-radius: 6px; display: grid; gap: 12px; justify-items: center; }
.lc-empty-art { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 22px; opacity: 0.55; max-width: 100%; }
.lc-empty h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; }
.lc-empty p { color: var(--mute); max-width: 30rem; }

.lc-sum { display: grid; gap: 10px; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.lc-chips li { display: grid; padding: 10px 16px; background: var(--paper); border-radius: 4px; border-left: 4px solid var(--blue); }
.lc-chips span { font-size: 0.75rem; font-weight: 600; color: var(--mute); }
.lc-chips b { font-size: 1.2rem; }
.lc-kind { font-size: 0.95rem; font-weight: 600; color: var(--mute); }
.lc-kind-light, .lc-kind-heavy { color: var(--ink); }

.lc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lc-card { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: clamp(16px, 2vw, 24px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; box-shadow: 0 10px 30px rgba(2, 6, 30, 0.06); min-width: 0; }
.lc-card-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lc-card-h h3 { font-size: 1.02rem; font-weight: 700; flex: 1; min-width: 0; line-height: 1.3; }
.lc-card-h svg.ic { color: var(--blue); stroke-width: 1.5; }
.lc-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--red); color: #fff; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.lc-big { font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.lc-units { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 6px 0 2px; }
.lc-unit { max-width: 100%; }
.lc-more { font-size: 0.85rem; font-weight: 700; color: var(--mute); align-self: center; }
.lc-spread { font-size: 0.8rem; color: var(--mute); margin-top: -6px; }

/* drawing */
.lc-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.lc-shadow { fill: rgba(3, 7, 32, 0.12); }
.lc-svg .lc-body { fill: #e2e7f4; stroke: #8f9bc4; stroke-width: 1.5; }
.lc-load { fill: var(--red); }
.lc-rib { stroke: rgba(3, 7, 32, 0.16); stroke-width: 1.2; fill: none; }
.lc-rib-soft { stroke: rgba(3, 7, 32, 0.08); }
.lc-rod { stroke: #5b668f; stroke-width: 2; fill: none; stroke-linecap: round; }
.lc-cast { fill: #323c64; }
.lc-chassis { fill: #323c64; }
.lc-cab { fill: var(--blue); stroke: var(--navy); stroke-width: 1.2; }
.lc-win { fill: #d7e6ff; }
.lc-lamp { fill: #ffd54a; }
.lc-tire { fill: #1a2036; }
.lc-hub { fill: #aab3d0; }
.lc-pct { font-family: var(--f-data); font-weight: 700; font-size: 17px; }
.lc-pct.in { fill: #fff; }
.lc-pct.out { fill: var(--ink); }

.lc-svg.lc-reefer .lc-body { fill: #d9ecf8; stroke: #6f9dbd; }
.lc-rf-unit { fill: #2f6f96; }
.lc-rf-flake { stroke: #fff; stroke-width: 1.4; stroke-linecap: round; fill: none; }

/* meters */
.lc-meter { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 4px 10px; align-items: center; font-size: 0.85rem; }
.lc-meter .lc-ml { font-weight: 600; color: var(--mute); }
.lc-meter small { grid-column: 2 / -1; color: var(--mute); font-size: 0.75rem; margin-top: -2px; }
.lc-bar { display: block; height: 10px; background: var(--paper); border-radius: 5px; overflow: hidden; }
.lc-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--blue) 55%, #fff); border-radius: 5px; transition: width 0.4s var(--ease); }
.lc-meter.is-limit .lc-bar i { background: var(--red); }
.lc-meter.is-limit b { color: var(--red); }
.lc-limit { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.lc-spare { font-size: 0.88rem; color: var(--mute); }
.lc-lcl, .lc-note { font-size: 0.88rem; line-height: 1.5; padding: 10px 12px; border-left: 4px solid var(--blue); background: var(--paper); border-radius: 3px; }
.lc-cta { justify-self: stretch; margin-top: 2px; }
.lc-best-note { font-size: 0.85rem; color: var(--mute); margin-top: -6px; }

/* all options */
.lc-all { border-top: 1px solid var(--line); padding-top: 12px; }
.lc-all summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--blue); }
.lc-table-wrap { overflow-x: auto; margin-top: 10px; }
.lc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lc-table th { text-align: left; font-size: 0.72rem; color: var(--mute); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.lc-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lc-table tr.is-best td { background: color-mix(in srgb, var(--red) 6%, #fff); font-weight: 600; }
.lc-table td:nth-child(2) { white-space: nowrap; color: var(--mute); }
.lc-optn { display: grid; gap: 1px; min-width: 0; }
.lc-optn small { font-size: 0.74rem; font-weight: 500; color: var(--mute); }
.lc-bar-s { display: inline-block; width: 40px; height: 8px; vertical-align: middle; margin-right: 8px; }

.lc-bestrow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-top: 12px; border: 2px solid var(--line); border-radius: 4px; cursor: pointer; background: #fff; transition: border-color 0.2s, background 0.2s; }
.lc-bestrow:has(input:checked) { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, #fff); }
.lc-bestrow input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--red); cursor: pointer; }
.lc-bestrow b { display: block; font-size: 0.92rem; }
.lc-bestrow small { display: block; font-size: 0.78rem; color: var(--mute); line-height: 1.4; margin-top: 2px; }
.lc-table tbody tr { cursor: pointer; }
.lc-table tr.is-picked td { background: color-mix(in srgb, var(--blue) 8%, #fff); font-weight: 600; }
.lc-table tr.is-best.is-picked td { background: color-mix(in srgb, var(--red) 7%, #fff); }
.lc-optl { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.lc-optl input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.lc-tag { font-style: normal; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.lc-badge-pick { background: var(--blue); }
.lc-pickednote { font-size: 0.85rem; color: var(--mute); margin-top: -6px; }
.lc-temp-note { font-size: 0.9rem; line-height: 1.5; padding: 12px 14px; border-left: 4px solid #2f6f96; background: #eaf3fa; border-radius: 3px; }

/* chargeable weight */
.lc-cw { border: 1px solid var(--line); border-radius: 6px; padding: clamp(16px, 2vw, 24px); display: grid; gap: 12px; }
.lc-cw h3 { font-size: 1.02rem; font-weight: 700; }
.lc-cw-t { font-size: 0.88rem; color: var(--mute); }
.lc-cw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lc-cw-c { display: grid; gap: 2px; padding: 12px 14px; background: var(--paper); border-radius: 4px; align-content: start; }
.lc-cw-l { font-size: 0.74rem; font-weight: 600; color: var(--mute); line-height: 1.3; }
.lc-cw-c b { font-size: 1.25rem; }
.lc-cw-c small { font-size: 0.75rem; color: var(--mute); }

.lc-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.lc-tool { padding: 9px 16px; border: 2px solid var(--line); border-radius: 4px; font-weight: 600; font-size: 0.88rem; }
.lc-tool:hover { border-color: var(--blue); }
.lc-disclaimer { font-size: 0.8rem; color: var(--mute); line-height: 1.55; max-width: 52rem; }

@media (max-width: 1180px) { .lc-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .lc-grid { grid-template-columns: minmax(0, 1fr); }
  .lc-in { position: static; }
}
@media (max-width: 520px) {
  .lc-cw-grid { grid-template-columns: minmax(0, 1fr); }
  .lc-line { grid-template-columns: 0.8fr repeat(3, 1fr) 1.1fr 24px; gap: 4px; }
  .lc-line input { font-size: 0.9rem; }
  .lc-meter { grid-template-columns: 4.6rem 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { .lc-bar i { transition: none; } }
@media print {
  .site-head, .drawer, .lc-in, .lc-tools, .lc-cta, .phead, .site-foot, footer, .cta-band, .lc-all { display: none !important; }
  .lc-grid { display: block; }
  .lc-card, .lc-cw { box-shadow: none; break-inside: avoid; }
  .lc-cards { grid-template-columns: 1fr 1fr; }
}
