/* Evidence and triage have independent scroll regions; selection never scrolls the document. */
.audit-layout { overflow-anchor: none; }
.audit-layout .viewer-panel > .toolbar {
  flex-wrap: nowrap;
  gap: 12px;
}
.audit-layout .viewer-panel > .toolbar > .eyebrow {
  flex-shrink: 0;
  white-space: nowrap;
}
.audit-layout .viewer-panel > .toolbar > .actions {
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.audit-layout .viewer-panel .capture-select {
  flex: 1;
  min-width: 0;
  width: auto;
}
.audit-layout .viewer-panel > .toolbar .button {
  flex: 0 0 42px;
  padding: 9px;
}
.audit-layout .screen-frame {
  height: clamp(280px, calc(100dvh - 160px), 780px);
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.audit-layout .screen-frame img { height: auto; }
.audit-layout > section:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}
.audit-layout #finding-list {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 100px;
  scrollbar-gutter: stable;
}
.finding-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  box-shadow: -12px 0 40px #20372f20;
  overflow: hidden;
}
.finding-drawer[open] { display: flex; flex-direction: column; }
.finding-drawer::backdrop { background: rgb(32 55 47 / 12%); }
body:has(.finding-drawer[open]) { overflow: hidden; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.drawer-header h2 { font-size: 17px; margin: 0; }
.finding-drawer #finding-detail { overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.finding-drawer .finding-detail { border: 0; margin: 0; }
html { scrollbar-gutter: stable; }
@media (max-width: 1100px) {
  .audit-layout .viewer-panel {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--paper);
    padding: 10px 0;
  }
  .audit-layout .screen-frame { height: clamp(200px, 38dvh, 400px); }
  .audit-layout .viewer-panel > .kbd-note { margin-bottom: 0; }
  .audit-layout > section:last-child { max-height: none; }
  .audit-layout #finding-list { max-height: 260px; }
  .audit-layout #finding-detail { overflow: visible; }
}
