.progress-workspace {
  --progress-accent: #254b3b;
  --progress-green: #3b7357;
  --progress-sage: #edf3e8;
  --progress-line: #c9d6c5;
  --progress-gap: clamp(12px, 2.4vw, 22px);
  margin: 0 auto 2rem;
}

.progress-workspace > * + * { margin-block-start: var(--progress-gap); }
.progress-workspace h2 { margin: 0 0 .6em; font-size: clamp(1.5rem, 3.4vw, 2rem); }
.progress-workspace h3 { margin: 0 0 .55em; font-size: clamp(1.13rem, 2.1vw, 1.35rem); }
.progress-workspace p { max-width: 68ch; }
.progress-workspace a:not(.button) { color: var(--progress-accent); text-decoration: underline; text-underline-offset: .16em; }
.progress-workspace :is([id], a, button, select, summary, [tabindex]) { scroll-margin-block-start: 6rem; }
.progress-workspace :is(select, summary, [tabindex]):focus-visible { outline: 3px solid var(--progress-accent); outline-offset: 3px; }

.progress-panel {
  min-width: 0;
  padding: clamp(15px, 3.4vw, 28px);
  border: 1px solid var(--line, var(--progress-line));
  border-radius: var(--exam-radius, 12px);
  background: var(--exam-panel, #fffdf7);
}
.progress-panel > :last-child { margin-block-end: 0; }
.progress-intro { background: #f3f6ed; }
.progress-intro .eyebrow { margin-block-end: 9px; }
.progress-empty { padding: 12px 14px; border-radius: 8px; background: var(--progress-sage); color: var(--progress-accent); }
.progress-empty > :last-child { margin-block-end: 0; }
.progress-note { color: var(--exam-text, #44584d); font-size: .94rem; }
.progress-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 14px 0; }
.progress-actions .button { min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }

.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--progress-gap);
}
.progress-grid > * { min-width: 0; }
.progress-grid > * > .progress-panel + .progress-panel { margin-block-start: var(--progress-gap); }
.progress-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 8px;
  margin-block: 15px 0;
  padding-inline-start: 0;
  list-style: none;
}
.progress-metric {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--progress-line);
  border-radius: 9px;
  background: var(--progress-sage);
}
.progress-metric dt { color: var(--exam-text, #44584d); font-size: .9rem; line-height: 1.35; }
.progress-metric :is(dd, .progress-value) {
  display: block;
  margin: .14em 0 0;
  color: var(--progress-accent);
  font-size: clamp(1.45rem, 3.8vw, 2rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
}
.progress-metric small { color: var(--exam-text, #44584d); font-size: .8rem; }

.progress-priorities { margin-block: 0; padding-inline-start: 1.35rem; }
.progress-priorities > li { padding: 10px 0 10px 3px; }
.progress-priorities > li + li { border-block-start: 1px solid var(--progress-line); }
.progress-priorities > li::marker { color: var(--progress-accent); font-weight: 700; }
.progress-priorities :is(p,h3,h4) { margin-block: 0 .35em; }
.progress-priorities .progress-actions { margin-block-start: 8px; }

.progress-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 8px 12px;
  align-items: end;
  margin-block: 10px 16px;
}
.progress-filter label { display: block; font-weight: 650; }
.progress-filter :is(select, input[type="search"]) {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-block-start: 4px;
  padding: 7px 9px;
  border: 1px solid #839b83;
  border-radius: 7px;
  color: var(--ink, #21382e);
  background: var(--exam-panel, #fffdf7);
  font: inherit;
  font-size: max(16px, 1em);
}
.progress-history, .progress-domains { margin-block: 0; padding-inline-start: 0; list-style: none; }
.progress-history-item, .progress-domain {
  min-width: 0;
  margin-block: 7px;
  padding-inline: clamp(9px, 2vw, 15px);
  border: 1px solid var(--progress-line);
  border-radius: 8px;
  background: #f7f9f2;
}
.progress-workspace summary { min-height: 44px; padding-block: 9px; color: var(--progress-accent); font-weight: 650; cursor: pointer; }
.progress-history-item[open], .progress-domain[open] { padding-block-end: 12px; }
.progress-history-item[open] > summary, .progress-domain[open] > summary { border-block-end: 1px solid var(--progress-line); margin-block-end: 9px; }
.progress-history-meta { color: var(--exam-text, #44584d); font-size: .86rem; font-weight: 400; }
.progress-history-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; padding-block: 10px; }
.progress-history-item :is(.eyebrow, .progress-history-meta) { margin: 3px 0; }
.progress-detail { margin-top: 12px; }
.progress-observations { padding-inline-start: 1.2rem; }
.progress-observation { padding-block: 7px; }
.progress-observation + .progress-observation { border-block-start: 1px solid var(--progress-line); }
.progress-observation h4 { margin: 0; }
.progress-observation .revision-formula { overflow-y: hidden; }
.progress-rules dt { font-weight: 700; }
.progress-rules dd { margin: 0 0 8px; }
.progress-history-item ul { padding-inline-start: 1.25rem; }
.progress-history-item .revision-formula { max-width: 100%; overflow-x: auto; }

.progress-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-block: 7px 0;
  border: 1px solid var(--progress-line);
  border-radius: 7px;
}
.progress-table {
  width: 100%;
  min-width: 39rem;
  border-collapse: collapse;
  background: var(--exam-panel, #fffdf7);
  font-size: .89rem;
  font-variant-numeric: tabular-nums;
}
.progress-table caption { padding: 9px 10px; text-align: start; font-weight: 650; }
.progress-table :is(th, td) { padding: 9px 10px; border-block-end: 1px solid #e0e8dd; text-align: start; vertical-align: top; }
.progress-table thead { background: var(--progress-sage); color: var(--progress-accent); }
.progress-table tbody tr:last-child > * { border-block-end: 0; }
.progress-table tbody tr:nth-child(even) { background: #f7f9f2; }
.progress-table th[scope="row"] { min-width: 11rem; }
.progress-status {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #c4cec2;
  border-radius: 5px;
  color: #47584c;
  background: #e9eee7;
  font-size: .83rem;
  font-weight: 700;
  line-height: 1.45;
}
.progress-status[data-status="reinforce"] { border-color: #d6c5a6; color: #65491f; background: #f5ebd6; }
.progress-status[data-status="progressing"] { border-color: #b6ccd0; color: #2f5259; background: #e7f0f0; }
.progress-status[data-status="probable"] { border-color: #b0c8b2; color: #254c36; background: #e3eee1; }

.progress-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--progress-gap); }
.progress-chart { min-width: 0; margin: 0; }
.progress-chart figcaption { margin-block-end: 8px; color: var(--progress-accent); font-weight: 650; }
.progress-bars { display: grid; gap: 7px; margin: 0; padding-inline-start: 0; list-style: none; }
.progress-bar-row {
  display: grid;
  grid-template-columns: minmax(5.8rem, .85fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 5px 8px;
  min-width: 0;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.progress-bar-track { display: block; height: .62rem; min-width: 0; overflow: hidden; border-radius: 1rem; background: #e2ebe0; }
.progress-bar-fill { display: block; width: 0; height: 100%; max-width: 100%; border-radius: inherit; background: var(--progress-green); }
.progress-bar-value { text-align: end; font-weight: 650; }
.progress-bar-row[data-empty] .progress-bar-track { border: 1px dashed #a0b2a1; background: transparent; }

.progress-dialog {
  width: min(32rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(15px, 4vw, 24px);
  border: 1px solid var(--line, #c9d6c5);
  border-radius: 12px;
  color: var(--ink, #21382e);
  background: var(--exam-panel, #fffdf7);
}
.progress-dialog::backdrop { background: #142b22bf; }
.progress-dialog h2 { margin-block: 0 .6em; }

@media (max-width: 760px) {
  .progress-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 450px) {
  .progress-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .progress-bar-track { grid-column: 1 / -1; grid-row: 2; }
}
