/* Track C: projects, recurring rules, contracts.
   Reuses the shared tokens, .btn, .field, .chip, .seg and type classes. */

.tc-page { display: flex; flex-direction: column; gap: var(--s3, 12px); }

.tc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3, 12px);
  margin-bottom: var(--s1, 4px);
}

.tc-top .t-title { margin: 0; }

.tc-empty { color: var(--muted); }

.tc-section {
  margin: var(--s4, 16px) 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tc-meta { margin: var(--s1, 4px) 0 0; }
.tc-note { margin: var(--s2, 8px) 0 0; }
.tc-back { align-self: flex-start; }

/* ---------- project cards ---------- */

.proj-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-comp);
  padding: var(--s3, 12px) var(--s4, 16px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.proj-card:active { transform: scale(0.99); }

.proj-head {
  display: flex;
  align-items: center;
  gap: var(--s2, 8px);
}

.proj-title { font-weight: 600; }

.cdot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.cdot-slate { background: #64748B; }
.cdot-blue { background: var(--blue); }
.cdot-green { background: var(--green); }
.cdot-amber { background: var(--amber); }
.cdot-red { background: #E5484D; }

/* ---------- progress ---------- */

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--raised);
  overflow: hidden;
  margin-top: var(--s2, 8px);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--violet);
  transition: width var(--motion-med) var(--ease-out);
}

/* ---------- project detail ---------- */

.tc-detail-head {
  display: flex;
  align-items: center;
  gap: var(--s2, 8px);
}

.tc-detail-head .t-title { margin: 0; }
.tc-detail-note { margin: 0; }

.tc-task-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s2, 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-comp);
  padding: var(--s2, 8px) var(--s3, 12px);
}

.tc-check {
  width: var(--tap-min);
  height: var(--tap-min);
  flex: none;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--teal);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.tc-check[aria-pressed="true"] { border-color: var(--teal); }

.tc-task-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
  min-height: var(--tap-min);
  justify-content: center;
}

.tc-done-text { text-decoration: line-through; color: var(--muted); }

.tc-quickadd {
  display: flex;
  gap: var(--s2, 8px);
  align-items: center;
}

.tc-quickadd .field { flex: 1; }

.tc-actions {
  display: flex;
  gap: var(--s2, 8px);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--s2, 8px);
}

.tc-confirm { display: inline-flex; gap: var(--s2, 8px); }

.tc-danger { color: var(--coral); border-color: var(--coral); }

/* ---------- forms ---------- */

.tc-form { display: flex; flex-direction: column; gap: var(--s2, 8px); }

.tc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: var(--s2, 8px) 0 0;
}

.tc-form-row {
  display: flex;
  gap: var(--s2, 8px);
  margin-top: var(--s4, 16px);
}

.tc-form select.field {
  appearance: auto;
  min-height: var(--tap-min);
}

/* ---------- recurring rules ---------- */

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-comp);
  padding: var(--s3, 12px) var(--s4, 16px);
  box-shadow: var(--shadow-sm);
}

.rule-paused { opacity: 0.65; }

.rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3, 12px);
}

.rule-head .t-body { font-weight: 600; margin: 0; }

.rule-toggle {
  width: 52px;
  height: 32px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--raised);
  position: relative;
  cursor: pointer;
  padding: 0;
}

.rule-toggle .rule-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--faint);
  transition: left var(--motion-fast) var(--ease-out), background var(--motion-fast);
}

.rule-toggle.on { background: var(--teal); border-color: var(--teal); }

.rule-toggle.on .rule-toggle-knob { left: 22px; background: #fff; }

.day-row {
  display: flex;
  gap: var(--s2, 8px);
  flex-wrap: wrap;
}

.day-chip {
  min-width: var(--tap-min);
  min-height: 40px;
  padding: 0 var(--s2, 8px);
  border-radius: var(--r-chip);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.day-chip.on {
  border-color: var(--violet);
  background: var(--violet);
  color: var(--on-accent);
}

/* ---------- contracts ---------- */

.tc-explainer { color: var(--muted); margin: 0; }

.contract-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-comp);
  padding: var(--s3, 12px) var(--s4, 16px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s1, 4px);
}

.contract-card.breached { border-color: var(--coral); }

.contract-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2, 8px);
}

.contract-head .t-body { font-weight: 600; margin: 0; }

.tc-contract-msg { margin: var(--s1, 4px) 0; font-style: italic; }

.tc-stake { font-weight: 600; color: var(--text); margin: 0; }

.badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px var(--s2, 8px);
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-breached {
  background: var(--coral);
  color: #fff;
}

.tc-foot { color: var(--faint); margin-top: var(--s3, 12px); }
