.black-box {
  width: min(100% - 3rem, 71rem);
}

.case-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .83fr);
  align-items: start;
  gap: clamp(1.1rem, 4vw, 3rem);
}

.case-header h1 {
  font-size: clamp(2rem, 5.9vw, 4.15rem);
  width: fit-content;
  overflow-wrap: anywhere;
}

.case-header h1 span {
  margin-top: .12em;
}

.case-file {
  display: grid;
  gap: .55rem;
  align-content: start;
  padding: clamp(.95rem, 2.6vw, 1.35rem);
  border: 1px solid var(--line);
  border-top: 2px solid var(--red);
  background: #1d1319;
  box-shadow: 4px 4px 0 #080608;
}

.case-file > p:first-child,
.evidence-count {
  color: var(--soft-red);
}

.case-file #case-brief {
  max-width: 58ch;
}

.investigation-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: stretch;
}

.investigation-grid > section,
.finding-panel {
  border-top-color: #86505b;
}

.log-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.log-switcher button {
  min-height: 2.4rem;
  padding: .35rem .55rem;
  font-size: .875rem;
}

.log-switcher [aria-pressed="true"] {
  border-color: var(--soft-red);
  background: #ff9ba3;
  color: #18090c;
  font-weight: 700;
}

.log-feed,
.evidence-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-feed {
  border: 1px solid var(--line);
  background: #0e0c0e;
}

.log-entry,
.evidence-entry {
  display: grid;
  align-items: start;
  justify-content: space-between;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem .75rem;
  padding: .7rem .75rem;
  font-size: .9rem;
}

.log-entry + .log-entry,
.evidence-entry + .evidence-entry {
  border-top: 1px solid var(--line);
}

.log-entry:has([aria-pressed="true"]) {
  box-shadow: inset 2px 0 var(--red);
  background: #1e1318;
}

.log-entry time,
.evidence-entry time {
  display: block;
  margin-bottom: .18rem;
  color: var(--soft-red);
  font-size: .8rem;
}

.log-entry .lab-button,
.evidence-entry .lab-button {
  min-width: 4.4rem;
  min-height: 2.2rem;
  padding: .2rem .5rem;
  font-size: .8rem;
}

.log-entry .lab-button[aria-pressed="true"] {
  border-color: var(--soft-red);
  background: var(--soft-red);
  color: #18090c;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem 1rem;
}

.evidence-count {
  font-size: .85rem;
}

.empty-timeline {
  padding: .85rem;
  border: 1px dashed #76505b;
  background: #100d10;
  color: var(--muted);
}

.evidence-list:not(:empty) {
  border: 1px solid var(--line);
  background: #100d10;
}

.evidence-entry .source-name {
  color: var(--muted);
}

.finding-options {
  padding: 0;
  border: 0;
}

#cause-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .6rem;
}

.cause-option {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  background: #1a1317;
  line-height: 1.45;
  cursor: pointer;
}

.cause-option:has(input:checked) {
  border-color: var(--red);
}

.finding-feedback {
  display: grid;
  gap: .55rem;
  padding: .8rem .9rem;
  border: 1px solid #7d4651;
  border-inline-start: 3px solid var(--red);
  background: #21151a;
}

.finding-feedback h4,
.finding-feedback ul {
  margin: 0;
}

.finding-feedback ul {
  padding-inline-start: 1.35rem;
}

.finding-feedback li + li {
  margin-top: .25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 48rem) {
  .black-box { width: calc(100% - 2.25rem); }
  .case-header,
  .investigation-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 26rem) {
  .black-box { width: calc(100% - 1.65rem); }
  .log-entry,
  .evidence-entry { padding-inline: .55rem; }
}
