:root {
  --bg: #f6f5f2;
  --ink: #222522;
  --muted: #676c68;
  --line: #d8d7d0;
  --panel: #ffffff;
  --panel-soft: #f0efea;
  --accent: #0f6f64;
  --accent-dark: #0a5048;
  --warning: #a06112;
  --danger: #a93535;
  --info: #356f9a;
  --shadow: 0 16px 42px rgba(39, 43, 39, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.auth-pending {
  overflow: hidden;
}

body.auth-pending .app-shell,
body.auth-required .app-shell {
  visibility: hidden;
}

.login-screen {
  position: fixed;
  z-index: 1000;
  display: grid;
  width: 100%;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7), rgba(246, 245, 242, 0.92)),
    var(--bg);
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(100%, 390px);
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 8px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(30, 35, 32, 0.13);
}

.login-brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.login-heading p {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.login-heading h1 {
  font-size: 28px;
}

.login-heading span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 111, 100, 0.12);
}

.login-button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-weight: 750;
}

.login-button:hover {
  background: var(--accent-dark);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(39, 43, 39, 0.06);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.status-pill {
  margin-left: auto;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px 4px 5px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.account-button[hidden] {
  display: none;
}

.account-button > span:first-child {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-lockup {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.brand-subtitle,
.view-heading p,
.panel-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
}

.nav-tab {
  position: relative;
  min-width: 94px;
  border: 0;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.nav-tab::after {
  position: absolute;
  right: 14px;
  bottom: 3px;
  left: 14px;
  height: 2px;
  background: transparent;
  content: "";
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--ink);
}

.nav-tab.active::after {
  background: var(--accent);
}

.app-view[hidden] {
  display: none;
}

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.view-heading h2 {
  font-size: 21px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace.state-empty,
.workspace.state-processing {
  grid-template-columns: minmax(320px, 640px);
  justify-content: center;
}

.workspace.state-empty .review-pane,
.workspace.state-processing .review-pane,
.workspace.state-review .input-pane {
  display: none;
}

.workspace.state-empty .input-pane,
.workspace.state-processing .input-pane {
  position: static;
  width: 100%;
  max-height: none;
}

.workspace.state-processing .field-grid,
.workspace.state-processing .input-mode-switch,
.workspace.state-processing .input-mode-panel {
  display: none;
}

.workspace.state-review {
  grid-template-columns: minmax(0, 1fr);
}

.input-pane,
.review-pane,
.report-pane,
.knowledge-pane,
.qa-pane,
.records-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(39, 43, 39, 0.06);
}

.input-pane {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
}

.review-pane {
  min-height: 620px;
  overflow: hidden;
}

.run-metrics {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7f9f7;
  padding: 14px 18px;
}

.run-metrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.run-metrics-head span {
  color: var(--muted);
  font-size: 12px;
}

.run-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.run-metric {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.run-metric:last-child {
  border-right: 0;
}

.run-metric span,
.run-metric strong {
  display: block;
  overflow-wrap: anywhere;
}

.run-metric span {
  color: var(--muted);
  font-size: 11px;
}

.run-metric strong {
  margin-top: 4px;
  font-size: 15px;
}

.run-stage-list {
  margin-top: 10px;
  font-size: 12px;
}

.run-stage-head,
.run-stage-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.7fr) repeat(4, minmax(70px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
}

.run-stage-head {
  color: var(--muted);
}

.run-stage-row {
  border-top: 1px solid var(--line);
}

.run-stage-row strong {
  font-size: 12px;
}

.report-pane {
  margin-top: 16px;
  padding: 18px;
  scroll-margin-top: 16px;
}

.report-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-pane,
.qa-pane,
.eval-pane,
.records-pane {
  margin-top: 0;
  padding: 18px;
}

.records-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) minmax(150px, 0.7fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.records-run-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  margin-top: 16px;
  overflow: visible;
}

.records-run-list .run-item {
  min-height: 96px;
  padding: 14px;
}

.records-run-list .run-title {
  font-size: 14px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.eval-pane {
  max-width: 1120px;
}

.panel-heading,
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading span,
.review-header p,
#reportMeta {
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  min-height: 17px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}

.field-grid .full-width {
  grid-column: 1 / -1;
}

.input-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: var(--panel-soft);
}

.input-mode-tab {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.input-mode-tab:hover {
  color: var(--ink);
}

.input-mode-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(39, 43, 39, 0.12);
}

.input-mode-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.input-mode-panel {
  margin-top: 10px;
}

.input-mode-panel[hidden] {
  display: none;
}

.input-mode-panel .question-textarea {
  min-height: 260px;
}

.mode-submit-button {
  width: 100%;
  margin-top: 12px;
}

.text-input,
.select-input,
.question-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.text-input {
  height: 40px;
  padding: 0 12px;
}

.select-input {
  height: 40px;
  padding: 0 10px;
}

.question-textarea {
  min-height: 260px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.compact-textarea {
  min-height: 92px;
}

.text-input:focus,
.select-input:focus,
.question-textarea:focus,
.final-answer:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 111, 100, 0.14);
}

.upload-box {
  display: grid;
  min-height: 106px;
  align-content: center;
  border: 1px dashed #aaa99f;
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-picker {
  display: block;
  min-width: 0;
  cursor: pointer;
  text-align: center;
}

.file-picker strong,
.file-picker span {
  display: block;
  overflow-wrap: anywhere;
}

.file-picker strong {
  color: var(--ink);
  font-size: 13px;
}

.file-picker span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.file-input:focus-visible + .file-picker {
  border-radius: 5px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.upload-box p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.history-panel {
  margin-top: 18px;
}

.history-heading {
  margin-top: 2px;
}

.run-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  margin-top: 12px;
  overflow: auto;
}

.history-filter {
  margin-top: 12px;
}

.history-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.run-item {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.run-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 111, 100, 0.1);
}

.run-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.run-submeta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.history-empty {
  color: var(--muted);
  font-size: 13px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.actions.compact {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0;
}

.download-control {
  position: relative;
}

.download-menu-button {
  min-width: 116px;
}

.download-menu-button span {
  margin-left: 5px;
  color: var(--muted);
}

.download-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 196px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(39, 43, 39, 0.16);
}

.download-menu[hidden] {
  display: none;
}

.download-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.download-menu button:last-child {
  border-bottom: 0;
}

.download-menu button:hover,
.download-menu button:focus-visible {
  background: var(--panel-soft);
  outline: none;
}

.download-menu small {
  color: var(--muted);
  font-size: 11px;
}

.job-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.job-panel[hidden] {
  display: none;
}

.job-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-panel-head strong {
  font-size: 13px;
}

.job-panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.job-panel[data-status="failed"] {
  border-color: rgba(169, 53, 53, 0.42);
}

.job-progress {
  height: 5px;
  margin-top: 11px;
  border-radius: 3px;
  overflow: hidden;
  background: #deddd7;
}

.job-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.job-progress span.indeterminate {
  animation: job-progress 1.4s ease-in-out infinite;
}

.job-panel[data-status="failed"] .job-progress span {
  background: var(--danger);
}

.job-stage-list {
  display: grid;
  gap: 0;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.job-stage-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  min-height: 31px;
  color: #87877f;
  font-size: 12px;
}

.job-stage-item::before {
  content: "";
  position: absolute;
  top: 15px;
  bottom: -1px;
  left: 7px;
  width: 1px;
  background: #d8d7d0;
}

.job-stage-item:last-child::before {
  display: none;
}

.job-stage-marker {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border: 2px solid #cac9c2;
  border-radius: 50%;
  background: #fbfaf7;
}

.job-stage-copy {
  min-width: 0;
  padding-bottom: 9px;
}

.job-stage-copy strong {
  display: block;
  color: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.job-stage-copy small {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.35;
}

.job-stage-item.completed {
  color: #555850;
}

.job-stage-item.completed .job-stage-marker {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #fbfaf7;
}

.job-stage-item.active {
  color: var(--ink);
}

.job-stage-item.active .job-stage-marker {
  border-color: var(--accent);
  background: #fbfaf7;
  box-shadow: 0 0 0 4px rgba(15, 111, 100, 0.12);
  animation: job-stage-pulse 1.8s ease-in-out infinite;
}

.job-stage-item.failed .job-stage-marker {
  border-color: var(--danger);
  background: var(--danger);
}

.job-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

@keyframes job-stage-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(15, 111, 100, 0.1); }
  50% { box-shadow: 0 0 0 6px rgba(15, 111, 100, 0.04); }
}

@keyframes job-progress {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(90%); }
  100% { transform: translateX(270%); }
}

.primary-button,
.secondary-button,
.icon-button,
.tab {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary-button,
.icon-button,
.tab {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.secondary-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.tab:hover {
  border-color: var(--accent);
}

.secondary-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.review-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.review-header .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.autosave-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.autosave-status[data-status="saving"],
.autosave-status[data-status="pending"] {
  color: var(--info);
}

.autosave-status[data-status="failed"] {
  color: var(--danger);
  font-weight: 700;
}

.status-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  font-size: 13px;
}

.tab.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.answer-list {
  display: block;
  padding: 0;
}

.empty-state {
  place-items: center;
  min-height: 420px;
  color: var(--muted);
  text-align: center;
}

.answer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.answer-card.excluded {
  opacity: 0.62;
}

.review-workbench {
  display: grid;
  grid-template-columns: 230px minmax(390px, 1fr) minmax(290px, 0.72fr);
  min-height: 620px;
}

.question-navigator {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfaf7;
}

.question-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 49px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 12px;
}

.question-nav-head span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.question-nav-list {
  max-height: 680px;
  overflow-y: auto;
  padding: 6px;
}

.question-nav-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.question-nav-item:hover {
  background: #fff;
}

.question-nav-item.active {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(39, 43, 39, 0.05);
}

.question-nav-item.excluded {
  opacity: 0.52;
}

.question-nav-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 800;
}

.question-nav-item.completed .question-nav-index,
.question-nav-item.active .question-nav-index {
  color: #fff;
  background: var(--accent);
}

.question-nav-copy {
  min-width: 0;
}

.question-nav-copy strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-nav-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.answer-editor {
  min-width: 0;
  padding: 20px;
}

.answer-editor.excluded {
  opacity: 0.64;
}

.answer-editor-head {
  margin-bottom: 18px;
}

.answer-field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.answer-editor .final-answer {
  min-height: 280px;
}

.answer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.answer-editor-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.answer-editor-nav span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.citation-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 32px;
  margin-top: 8px;
}

.citation-strip > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.citation-strip button {
  min-width: 29px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  color: var(--accent-dark);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.citation-strip button:hover,
.citation-strip button:focus-visible {
  border-color: var(--accent);
  outline: none;
  background: rgba(15, 111, 100, 0.06);
}

.answer-fact-validation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
}

.answer-fact-validation.valid {
  border-color: rgba(36, 138, 61, 0.16);
  color: #1b6b31;
  background: rgba(36, 138, 61, 0.07);
}

.answer-fact-validation.invalid {
  border-color: rgba(215, 0, 21, 0.18);
  color: #b42318;
  background: rgba(215, 0, 21, 0.07);
}

.answer-fact-validation span {
  text-align: right;
}

.evidence-drawer {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 16px;
  overflow-y: auto;
  background: #fbfcfb;
}

.source-citation {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.answer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  padding: 16px;
}

.question-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.question-index {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 4px 7px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.question-text {
  line-height: 1.45;
  font-weight: 800;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 700;
}

.badge.ready_from_approved_qa {
  color: var(--accent-dark);
  background: rgba(15, 111, 100, 0.12);
}

.badge.draft_from_dd_room {
  color: var(--info);
  background: rgba(53, 111, 154, 0.12);
}

.badge.needs_ir_input {
  color: var(--warning);
  background: rgba(160, 97, 18, 0.14);
}

.badge.sensitive_needs_escalation {
  color: var(--danger);
  background: rgba(169, 53, 53, 0.12);
}

.final-answer {
  width: 100%;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.composition-reason {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.side-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
  background: #fbfcfb;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.source-box {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.source-overview strong,
.source-overview span {
  display: block;
}

.source-overview strong {
  color: var(--ink);
  font-size: 13px;
}

.source-overview div > span {
  margin-top: 2px;
  font-size: 11px;
}

.source-count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.source-section + .source-section {
  margin-top: 12px;
}

.source-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-section-title span {
  color: var(--muted);
  font-weight: 600;
}

.source-item {
  border-top: 1px solid var(--line);
  background: transparent;
}

.source-item:last-child {
  border-bottom: 1px solid var(--line);
}

.source-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 2px;
  cursor: pointer;
  list-style: none;
}

.source-item summary::-webkit-details-marker {
  display: none;
}

.source-item-heading {
  min-width: 0;
}

.source-item-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-item-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.source-item-action {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.source-item[open] .source-item-action::before {
  content: "收起";
}

.source-item[open] .source-item-action {
  font-size: 0;
}

.source-item[open] .source-item-action::before {
  font-size: 11px;
}

.source-item-body {
  padding: 0 2px 12px;
}

.source-item-body p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.source-security-warning {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #f0c36a;
  border-radius: 7px;
  background: #fff8e8;
  color: #7a4b00;
  font-size: 13px;
  line-height: 1.45;
}

.source-version-warning {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #d8d5ce;
  border-radius: 7px;
  background: #f6f5f2;
  color: #4f4d48;
  font-size: 13px;
  line-height: 1.45;
}

.badge.external-policy.policy-local_only {
  color: #8a3b12;
  background: #fff0e8;
  border-color: #efc0a8;
}

.badge.external-policy.policy-redact {
  color: #71520b;
  background: #fff8df;
  border-color: #ead38a;
}

.source-item-body a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.source-item-body a:hover {
  text-decoration: underline;
}

.evidence-status {
  border-radius: 6px;
  margin: 6px 0 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
}

.evidence-status.ok {
  color: var(--accent-dark);
  background: rgba(15, 111, 100, 0.1);
}

.evidence-status.weak {
  color: var(--warning);
  background: rgba(160, 97, 18, 0.12);
}

.review-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.review-dialog::backdrop {
  background: rgba(24, 27, 24, 0.42);
}

.review-dialog-content {
  padding: 20px;
}

.review-dialog-head,
.review-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-dialog-head p,
.complete-review-summary > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.complete-review-summary {
  margin: 18px 0;
}

.completion-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.completion-metrics div {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 12px;
}

.completion-metrics div:last-child {
  border-right: 0;
}

.completion-metrics strong,
.completion-metrics span {
  display: block;
}

.completion-metrics strong {
  font-size: 20px;
}

.completion-metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.completion-metrics .warning strong {
  color: var(--warning);
}

.completion-warning {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border-radius: 6px;
  padding: 10px;
  color: var(--warning);
  background: rgba(160, 97, 18, 0.1);
  font-size: 12px;
}

.review-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.rationale {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.answer-rationale {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
}

.report-preview {
  min-height: 260px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  background: #fbfaf7;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.55;
}

.document-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.document-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fbfaf7;
}

.document-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.document-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.document-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-card-head strong {
  font-size: 14px;
}

.document-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge.profile-ready {
  color: var(--accent-dark);
  background: rgba(15, 111, 100, 0.12);
}

.badge.understanding-quality.quality-high {
  color: #1b6b31;
  background: rgba(36, 138, 61, 0.1);
}

.badge.understanding-quality.quality-medium {
  color: #004f9f;
  background: rgba(0, 113, 227, 0.09);
}

.badge.understanding-quality.quality-low {
  color: #9a5b00;
  background: rgba(166, 83, 0, 0.09);
}

.badge.understanding-quality.quality-unusable {
  color: #b42318;
  background: rgba(215, 0, 21, 0.08);
}

.badge.version-latest {
  color: #075f36;
  background: #e7f6ed;
}

.badge.version-draft,
.badge.version-conflict {
  color: #8a3b12;
  background: #fff0e6;
}

.badge.version-duplicate {
  color: #57534e;
  background: #eceae6;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.document-meta a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.document-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.document-profile {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.document-profile summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.document-profile-body {
  padding-top: 10px;
}

.document-profile-body p {
  color: var(--ink);
  line-height: 1.55;
}

.document-profile-body dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
}

.document-profile-body dt {
  color: var(--muted);
  font-weight: 800;
}

.document-profile-body dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.profile-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel-soft);
}

.qa-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  margin-top: 14px;
}

.qa-create {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.qa-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.qa-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.qa-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.qa-item.inactive {
  opacity: 0.62;
}

.qa-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.qa-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.qa-edit-grid {
  display: grid;
  gap: 10px;
}

.qa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eval-summary {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fbfaf7;
  font-size: 13px;
}

.eval-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--ink);
  font-size: 13px;
}

.eval-run-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.eval-run-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.eval-run-item small {
  color: var(--muted);
  white-space: nowrap;
}

.eval-run-item.active {
  border-color: var(--accent);
  background: #f3f7fb;
}

.eval-results {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.eval-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.eval-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.eval-answer {
  margin: 10px 0;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.eval-source {
  margin-top: 8px;
  border-left: 3px solid rgba(53, 111, 154, 0.25);
  padding-left: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.eval-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.eval-note-input {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.reasoning-box {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reasoning-box > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.reasoning-box > summary::-webkit-details-marker {
  display: none;
}

.reasoning-box > summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

.reasoning-body {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.reasoning-error {
  margin-top: 4px;
  color: #a44444;
}

.reasoning-details {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.reasoning-details summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.reasoning-detail-row {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  border-left: 3px solid rgba(53, 111, 154, 0.28);
  padding-left: 8px;
}

.reasoning-detail-row b {
  color: var(--ink);
}

.reasoning-detail-row span,
.reasoning-detail-row small {
  overflow-wrap: anywhere;
}

.reasoning-detail-row.conflict {
  border-left-color: var(--danger);
}

.reasoning-detail-row.claim {
  border-left-color: var(--accent);
}

.claim-citation-list {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.claim-citation {
  border-left: 3px solid #16835f;
  background: #f4faf7;
  padding: 9px 11px;
}

.claim-citation.invalid {
  border-left-color: #c4473d;
  background: #fff6f5;
}

.claim-citation span,
.claim-citation small,
.claim-citation p {
  display: block;
}

.claim-citation span {
  color: #1d2824;
  font-weight: 650;
}

.claim-citation small {
  color: #65706b;
  margin-top: 2px;
}

.claim-citation p {
  color: #3f4945;
  line-height: 1.55;
  margin: 7px 0 0;
}

.claim-citation-missing {
  color: #a13730;
  font-weight: 650;
}

/* Apple-inspired enterprise polish */
:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.18);
  --line-strong: rgba(60, 60, 67, 0.28);
  --panel: #ffffff;
  --panel-soft: #f2f2f7;
  --accent: #0071e3;
  --accent-dark: #0058b0;
  --success: #248a3d;
  --warning: #a65300;
  --danger: #d70015;
  --info: #5856d6;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

html {
  color-scheme: light;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select,
summary {
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease;
}

button:active:not(:disabled) {
  transform: scale(0.985);
}

button:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

* {
  scrollbar-color: rgba(118, 118, 128, 0.38) transparent;
  scrollbar-width: thin;
}

::selection {
  color: var(--ink);
  background: rgba(0, 113, 227, 0.18);
}

.app-shell {
  width: min(1520px, calc(100vw - 36px));
  padding-top: 18px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 10px;
  min-height: 66px;
  margin-bottom: 26px;
  border-color: rgba(60, 60, 67, 0.12);
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 32px rgba(0, 0, 0, 0.06);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.brand-lockup {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 3px 10px rgba(0, 0, 0, 0.16);
  letter-spacing: 0;
}

.brand-subtitle {
  color: #86868b;
  font-size: 11px;
}

.primary-nav {
  align-self: center;
  gap: 2px;
  min-height: 42px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 8px;
  padding: 3px;
  background: rgba(118, 118, 128, 0.09);
}

.nav-tab {
  min-width: 92px;
  border-radius: 6px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 650;
}

.nav-tab::after {
  display: none;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.56);
}

.nav-tab.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 84px;
  border-color: rgba(60, 60, 67, 0.12);
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #48484a;
  font-size: 12px;
}

.status-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.12);
  content: "";
}

.view-heading {
  min-height: 50px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.view-heading h2 {
  font-size: 22px;
  font-weight: 720;
}

.view-heading p {
  margin-top: 4px;
  color: #86868b;
  font-size: 12px;
}

.input-pane,
.review-pane,
.report-pane,
.knowledge-pane,
.qa-pane,
.records-pane,
.eval-pane {
  border-color: rgba(60, 60, 67, 0.13);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.input-pane {
  padding: 24px;
}

.workspace.state-empty .input-pane {
  margin-top: 12px;
}

.workspace.state-empty .panel-heading {
  margin-bottom: 6px;
}

.panel-heading h2,
.review-header h2 {
  font-size: 17px;
  font-weight: 720;
}

.panel-heading p,
.review-header p {
  color: #86868b;
}

.field-label {
  margin: 17px 0 7px;
  color: #515154;
  font-size: 12px;
  font-weight: 650;
}

.text-input,
.select-input,
.question-textarea,
.final-answer,
.eval-note-input {
  border-color: rgba(60, 60, 67, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.025);
}

.text-input,
.select-input {
  height: 44px;
  padding-right: 13px;
  padding-left: 13px;
}

.text-input:hover,
.select-input:hover,
.question-textarea:hover,
.final-answer:hover {
  border-color: var(--line-strong);
}

.text-input:focus,
.select-input:focus,
.question-textarea:focus,
.final-answer:focus,
.eval-note-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.input-mode-switch {
  gap: 2px;
  border-color: rgba(60, 60, 67, 0.12);
  padding: 3px;
  background: rgba(118, 118, 128, 0.1);
}

.input-mode-tab {
  min-height: 42px;
  color: #636366;
  font-size: 13px;
  font-weight: 650;
}

.input-mode-tab.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
}

.upload-box {
  min-height: 136px;
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.035);
}

.upload-box:hover {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
}

.file-picker strong {
  color: #2c2c2e;
  font-size: 14px;
}

.file-picker span,
.upload-box p {
  color: #86868b;
}

.primary-button,
.secondary-button,
.icon-button,
.ghost-button,
.tab {
  min-height: 40px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 3px 10px rgba(0, 113, 227, 0.18);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.22);
}

.secondary-button,
.icon-button,
.tab,
.ghost-button {
  border-color: rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}

.secondary-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.tab:hover,
.ghost-button:hover:not(:disabled) {
  border-color: rgba(60, 60, 67, 0.24);
  background: #f7f7f9;
}

.mode-submit-button {
  min-height: 46px;
  margin-top: 14px;
}

.review-header {
  min-height: 72px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #636366;
}

.autosave-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  content: "";
}

.autosave-status[data-status="saving"]::before,
.autosave-status[data-status="pending"]::before {
  background: #0a84ff;
}

.autosave-status[data-status="failed"]::before {
  background: var(--danger);
}

.status-tabs {
  gap: 4px;
  padding: 9px 14px;
  background: rgba(242, 242, 247, 0.72);
}

.status-tabs .tab {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #636366;
}

.status-tabs .tab.active {
  border-color: rgba(60, 60, 67, 0.12);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.review-workbench {
  background: #fff;
}

.question-navigator {
  border-right-color: rgba(60, 60, 67, 0.13);
  background: rgba(242, 242, 247, 0.62);
}

.question-nav-head {
  border-bottom-color: rgba(60, 60, 67, 0.12);
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.38);
}

.question-nav-list {
  padding: 8px;
}

.question-nav-item {
  min-height: 68px;
  border-radius: 7px;
  padding: 9px;
}

.question-nav-item:hover {
  background: rgba(255, 255, 255, 0.72);
}

.question-nav-item.active {
  border-color: rgba(60, 60, 67, 0.14);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.question-nav-index {
  color: #636366;
  background: rgba(118, 118, 128, 0.12);
}

.question-nav-item.completed .question-nav-index {
  background: var(--success);
}

.question-nav-item.active .question-nav-index {
  background: var(--accent);
}

.answer-editor {
  padding: 24px 28px;
  background: #fff;
}

.answer-editor-head {
  margin-bottom: 22px;
}

.answer-editor .question-text {
  color: #1d1d1f;
  font-size: 17px;
  line-height: 1.45;
}

.question-index {
  border-radius: 6px;
  background: #2c2c2e;
}

.answer-editor .final-answer {
  min-height: 320px;
  border-color: rgba(60, 60, 67, 0.2);
  padding: 16px;
  background: #fff;
  font-size: 14px;
  line-height: 1.65;
}

.answer-options {
  border-top-color: rgba(60, 60, 67, 0.12);
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.citation-strip {
  margin-top: 10px;
}

.citation-strip button {
  border-color: rgba(0, 113, 227, 0.2);
  color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
}

.citation-strip button:hover,
.citation-strip button:focus-visible {
  border-color: rgba(0, 113, 227, 0.38);
  background: rgba(0, 113, 227, 0.11);
}

.evidence-drawer {
  border-left-color: rgba(60, 60, 67, 0.13);
  padding: 18px;
  background: #fafafa;
}

.source-count {
  border-color: rgba(60, 60, 67, 0.13);
  background: rgba(255, 255, 255, 0.84);
}

.source-item,
.source-item:last-child {
  border-color: rgba(60, 60, 67, 0.12);
}

.source-item summary {
  min-height: 60px;
  border-radius: 6px;
  padding: 9px 4px;
}

.source-item summary:hover {
  background: rgba(118, 118, 128, 0.06);
}

.source-citation,
.source-item-action,
.source-item-body a,
.document-meta a,
.document-profile summary,
.reasoning-details summary {
  color: var(--accent);
}

.source-item-title {
  font-weight: 680;
}

.evidence-status {
  border: 1px solid transparent;
  padding: 8px 10px;
}

.evidence-status.ok {
  border-color: rgba(36, 138, 61, 0.16);
  color: #1b6b31;
  background: rgba(36, 138, 61, 0.08);
}

.evidence-status.weak {
  border-color: rgba(166, 83, 0, 0.15);
  background: rgba(166, 83, 0, 0.08);
}

.badge {
  border: 1px solid rgba(60, 60, 67, 0.08);
  color: #636366;
  background: rgba(118, 118, 128, 0.1);
  font-weight: 650;
}

.badge.ready_from_approved_qa,
.badge.profile-ready {
  color: #1b6b31;
  background: rgba(36, 138, 61, 0.09);
}

.badge.draft_from_dd_room {
  color: #004f9f;
  background: rgba(0, 113, 227, 0.09);
}

.badge.needs_ir_input {
  background: rgba(166, 83, 0, 0.09);
}

.badge.sensitive_needs_escalation {
  background: rgba(215, 0, 21, 0.08);
}

.job-panel {
  border-color: rgba(60, 60, 67, 0.13);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.job-progress {
  height: 6px;
  background: rgba(118, 118, 128, 0.14);
}

.job-stage-marker {
  border-color: rgba(118, 118, 128, 0.36);
  background: #fff;
}

.job-stage-item.completed .job-stage-marker {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 3px #fff;
}

.job-stage-item.active .job-stage-marker {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.job-meta {
  border-top-color: rgba(60, 60, 67, 0.12);
}

.run-metrics {
  border-color: rgba(60, 60, 67, 0.12);
  background: #fafafa;
}

.review-dialog {
  border-color: rgba(60, 60, 67, 0.2);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.review-dialog::backdrop {
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
}

.completion-metrics {
  border-color: rgba(60, 60, 67, 0.14);
  background: rgba(242, 242, 247, 0.58);
}

.completion-metrics div,
.review-dialog-actions {
  border-color: rgba(60, 60, 67, 0.12);
}

.completion-warning {
  background: rgba(166, 83, 0, 0.08);
}

.records-pane,
.knowledge-pane,
.qa-pane,
.eval-pane {
  padding: 20px;
}

.records-filters,
.qa-toolbar {
  gap: 8px;
}

.run-item,
.document-card,
.qa-item,
.eval-card,
.eval-run-item,
.qa-create,
.eval-summary,
.reasoning-box {
  border-color: rgba(60, 60, 67, 0.13);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.run-item:hover,
.document-card:hover,
.qa-item:hover,
.eval-run-item:hover {
  border-color: rgba(0, 113, 227, 0.28);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
}

.eval-run-item.active {
  border-color: rgba(0, 113, 227, 0.4);
  background: rgba(0, 113, 227, 0.055);
}

.report-pane {
  margin-top: 18px;
  padding: 22px;
}

.report-preview {
  max-width: 900px;
  min-height: 560px;
  margin: 18px auto 0;
  border-color: rgba(60, 60, 67, 0.14);
  padding: 42px 48px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  line-height: 1.7;
}

.knowledge-layout.single-pane {
  grid-template-columns: minmax(0, 1fr);
}

.qa-management-pane {
  overflow: hidden;
  padding: 0;
}

.qa-management-pane > .panel-heading {
  padding: 22px 24px 18px;
}

.qa-management-pane > .qa-toolbar {
  margin: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  padding: 14px 24px;
  background: rgba(242, 242, 247, 0.48);
}

.qa-management-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(440px, 1.28fr);
  min-height: 520px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.qa-create-column {
  border-right: 1px solid rgba(60, 60, 67, 0.1);
  padding: 22px 24px;
  background: rgba(242, 242, 247, 0.36);
}

.qa-create-column h3,
.qa-list-heading h3 {
  font-size: 14px;
  font-weight: 700;
}

.qa-create-column > p {
  margin-top: 4px;
  color: #86868b;
  font-size: 11px;
}

.qa-create-column .qa-create {
  margin-top: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.qa-create-column .compact-textarea {
  min-height: 190px;
}

.qa-list-column {
  min-width: 0;
  padding: 22px 24px 28px;
}

.qa-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qa-list-heading span {
  color: #86868b;
  font-size: 11px;
}

.qa-management-pane .qa-list {
  margin-top: 16px;
}

.qa-management-pane .qa-item {
  padding: 16px;
}

.qa-management-pane .qa-item-head strong {
  font-size: 13px;
}

/* The empty workspace uses the full working width without adding decorative filler. */
.workspace.state-empty {
  grid-template-columns: minmax(680px, 1080px);
}

.workspace.state-processing {
  grid-template-columns: minmax(320px, 640px);
}

.workspace.state-empty .input-pane {
  margin-top: 4px;
  padding: 26px 28px 28px;
}

.workspace.state-empty .panel-heading {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.11);
}

.workspace.state-empty #questionCount {
  border-radius: 999px;
  padding: 4px 9px;
  color: #515154;
  background: rgba(118, 118, 128, 0.1);
  font-size: 11px;
  font-weight: 650;
}

.questionnaire-form-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.8fr) minmax(390px, 1.2fr);
  gap: 0;
}

.questionnaire-details {
  padding-right: 28px;
}

.questionnaire-source {
  min-width: 0;
  border-left: 1px solid rgba(60, 60, 67, 0.11);
  padding-left: 28px;
}

.form-section-title {
  color: #515154;
  font-size: 12px;
  font-weight: 680;
}

.questionnaire-details .field-grid {
  grid-template-columns: 1fr;
}

.questionnaire-details .field-grid .full-width {
  grid-column: auto;
}

.questionnaire-form-layout .field-label {
  margin-top: 15px;
}

.questionnaire-form-layout .input-mode-switch {
  margin-top: 10px;
}

.workspace.state-empty .questionnaire-source .upload-box {
  min-height: 148px;
}

.workspace.state-empty .questionnaire-source .question-textarea {
  min-height: 190px;
}

.workspace.state-processing .questionnaire-form-layout {
  display: none;
}

/* Questionnaire records are optimized for scanning rather than browsing cards. */
.records-pane {
  overflow: visible;
  padding: 0;
}

.records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
}

.records-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.records-title-line h2 {
  font-size: 17px;
  font-weight: 720;
}

.records-header p {
  margin-top: 4px;
  color: #86868b;
  font-size: 12px;
}

.records-count {
  min-width: 38px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #515154;
  background: rgba(118, 118, 128, 0.11);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.records-refresh-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 50%;
  color: #515154;
  background: rgba(255, 255, 255, 0.82);
  font-size: 19px;
  line-height: 1;
}

.records-refresh-button:hover {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.3);
  background: #fff;
}

.records-filters {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 160px 120px;
  gap: 10px;
  margin: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  padding: 14px 24px;
  background: rgba(242, 242, 247, 0.48);
}

.records-search {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(60, 60, 67, 0.16);
  border-radius: 7px;
  padding: 0 11px;
  color: #86868b;
  background: rgba(255, 255, 255, 0.94);
}

.records-search:focus-within {
  border-color: rgba(0, 113, 227, 0.52);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.records-search > span {
  font-size: 18px;
  line-height: 1;
}

.records-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.records-more-filters {
  position: relative;
}

.records-more-filters summary {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 7px;
  color: #515154;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.records-more-filters summary::-webkit-details-marker {
  display: none;
}

.records-more-filters[open] summary {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.35);
}

.records-more-fields {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 280px;
  gap: 8px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px);
}

.records-table-head,
.records-run-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 100px 64px minmax(120px, 0.8fr) 150px 22px;
  gap: 16px;
  align-items: center;
}

.records-table-head {
  padding: 11px 24px 9px;
  color: #86868b;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.records-run-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: none;
  margin: 0;
  overflow: visible;
}

.records-run-list .records-run-row {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 0;
  padding: 12px 24px;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.records-run-list .records-run-row:hover {
  border-color: rgba(60, 60, 67, 0.1);
  background: rgba(0, 113, 227, 0.035);
  box-shadow: none;
}

.records-run-list .records-run-row.active {
  border-color: rgba(60, 60, 67, 0.1);
  background: rgba(0, 113, 227, 0.065);
  box-shadow: inset 3px 0 0 var(--accent);
}

.records-run-name {
  min-width: 0;
}

.records-run-name strong,
.records-run-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-run-name strong {
  font-size: 13px;
  font-weight: 680;
}

.records-run-name small,
.records-question-count small {
  margin-top: 4px;
  color: #86868b;
  font-size: 11px;
}

.records-status {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #765500;
  background: rgba(255, 159, 10, 0.12);
  font-size: 11px;
  font-weight: 650;
}

.records-status.status-exported {
  color: #005493;
  background: rgba(0, 113, 227, 0.1);
}

.records-status.status-confirmed {
  color: #14742d;
  background: rgba(52, 199, 89, 0.12);
}

.records-question-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.records-question-count strong {
  font-size: 14px;
}

.records-question-count small {
  margin: 0;
}

.records-investor,
.records-updated {
  overflow: hidden;
  color: #515154;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-open {
  color: #86868b;
  font-size: 24px;
  font-weight: 300;
  text-align: right;
}

.records-run-row:hover .records-open {
  color: var(--accent);
}

.records-empty {
  display: grid;
  min-height: 220px;
  place-content: center;
  gap: 5px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  color: #515154;
  text-align: center;
}

.records-empty strong {
  font-size: 14px;
}

.records-empty span {
  color: #86868b;
  font-size: 12px;
}

/* Knowledge collections use the same quiet, scan-first language as records. */
.collection-pane {
  overflow: hidden;
  padding: 0;
}

.collection-pane .records-header {
  padding: 22px 24px 18px;
}

.collection-pane .records-filters {
  margin: 0;
}

.collection-filters {
  grid-template-columns: minmax(320px, 1fr) 180px;
}

.qa-record-filters {
  grid-template-columns: minmax(320px, 1fr) 150px 120px;
}

.document-stats {
  gap: 16px;
  margin: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.72);
}

.document-stats span {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 11px;
}

.collection-table-head {
  display: grid;
  gap: 16px;
  padding: 11px 24px 9px;
  color: #86868b;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.document-table-head,
.document-record-grid {
  grid-template-columns: minmax(260px, 2fr) 96px 80px 82px minmax(110px, 0.7fr) 22px;
}

.qa-table-head,
.qa-record-summary {
  grid-template-columns: minmax(320px, 2fr) 90px minmax(110px, 0.7fr) 150px;
}

.document-list,
.qa-record-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.collection-pane .document-record-row,
.collection-pane .qa-record-row {
  border: 0;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.collection-pane .document-record-row:hover,
.collection-pane .qa-record-row:hover {
  border-color: rgba(60, 60, 67, 0.1);
  background: rgba(0, 113, 227, 0.025);
  box-shadow: none;
}

.document-record-grid,
.qa-record-summary {
  display: grid;
  min-height: 68px;
  align-items: center;
  gap: 16px;
  padding: 11px 24px;
}

.document-record-name,
.qa-record-name {
  min-width: 0;
}

.document-record-name strong,
.document-record-name small,
.qa-record-name strong,
.qa-record-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-record-name strong,
.qa-record-name strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 680;
}

.document-record-name small,
.qa-record-name small {
  margin-top: 4px;
  color: #86868b;
  font-size: 11px;
}

.document-record-type,
.qa-record-approver,
.qa-record-updated {
  overflow: hidden;
  color: #515154;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-record-chunks {
  color: #515154;
  font-size: 12px;
}

.document-record-chunks small {
  color: #86868b;
  font-size: 10px;
}

.document-source-badge {
  width: fit-content;
}

.document-understanding-badges {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-direction: column;
}

.badge.parse-status {
  border-color: rgba(60, 60, 67, 0.12);
  color: #6e6e73;
  font-size: 9px;
}

.badge.parse-complete {
  border-color: rgba(36, 138, 61, 0.18);
  color: #248a3d;
}

.badge.parse-partial,
.badge.parse-empty,
.badge.parse-unverified {
  border-color: rgba(180, 95, 0, 0.2);
  color: #9a5b00;
}

.badge.parse-failed,
.badge.parse-metadata_only {
  border-color: rgba(215, 0, 21, 0.18);
  color: #b42318;
}

.collection-open {
  color: #86868b;
  font-size: 24px;
  font-weight: 300;
  text-align: right;
  text-decoration: none;
}

.document-record-row:hover .collection-open {
  color: var(--accent);
}

.document-record-details {
  padding: 0 24px 12px;
}

.document-record-details .document-meta {
  margin: 0;
}

.document-record-details .document-profile {
  margin-top: 9px;
}

.qa-record-row.inactive {
  opacity: 0.58;
}

.qa-record-row .qa-edit-grid {
  gap: 9px;
  border-top: 1px solid rgba(60, 60, 67, 0.08);
  padding: 14px 24px 18px;
  background: rgba(242, 242, 247, 0.28);
}

.qa-record-row .compact-textarea {
  min-height: 96px;
}

.qa-create-disclosure {
  position: relative;
}

.qa-create-popover {
  position: absolute;
  z-index: 14;
  top: calc(100% + 8px);
  right: 0;
  width: min(520px, calc(100vw - 48px));
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(18px);
}

.qa-create-heading strong,
.qa-create-heading span {
  display: block;
}

.qa-create-heading strong {
  font-size: 14px;
}

.qa-create-heading span {
  margin-top: 4px;
  color: #86868b;
  font-size: 11px;
}

.qa-create-popover .qa-create {
  margin-top: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.qa-create-popover .compact-textarea {
  min-height: 150px;
}

.collection-pane .history-empty {
  display: grid;
  min-height: 220px;
  place-content: center;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  color: #86868b;
  text-align: center;
}

.confirmation-filters {
  grid-template-columns: 170px 190px minmax(180px, 1fr);
}

.confirmation-list {
  display: grid;
}

.confirmation-item {
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.72);
}

.confirmation-item:hover {
  background: rgba(0, 113, 227, 0.025);
}

.confirmation-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.confirmation-item-head h3 {
  margin-top: 5px;
  color: #1d1d1f;
  font-size: 15px;
}

.confirmation-item-head p {
  margin-top: 5px;
  color: #6e6e73;
  font-size: 12px;
}

.confirmation-type {
  color: #0071e3;
  font-size: 10px;
  font-weight: 700;
}

.confirmation-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: #6e6e73;
  background: #f2f2f7;
  font-size: 10px;
  font-weight: 650;
}

.confirmation-status.pending {
  color: #9a5b00;
  background: #fff4dd;
}

.confirmation-status.confirmed {
  color: #17652b;
  background: #e8f7eb;
}

.confirmation-status.rejected {
  color: #b42318;
  background: #fff0ef;
}

.confirmation-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.confirmation-field {
  display: grid;
  gap: 6px;
}

.confirmation-field > span,
.confirmation-context strong {
  color: #6e6e73;
  font-size: 11px;
  font-weight: 650;
}

.confirmation-context,
.confirmation-resolution {
  display: flex;
  align-items: baseline;
  gap: 10px;
  grid-column: 1 / -1;
  border-left: 2px solid rgba(0, 113, 227, 0.35);
  padding: 7px 10px;
  color: #515154;
  background: rgba(0, 113, 227, 0.04);
  font-size: 12px;
}

.confirmation-resolution strong {
  flex: 0 0 auto;
}

.confirmation-meta {
  display: flex;
  gap: 14px;
  color: #86868b;
  font-size: 10px;
}

.confirmation-actions {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
}

.confirmation-review-note {
  color: #6e6e73;
  font-size: 12px;
}

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

@media (max-width: 980px) {
  .app-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 14px;
  }

  .workspace,
  .answer-main,
  .review-header,
  .qa-toolbar,
  .qa-create-row {
    display: block;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    padding-top: 6px;
  }

  .nav-tab {
    min-height: 42px;
  }

  .status-pill {
    margin-top: 0;
  }

  .workspace.state-empty {
    display: grid;
    grid-template-columns: minmax(0, 760px);
  }

  .questionnaire-form-layout {
    grid-template-columns: 1fr;
  }

  .questionnaire-details {
    padding-right: 0;
  }

  .questionnaire-source {
    margin-top: 24px;
    border-top: 1px solid rgba(60, 60, 67, 0.11);
    border-left: 0;
    padding-top: 22px;
    padding-left: 0;
  }

  .questionnaire-details .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .questionnaire-details .field-grid .full-width {
    grid-column: 1 / -1;
  }

  .qa-management-layout {
    grid-template-columns: 1fr;
  }

  .qa-create-column {
    border-right: 0;
    border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  }

  .qa-management-pane > .qa-toolbar {
    display: grid;
  }

  .records-table-head,
  .records-run-row {
    grid-template-columns: minmax(230px, 2fr) 96px 54px 130px 20px;
  }

  .records-table-head span:nth-child(4),
  .records-investor {
    display: none;
  }

  .input-pane {
    position: static;
    max-height: none;
    margin-bottom: 14px;
  }

  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .records-filters,
  .records-run-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-header .actions {
    margin-top: 14px;
  }

  .side-tools {
    margin-top: 14px;
  }

  .review-workbench {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .evidence-drawer {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .answer-support-grid {
    grid-template-columns: 1fr;
  }

  .run-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .run-metric:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .run-metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .run-stage-head,
  .run-stage-row {
    grid-template-columns: minmax(110px, 1.5fr) repeat(2, minmax(58px, 1fr));
  }

  .run-stage-head span:nth-child(4),
  .run-stage-head span:nth-child(5),
  .run-stage-row span:nth-child(4),
  .run-stage-row span:nth-child(5) {
    display: none;
  }

  .view-heading h2 {
    font-size: 19px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100vw - 12px);
    padding-top: 6px;
  }

  .topbar {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 10px;
  }

  .brand-subtitle,
  .status-pill {
    display: none;
  }

  .primary-nav {
    gap: 0;
  }

  .nav-tab {
    flex: 1 0 auto;
    min-width: 96px;
    padding: 0 10px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .workspace.state-empty .input-pane {
    padding: 20px 16px;
  }

  .questionnaire-details .field-grid {
    grid-template-columns: 1fr;
  }

  .questionnaire-details .field-grid .full-width {
    grid-column: auto;
  }

  .qa-management-pane > .panel-heading,
  .qa-management-pane > .qa-toolbar,
  .qa-create-column,
  .qa-list-column {
    padding-right: 16px;
    padding-left: 16px;
  }

  .records-filters {
    grid-template-columns: 1fr;
  }

  .records-run-list {
    grid-template-columns: 1fr;
  }

  .records-more-fields {
    right: auto;
    left: 0;
    width: 100%;
  }

  .records-table-head {
    display: none;
  }

  .records-run-list .records-run-row {
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 10px;
    padding: 14px 16px;
  }

  .records-run-name {
    grid-column: 1;
  }

  .records-status {
    grid-column: 2;
    grid-row: 1;
  }

  .records-question-count,
  .records-investor,
  .records-updated {
    display: none;
  }

  .records-open {
    grid-column: 3;
    grid-row: 1;
  }

  .field-grid .full-width {
    grid-column: auto;
  }

  .review-workbench {
    display: block;
  }

  .question-navigator {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .question-nav-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .question-nav-item {
    flex: 0 0 220px;
  }

  .answer-editor {
    padding: 15px;
  }

  .answer-editor .final-answer {
    min-height: 220px;
  }

  .completion-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completion-metrics div:nth-child(2) {
    border-right: 0;
  }

  .completion-metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .actions,
  .review-header .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions button {
    width: 100%;
  }

  .download-control,
  .download-menu-button {
    width: 100%;
  }
}

.eval-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 3px;
  margin-bottom: 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 8px;
  padding: 3px;
  background: rgba(118, 118, 128, 0.1);
}

.eval-mode-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}

.eval-mode-switch button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.gold-review-pane {
  padding: 0;
  overflow: hidden;
}

.gold-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}

.gold-title-line,
.gold-review-actions,
.gold-counts,
.gold-editor-footer,
.gold-decision-actions,
.gold-section-heading,
.gold-evidence-item summary {
  display: flex;
  align-items: center;
}

.gold-title-line {
  gap: 10px;
}

.gold-review-header p,
.gold-section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.gold-review-actions {
  gap: 10px;
}

.compact-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.compact-field .text-input {
  width: 150px;
  min-height: 38px;
}

.badge.gold-pending {
  color: #8a570e;
  background: rgba(255, 159, 10, 0.12);
}

.badge.gold-approved,
.badge.approved {
  color: #17612f;
  background: rgba(52, 199, 89, 0.12);
}

.badge.rejected {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.1);
}

.gold-summary {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(248, 248, 250, 0.72);
}

.gold-progress-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.gold-progress-copy strong {
  font-size: 18px;
}

.gold-progress-copy span,
.gold-counts {
  color: var(--muted);
  font-size: 12px;
}

.gold-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(118, 118, 128, 0.16);
}

.gold-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #34c759;
  transition: width 180ms ease;
}

.gold-counts {
  gap: 14px;
}

.gold-counts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #8e8e93;
}

.status-dot.draft {
  background: #ff9f0a;
}

.status-dot.approved {
  background: #34c759;
}

.status-dot.rejected {
  background: #ff3b30;
}

.gold-review-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  min-height: 690px;
}

.gold-question-nav {
  border-right: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(248, 248, 250, 0.52);
}

.gold-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.gold-filter-row .text-input {
  min-width: 0;
  min-height: 38px;
}

.gold-question-list {
  max-height: 760px;
  overflow-y: auto;
  padding: 6px;
}

.gold-question-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 11px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.gold-question-item:hover {
  background: rgba(118, 118, 128, 0.08);
}

.gold-question-item.active {
  background: rgba(0, 113, 227, 0.11);
}

.gold-question-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  background: #3a3a3c;
  font-size: 11px;
  font-weight: 750;
}

.gold-question-copy {
  min-width: 0;
}

.gold-question-copy strong,
.gold-question-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gold-question-copy strong {
  font-size: 13px;
  line-height: 1.35;
}

.gold-question-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.gold-question-editor {
  min-width: 0;
  padding: 24px 28px 28px;
}

.gold-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.gold-editor-head h3 {
  max-width: 820px;
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.42;
}

.gold-editor-kicker,
.gold-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.gold-policy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0;
  border-block: 1px solid rgba(60, 60, 67, 0.1);
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.gold-policy-strip span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.gold-editor-field {
  display: grid;
  gap: 7px;
}

.gold-editor-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.gold-editor-field input,
.gold-editor-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

.gold-editor-field textarea {
  min-height: 112px;
  resize: vertical;
}

.gold-editor-field textarea.gold-note {
  min-height: 72px;
}

.gold-editor-field input:focus,
.gold-editor-field textarea:focus {
  border-color: rgba(0, 113, 227, 0.55);
  outline: 3px solid rgba(0, 113, 227, 0.1);
}

.gold-scope-grid,
.gold-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.gold-scope-grid .full,
.gold-editor-field.full {
  grid-column: 1 / -1;
}

.gold-criteria-grid > div {
  min-width: 0;
  border-block: 1px solid rgba(60, 60, 67, 0.1);
  padding: 12px 0;
}

.gold-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gold-chip {
  border-radius: 5px;
  padding: 5px 7px;
  color: #245d39;
  background: rgba(52, 199, 89, 0.1);
  font-size: 11px;
}

.gold-chip.forbidden {
  color: #91342e;
  background: rgba(255, 59, 48, 0.08);
}

.gold-chip.muted {
  color: var(--muted);
  background: rgba(118, 118, 128, 0.08);
}

.gold-evidence-section {
  margin: 18px 0;
}

.gold-section-heading {
  justify-content: space-between;
  margin-bottom: 8px;
}

.gold-section-heading h4 {
  margin: 0;
  font-size: 14px;
}

.gold-section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.gold-evidence-list {
  border-block: 1px solid rgba(60, 60, 67, 0.12);
}

.gold-evidence-item {
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.gold-evidence-item:last-child {
  border-bottom: 0;
}

.gold-evidence-item summary {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  cursor: pointer;
  list-style-position: outside;
}

.gold-evidence-item summary span {
  min-width: 0;
}

.gold-evidence-item summary strong,
.gold-evidence-item summary small {
  display: block;
}

.gold-evidence-item summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.gold-evidence-item summary small,
.gold-evidence-item summary a {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.gold-evidence-item summary a {
  flex: 0 0 auto;
  color: #0066cc;
  text-decoration: none;
}

.gold-evidence-content {
  max-height: 240px;
  overflow: auto;
  margin-bottom: 8px;
  border-left: 3px solid rgba(0, 113, 227, 0.2);
  padding: 10px 12px;
  color: #3a3a3c;
  background: rgba(242, 242, 247, 0.62);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.gold-evidence-item code {
  display: block;
  overflow: hidden;
  margin-bottom: 10px;
  color: #8e8e93;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gold-editor-footer {
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border-top: 1px solid rgba(60, 60, 67, 0.12);
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
}

.gold-decision-actions {
  gap: 8px;
}

.danger-quiet-button {
  min-height: 38px;
  border: 1px solid rgba(255, 59, 48, 0.24);
  border-radius: 7px;
  padding: 0 15px;
  color: #c4312a;
  background: rgba(255, 59, 48, 0.04);
  font-weight: 650;
}

.gold-load-error {
  grid-column: 1 / -1;
  color: var(--danger);
}

@media (max-width: 900px) {
  .gold-review-header,
  .gold-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .gold-summary {
    grid-template-columns: auto 1fr;
  }

  .gold-counts {
    grid-column: 1 / -1;
  }

  .gold-review-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .gold-question-nav {
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  }

  .gold-question-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .gold-question-item {
    flex: 0 0 300px;
  }

  .gold-question-editor,
  .gold-scope-grid > *,
  .gold-criteria-grid > * {
    min-width: 0;
  }

  .gold-decision-actions button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .eval-mode-switch {
    width: 100%;
  }

  .gold-review-header,
  .gold-question-editor {
    padding: 16px;
  }

  .gold-review-actions,
  .gold-decision-actions,
  .gold-scope-grid,
  .gold-criteria-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .compact-field .text-input,
  .gold-review-actions button {
    width: 100%;
  }

  .gold-filter-row {
    grid-template-columns: 1fr;
  }

  .gold-editor-head {
    gap: 10px;
  }
}

@media (max-width: 980px) {
  .document-table-head,
  .document-record-grid {
    grid-template-columns: minmax(220px, 2fr) 92px 72px 74px 22px;
  }

  .document-table-head span:nth-child(5),
  .document-source-badge {
    display: none;
  }

  .qa-table-head,
  .qa-record-summary {
    grid-template-columns: minmax(250px, 2fr) 82px minmax(100px, 0.7fr);
  }

  .qa-table-head span:nth-child(4),
  .qa-record-updated {
    display: none;
  }
}

@media (max-width: 560px) {
  .collection-pane .records-header,
  .document-stats,
  .collection-table-head,
  .document-record-grid,
  .document-record-details,
  .qa-record-row .qa-edit-grid {
    padding-right: 16px;
    padding-left: 16px;
  }

  .collection-filters,
  .qa-record-filters,
  .confirmation-filters,
  .confirmation-editor-grid,
  .confirmation-actions {
    grid-template-columns: 1fr;
  }

  .confirmation-item {
    padding: 16px;
  }

  .confirmation-item-head {
    gap: 10px;
  }

  .collection-table-head {
    display: none;
  }

  .document-record-grid {
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .document-record-grid > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .document-record-type,
  .document-record-chunks,
  .document-source-badge {
    display: none;
  }

  .collection-open {
    grid-column: 3;
    grid-row: 1;
  }

  .qa-record-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 16px;
  }

  .qa-record-approver,
  .qa-record-updated {
    display: none;
  }

  .qa-create-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .qa-create-row {
    grid-template-columns: 1fr;
  }
}
