.report-header { display: grid; grid-template-columns: 1fr auto; gap: var(--space-5); align-items: end; padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.report-header h1 { margin-bottom: 0; overflow-wrap: anywhere; }
.report-meta { display: grid; grid-template-columns: repeat(3, auto); gap: var(--space-4); margin: 0; }
.report-meta dt { margin-bottom: var(--space-1); color: var(--muted); font-size: 12px; }
.report-meta dd { margin: 0; font-size: 14px; }
.scan-status { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.status-success { color: var(--ok); }
.status-suspect, .status-timeout { color: var(--warn); }
.status-running { color: var(--accent); }
.status-failed { color: var(--crit); }
.pulse-dot { width: 8px; height: 8px; background: currentColor; animation: scan-pulse 1.4s ease-out infinite; }

@keyframes scan-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.progress-line { margin: var(--space-3) 0 0; padding: var(--space-3); border-left: 3px solid var(--accent); background: var(--surface); color: var(--muted); }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); margin: var(--space-5) 0; border: 1px solid var(--line); background: var(--surface); }
.funnel > div { min-width: 0; padding: var(--space-3); border-right: 1px solid var(--line); }
.funnel > div:last-child { border-right: 0; }
.funnel span { display: block; min-height: 40px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.funnel strong { display: block; margin-top: var(--space-2); font: 600 clamp(26px, 4vw, 36px)/1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.funnel-primary strong { color: var(--accent); }

.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.tier-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-button, .sort-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.filter-button.is-active { border-color: var(--accent); color: var(--accent); }
.sort-button { font-family: var(--font-mono); font-size: 12px; }

.finding-section { margin: var(--space-6) 0; padding-left: var(--space-4); border-left: 3px solid var(--noise); }
.tier-A, .tier-B1 { border-left-color: var(--crit); }
.tier-B2 { border-left-color: var(--warn); }
.noise-section { border-left-color: var(--noise); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-heading h2 { margin-bottom: 0; }
.tier-label { display: block; margin-bottom: var(--space-1); color: var(--muted); font: 600 11px/1.2 var(--font-mono); letter-spacing: 0.09em; }
.tier-A .tier-label, .tier-B1 .tier-label { color: var(--crit); }
.tier-B2 .tier-label { color: var(--warn); }
.section-deadline { color: var(--muted); font-size: 13px; }
.finding-list { border-top: 1px solid var(--line); }
.finding-row { border-bottom: 1px solid var(--line); background: transparent; }
.finding-toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: 12px 0;
  border: 0;
  border-left: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.finding-title { font-weight: 600; line-height: 1.35; }
.probability { color: var(--muted); font: 500 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.finding-details, .noise-content { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 180ms ease-out, opacity 180ms ease-out; }
.js .finding-details:not(.is-open), .js .noise-content:not(.is-open) { grid-template-rows: 0fr; opacity: 0; }
.finding-details-inner, .noise-content-inner { min-height: 0; overflow: hidden; }
.finding-explanation { display: grid; gap: var(--space-3); margin: 0; padding: var(--space-2) 0 var(--space-3); }
.finding-explanation div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--space-3); }
.finding-explanation dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.finding-explanation dd { margin: 0; line-height: 1.55; }
.technical-line { margin: 0 0 var(--space-3); color: var(--muted); font: 400 12px/1.55 var(--font-mono); overflow-wrap: anywhere; }

.js .finding-row.is-entering { animation: row-enter 200ms ease-out both; }
.js .finding-section[hidden] { display: none; }
@keyframes row-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.noise-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 0 var(--space-3);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.noise-toggle strong { display: block; font-size: 20px; }
.noise-toggle > span:last-child { color: var(--muted); font-size: 13px; }
.noise-content-inner > p { max-width: 700px; margin: var(--space-3) 0; color: var(--muted); line-height: 1.55; }
.noise-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.noise-table th, .noise-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.noise-table th { color: var(--muted); font-size: 12px; font-weight: 500; }
.noise-table th:first-child { width: 28%; }
.noise-table th:last-child { width: 20%; }
.noise-table th button { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }

.workflow-summary { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.workflow-summary dl { margin: 0; }
.workflow-summary dl div { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.workflow-summary dd { margin: 0; color: var(--muted); }
.review-signoff { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); color: var(--muted); }
.review-signoff strong { color: var(--fg); }

@media (max-width: 700px) {
  .report-header { grid-template-columns: 1fr; align-items: start; }
  .report-meta { grid-template-columns: repeat(2, 1fr); }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .funnel > div:nth-child(2) { border-right: 0; }
  .funnel > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .report-toolbar, .section-heading { align-items: stretch; flex-direction: column; }
  .sort-button { align-self: flex-start; }
  .finding-section { padding-left: var(--space-3); }
}

@media (max-width: 500px) {
  .report-meta { grid-template-columns: 1fr; gap: var(--space-2); }
  .finding-explanation div { grid-template-columns: 1fr; gap: var(--space-1); }
  .finding-toggle { grid-template-columns: 1fr; gap: var(--space-1); }
  .noise-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .noise-table, .noise-table tbody, .noise-table tr, .noise-table td { display: block; width: 100%; }
  .noise-table tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
  .noise-table td { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: var(--space-2); padding: 4px 0; border: 0; }
  .noise-table td::before { content: attr(data-label); color: var(--muted); font-family: var(--font-body); font-size: 12px; }
  .workflow-summary dl div { flex-direction: column; gap: var(--space-1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
