/* Strike — the check-days screen.
 *
 * Every colour here is a token from tokens.css (05_CONVENTIONS.md guardrail
 * 10); scripts/check.js fails the build on a raw hex anywhere under
 * src/public. The back link, the hero, the identity capture and the save bar
 * are `components/territory-page.css` now — an audit on 2026-08-04 found this
 * file and `build.css` were the same design with a different prefix. What is
 * left below is what is genuinely Strike's own: the four day checkboxes and
 * the refund bar.
 *
 * The territory colour is used two ways and they need different values: as a
 * fill behind white (`--t-strike`, with `--t-strike-fg` on it) and as text on
 * its own tint (`--t-strike-deep`). The design file uses the primary in both
 * positions, which measures 3.65:1 on the tint — below AA, and worst in the
 * blinding sun this app exists for. See 04_DESIGN_HANDOFF.md § Contrast.
 */

.strike-lede { margin: 0 0 var(--space-3); font-size: 15px; }

/* --- the four days -------------------------------------------------------- */

.strike-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.strike-day {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  min-height: 56px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.strike-day.is-on { background: var(--t-strike-t); border-color: var(--t-strike); }

/* Was `:focus-within`, which puts the ring on a mouse click — exactly what
 * `:focus-visible` exists to prevent, and the same bug `build.css` had.
 * `:focus-within` matches whenever the checkbox inside has focus at all;
 * `:has(:focus-visible)` matches only when that focus is the keyboard kind. */
.strike-day:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The checkbox is the box: styling the real control keeps the keyboard, the
 * screen reader and the label click working without re-implementing any of
 * it. At 24x24 it is below the 48px tap floor on its own, but it is never
 * tapped on its own — it sits inside a `<label>` that is the full 56px row,
 * so the whole row is the real target (verified against the rendered DOM,
 * not assumed from the CSS). */
.strike-box {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.strike-box:checked { border-color: var(--t-strike); background: var(--t-strike); }

.strike-box:checked::after {
  content: '✓';
  color: var(--t-strike-fg);
  font-size: var(--size-small);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.strike-day-body { flex: 1; min-width: 0; }

.strike-day-title {
  display: block;
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
}

.strike-day-meta {
  display: block;
  font-size: var(--size-small);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.strike-day-tasks {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--size-small);
  color: var(--soft);
  line-height: 1.45;
}

/* --- refund indicator (Rule 4) -------------------------------------------- */

.strike-refund {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--card);
}

.strike-refund-label { font-size: var(--size-small); color: var(--soft); }

.strike-refund-value {
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.strike-refund.is-earned { background: var(--live-bg); }
.strike-refund.is-earned .strike-refund-value { color: var(--live); }

/* --- the note field -------------------------------------------------------- */

.strike-note {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 420px;
  margin-bottom: var(--space-4);
}

@media (max-width: 767px) {
  .strike-days { grid-template-columns: 1fr; }
}
