/* Work: Dima's layout in aius.co's document style. The view sits on the page ground; every block a
   reader consults is a card (aius-card), prose and provenance notes stay on the ground, and each
   disclosure carries the one circle mark (disclosure-mark). */
.work-page {
  position: relative;
}
.work-header {
  margin-bottom: 32px;
}
.work-header h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: var(--ls-title);
  line-height: 1.1;
  margin: 0;
}
.work-header p {
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 12px 0 0;
  max-width: 720px;
}
/* Sections are separated by space and their own head: no rule and no padding between them. */
.work-section {
  margin: 32px 0 0;
  scroll-margin-top: var(--outline-anchor-gap, 0px);
}
.work-header + .work-section {
  margin-top: 0;
}
/* Section labels are aius.co's .h-section. */
.work-label {
  color: var(--caps-ink);
  font-family: var(--caps-font);
  font-size: var(--caps-size);
  font-weight: var(--caps-weight);
  letter-spacing: var(--ls-caps);
  line-height: var(--caps-line);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.work-label *,
.work-lesson-kicker * {
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}
.work-section h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: var(--ls-title);
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}
/* The verdict clause reads at body ink against the muted remainder: a step in ink, not a slab of weight. */
.work-deck {
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 12px 0 0;
}
.work-deck b {
  color: var(--fg);
  font-weight: 500;
}
.work-foot {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}

/* The metric band: one card, one column per fact, one peak. */
/* The metric band takes aius.co's KPI scale: 12px labels, 24px 600 values. */
.work-metrics {
  display: grid;
  gap: 16px 24px;
  grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
  margin-top: 20px;
  min-width: 0;
  padding: 18px;
}
.work-metric {
  color: var(--fg-muted);
  display: grid;
  gap: 8px;
  /* Label, value and note share the band's rows, so values keep one baseline when a label wraps. */
  grid-row: span 3;
  grid-template-rows: subgrid;
  min-width: 0;
  overflow-wrap: anywhere;
}
.work-metric > span,
.work-metric small {
  font-size: 12px;
  line-height: 1.4;
}
.work-metric strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: var(--ls-title);
  line-height: 1.2;
}
.work-metric[data-peak] strong {
  color: var(--fg);
  font-weight: 600;
}
.work-metric[data-peak="warning"] > span,
.work-metric[data-peak="warning"] strong {
  color: var(--caution);
}
.work-metric[data-peak="warning"] > span {
  font-weight: 500;
}
/* The attention state never rests on colour alone: a glyph leads the label. */
.work-metric[data-peak="warning"] > span::before {
  content: "\25B2" / "";
  font-size: 12px;
  line-height: 1;
  margin-inline-end: 4px;
}

/* Limited report sections: a consulted list, so a card; each row states its state once, in a chip
   at its right end. The chip is first in the markup so it is heard before the claim it qualifies. */
.work-limits {
  list-style: none;
  margin: 20px 0 0;
  padding: 4px 18px;
}
.work-limits > li {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 0;
}
.work-limits > li + li {
  border-top: 1px solid var(--line);
}
.work-limits > li > div {
  grid-area: 1 / 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.work-limits > li > .work-chip {
  grid-area: 1 / 2;
}
.work-limits strong {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
.work-limits p {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  margin: 4px 0 0;
}
/* The state chip is aius.co's amber pill. */
.work-chip {
  align-items: center;
  background: var(--warning-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--warning-fg);
  display: inline-flex;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  min-height: 22px;
  padding: 0 8px;
  white-space: nowrap;
}

/* Tier A: a section-level disclosure is a card. It pays no padding on the shell; the head is the
   hit target and carries the mark at its right end, and one hairline opens the body. */
.work-disclosure {
  margin-top: 16px;
  min-width: 0;
  padding: 0;
}
.work-disclosure > summary {
  align-items: center;
  border-radius: calc(var(--radius-lg) - 1px);
  column-gap: 16px;
  cursor: pointer;
  display: grid;
  font-weight: 400;
  grid-template-columns: minmax(0, 1fr) 24px;
  list-style: none;
  min-block-size: 56px;
  padding: 0 18px;
  user-select: none;
}
.work-disclosure[open] > summary {
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}
.work-disclosure > summary::-webkit-details-marker,
.work-stream > summary::-webkit-details-marker,
.work-identity-brief > summary::-webkit-details-marker {
  display: none;
}
.work-disclosure__heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.work-disclosure__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
.work-disclosure__signal {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.4;
}
.work-disclosure > .work-disclosure__body {
  border-top: 1px solid var(--line);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 16px 18px 18px;
}
/* Published sessions are rows inside the card: each row after the first opens with its own rule,
   the body's hairline opens the list and the card edge closes it. */
.work-sessions > .work-disclosure__body {
  padding-block: 4px 8px;
}
.work-sessions .rows {
  border-top: 0;
}
.work-sessions .item-row {
  border-bottom: 0;
}
.work-sessions .item-row + .item-row {
  border-top: 1px solid var(--line);
}
.work-disclosure__body > .work-foot:first-child {
  margin-top: 0;
}
.work-disclosure__body > .work-foot + .work-run-data {
  margin-top: 16px;
}
.work-disclosure > summary:focus-visible,
.work-stream > summary:focus-visible,
.work-identity-brief > summary:focus-visible {
  box-shadow: 0 0 0 3px rgb(46 0 156 / 0.12);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* The ledger: one card, no padding on the shell; its rows are Tier B disclosures that pay the
   inset themselves, so the hit target reaches the card edge. A rule opens each row after the first;
   the card edge closes the list. */
.work-ledger-card {
  margin-top: 20px;
  min-width: 0;
}
.work-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}
.work-ledger > li + li {
  border-top: 1px solid var(--line);
}
.work-ledger-empty {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  padding: 14px 18px;
}
.work-stream {
  border: 0;
  padding: 0;
}
.work-stream > summary {
  align-items: center;
  column-gap: 16px;
  cursor: pointer;
  display: grid;
  font-weight: 400;
  grid-template-columns: 24px minmax(0, 1fr) auto minmax(144px, 216px);
  list-style: none;
  padding: 16px 18px;
  user-select: none;
}
.work-ledger > li:first-child > .work-stream > summary {
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}
.work-stream > summary > .disclosure-mark {
  align-self: center;
}
.work-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.work-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}
.work-name small {
  color: var(--fg-muted);
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}
/* The flagged row names its own cause: the tag leads the sub-line, in the warning trio. */
.work-tag {
  align-items: center;
  background: var(--warning-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--warning-fg);
  display: inline-flex;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  min-height: 22px;
  padding: 0 8px;
  white-space: nowrap;
  margin-inline-end: 8px;
  vertical-align: baseline;
}
.work-row-metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(64px, auto) minmax(56px, auto) minmax(104px, auto);
}
.work-row-metrics > span {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-align: right;
}
.work-row-metrics small {
  color: var(--fg-muted);
  font-size: 12px;
}
.work-share {
  align-items: center;
  display: grid;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.work-share > :last-child {
  min-width: 40px;
  text-align: right;
}
.work-bar {
  background: var(--chart-solo-soft);
  border-radius: 2px;
  height: 8px;
}
.work-stream[data-rewritten] .work-name strong {
  font-weight: 600;
}
.work-stream[data-rewritten] .work-bar {
  background: var(--chart-solo);
}
/* Tier B body: no ground, no radius, no shadow; only the inset, so its ink meets the head's axis. */
.work-stream > .work-run-body {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  min-width: 0;
  padding: 0 18px 18px;
}
.work-ledger-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
}
.work-ledger-foot > .work-foot {
  margin: 0;
}

/* Runs inside a disclosure. The scroller is the containing block for its own visually hidden
   header text, so that text cannot widen the page past the scroller. */
.work-run-scroll {
  max-width: 100%;
  overflow: auto;
  position: relative;
}
.work-measurement {
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.work-run-scroll table {
  min-width: 1200px;
  table-layout: fixed;
}
.work-run-scroll th {
  background: transparent;
  font-weight: 500;
}
.work-run-scroll thead th {
  border-bottom-color: var(--line);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.work-run-scroll tbody tr:last-child > * {
  border-bottom: 0;
}
/* The table's outer ink meets the card's axis instead of hanging a cell inset inboard of it. */
.work-run-scroll tr > :first-child {
  padding-inline-start: 0;
}
.work-run-scroll tr > :last-child {
  padding-inline-end: 0;
}
.work-run-scroll thead th:nth-child(1),
.work-run-scroll thead th:nth-child(2),
.work-run-scroll thead th:nth-child(5) {
  width: 10%;
}
.work-run-scroll thead th:nth-child(3) {
  width: 12%;
}
.work-run-scroll thead th:nth-child(4) {
  width: 11%;
}
.work-run-scroll thead th:nth-child(6) {
  width: 6%;
}
.work-run-scroll thead th:nth-child(7) {
  width: 5%;
}
.work-run-scroll thead th:nth-child(8) {
  width: 9%;
}
.work-run-scroll thead th:nth-child(9) {
  width: 23%;
}
.work-run-scroll thead th:nth-child(10) {
  width: 4%;
}
.work-outputs {
  list-style: none;
  margin: 0;
  min-width: 200px;
  padding: 0;
}
.work-outputs li + li {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.work-outputs .annotation,
.work-previous {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}
.work-outputs a {
  overflow-wrap: anywhere;
}
.work-run-scroll caption {
  color: var(--fg-muted);
  font-size: 12px;
  padding: 0 0 12px;
  text-align: left;
}
.work-run-scroll .number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.work-run-data > button[data-more-runs] {
  margin-top: 12px;
}
.work-run-scroll tr:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* A workstream lesson is an authored judgement that interrupts the run record: an aius.co callout
   in the judgement tone, never a nested card. */
.work-lesson {
  background: var(--brand-wash);
  border: 1px solid rgb(var(--brand-rgb) / 0.18);
  border-radius: var(--radius-md);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 14px 16px;
}
.work-lesson-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.work-lesson-kicker {
  color: var(--brand);
  font-family: var(--caps-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin: 0;
  text-transform: uppercase;
}
.work-lesson h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin: 4px 0 8px;
}
.work-lesson-text {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.work-citations {
  font-size: 12px;
  line-height: 1.5;
  padding-left: 20px;
}
.work-citations .annotation {
  display: block;
}

/* Provenance notes collect at the foot of a section, on the ground under a hairline. */
.work-apparatus {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 14px;
}
.work-apparatus > .work-foot {
  margin: 0;
}

/* Identity history rows sit inside the Tier A body; each brief snapshot is a nested Tier B
   disclosure whose body starts under its name. */
.work-identity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.work-identity-list > li {
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  padding: 20px 0;
}
.work-identity-list > li:last-child {
  padding-bottom: 0;
}
.work-identity-meta {
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px 24px;
  justify-content: space-between;
}
.work-identity-list h3 {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  margin: 8px 0;
}
.work-identity-goal {
  white-space: pre-wrap;
}
.work-identity-brief {
  border: 0;
  margin-top: 12px;
  padding: 0;
}
.work-identity-brief > summary {
  align-items: center;
  column-gap: 16px;
  display: grid;
  font-size: 13.5px;
  grid-template-columns: 24px minmax(0, 1fr);
  list-style: none;
  user-select: none;
}
.work-identity-brief > pre {
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 1.5;
  margin: 16px 0 0 40px;
  max-height: 320px;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 1199px) {
  .work-stream > summary {
    grid-template-columns: 24px minmax(0, 1fr) auto minmax(108px, 144px);
  }
}
@media (max-width: 959px) {
  .work-stream > summary {
    align-items: start;
    grid-template-columns: 24px minmax(0, 1fr);
    row-gap: 12px;
  }
  .work-row-metrics,
  .work-share {
    grid-column: 2 / -1;
  }
  /* The cells sit under the name at their own widths; only the token cell wraps when it must. */
  .work-row-metrics {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
  .work-row-metrics > span {
    overflow-wrap: anywhere;
    text-align: left;
  }
  .work-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Every Work card steps its inset down together. */
@media (max-width: 719px) {
  .work-metrics {
    padding: 16px;
  }
  .work-limits {
    padding: 0 16px;
  }
  .work-disclosure > summary {
    padding: 0 16px;
  }
  .work-disclosure > .work-disclosure__body {
    padding: 16px;
  }
  .work-sessions > .work-disclosure__body {
    padding-block: 0 4px;
  }
  .work-stream > summary {
    padding: 16px;
  }
  .work-stream > .work-run-body {
    padding: 0 16px 16px;
  }
  .work-ledger-empty,
  .work-ledger-foot {
    padding: 16px;
  }
  .work-identity-brief > pre {
    margin-left: 0;
  }
}
@media (max-width: 479px) {
  .work-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media print {
  .work-lesson,
  .work-identity-list > li {
    break-inside: avoid;
  }
  .work-lesson {
    border-color: var(--brand-line);
  }
  .work-outputs {
    min-width: 0;
  }
  .work-metrics,
  .work-limits > li,
  .work-disclosure > summary,
  .work-stream > summary,
  .work-run-scroll tr {
    break-inside: avoid;
  }
  .work-disclosure > summary,
  .work-stream > summary {
    break-after: avoid;
  }
  /* The mark does not print, so the ledger head gives its leading track back to the name. */
  .work-stream > summary {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }
  .work-stream > summary > * {
    grid-column: 1 / -1;
  }
  .work-identity-brief > summary {
    grid-template-columns: minmax(0, 1fr);
  }
  .work-identity-brief > pre {
    margin-left: 0;
  }
  .work-disclosure > summary {
    min-block-size: 0;
    padding-block: 16px;
  }
  .work-run-scroll th:last-child,
  .work-run-scroll td:last-child {
    display: none;
  }
  .work-run-body button,
  .work-disclosure__body button,
  .work-sessions .row-actions {
    display: none !important;
  }
  /* Nothing scrolls on paper, so the scroller need not contain its hidden text; staying in flow keeps
     the table in reading order in the printed text layer. */
  .work-run-scroll {
    overflow: visible;
    position: static;
  }
  .work-run-scroll table {
    font-size: 11px;
    min-width: 0;
  }
  .work-run-scroll .annotation,
  .work-previous {
    font-size: 11px;
  }
  .work-run-scroll thead th:nth-child(4) {
    width: 10%;
  }
  .work-run-scroll thead th:nth-child(6) {
    width: 8%;
  }
  .work-run-scroll thead th:nth-child(7) {
    width: 6%;
  }
  .work-run-scroll thead th:nth-child(8) {
    width: 11%;
  }
  .work-run-scroll thead th:nth-child(9) {
    width: 23%;
  }
  .work-run-scroll th,
  .work-run-scroll td {
    overflow-wrap: anywhere;
    padding: 6px 3px;
  }
  .work-bar {
    print-color-adjust: exact;
  }
  .work-identity-brief > pre {
    max-height: none;
    overflow: visible;
  }
}
