/* calc.css: page-local layout for the readiness checklist, on the desk.css tokens (--dk-*).
   The same design language as the calculators (calculators/custom-sme-ops-desk-payback/calc.css).
   Load after desk.css. The page puts class="dk cx rc" on <main>. Shared classes use the cx- prefix.
   Classes that only this page has use the rc- prefix. */

/* 1. Form on the left, result on the right. One column on a narrow screen. */
.cx-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px 32px; align-items: start; margin-top: 20px; }
.cx-form { padding: 20px 22px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); }
.cx-form fieldset { min-width: 0; margin: 0 0 6px; padding: 0; border: 0; }
.cx-form legend { margin: 0 0 12px; padding: 0; font-size: 13px; line-height: 1.4; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--dk-muted); }
.cx-form fieldset + fieldset { padding-top: 18px; border-top: 1px solid var(--dk-line); }

/* 2. Fields: 2 number fields and 6 lists. */
.cx-field { margin: 0 0 16px; }
.cx-field label { display: block; margin: 0 0 5px; font-size: 15px; line-height: 1.4; font-weight: 650; color: var(--dk-ink); }
.cx-field input, .cx-field select { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #7d857a; border-radius: var(--dk-radius-sm); background-color: var(--dk-panel); color: var(--dk-ink); font: 16px/1.3 var(--dk-sans); font-variant-numeric: tabular-nums; }
.cx-field select { max-width: 100%; text-overflow: ellipsis; cursor: pointer; }
.cx-field input:hover, .cx-field select:hover { border-color: var(--dk-ink-2); }
.cx-field input[aria-invalid="true"] { border-color: var(--dk-bad); box-shadow: inset 0 0 0 1px var(--dk-bad); }
.dk p.cx-hint { margin: 6px 0 0; max-width: none; font-size: 13.5px; line-height: 1.45; color: var(--dk-muted); }
.dk p.cx-error { margin: 6px 0 0; max-width: none; font-size: 13.5px; line-height: 1.45; font-weight: 600; color: var(--dk-bad); }
.cx-form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* 3. Result */
.cx-results { min-width: 0; }
.dk .cx-results > h3 { margin: 0 0 12px; font-size: 13px; line-height: 1.4; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--dk-muted); }
.rc-banner { margin: 0 0 18px; padding: 16px 18px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-left: 5px solid var(--dk-good); border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); }
/* One colour for each of the 3 results, so that a change of result shows at a glance: green on
   white for Track 1, blue on a blue tint for Track 2, orange on an amber tint for Prep first.
   The colour is never the only sign: the first line of the banner names the result. */
.rc-result[data-track="custom-desk"] .rc-banner { border-left-color: #1d5fa8; background: #eef4fb; }
.rc-result[data-track="prep-first"] .rc-banner { border-left-color: #c2570c; background: var(--dk-warn-soft); }
.dk p.rc-track { margin: 0 0 6px; max-width: none; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; color: var(--dk-ink); overflow-wrap: anywhere; }
.dk p.rc-headline { margin: 0 0 6px; max-width: none; font-size: 15.5px; line-height: 1.5; color: var(--dk-ink); }
.dk p.rc-rule { margin: 0; max-width: none; font-size: 13.5px; line-height: 1.45; color: var(--dk-muted); }
.dk p.rc-noscript { margin: 0 0 12px; max-width: none; font-size: 14px; color: var(--dk-ink-2); }
.dk .rc-result h4 { margin: 18px 0 8px; font-size: 15px; line-height: 1.4; font-weight: 700; color: var(--dk-ink); }
.dk .rc-result .rc-list { margin: 0 0 4px; padding-left: 22px; max-width: none; font-size: 15px; line-height: 1.5; color: var(--dk-ink-2); }
.dk .rc-result .rc-list li { margin: 0 0 7px; overflow-wrap: anywhere; }
.dk .rc-result .rc-links a { display: block; font-weight: 600; }
.dk .rc-result .rc-links span { display: block; }
.rc-copy { margin: 18px 0 16px; }
.rc-copy .btn { min-height: 44px; }
.dk p.rc-copy-status { margin: 8px 0 0; max-width: none; min-height: 1.45em; font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--dk-good); }
.rc-copy-box { display: block; width: 100%; margin: 8px 0 0; padding: 10px 12px; border: 1px solid #7d857a; border-radius: var(--dk-radius-sm); background: var(--dk-panel); color: var(--dk-ink); font: 13px/1.5 var(--dk-mono); resize: vertical; }
.dk .cx-disclaimer { margin-bottom: 0; }
.dk .cx-disclaimer p { margin: 0; }
/* The status line is for screen readers: it reports each new result. */
.cx-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* 4. Tables wrap where there is no room. The rule number keeps one line. */
.rc #rules .dk-data thead th:first-child { white-space: nowrap; }
.cx .dk-data th, .cx .dk-data td, .cx .dk-kv th, .cx .dk-kv td { overflow-wrap: anywhere; }
.cx .dk-data thead th { white-space: normal; }
.cx .dk-card h3 { overflow-wrap: anywhere; }
.dk .dk-closing .dk-note { margin-top: 18px; font-size: 14px; color: var(--dk-ink-2); }

@media (max-width: 860px) {
  .cx-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cx-form { padding: 16px; }
  .cx-form-actions .btn, .rc-copy .btn { width: 100%; }
}
@media print {
  .cx-form-actions, .rc-copy { display: none !important; }
  .cx-form, .rc-banner { break-inside: avoid; }
}
