/* Cost and site records picked up by the sweep (ew2/web/costrecords.js). Brand tokens from app.css. */
.cr-seg { margin: 0 0 14px; flex-wrap: wrap; }
.cr-seg .cr-count, .cr-kind .cr-count { display: inline-block; min-width: 1.6em; margin-left: 6px; padding: 0 6px; border-radius: 10px;
  background: var(--tint); color: var(--ink); font-size: .78rem; font-weight: 600; text-align: center; }
.cr-wrap { display: grid; gap: 16px; min-width: 0; }
.cr-card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; }
.cr-card h3, .cr-list h3 { margin: 0; font-size: 1rem; }
.cr-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.cr-tag { display: inline-block; padding: 2px 10px; border-radius: var(--pill); font-size: .8rem; font-weight: 600; }
.cr-tag.warn { background: #f6efdc; color: var(--medium); }
.cr-tag.ok { background: var(--tint); color: var(--low); }

/* The switch: the one on/off component for every setting (Company: documents you send, payroll records, cost and
   site records, share credits). The label on the left wraps; the switch sits on the right with its thumb inside the
   track; the whole row is the tap target, at least 44px tall. The label:has() selector outranks the touch-screen rule
   in app.css that turns any label with a tick box into a flex row (that rule squeezed the track to nothing on a
   phone, so the thumb floated outside it and the text ran under it: Han, iPhone, 12 October 2026). */
.cr-setting.on { border-color: var(--sage); }
.cr-switch, label.cr-switch:has(> input[type="checkbox"]) { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: center;
  gap: 14px; min-height: 44px; cursor: pointer; position: relative; }
.cr-switch > .cr-switch-l { grid-column: 1; grid-row: 1; }
.cr-switch > .cr-track { grid-column: 2; grid-row: 1; }
.cr-switch > .cr-switch-in, .cr-switch > input.cr-switch-in[type="checkbox"] { position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  opacity: 0; width: 46px; height: 44px; margin: 0; cursor: pointer; z-index: 1; }
.cr-track { display: block; flex: none; box-sizing: border-box; width: 46px; min-width: 46px; height: 28px; border-radius: 14px;
  background: #c9d6ce; position: relative; overflow: hidden; transition: background .15s; }
.cr-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.cr-switch-in:checked + .cr-track { background: var(--ink); }
.cr-switch-in:checked + .cr-track::after { transform: translateX(18px); }
.cr-switch-in:focus-visible + .cr-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.cr-switch-in:disabled + .cr-track { opacity: .55; }
.cr-switch-l { display: grid; gap: 2px; min-width: 0; }
.cr-privacy { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--tint-2); font-size: .88rem; color: var(--ink-2); }
.cr-waiting { margin: 0; }

/* The gap view */
.cr-gap-wrap { overflow-x: auto; margin-top: 8px; }
table.cr-gap { font-size: .88rem; min-width: 0; }
table.cr-gap th[scope="row"] { font-weight: 600; white-space: nowrap; }
table.cr-gap td { white-space: nowrap; }
table.cr-gap td.no { color: var(--critical); font-weight: 600; }
table.cr-gap td.yes { color: var(--low); }
table.cr-gap tr.gap th[scope="row"] { color: var(--critical); }
.cr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
td.no .cr-dot { background: transparent; border: 2px solid currentColor; width: 9px; height: 9px; }

/* By kind and month */
.cr-list { min-width: 0; }
.cr-kind { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 16px; margin-top: 10px; }
.cr-kind > summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style-position: outside; }
.cr-kind[open] > summary { border-bottom: 1px solid var(--line); }
.cr-month { padding: 10px 0 4px; }
.cr-month + .cr-month { border-top: 1px dashed var(--line); }
.cr-month h4 { margin: 0 0 4px; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.cr-recs { list-style: none; margin: 0; padding: 0; }
.cr-rec { display: grid; gap: 1px; padding: 6px 0; min-width: 0; }
.cr-file { font-weight: 600; color: var(--link); overflow-wrap: anywhere; }
.cr-src, .cr-why { font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* The offer on a claim */
#sweep-offer { margin-top: 14px; }
.cr-offer { background: var(--tint-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; min-width: 0; }
.cr-offer-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 8px; }
.cr-offer-h h3 { margin: 0; font-size: 1rem; }
.cr-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-month-in { font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); color: var(--ink); min-height: 40px; }
.cr-all { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.cr-all input, .cr-picks input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; }
.cr-offer-line { font-weight: 600; }
.cr-picks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.cr-picks label { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.cr-picks label:hover { background: var(--tint); }
.cr-pick-n { overflow-wrap: anywhere; font-size: .92rem; }
.cr-pick-k { grid-column: 2; font-size: .8rem; color: var(--ink-2); }
.cr-against { margin-top: 12px; }
.cr-against-h { margin: 0 0 4px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.cr-heads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cr-heads > li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); column-gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.cr-head-l { font-weight: 600; }
.cr-heads > li.none .cr-head-f { color: var(--ink-2); }
.cr-head-m { grid-column: 2; color: var(--medium); font-size: .82rem; }
.cr-head-need { grid-column: 2; font-size: .82rem; }
.cr-head-need summary { cursor: pointer; color: var(--link); }
.cr-head-need ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }

@media (max-width: 640px) {
  .cr-card { padding: 14px; }
  .cr-heads > li { grid-template-columns: minmax(0, 1fr); }
  .cr-head-m, .cr-head-need { grid-column: 1; }
  .cr-offer-h { align-items: flex-start; }
  .cr-period { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); width: 100%; }
  .cr-period > .hint:first-child { grid-column: 1 / -1; }
  .cr-month-in { width: 100%; }
  .cr-gap-wrap { overflow-x: visible; }
  table.cr-gap, table.cr-gap tbody, table.cr-gap tr { display: block; width: 100%; }
  table.cr-gap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cr-gap tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.cr-gap th[scope="row"] { grid-column: 1 / -1; display: block; padding: 0; border: 0; }
  table.cr-gap td { display: block; padding: 0; border: 0; white-space: normal; font-size: .8rem; }
  table.cr-gap td::before { content: attr(data-label); display: block; color: var(--ink-2); font-weight: 400; font-size: .74rem; }
}
.seg button[aria-pressed="true"] .cr-count { background: var(--lime); color: var(--ink); }
