:root {
  --radius: 3px;
  --brand-red: #bf1b30;
}
:root[data-theme="light"] {
  --bg: #fff;
  --hot: var(--brand-red);
  --hot2: #a51a2a;
  --tint: #fbeced;
  --line: #dcd9d6;
}
.brand-stripes, .headline::after {
  display: block;
  width: 36px;
  height: 23px;
  flex: none;
  background: linear-gradient(to right, var(--brand-red) 0 25%, transparent 25% 37.5%, var(--brand-red) 37.5% 62.5%, transparent 62.5% 75%, var(--brand-red) 75%);
  transform: skewX(-24deg);
}
.brand { gap: 13px; letter-spacing: -.035em; }
.brand small { color: var(--text); font-size: .67rem; }
.auth { border-top: 4px solid var(--brand-red); }
.auth-art { background: var(--surface-soft); border: 0; border-left: 1px solid var(--line); }
.auth-art .brand-stripes { width: min(52%, 19rem); height: clamp(4rem, 13vw, 12rem); }
.headline {
  gap: 12px 24px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}
.headline::after { content: ""; width: 47px; height: 30px; align-self: center; margin-inline: auto 8px; }
.headline .actions { margin-inline-start: auto; }
.headline:has(.actions)::after { display: none; }
.headline h1 { font-size: clamp(2.05rem, 4.5vw, 4.2rem); letter-spacing: -.065em; }
.case-work-pane { min-width: 0; }
.case-work-pane > :is(.panel,.case-disclosure,.actions) { margin-block: 12px 0; scroll-margin-top: 16px; }
.case-work-pane > :first-child { margin-top: 0; }
.case-work-pane :is(.panel,.case-original-photo) { min-width: 0; }
.case-original-photo { align-self: start; background: var(--panel); border-top: 3px solid var(--text); }
.original-photo-frame { text-align: center; background: var(--photo); line-height: 0; }
.original-photo-plane { position: relative; display: inline-block; max-width: 100%; }
.case-original-photo .original-photo-plane img { width: auto; max-width: 100%; height: auto; max-height: 31rem; aspect-ratio: auto; border-radius: 0; }
.finding-pin {
  display: none;
  position: absolute;
  inset-inline-start: clamp(18px, var(--pin-x), calc(100% - 18px));
  top: clamp(18px, var(--pin-y), calc(100% - 18px));
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 1px #401017, 0 2px 5px #0008;
  color: #fff;
  font: 700 1.05rem/1 var(--heading);
  cursor: pointer;
}
.original-photo-plane.ready .finding-pin { display: block; }
.finding-pin:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.cut-wipe { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--photo); --split: 50%; }
.cut-wipe img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cut-wipe-before { position: absolute; inset: 0; background: var(--photo); clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.cut-wipe-line { position: absolute; inset-block: 0; left: var(--split); width: 2px; background: #fff; box-shadow: 0 0 0 1px #1118; pointer-events: none; }
.cut-wipe-line b { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; background: var(--brand-red); color: #fff; padding: 2px 8px; border: 1px solid #fff; }
.cut-wipe input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cut-wipe:focus-within { outline: 2px solid var(--hot2); outline-offset: 2px; }
.cut-wipe-caption { display: flex; justify-content: space-between; color: var(--muted); }
.closed-evidence { display: grid; gap: 10px; margin-block: 14px; }
.closed-evidence.has-pair { grid-template-columns: repeat(2, minmax(0,1fr)); }
.closed-evidence figure { min-width: 0; margin: 0; border: 1px solid var(--line); }
.closed-evidence img { display: block; width: 100%; height: clamp(8rem, 24vw, 22rem); object-fit: contain; background: var(--photo); }
.closed-evidence figcaption { padding: 7px 10px; color: var(--muted); font-weight: 600; }
.case-result-changes { margin-top: 10px; }
@container (min-width: 43rem) {
  .case-diagnosis-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .case-diagnosis-layout > .case-original-photo { grid-column: 1; grid-row: 1; }
  .case-diagnosis-layout > .detail-copy { grid-column: 2; grid-row: 1; }
}
@media screen {
  .layout { display: block; }
  .sidebar {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding: 12px max(var(--page-gutter), calc((100vw - var(--page-width)) / 2 + var(--page-gutter)));
    border: 0;
    border-top: 4px solid var(--brand-red);
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand { margin: 0 0 0 4px; }
  .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
  .nav a { min-height: 40px; padding: 6px 10px; }
  .nav-icon { display: none; }
  .account { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account .avatar { display: none; }
  .topbar { min-height: 46px; padding-block: 4px; }
  .theme-switch, .theme-switch button, .btn { border-radius: 3px; }
  .case-flow { max-width: none; }
  .case-work-pane .panel:target, .case-work-pane .panel:focus { scroll-margin-top: 1.5rem; }
}
@media screen and (min-width: 900px) {
  .case-flow { display: grid; grid-template-columns: clamp(190px, 19vw, 265px) minmax(0, 1fr); gap: clamp(18px, 3vw, 42px); align-items: start; }
  .case-flow > .case-progress {
    position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; margin: 0;
    padding: 0 14px 5px 0; border: 0; border-inline-end: 1px solid var(--line); border-radius: 0;
  }
  .case-progress-summary { grid-template-columns: 1fr; gap: 9px; padding: 12px; }
  .case-progress .case-progress-action { justify-self: stretch; }
  .case-progress .case-steps { grid-template-columns: 1fr; grid-auto-flow: row; gap: 1px; }
  .case-step:not(:last-child)::after { display: none; }
  .case-steps .case-step-hit { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; align-content: center; justify-items: start; gap: 10px; padding: 8px 9px; text-align: start; border-radius: 0; }
  .case-step-copy { font-size: 1rem; }
  .case-step[aria-current="step"] { background: var(--tint); border-inline-start: 3px solid var(--hot); }
  .case-step-dot { border-radius: 3px; }
}
@media screen and (max-width: 899px) {
  .sidebar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; padding-block: 7px 4px; }
  .sidebar .account { grid-column: 2; grid-row: 1; }
  .sidebar .nav { grid-column: 1/-1; display: flex; flex-wrap: nowrap; overflow-x: auto; }
  .nav a { flex: none; min-height: 44px; }
  .headline::after { width: 33px; height: 22px; }
  .headline > div:first-child { flex: 1; }
  .case-diagnosis-layout > .case-original-photo { order: -1; }
}
@media (max-width: 540px) {
  #content { padding-inline: 12px; }
  .sidebar { padding-inline: 12px; }
  .brand-stripes { width: 28px; height: 18px; }
  .case-progress .case-steps { grid-template-columns: repeat(2, minmax(0,1fr)); grid-auto-flow: row; gap: 3px; }
  .case-steps .case-step-hit { grid-template-columns: 22px minmax(0,1fr); align-items: center; align-content: center; justify-items: start; gap: 5px; padding: 3px; text-align: start; }
  .case-step:not(:last-child)::after { display: none; }
  .case-steps .case-step-dot { inline-size: 20px; block-size: 20px; }
  .case-steps .case-step-meta { font-size: .75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .headline::after { animation: stripe-wipe .38s ease-out both; }
  .finding-pin:active { box-shadow: 0 0 0 6px #c5284855; }
  @keyframes stripe-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
}
