/* Results (close-demo.html) only: the score table, the click-to-open detail, the draft entry and the download.
   Tables read like a workpaper: labels left, figures right, thin rules, the total ruled twice. */

.tbl-scroll, .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sub { display: block; font-weight: 400; font-size: .875rem; color: var(--fg3); }
.src { font-size: .875rem; color: var(--fg3); }

/* every company */
.scores { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.scores th, .scores td { padding: .6rem .6rem; vertical-align: top; border-bottom: 1px solid var(--hair); }
.scores th:first-child { padding-left: 0; }
.scores thead th:first-child { width: 44%; }
.scores td:last-child, .scores th:last-child { padding-right: 0; }
.scores thead th { font-size: .8125rem; font-weight: 500; color: var(--fg3); text-align: right; vertical-align: bottom; border-bottom-color: var(--hair-2); }
.scores thead th:first-child { text-align: left; }
.scores tbody th, .scores tfoot th { text-align: left; font-weight: 600; }
.scores td { text-align: right; white-space: nowrap; }
.scores tfoot th, .scores tfoot td { border-top: 1px solid var(--fg); border-bottom: 0; font-weight: 600; }
.scores tfoot td .n { border-bottom: 3px double var(--fg); padding-bottom: 1px; }
@media (max-width: 40rem) {
  .scores thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .scores, .scores tbody, .scores tfoot, .scores tr, .scores th, .scores td { display: block; }
  .scores tr { padding: .8rem 0; border-bottom: 1px solid var(--hair); }
  .scores tbody tr:first-child { border-top: 1px solid var(--hair); }
  .scores tfoot tr { border-top: 1px solid var(--fg); border-bottom: 0; }
  .scores th, .scores td, .scores tfoot td, .scores tfoot th { border: 0; padding: .12rem 0; }
  .scores tbody th, .scores tfoot th { padding-bottom: .3rem; }
  .scores td { display: flex; justify-content: space-between; gap: 1rem; }
  .scores td::before { content: attr(data-label); color: var(--fg2); font-weight: 400; }
}

/* a two- or three-column schedule */
.sched { width: 100%; max-width: 38rem; border-collapse: collapse; font-size: .9375rem; }
.sched th, .sched td { padding: .5rem .6rem; vertical-align: top; border-bottom: 1px solid var(--hair); }
.sched th:first-child { padding-left: 0; }
.sched td:last-child, .sched th:last-child { padding-right: 0; }
.sched thead th { font-size: .8125rem; font-weight: 500; color: var(--fg3); text-align: right; vertical-align: bottom; border-bottom-color: var(--hair-2); }
.sched thead th:first-child { text-align: left; }
.sched tbody th { text-align: left; font-weight: 400; }
.sched td { text-align: right; white-space: nowrap; }
@media (max-width: 30rem) { .sched td { white-space: normal; } }

/* click to open */
.folds { border-top: 1px solid var(--hair); }
details.more { border-bottom: 1px solid var(--hair); }
details.more > summary { cursor: pointer; padding: .7rem 0; font-weight: 500; color: var(--accent); }
details.more > summary:hover { color: var(--accent-ink); }
details.more > .more__body { padding: .25rem 0 1rem; display: grid; gap: .8rem; }
.more__body > p { max-width: var(--text); }

/* generated detail: every planted error, and anything missed */
.stack { display: grid; gap: 1rem; }
.folds > .stack, .folds .group:has(> details.more) { gap: 0; }
.group { display: grid; gap: .6rem; }
.folds .group:not(:has(> details.more)) { padding: 1rem 0; border-bottom: 1px solid var(--hair); }
.group__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; }
.group__h .count { font-size: .875rem; color: var(--fg3); }
.group__lede { color: var(--fg2); max-width: var(--text); font-size: .9375rem; }
.items { list-style: none; padding: 0; border-top: 1px solid var(--hair); }
.item { padding: .8rem 0; border-bottom: 1px solid var(--hair); display: grid; gap: .4rem; }
.item__head { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; }
.item__id { font-size: .8125rem; color: var(--fg3); min-width: 2.4rem; }
.item__title { font-weight: 600; flex: 1 1 16rem; min-width: 0; }
.item__dl { display: grid; gap: .3rem; font-size: .9375rem; }
.item__dl > div { display: grid; gap: .1rem .9rem; }
.item__dl dt { font-size: .8125rem; color: var(--fg3); }
.item__dl dd { margin: 0; color: var(--fg2); min-width: 0; }
@media (min-width: 44rem) { .item__dl > div { grid-template-columns: 9.5rem minmax(0, 1fr); } }

.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.45; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--hair); }
.tbl thead th { font-size: .8125rem; font-weight: 500; color: var(--fg3); border-bottom-color: var(--hair-2); vertical-align: bottom; }
.tbl tbody th { font-weight: 400; }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--fg3); white-space: nowrap; }
.chip { display: inline-flex; align-items: baseline; gap: .3rem; color: var(--fg2); white-space: nowrap; }
.chip .i { width: .85em; height: .85em; position: relative; top: .08em; }
.chip--good { color: var(--good); }
.chip--warn { color: var(--warn); }
.chip--bad { color: var(--bad); }
@media (max-width: 43.99rem) {
  .tbl--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl--stack, .tbl--stack tbody, .tbl--stack tr, .tbl--stack th, .tbl--stack td { display: block; }
  .tbl--stack tr { padding: .6rem 0; border-bottom: 1px solid var(--hair); }
  .tbl--stack tbody tr:last-child { border-bottom: 0; }
  .tbl--stack th, .tbl--stack td { border: 0; padding: .1rem 0; }
  .tbl--stack td[data-label="Id"] { font-size: .8125rem; }
  .tbl--stack td:empty { display: none; }
  .chip { white-space: normal; }
}

/* one draft entry, as the tool wrote it */
.cs-anatomy { display: grid; gap: .55rem; max-width: 34rem; }
.cs-anatomy figcaption { font-size: .875rem; color: var(--fg3); }
.cs-slip { border: 1px solid var(--hair-2); border-radius: 8px; padding: .9rem 1rem; display: grid; gap: .6rem; font-size: .9375rem; }
.cs-slip__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; font-size: .875rem; color: var(--fg3); }
.cs-slip__kind { font-weight: 600; color: var(--fg); }
.cs-slip__line { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--hair); }
.cs-slip__line--cr .cs-slip__acct { padding-left: 1.25rem; }
.cs-slip__line--tot { border-top-color: var(--fg); font-weight: 600; }
.cs-slip__line--tot .cs-slip__amt { border-bottom: 3px double var(--fg); }
.cs-slip__side { color: var(--fg3); }
.cs-slip__acct { min-width: 0; }
.cs-slip__amt { text-align: right; white-space: nowrap; }
.cs-slip__meta { display: grid; gap: .1rem; font-size: .875rem; color: var(--fg2); }
.cs-slip__meta > div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .5rem; }
.cs-slip__meta dt { color: var(--fg3); }
.cs-slip__meta dd { margin: 0; }
.item__dl .cs-slip { margin-top: .3rem; max-width: 34rem; }

/* the download */
.dl-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.dl-list small { display: block; font-size: .875rem; color: var(--fg3); }
