/* This week. Tokens and components come from style.css. */

/* Synced before the reset: a caution strip above the groups */
.notice {
  --fill: color-mix(in srgb, var(--warn) 8%, transparent);
  --cut: 9px;
  --cut-line: var(--warn);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-left-width: 3px;
  color: var(--ivory);
  font-size: var(--step--1);
}

.groups { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.groups.skeleton span { height: 22rem; }

/* ---------- a group ---------- */

.group { margin-top: 0; }
.group.complete { --cut-line: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.group .panel-head { flex-wrap: nowrap; align-items: flex-end; margin-bottom: 0; }
.group .panel-head h2 { font-size: var(--step-2); }
.group .eyebrow { color: var(--muted); }
.group .count { flex: none; font: 600 var(--step-1)/1 var(--num); color: var(--muted); white-space: nowrap; }
.group .count b { font-size: var(--step-2); font-weight: 600; color: var(--gold-hi); }
.group.complete .count b { color: var(--ok); }

/* How much of the group is done */
.meter { height: 3px; margin: var(--sp-3) 0 var(--sp-1); background: var(--line-soft); }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent); }
.group.complete .meter i { background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 55%, transparent); }

.all-done, .hidden-done { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 0; font-size: var(--step--1); }
.all-done { color: var(--ok); }
.all-done::before { content: ""; width: 0.45rem; height: 0.45rem; rotate: 45deg; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* "Done": a small rule between what is left and what is done */
.done-head { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0 0; color: var(--muted); font: 600 var(--step--2)/1.3 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; }
.done-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-soft), transparent); }

/* ---------- a task ---------- */

.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { position: relative; border-top: 1px solid var(--line-soft); }
.tasks li:first-child { border-top: 0; }
.done-list { margin-top: var(--sp-1); }

/* The whole row is the check box's label */
.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-1) var(--sp-3);
  margin: 0 calc(-1 * var(--sp-2));
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-ctl);
  cursor: pointer;
  transition: background var(--fast) ease;
}
.task:hover { background: color-mix(in srgb, var(--surface-3) 45%, transparent); }
.task:has(input:disabled) { cursor: default; }
.task .text { display: grid; gap: 0.15rem; min-width: 0; }
.task .name { color: var(--ivory); font-weight: 500; overflow-wrap: anywhere; }
.task .detail { color: var(--muted); font-size: var(--step--2); }
.task .auto { align-self: center; gap: 0.45rem; white-space: nowrap; }

/* The check box: a square that fills with --ok and a tick */
.task .box {
  position: relative;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  border: 1px solid var(--line-hover);
  border-radius: var(--r-ctl);
  background: color-mix(in srgb, var(--lapis-950) 70%, transparent);
  transition: background var(--fast) ease, border-color var(--fast) ease, box-shadow var(--mid) ease;
}
.task .box::after {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 0.12rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid var(--lapis-950);
  border-width: 0 2px 2px 0;
  rotate: 45deg;
  scale: 0;
  transition: scale var(--fast) var(--ease);
}
.task:hover input:not(:disabled) + .box { border-color: var(--gold); }
.task input:checked + .box { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 35%, transparent); }
.task input:checked + .box::after { scale: 1; }
.task input:focus-visible + .box { outline: 2px solid var(--void); outline-offset: 2px; }
li.saving .box { animation: blink 0.7s ease-in-out infinite alternate; }

li.done .name { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
li.done .detail { opacity: 0.75; }

/* Progress read from the inventory: one diamond per step (also in arcanes.css) */
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 0.6rem; height: 0.6rem; rotate: 45deg; scale: 0.85; border: 1px solid color-mix(in srgb, var(--muted) 60%, transparent); background: color-mix(in srgb, var(--lapis-950) 60%, transparent); }
.pips i.on { border-color: var(--gold); background: var(--gold); }
.chip.ok .pips i.on { border-color: var(--ok); background: var(--ok); }

/* ---------- limited vendor purchases ---------- */

.vendors ul { list-style: none; margin: 0; padding: var(--sp-1) var(--sp-4); }
.vendors li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) 0; border-top: 1px solid var(--line-soft); font-size: var(--step--1); }
.vendors li:first-child { border-top: 0; }

/* ---------- phone ---------- */

@media (max-width: 40rem) {
  .group .panel-head h2, .vendors .section-head h2 { font-size: var(--step-1); }
  /* The inventory read-out goes under the name */
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task .auto { grid-column: 2; justify-self: start; white-space: normal; }
  .vendors ul { padding: var(--sp-1) var(--sp-3); }
}
