:root {
  color-scheme: light;
  --accent: #2f6feb;
  --accent-hover: #1d5cd6;
  --accent-ink: #1e57c5;
  --ink: #1d1d1f;
  --secondary: #55555c;
  --muted: #656570;
  --canvas: #fafafc;
  --surface: #fff;
  --chrome: #f4f4f6;
  --line: #e4e4eb;
  --blue-wash: #f3f7ff;
  --blue-line: #dce7fe;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, p, ol, blockquote { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, summary, textarea, .drop-area { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.visually-hidden, .icon-library {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand-wave { width: 25px; height: 25px; color: var(--accent); }
.brand-word { font-size: 22px; font-weight: 760; letter-spacing: -.055em; }
.brand-product {
  color: var(--secondary);
  border-left: 1px solid var(--line);
  padding-left: 10px;
  margin-left: 3px;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: .03em;
}

.main { padding-top: 55px; }
.intro h1 {
  font-size: clamp(2.15rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.062em;
  font-weight: 760;
}
.intro p { margin-top: 12px; color: var(--secondary); font-size: 1.09rem; }
.stepper { margin: 31px 0 23px; }
.stepper ol { display: flex; flex-wrap: wrap; padding: 0; gap: 12px; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 12px; }
.stepper li + li::before { content: ""; width: 26px; height: 1px; background: var(--line); }
.step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 6px 9px 6px 6px;
  font-size: .875rem;
  font-weight: 620;
  text-align: left;
}
.step > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--secondary);
  background: var(--surface);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}
.step[aria-current="step"] { color: var(--accent-ink); background: #edf3ff; border-color: var(--blue-line); }
.step[aria-current="step"] > span { color: #fff; background: var(--accent); border-color: var(--accent); }
.step:not(:disabled):not([aria-current="step"]):hover { background: var(--chrome); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  align-items: start;
  gap: 20px;
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stage { padding: clamp(20px, 3vw, 32px); box-shadow: 0 8px 26px rgba(32, 35, 54, .035); }
.stage-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 23px; }
.stage-icon, .drop-icon {
  display: grid;
  flex: none;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--blue-line);
  border-radius: 12px;
  color: var(--accent);
  background: var(--blue-wash);
}
.stage-heading h2, .report-heading h2 {
  font-size: clamp(1.38rem, 3vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -.042em;
  font-weight: 730;
}
.stage-heading p { margin-top: 6px; color: var(--secondary); font-size: .94rem; }
.segmented {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--chrome);
  border: 1px solid #ebebf0;
  border-radius: 10px;
}
.segmented button {
  padding: 7px 11px;
  background: transparent;
  color: var(--secondary);
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: .875rem;
  font-weight: 620;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px #20203212;
}
.segmented button:disabled { opacity: .63; }
.drop-area {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  min-height: 174px;
  padding: 20px 14px;
  text-align: center;
  background: #fcfdff;
  border: 1px dashed #afc7f5;
  border-radius: 12px;
  cursor: pointer;
}
.drop-area:hover, .drop-area.is-dragging, .drop-area:focus-within { background: var(--blue-wash); border-color: var(--accent); }
.drop-area:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-area input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-icon { width: 40px; height: 40px; margin-bottom: 4px; background: #eaf1ff; }
.drop-area strong { color: var(--accent-ink); font-size: .96rem; font-weight: 650; }
.drop-area strong > span { color: var(--secondary); font-weight: 500; }
.drop-area small { color: var(--muted); font-size: .825rem; }
.file-selection { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.file-selection:has(> span:not([hidden])) {
  margin-top: 11px;
  background: var(--chrome);
  border-radius: 8px;
  padding: 6px 11px;
}
.file-selection span { min-width: 0; overflow-wrap: anywhere; font-size: .875rem; font-weight: 620; }
textarea, .access-code-field input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fcfdff;
}
textarea {
  min-height: 174px;
  resize: vertical;
}
textarea::placeholder { color: #73737d; }
textarea:focus, .access-code-field input:focus { border-color: var(--accent); }
.access-code-field {
  display: grid;
  gap: 5px;
  max-width: 22rem;
  margin-top: 16px;
}
.access-code-field label { font-size: .875rem; font-weight: 650; }
.scope-reference {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -6px 0 16px;
  padding: 8px 10px;
  background: var(--chrome);
  border-radius: 8px;
  color: var(--secondary);
  font-size: .875rem;
}
.scope-reference .icon { width: 17px; height: 17px; }
.scope-reference strong { overflow-wrap: anywhere; color: var(--ink); }
.stage-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px; }
.stage-footer-split { justify-content: space-between; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.34;
  color: var(--ink);
  background: transparent;
}
.button-small { min-height: 36px; padding: 7px 11px; font-size: .84rem; }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: white; background: var(--accent); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { background: var(--surface); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { background: var(--chrome); }
.button-link { color: var(--accent-ink); min-height: 32px; padding: 4px 2px; }
.button-link:hover { text-decoration: underline; }
.button:disabled { opacity: .6; }
.inline-error, .analysis-progress {
  margin-top: 13px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: .875rem;
}
.inline-error { background: #fff1f1; color: #942125; }
.analysis-progress { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); background: var(--blue-wash); }
.api-note { margin-top: 11px; color: var(--secondary); font-size: .875rem; }
.api-note:empty { display: none; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cadbfc;
  border-top-color: var(--accent);
  border-radius: 50%;
  flex: none;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.report-preview {
  padding: 22px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius);
}
.preview-header { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.preview-header .icon { color: var(--accent); }
.preview-header h2 { font-size: 1.02rem; letter-spacing: -.018em; font-weight: 700; }
.preview-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--blue-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px #2c5aac0a;
}
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-status, .finding-label, .report-demo {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: .76rem;
  font-weight: 690;
  line-height: 1.25;
}
.preview-status { background: #fff1e6; color: #8e3f17; }
.preview-status i { background: #d47538; width: 6px; height: 6px; border-radius: 50%; }
.timecode { color: var(--secondary); font: .78rem var(--mono); white-space: nowrap; }
.preview-card h3 { margin-top: 10px; font-size: 1rem; line-height: 1.35; letter-spacing: -.025em; }
.preview-source { margin-top: 12px; border-top: 1px solid #eef0f5; padding-top: 9px; }
.preview-source span { font-size: .76rem; font-weight: 670; color: var(--muted); }
.preview-source p { margin-top: 2px; font-size: .875rem; line-height: 1.4; }
.preview-caption { color: #445474; margin-top: 14px; font-size: .875rem; line-height: 1.45; }
.footer {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 22px 0 36px;
  color: var(--muted);
  font-size: .82rem;
}
.footer .icon { width: 16px; height: 16px; margin-top: 1px; }

body[data-step="3"] .workspace { grid-template-columns: minmax(0, 1fr); }
body[data-step="3"] .report-preview { display: none; }
.report { grid-column: 1 / -1; display: grid; gap: 15px; }
.report-heading { padding: clamp(18px, 3vw, 28px); }
.report-heading-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.report-heading-main > button { flex-shrink: 0; }
.report-heading-copy { max-width: 72ch; }
.report-heading-copy p { margin-top: 7px; color: var(--secondary); overflow-wrap: anywhere; }
.report-heading-copy .report-sources { color: var(--muted); font-size: .85rem; }
.report-demo { background: var(--blue-wash); color: var(--accent-ink); margin-bottom: 9px; }
.report-counts { margin-top: 19px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
[data-status="changed"] { --status-ink: #9a2938; --status-wash: #fdf0f2; --status-line: #f2cbd1; }
[data-status="outside"] { --status-ink: #8e3f17; --status-wash: #fff1e6; --status-line: #f3d9c6; }
[data-status="review"] { --status-ink: #705611; --status-wash: #fdf7df; --status-line: #eadeb7; }
[data-status="aligned"] { --status-ink: #24654a; --status-wash: #eaf6ee; --status-line: #cee7d7; }
.stat-button {
  display: grid;
  gap: 1px;
  align-content: start;
  min-height: 75px;
  padding: 10px 12px;
  text-align: start;
  background: var(--status-wash, var(--chrome));
  color: var(--status-ink, var(--ink));
  border: 1px solid var(--status-line, var(--line));
  border-radius: 10px;
}
.stat-button:hover, .stat-button[aria-pressed="true"] { border-color: currentColor; }
.stat-count { font-weight: 730; font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 650; font-size: .83rem; }
.report-audio, .report-followup, .report-empty { padding: 17px 20px; }
.report-audio h3 { font-size: .93rem; margin-bottom: 8px; }
.report-audio audio { display: block; width: min(100%, 520px); }
.report-items { display: grid; gap: 12px; }
.report-items:empty { display: none; }
.finding {
  padding: clamp(16px, 2.7vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.finding-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; margin-bottom: 11px; }
.finding h3 { min-width: 0; overflow-wrap: anywhere; letter-spacing: -.027em; font-size: 1.16rem; line-height: 1.24; }
.finding-label { background: var(--status-wash, var(--chrome)); color: var(--status-ink, var(--ink)); }
.finding-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0; }
.finding-block { display: grid; gap: 5px; align-content: start; padding: 12px; border-radius: 8px; background: var(--canvas); }
.finding-block > strong, .finding-meta, .finding-requirement-ref { color: var(--secondary); font-size: .84rem; font-weight: 650; }
.finding-block p, .finding-quote, .finding-action { font-size: .94rem; }
.finding p, .finding-quote { overflow-wrap: anywhere; }
.finding-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timestamp-button {
  border: 1px solid var(--blue-line);
  background: var(--blue-wash);
  color: var(--accent-ink);
  padding: 3px 6px;
  border-radius: 5px;
  font: .8rem var(--mono);
}
.timestamp-button:hover { border-color: var(--accent); }
.finding-action { margin-top: 8px; }
.report-followup summary { cursor: pointer; font-weight: 680; }
.report-followup p { white-space: pre-wrap; margin-top: 9px; color: var(--secondary); }
.report-footer { display: flex; justify-content: space-between; gap: 10px; }

@media (max-width: 800px) {
  .shell { width: calc(100% - 40px); }
  .main { padding-top: 38px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .report-preview { grid-row: 2; }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 28px); }
  .masthead-inner { min-height: 58px; }
  .brand { gap: 6px; }
  .brand-word { font-size: 19px; }
  .brand-product { padding-left: 7px; margin-left: 1px; }
  .brand-wave { width: 21px; height: 21px; }
  .button-small { padding-inline: 8px; }
  .button-small .icon { display: none; }
  .main { padding-top: 29px; }
  .intro p { font-size: .98rem; }
  .stepper { margin: 22px 0 17px; }
  .stepper ol, .stepper li { gap: 4px; }
  .stepper li + li::before { display: none; }
  .step { font-size: .73rem; padding: 5px; gap: 5px; }
  .step > span { width: 21px; height: 21px; font-size: .69rem; }
  .segmented button { padding: 7px; font-size: .8rem; }
  .report-heading-main { flex-direction: column; }
  .report-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finding-grid { grid-template-columns: minmax(0, 1fr); }
}
