:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f3f6fa;
  --text: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #edf2f7;
  --primary: #14b8a6;
  --primary-strong: #0f766e;
  --primary-soft: #eefdfb;
  --brand-red: #d51f2a;
  --brand-red-strong: #b91c1c;
  --brand-red-soft: #fff1f2;
  --blue: #0284c7;
  --blue-soft: #eff6ff;
  --pass-bg: #dcfce7;
  --pass-text: #047857;
  --fail-bg: #fff0f0;
  --fail-text: #be123c;
  --warn-bg: #fef3c7;
  --warn-text: #b45309;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --header-h: 68px;
  --sidebar-w: 264px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

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

.topbar {
  grid-column: 1 / 3;
  position: relative;
  top: auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.brand,
.top-actions,
.actions,
.ghost-action,
.secondary-action,
.primary-action,
.secondary-button,
.text-button,
.user-chip {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  min-width: 0;
}

.brand-logo-horizontal {
  display: block;
  width: 220px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

h1 {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
}

.brand-copy p,
.result-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.top-actions {
  gap: 14px;
  color: #344054;
  font-size: 14px;
  white-space: nowrap;
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill,
.badge,
.record-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  min-height: 28px;
  padding: 4px 12px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid #f2d7a6;
}

.status-pill.running {
  color: #0f5f89;
  background: #e8f4fb;
  border-color: #c4e2f4;
}

.status-pill.done,
.badge.pass {
  color: var(--pass-text);
  background: var(--pass-bg);
  border: 1px solid #bfe8cc;
}

.status-pill.issue,
.badge.fail {
  color: var(--fail-text);
  background: var(--fail-bg);
  border: 1px solid #ffc9c9;
}

.badge.mute {
  color: #667085;
  background: #eef1f4;
  border: 1px solid #d8dee5;
}

.muted,
.extract-warning {
  color: var(--muted);
}

.extract-warning {
  display: inline-block;
  max-width: 360px;
  line-height: 1.45;
}

.ghost-action,
.text-button {
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  color: #344054;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #344054;
  background: #fff;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #ccebd8;
}

.ghost-action:hover,
.text-button:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #ccebd8;
}

.text-button:disabled,
.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #fff 0 31%, transparent 32%),
    #566274;
}

.user-chip {
  gap: 8px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--header-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  background: #f3f7fb;
}

.app-sidebar {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  padding: 12px 12px;
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  padding: 4px 8px 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
  display: block;
  width: 118px;
  height: auto;
  object-fit: contain;
}

.sidebar-section + .sidebar-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-label {
  padding: 8px 10px 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin-bottom: 6px;
  padding: 8px 12px;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.menu-item svg {
  width: 20px;
  height: 20px;
  color: #64748b;
}

.menu-item:hover {
  background: #f1f5f9;
  border-color: var(--line);
}

.menu-item.active {
  color: var(--brand-red-strong);
  background: var(--brand-red-soft);
  border-color: #fecdd3;
  box-shadow: 0 10px 24px rgba(213, 31, 42, 0.1);
}

.menu-item.active svg {
  color: var(--brand-red);
}

.scope-card {
  display: grid;
  gap: 6px;
  margin: 0 4px 8px;
  padding: 10px;
  border: 1px solid #ccfbf1;
  border-radius: 8px;
  background: #f0fdfa;
}

.scope-card strong {
  color: #0f766e;
  font-size: 14px;
}

.scope-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.scope-card.muted-card {
  border-color: #dbeafe;
  background: #eff6ff;
}

.scope-card.muted-card strong {
  color: #2563eb;
}

.workspace {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  align-items: start;
}

.workspace.view-workbench {
  grid-template-columns: minmax(500px, 0.9fr) minmax(420px, 1.1fr);
  grid-template-rows: 170px minmax(0, 1fr);
  overflow: hidden;
  align-items: stretch;
}

.workspace.view-workbench .side-column {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.workspace.view-workbench .control-panel {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.workspace.view-workbench .control-panel form {
  min-height: 0;
  align-content: start;
}

.workspace.view-workbench .live-log-panel {
  display: block;
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  min-height: 0;
}

.workspace.view-workbench .record-panel,
.workspace.view-workbench .dashboard-strip,
.workspace.view-workbench .rules-overview-panel,
.workspace.view-workbench .result-panel {
  display: none;
}

.workspace.view-pending,
.workspace.view-rules,
.workspace.view-dashboard {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
}

.workspace.view-pending .overview-strip,
.workspace.view-pending .dashboard-strip,
.workspace.view-pending .rules-overview-panel,
.workspace.view-pending .live-log-panel,
.workspace.view-pending .result-panel,
.workspace.view-pending .record-panel,
.workspace.view-rules .overview-strip,
.workspace.view-rules .dashboard-strip,
.workspace.view-rules .side-column,
.workspace.view-rules .live-log-panel,
.workspace.view-rules .result-panel,
.workspace.view-dashboard .overview-strip,
.workspace.view-dashboard .rules-overview-panel,
.workspace.view-dashboard .side-column,
.workspace.view-dashboard .live-log-panel,
.workspace.view-dashboard .result-panel {
  display: none;
}

.workspace.view-pending .side-column {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
}

.workspace.view-pending .control-panel {
  display: block;
  max-width: 980px;
  margin: 0 auto;
}

.workspace.view-rules .rules-overview-panel,
.workspace.view-dashboard .dashboard-strip {
  display: grid;
  grid-column: 1 / -1;
}

.workspace.view-dashboard .dashboard-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace.view-result {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
}

.workspace.view-result .overview-strip,
.workspace.view-result .dashboard-strip,
.workspace.view-result .rules-overview-panel,
.workspace.view-result .side-column,
.workspace.view-result .live-log-panel {
  display: none;
}

.workspace.view-result .result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  align-content: start;
  grid-column: 1 / -1;
  min-height: auto;
}

.workspace.view-result .result-panel[data-active-tab="preview"] {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.view-result .result-panel[data-active-tab="preview"] .result-side-summary {
  display: none;
}

.workspace.view-result .result-header,
.workspace.view-result .metrics {
  grid-column: 1 / -1;
}

.workspace.view-result .result-content-grid {
  display: contents;
}

.result-main-content {
  min-width: 0;
}

.result-side-summary {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.result-side-summary h3 {
  margin-bottom: 6px;
}

.issue-summary-block {
  display: grid;
  gap: 10px;
}

.issue-summary-block strong {
  color: #0f172a;
  font-size: 13px;
}

.issue-summary-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.issue-list,
.evidence-mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
}

.issue-list span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--brand-red);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.evidence-mini-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
}

.evidence-mini-list b {
  color: #0f172a;
  font-size: 13px;
}

.evidence-mini-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.workspace.view-records {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
}

.workspace.view-records .overview-strip,
.workspace.view-records .dashboard-strip,
.workspace.view-records .rules-overview-panel,
.workspace.view-records .live-log-panel,
.workspace.view-records .control-panel,
.workspace.view-records .result-panel {
  display: none;
}

.workspace.view-records .side-column {
  grid-column: 1 / -1;
  width: 100%;
}

.workspace.view-records .record-panel {
  display: block;
  min-height: calc(100dvh - var(--header-h) - 36px);
  padding: 20px;
}

.workspace.view-records .record-actions,
.workspace.view-records .record-filter-panel {
  max-width: none;
}

.workspace.view-records .record-table-wrap {
  max-height: calc(100dvh - var(--header-h) - 330px);
}

.live-log-panel {
  display: none;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace.view-workbench .live-log-panel {
  display: flex;
  flex-direction: column;
}

.live-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.live-log-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.live-log-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid #ccfbf1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.overview-strip {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 14px 18px;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #fff7f7 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
}

.overview-head h2 {
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.overview-head p {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.system-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--brand-red-strong);
  background: #ffffff;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.08);
}

.agent-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

.agent-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--agent-border, #c8f1e8);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, var(--agent-bg, #eefdf8) 100%);
}

.agent-summary-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -44px;
  width: 118px;
  height: 80px;
  border-radius: 999px;
  background: var(--agent-shape, rgba(20, 184, 166, 0.12));
}

.agent-summary-card.green {
  --agent-bg: #fff7f7;
  --agent-border: #fecdd3;
  --agent-accent: #d51f2a;
  --agent-shape: rgba(213, 31, 42, 0.09);
}

.agent-summary-card.blue {
  --agent-bg: #eff6ff;
  --agent-border: #bfdbfe;
  --agent-accent: #2563eb;
  --agent-shape: rgba(96, 165, 250, 0.15);
}

.agent-summary-card.orange {
  --agent-bg: #fff7ed;
  --agent-border: #fed7aa;
  --agent-accent: #ea580c;
  --agent-shape: rgba(251, 146, 60, 0.15);
}

.agent-summary-card span {
  color: var(--agent-accent);
  font-size: 12px;
  font-weight: 900;
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff !important;
  background: var(--agent-accent);
  border-radius: 999px;
  font-size: 15px !important;
}

.agent-summary-card strong {
  display: inline-block;
  margin: 0 0 0 8px;
  color: #0f172a;
  font-size: 17px;
  font-weight: 900;
}

.step-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  color: #475569;
  font-size: 13px;
}

.step-status b {
  min-height: 22px;
  padding: 2px 8px;
  color: #1e293b;
  background: #eef2f7;
  border-radius: 999px;
  font-size: 12px;
}

.step-progress {
  position: relative;
  z-index: 1;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf0;
}

.step-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--agent-accent), rgba(37, 99, 235, 0.75));
  transition: width 0.22s ease;
}

.agent-summary-card p {
  display: none;
}

.side-column {
  display: grid;
  gap: 12px;
  align-self: start;
  min-width: 0;
}

.control-panel,
.record-panel,
.result-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.control-panel,
.record-panel {
  padding: 16px 18px;
}

.result-panel {
  min-width: 0;
  padding: 18px 20px;
}

h2 {
  font-size: 19px;
  line-height: 1.4;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 10px;
}

form {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}

label {
  display: block;
  color: #273444;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin-top: 6px;
  padding: 8px 11px;
  color: var(--text);
  background: #fbfcfd;
  border: 1px solid #cad4df;
  border-radius: 5px;
  font: inherit;
  font-size: 14px;
}

.control-panel input,
.control-panel select {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

input:focus,
select:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(15, 143, 77, 0.18);
  outline-offset: 2px;
}

.path-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: end;
}

.path-picker.compact {
  grid-template-columns: 1fr;
}

.path-picker input {
  min-width: 0;
}

.dock-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: end;
}

.dock-picker select {
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.code-mode-block {
  display: grid;
  gap: 8px;
}

.code-mode-toggle {
  display: flex;
  gap: 10px;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #d4dde6;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-chip input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
}

.manual-code-row {
  display: none;
  gap: 6px;
}

.manual-code-row.active {
  display: grid;
}

.manual-code-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auto-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auto-field-row div,
.audit-progress {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.auto-field-row div {
  padding: 8px 10px;
}

.auto-field-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auto-field-row strong {
  display: block;
  margin-top: 5px;
  color: #273444;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.audit-progress {
  padding: 12px;
  min-height: 0;
}

.live-log-panel .audit-progress {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.control-panel .audit-progress {
  display: none;
}

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

.progress-head strong {
  color: var(--primary-strong);
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #15a863, #0f7fbc);
  transition: width 0.22s ease;
}

#progressMessage {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.progress-log {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 10px 0 0;
  padding: 8px 10px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
}

.progress-log li {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  color: #344054;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.45;
}

.progress-log li:last-child {
  border-bottom: 0;
}

.progress-log span {
  display: inline-block;
  min-width: 58px;
  color: var(--muted);
}

.progress-log li strong {
  color: #0f172a;
}

.progress-log li em {
  display: block;
  margin-top: 2px;
  color: #475569;
  font-style: normal;
}

.primary-action,
.secondary-action,
.secondary-button {
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.primary-action {
  margin-top: 4px;
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, #e02a34, #b91c1c);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

#runAuditBtn {
  min-height: 44px;
  margin-top: 6px;
  font-size: 15px;
}

.primary-action:hover {
  background: linear-gradient(180deg, #cf1f2a, #991b1b);
}

.primary-action:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary-action,
.secondary-button {
  color: #1f2937;
  border: 1px solid #d4dde6;
  background: #fff;
}

.secondary-button.solid {
  color: #fff;
  border-color: var(--brand-red-strong);
  background: var(--brand-red);
}

.secondary-action:hover,
.secondary-button:hover {
  color: var(--primary-strong);
  border-color: #a9d5bb;
  background: #f1fbf5;
}

.secondary-button.solid:hover {
  color: #fff;
  background: var(--brand-red-strong);
}

.secondary-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.secondary-action.disabled {
  pointer-events: none;
  color: #98a2b3;
  background: #f4f6f8;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: flex-end;
}

.workspace.view-records .record-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.workspace.view-records .record-header h2 {
  font-size: 24px;
}

.record-action-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.record-filter-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(220px, auto);
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.record-filter-panel span {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.record-search input {
  min-height: 36px;
  margin-top: 0;
  font-size: 13px;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin: 0;
}

.filter-chip {
  min-width: 58px;
  min-height: 30px;
  color: #344054;
  background: #fff;
  border: 1px solid #d8e1ea;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.active {
  color: #fff;
  background: var(--brand-red);
  border-color: var(--brand-red);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.record-table-wrap,
.table-scroll,
.preview-shell {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.workspace.view-records .record-table-wrap {
  border-radius: 8px;
}

.audit-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 16px;
  align-items: start;
}

.audit-form-preview {
  min-height: calc(100dvh - var(--header-h) - 260px);
}

.manual-correction-panel {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100dvh - var(--header-h) - 110px);
  min-width: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.manual-correction-panel h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.manual-correction-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.manual-correction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.manual-correction-grid label,
.manual-check-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.manual-correction-grid input,
.manual-correction-grid select,
.manual-correction-grid textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.manual-correction-grid input,
.manual-correction-grid select {
  height: 36px;
}

.manual-correction-grid textarea {
  resize: vertical;
  min-height: 36px;
  line-height: 1.4;
}

.manual-correction-grid input:disabled {
  color: #94a3b8;
  background: #eef2f7;
}

.manual-correction-wide {
  grid-column: span 2;
}

.manual-check-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.manual-check-section h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
}

.manual-check-section p {
  font-size: 12px;
}

.manual-check-list {
  display: grid;
  gap: 8px;
}

.manual-check-row {
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #f8fafc;
}

.manual-check-row span {
  overflow-wrap: anywhere;
  color: #344054;
  line-height: 1.35;
}

.manual-check-row select {
  width: 92px;
  min-height: 32px;
  margin-top: 0;
  padding: 5px 8px;
  background: #fff;
  font-size: 12px;
}

.manual-correction-submit {
  width: 100%;
  min-height: 40px;
  margin-top: 2px;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop.active {
  display: flex;
}

.settings-dialog {
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(16, 24, 40, 0.22);
}

.settings-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.settings-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px 20px 20px;
}

#settingsForm {
  grid-template-columns: 1fr;
  gap: 12px;
}

#settingsForm fieldset {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: end;
  padding: 16px;
}

#settingsForm legend {
  color: var(--brand-red-strong);
}

#settingsForm .toggle-line,
#settingsForm small {
  grid-column: 1 / -1;
}

#settingsForm label:not(.toggle-line) {
  align-self: center;
  margin-top: 0;
}

#settingsForm input {
  margin-top: 0;
}

#settingsForm .settings-wide {
  grid-column: 1;
}

#settingsForm .settings-wide input {
  grid-column: 2;
}

.settings-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.settings-form legend {
  padding: 0 6px;
  color: #273444;
  font-size: 14px;
  font-weight: 800;
}

.settings-form label {
  margin-top: 10px;
}

.settings-form small {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-wide,
.settings-actions {
  grid-column: 1 / -1;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0 !important;
}

.toggle-line input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

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

.settings-actions .secondary-button,
.settings-actions .primary-action {
  min-width: 112px;
  padding: 0 16px;
}

.dock-dialog {
  width: min(860px, 100%);
  max-width: 860px;
}

.dock-form {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
  align-items: start;
}

.dock-form fieldset {
  min-height: 100%;
}

.dock-edit-grid {
  display: grid;
  grid-template-columns: 88px minmax(160px, 1fr);
  gap: 12px;
  align-items: end;
}

.dock-edit-grid .primary-action {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 40px;
}

.dock-edit-grid label {
  display: block;
  white-space: nowrap;
}

.dock-list-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.dock-table {
  margin: 0;
  table-layout: fixed;
  min-width: 0;
}

.dock-table th,
.dock-table td {
  vertical-align: middle;
}

.dock-table th:nth-child(1),
.dock-table td:nth-child(1) {
  width: 72px;
  text-align: center;
}

.dock-table th:nth-child(3),
.dock-table td:nth-child(3) {
  width: 74px;
  text-align: center;
}

.dock-table td:nth-child(2) {
  word-break: break-word;
}

.record-table,
.data-table,
.info-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.record-table th,
.record-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.record-table th {
  color: #344054;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 700;
}

.record-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-table th:nth-child(1),
.record-table td:nth-child(1) {
  width: auto;
}

.record-table th:nth-child(2),
.record-table td:nth-child(2) {
  width: 112px;
  white-space: nowrap;
}

.record-table th:nth-child(3),
.record-table td:nth-child(3) {
  width: 48px;
  text-align: center;
}

.record-table th:nth-child(4),
.record-table td:nth-child(4) {
  width: 108px;
  white-space: nowrap;
}

.record-table th:nth-child(5),
.record-table td:nth-child(5) {
  width: 76px;
  text-align: center;
}

.record-table th:nth-child(6),
.record-table td:nth-child(6) {
  width: 82px;
  text-align: center;
}

.record-row {
  cursor: pointer;
}

.record-row:hover {
  background: #f5faf7;
}

.record-status {
  min-height: 26px;
  padding: 3px 8px;
}

.record-status.ok {
  color: var(--pass-text);
  background: var(--pass-bg);
  border: 1px solid #bfe8cc;
}

.record-status.bad {
  color: var(--fail-text);
  background: var(--fail-bg);
  border: 1px solid #ffc9c9;
}

.record-delete {
  min-height: 28px;
  min-width: 54px;
  padding: 0 10px;
  color: var(--fail-text);
  background: #fff;
  border: 1px solid #ffc9c9;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.record-delete:hover {
  background: var(--fail-bg);
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
}

.record-pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.pager-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-button {
  min-height: 32px;
  padding: 0 10px;
  color: #344054;
  background: #fff;
  border: 1px solid #d8e1ea;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

#recordPageSize {
  min-height: 32px;
  margin-top: 0;
  padding: 4px 8px;
  font-size: 12px;
}

.result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.action-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.action-group-title {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.action-group-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.report-group {
  border-color: #c4e2f4;
  background: #f3f9fd;
}

.data-group {
  min-width: 96px;
}

.data-group .action-group-buttons {
  justify-content: stretch;
}

.secondary-action {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
  flex: 1 1 72px;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
}

.secondary-action.report-action {
  color: #0f5f89;
  border-color: #c4e2f4;
  background: #f3f9fd;
}

.secondary-action.report-action:hover {
  color: #0b4d72;
  border-color: #8cc8e8;
  background: #e8f4fb;
}

.secondary-action.data-action {
  color: #344054;
  border-color: #d8dee5;
  background: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0 16px;
}

.metric-card {
  min-height: 118px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-card span {
  display: block;
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong.ok {
  color: var(--pass-text);
}

.metric-card strong.bad {
  color: var(--fail-text);
}

.metric-card.warning strong {
  color: #e18310;
}

.field-table {
  margin-bottom: 18px;
}

.info-table {
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  font-size: 14px;
}

.info-table th,
.info-table td {
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.info-table th {
  width: 10%;
  color: #344054;
  background: #f8fafb;
  font-weight: 700;
}

.info-table td {
  width: 23%;
}

.tabs {
  display: flex;
  gap: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fafb;
}

.tab {
  min-height: 48px;
  padding: 0 34px;
  color: #344054;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

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

.tab-view {
  display: none;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
}

.tab-view.active {
  display: block;
}

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

.check-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.check-row span {
  font-size: 14px;
  line-height: 1.45;
}

.check-index {
  color: #667085;
  font-variant-numeric: tabular-nums;
}

.badge {
  min-height: 28px;
  padding: 4px 10px;
}

.legend-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 12px;
  color: #344054;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfd;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.pass {
  background: var(--pass-text);
}

.dot.fail {
  background: var(--fail-text);
}

.dot.mute {
  background: #98a2b3;
}

.evidence-list {
  display: grid;
  gap: 10px;
}

.evidence-list div,
.problem-list,
.geo-summary div,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.evidence-list div,
.problem-list,
.geo-summary div,
.empty-state {
  padding: 12px;
}

.evidence-list span,
.geo-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.evidence-list p,
.problem-list p {
  color: #2d3c47;
  font-size: 14px;
  line-height: 1.55;
  margin-top: 5px;
}

.problem-list {
  margin-top: 12px;
  background: #fffdf8;
}

.attention-state {
  border-color: #f6c96b;
  background: #fffaf0;
}

.attention-state strong {
  display: block;
  color: #9a3412;
  margin-bottom: 6px;
}

.attention-state p,
.attention-state li {
  color: #4b5563;
  line-height: 1.6;
}

.attention-state ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.data-table {
  min-width: 860px;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.data-table th {
  color: #32414d;
  background: #f8fafb;
  font-size: 13px;
  font-weight: 700;
}

.dock-table.data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.dock-table.data-table th,
.dock-table.data-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.compact-table {
  min-width: 720px;
}

.compact-table th,
.compact-table td {
  padding: 8px 10px;
  font-size: 13px;
}

.standard-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.standard-card h3 {
  color: #1f2f3a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.standard-summary {
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
}

.standard-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fbfcfd;
}

.standard-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.standard-summary strong,
.standard-summary p {
  display: block;
  margin-top: 5px;
  color: #253541;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.standard-summary .badge {
  display: inline-flex;
  margin-top: 8px;
}

.standard-card .table-scroll {
  min-width: 0;
}

.standard-card .data-table td:first-child {
  width: 190px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.standard-card .data-table td:nth-child(2) {
  min-width: 230px;
}

.geo-summary {
  display: grid;
  grid-template-columns: 0.8fr 1.3fr 1.5fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
}

.geo-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.geo-summary strong.ok {
  color: var(--pass-text);
}

.geo-summary strong.bad {
  color: var(--fail-text);
}

.geo-summary strong.warn {
  color: #a16207;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
}

iframe {
  display: block;
  width: 920px;
  min-height: 1180px;
  border: 0;
  background: #fff;
}

.report-preview-shell iframe {
  width: 1120px;
  min-height: 1420px;
}

/* Visual refresh: align the app with the task-oriented reference UI. */
.app-shell {
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
}

.topbar {
  min-height: 64px;
  padding: 0 22px;
  border-bottom-color: #dce5ee;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.brand-logo-horizontal {
  width: 205px;
  height: 38px;
}

.brand-copy {
  gap: 1px;
  padding-left: 12px;
}

h1 {
  font-size: 18px;
  font-weight: 900;
}

.brand-copy p {
  font-size: 12px;
}

.app-sidebar {
  padding: 14px 12px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.sidebar-brand {
  padding: 10px 8px 16px;
  margin-bottom: 14px;
}

.sidebar-brand img {
  width: 108px;
}

.menu-item {
  min-height: 44px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.menu-item.active {
  background: linear-gradient(90deg, #fff1f2 0%, #ffffff 100%);
  border-color: #fecdd3;
  box-shadow: inset 3px 0 0 var(--brand-red), 0 10px 22px rgba(213, 31, 42, 0.08);
}

.scope-card {
  padding: 12px;
  border-radius: 8px;
}

.workspace {
  gap: 16px;
  padding: 18px 20px 20px;
}

.workspace.view-workbench {
  grid-template-columns: minmax(520px, 0.95fr) minmax(520px, 1.05fr);
  grid-template-rows: 152px minmax(480px, 1fr) 104px;
  gap: 12px;
  overflow: auto;
}

.overview-strip {
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.overview-head {
  min-height: 30px;
  align-items: center;
}

.overview-head h2 {
  font-size: 19px;
  letter-spacing: 0;
}

.system-badge {
  min-height: 30px;
  padding: 0 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(213, 31, 42, 0.08);
}

.agent-summary-grid {
  gap: 12px;
}

.agent-summary-card {
  height: 98px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.agent-summary-card.green {
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.agent-summary-card.blue {
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.agent-summary-card.orange {
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.agent-summary-card::after {
  right: 18px;
  bottom: 16px;
  width: 62px;
  height: 62px;
  opacity: 0.8;
}

.step-index {
  width: 28px;
  height: 28px;
}

.agent-summary-card strong {
  font-size: 18px;
}

.step-status {
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

.step-progress {
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

.agent-summary-card p {
  position: relative;
  z-index: 1;
  display: none;
  margin-top: 5px;
  max-width: 70%;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-panel,
.live-log-panel,
.record-panel,
.result-panel {
  border-color: #dbe5ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.workspace.view-workbench .side-column,
.workspace.view-workbench .live-log-panel {
  grid-row: 2;
}

.workspace.view-workbench .side-column,
.workspace.view-workbench .control-panel {
  overflow: visible;
}

.workspace.view-workbench .control-panel {
  height: auto;
}

.workspace.view-workbench .auto-field-row {
  display: none;
}

.control-panel,
.record-panel {
  padding: 16px 20px;
}

.control-panel h2,
.live-log-head h2,
.record-header h2,
.result-header h2 {
  font-size: 18px;
  font-weight: 900;
}

form {
  gap: 9px;
}

input,
select,
.manual-correction-grid textarea {
  border-color: #cfd9e5;
  background: #fbfdff;
}

.path-picker {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.dock-picker {
  grid-template-columns: minmax(0, 1fr) 82px;
}

.auto-field-row div {
  padding: 12px;
  border-color: #dbe5ee;
  border-radius: 8px;
  background: #f8fafc;
}

#runAuditBtn {
  min-height: 48px;
  margin-top: 0;
  border-radius: 6px;
  font-weight: 900;
}

.live-log-panel {
  padding: 16px 20px;
}

.live-log-head {
  align-items: center;
}

.live-log-tools {
  display: grid;
  grid-template-columns: auto 180px auto auto;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.mini-progress {
  width: 180px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf0;
}

.mini-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.live-log-tools strong {
  color: #2563eb;
  font-size: 13px;
}

.audit-progress {
  padding: 14px;
  border-color: #dbe5ee;
  border-radius: 8px;
  background: #fbfdff;
}

.progress-log {
  padding: 0 14px 0 96px;
  border-radius: 8px;
  border: 0;
  background:
    linear-gradient(#dbeafe, #dbeafe) 78px 0 / 2px 100% no-repeat,
    #fff;
}

.progress-log li {
  position: relative;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  padding: 16px 0;
}

.progress-log li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 1px #93c5fd;
}

.progress-log li:first-child::before {
  background: #94a3b8;
  box-shadow: 0 0 0 1px #cbd5e1;
}

.selected-files-panel {
  display: grid;
  gap: 10px;
}

.selected-files-panel > span {
  color: #273444;
  font-size: 13px;
  font-weight: 800;
}

.file-type-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.file-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.file-chip.pdf {
  color: #dc2626;
}

.file-chip.docx {
  color: #2563eb;
}

.file-chip.xlsx {
  color: #16a34a;
}

.dashboard-strip {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(280px, 0.92fr);
  gap: 12px;
  min-height: 0;
}

.dashboard-card {
  display: grid;
  grid-template-columns: minmax(92px, 0.84fr) 62px minmax(82px, 0.78fr);
  align-items: center;
  gap: 10px;
  min-height: 104px;
  padding: 10px 14px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.dashboard-card span {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.dashboard-card strong {
  display: block;
  margin-top: 9px;
  color: var(--brand-red);
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

.dashboard-card small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

.dashboard-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  color: #344054;
  list-style: none;
  font-size: 12px;
}

.dashboard-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-card li i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.rules-overview-panel {
  display: none;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.rules-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rules-overview-head h2 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.25;
}

.rules-overview-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.rules-overview-head span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  color: #155e75;
  background: #ecfeff;
  font-size: 12px;
  font-weight: 800;
}

.rules-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rules-overview-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.rules-overview-grid strong {
  display: block;
  margin-bottom: 8px;
  color: #111827;
  font-size: 13px;
}

.rules-overview-grid ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
  color: #475467;
  font-size: 12px;
  line-height: 1.45;
}

.red-dot { background: #ef4444; }
.blue-dot { background: #2563eb; }
.green-dot { background: #22c55e; }
.cyan-dot { background: #22c1c3; }
.gray-dot { background: #94a3b8; }

.donut-ring {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: conic-gradient(#2563eb 0 68%, #e2e8f0 68% 100%);
  position: relative;
}

.donut-ring::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: inherit;
  background: #fff;
}

.donut-ring.red {
  background: conic-gradient(#ef4444 0 42%, #2563eb 42% 74%, #22c55e 74% 88%, #e2e8f0 88% 100%);
}

.donut-ring.cyan {
  background: conic-gradient(#22c1c3 0 72%, #94a3b8 72% 100%);
}

.donut-ring.green {
  background: conic-gradient(#22c55e 0 70%, #84cc16 70% 100%);
}

.recent-card {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  min-width: 0;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.recent-records {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.recent-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 38px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
}

.recent-record-row:nth-child(n + 3) {
  display: none;
}

.recent-record-row b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.recent-record-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.recent-record-row .ok {
  color: var(--pass-text);
  background: var(--pass-bg);
}

.recent-record-row .bad {
  color: var(--fail-text);
  background: var(--fail-bg);
}

.recent-record-row time {
  justify-self: end;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.main-nav {
  border-top: 0;
  padding-top: 0;
}

.menu-item.muted-item {
  color: #475569;
}

.sidebar-agent-card {
  display: grid;
  gap: 12px;
  margin: auto 4px 0;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(180deg, #f0fdfa 0%, #eff6ff 100%);
}

.sidebar-agent-card strong {
  color: #0f172a;
  font-size: 15px;
}

.sidebar-agent-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
}

.sidebar-agent-card span i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
}

.sidebar-agent-card small {
  color: #64748b;
  font-size: 12px;
}

.agent-illustration {
  display: grid;
  place-items: center;
  height: 112px;
}

.agent-illustration svg {
  width: 118px;
  height: 88px;
  color: #2563eb;
  stroke-width: 2;
  fill: rgba(37, 99, 235, 0.08);
}

.workspace.view-result .result-panel {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-content: start;
  padding: 20px 22px;
}

.result-header {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.actions {
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr) minmax(160px, 0.55fr);
  gap: 12px;
}

.action-group {
  padding: 10px;
  border-color: #dbe5ee;
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.report-group {
  border-color: #bfdbfe;
  background: #f3f8ff;
}

.secondary-action {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 800;
}

.metrics {
  gap: 16px;
  margin: 18px 0 16px;
}

.metric-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 20px 22px;
  border-color: #dbe5ee;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -18px;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.09);
}

.metric-card:nth-child(1)::after {
  background: rgba(37, 99, 235, 0.12);
}

.metric-card:nth-child(3)::after {
  background: rgba(213, 31, 42, 0.10);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  position: relative;
  z-index: 1;
}

.metric-card strong {
  font-size: 32px;
  font-weight: 900;
}

.tabs {
  border-color: #dbe5ee;
  background: #f8fafc;
}

.tab {
  min-height: 50px;
  padding: 0 26px;
  color: #334155;
}

.tab.active {
  color: var(--brand-red-strong);
  border-bottom-color: var(--brand-red);
}

.tab-view {
  border-color: #dbe5ee;
  background: #fff;
}

.result-side-summary {
  top: 20px;
  padding: 18px;
  border-color: #dbe5ee;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.result-side-summary h3 {
  font-size: 17px;
  font-weight: 900;
}

.audit-preview-layout {
  grid-template-columns: minmax(0, 1fr) clamp(360px, 28vw, 420px);
  gap: 18px;
}

.audit-form-preview {
  min-height: calc(100dvh - var(--header-h) - 290px);
  border-radius: 8px;
  background: #fff;
}

.manual-correction-panel {
  top: 18px;
  gap: 16px;
  max-height: calc(100dvh - var(--header-h) - 122px);
  padding: 18px;
  border-color: #dbe5ee;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.manual-correction-panel h3 {
  font-size: 17px;
  font-weight: 900;
}

.manual-correction-grid {
  gap: 12px;
}

.manual-correction-grid input,
.manual-correction-grid select,
.manual-correction-grid textarea {
  min-height: 38px;
  border-radius: 6px;
}

.manual-check-section {
  padding-top: 14px;
}

.manual-check-row {
  padding: 10px 12px;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.manual-correction-submit {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 900;
}

.workspace.view-records .record-panel {
  padding: 22px;
}

.record-actions {
  gap: 10px;
}

.record-filter-panel {
  border-color: #dbe5ee;
  background: #fbfdff;
}

.record-table th {
  background: #f8fafc;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .app-sidebar {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: visible;
  }

  .workspace.view-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .workspace.view-workbench .side-column,
  .workspace.view-workbench .live-log-panel {
    grid-column: 1 / -1;
  }

  .workspace.view-workbench .side-column {
    overflow: visible;
  }

  .progress-log {
    height: auto;
    min-height: 220px;
    max-height: 360px;
  }

  .brand-copy {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .audit-preview-layout,
  .manual-correction-grid,
  .rules-overview-grid {
    grid-template-columns: 1fr;
  }

  .manual-correction-wide {
    grid-column: auto;
  }

  .manual-correction-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1400px) and (min-width: 1181px) {
  .workspace.view-workbench .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .workspace.view-workbench .dock-picker {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .workspace.view-workbench .auto-field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .agent-summary-grid {
    grid-template-columns: 1fr;
  }

  .overview-head {
    flex-direction: column;
  }

  .topbar,
  .result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .action-group {
    min-width: 0;
    width: 100%;
  }

  .action-group-buttons {
    flex-wrap: wrap;
  }

  .workspace {
    padding: 10px;
  }

  .form-grid,
  .path-picker,
  .auto-field-row,
  .metrics,
  .check-board,
  .geo-summary,
  .standard-summary,
  .record-pager,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .settings-dialog {
    max-height: calc(100vh - 20px);
  }

  .tab {
    padding: 0 18px;
  }

  .info-table {
    min-width: 760px;
  }

  .record-table {
    min-width: 0;
  }

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

  .dock-edit-grid {
    grid-template-columns: 1fr;
  }
}
