.delegated-practice-pack {
  --pack-ink: #173233;
  --pack-muted: #5c7070;
  --pack-line: #c9d8d5;
  --pack-paper: #fbfdfb;
  --pack-accent: #087f7a;
  --pack-accent-dark: #0a5d5a;
  position: relative;
  margin: 0 0 1.25rem;
  padding: clamp(1.1rem, 2.6vw, 2rem);
  overflow: hidden;
  color: var(--pack-ink);
  background:
    linear-gradient(90deg, rgba(8, 127, 122, 0.08) 1px, transparent 1px) 1.4rem 0 / 2.15rem 100%,
    var(--pack-paper);
  border: 1px solid var(--pack-line);
  border-radius: 1.35rem;
  box-shadow: 0 18px 46px rgba(26, 67, 66, 0.11);
}

.delegated-practice-pack::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.42rem;
  background: repeating-linear-gradient(to bottom, var(--pack-accent) 0 0.85rem, transparent 0.85rem 1.2rem);
}

.delegated-practice-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.delegated-practice-heading > div > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--pack-accent-dark);
  font: 750 0.73rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.delegated-practice-heading h3 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(1.55rem, 3.3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.delegated-practice-heading p {
  margin: 0.65rem 0 0;
  max-width: 42rem;
  color: var(--pack-muted);
  line-height: 1.7;
}

.delegated-practice-proof {
  display: grid;
  gap: 0.25rem;
  min-width: 9rem;
  padding: 0.75rem 0.9rem;
  background: #edf6f3;
  border: 1px solid #bcd9d4;
  border-radius: 0.9rem;
}

.delegated-practice-proof span { color: var(--pack-muted); font-size: 0.75rem; }
.delegated-practice-proof strong { color: var(--pack-accent-dark); font-size: 0.92rem; }
.delegated-practice-proof small { max-width: 18rem; color: var(--pack-muted); font-size: 0.74rem; line-height: 1.45; }

.delegated-practice-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 1.4rem 0 1rem;
}

.delegated-practice-rail span {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  color: var(--pack-muted);
  background: rgba(236, 243, 241, 0.72);
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font-size: 0.82rem;
}

.delegated-practice-rail b {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #9bb8b4;
  border-radius: 50%;
  font-size: 0.72rem;
}

.delegated-practice-rail .is-current {
  color: var(--pack-accent-dark);
  background: #f3fbf8;
  border-color: #91c7c0;
  font-weight: 700;
}

.delegated-practice-rail .is-current b,
.delegated-practice-rail .is-complete b {
  color: #fff;
  background: var(--pack-accent);
  border-color: var(--pack-accent);
}

.delegated-practice-controls {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.8fr auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--pack-line);
  border-radius: 1rem;
}

.delegated-practice-controls label {
  display: grid;
  gap: 0.35rem;
  color: var(--pack-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.delegated-practice-controls select,
.delegated-practice-controls button,
.delegated-practice-summary-actions button,
.delegated-practice-marks button {
  min-height: 2.75rem;
  border-radius: 0.72rem;
}

.delegated-practice-controls button {
  padding-inline: 1rem;
  color: #fff;
  background: var(--pack-accent-dark);
  border: 1px solid var(--pack-accent-dark);
  font-weight: 800;
}

.delegated-practice-items {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.delegated-practice-empty {
  margin: 0;
  padding: 1.1rem;
  color: var(--pack-muted);
  text-align: center;
  border: 1px dashed #a8bfbb;
  border-radius: 0.9rem;
}

.delegated-practice-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(10.5rem, auto);
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid var(--pack-line);
  border-radius: 1rem;
}

.delegated-practice-item-index {
  color: #7a9692;
  font: 700 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.delegated-practice-item-copy > div {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.delegated-practice-item-copy span {
  padding: 0.24rem 0.48rem;
  color: #37635f;
  background: #edf6f3;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 750;
}

.delegated-practice-item-copy p {
  margin: 0.45rem 0;
  color: var(--pack-muted);
  line-height: 1.55;
}

.delegated-practice-item-copy blockquote {
  margin: 0;
  color: var(--pack-ink);
  font-weight: 700;
  line-height: 1.55;
}

.delegated-practice-item-copy a { display: inline-block; margin-top: 0.45rem; color: var(--pack-accent-dark); font-weight: 800; }

.delegated-practice-marks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}

.delegated-practice-marks button {
  min-height: 2.3rem;
  padding: 0.35rem 0.45rem;
  color: #42615e;
  background: #f6f9f8;
  border: 1px solid #c8d7d4;
  font-size: 0.72rem;
  font-weight: 700;
}

.delegated-practice-marks button[aria-pressed="true"] {
  color: #fff;
  background: var(--pack-accent);
  border-color: var(--pack-accent);
}

.delegated-practice-status {
  display: block;
  margin-top: 0.8rem;
  color: var(--pack-muted);
  font-size: 0.82rem;
}

.delegated-practice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  margin-top: 0.85rem;
  padding: 0.95rem;
  background: #f2f8f6;
  border: 1px solid #bbd3cf;
  border-radius: 1rem;
}

.delegated-practice-summary-main { display: grid; gap: 0.65rem; }
.delegated-practice-summary label { display: grid; gap: 0.4rem; color: var(--pack-accent-dark); font-weight: 800; }
.delegated-practice-summary textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
.delegated-practice-understanding {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #bbd3cf;
  border-radius: 0.8rem;
  background: #fff;
}
.delegated-practice-understanding legend { padding: 0 0.25rem; color: var(--pack-accent-dark); font-weight: 800; }
.delegated-practice-understanding > div { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.delegated-practice-understanding label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #c7d9d6;
  border-radius: 999px;
  color: var(--pack-ink);
  background: #f8fbfa;
  font-size: 0.82rem;
}
.delegated-practice-understanding output { color: var(--pack-muted); font-size: 0.8rem; line-height: 1.5; }
.delegated-practice-recommendation,
.delegated-practice-delivery-status { display: block; color: var(--pack-muted); font-size: 0.82rem; line-height: 1.55; }
.delegated-practice-print-text { display: none; white-space: pre-wrap; font: inherit; line-height: 1.7; }

.delegated-practice-summary-actions {
  display: grid;
  align-content: end;
  gap: 0.45rem;
  min-width: 9.5rem;
}

.delegated-practice-summary-actions button {
  padding-inline: 0.8rem;
  color: var(--pack-accent-dark);
  background: #fff;
  border: 1px solid #9dbdb8;
  font-weight: 750;
}

.delegated-practice-summary-actions #delegatedPracticeContinue,
.delegated-practice-summary-actions #delegatedPracticeApplySuggestion,
.delegated-practice-summary-actions #delegatedPracticeConfirmHandoff {
  color: #fff;
  background: var(--pack-accent-dark);
  border-color: var(--pack-accent-dark);
}

.delegated-practice-summary-actions button:disabled,
.delegated-practice-marks button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 900px) {
  .delegated-practice-heading,
  .delegated-practice-summary { grid-template-columns: 1fr; }
  .delegated-practice-proof { width: fit-content; }
  .delegated-practice-rail { grid-template-columns: repeat(5, minmax(7.25rem, 1fr)); overflow-x: auto; padding-bottom: 0.25rem; }
  .delegated-practice-controls { grid-template-columns: 1fr 1fr; }
  .delegated-practice-item { grid-template-columns: auto minmax(0, 1fr); }
  .delegated-practice-marks { grid-column: 2; }
  .delegated-practice-summary-actions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 580px) {
  .delegated-practice-pack { margin-inline: -0.2rem; padding: 1rem 0.85rem 1rem 1.05rem; border-radius: 1rem; }
  .delegated-practice-heading h3 { font-size: 1.65rem; }
  .delegated-practice-rail { gap: 0.25rem; scroll-snap-type: x proximity; }
  .delegated-practice-rail span { scroll-snap-align: start; }
  .delegated-practice-rail span { justify-content: center; padding: 0.55rem 0.3rem; font-size: 0.7rem; }
  .delegated-practice-controls { grid-template-columns: 1fr; }
  .delegated-practice-item { grid-template-columns: 1fr; }
  .delegated-practice-item-index { display: none; }
  .delegated-practice-marks { grid-column: 1; }
  .delegated-practice-summary-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .delegated-practice-pack *, .delegated-practice-pack *::before, .delegated-practice-pack *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body.printing-delegated-practice-pack > * { visibility: hidden !important; }
  body.printing-delegated-practice-pack #delegatedPracticePack,
  body.printing-delegated-practice-pack #delegatedPracticePack * { visibility: visible !important; }
  body.printing-delegated-practice-pack #delegatedPracticePack { position: absolute; inset: 0; margin: 0; box-shadow: none; }
  body.printing-delegated-practice-pack #delegatedPracticePack > * { display: none !important; }
  body.printing-delegated-practice-pack #delegatedPracticeSummary { display: block !important; padding: 0; border: 0; background: #fff; }
  body.printing-delegated-practice-pack #delegatedPracticeSummary > * { display: none !important; }
  body.printing-delegated-practice-pack #delegatedPracticeSummary .delegated-practice-summary-main { display: block !important; }
  body.printing-delegated-practice-pack #delegatedPracticeSummary .delegated-practice-summary-main > * { display: none !important; }
  body.printing-delegated-practice-pack #delegatedPracticePrintText { display: block !important; margin: 0; color: #111; }
}
