/* DutyVerify — Round 2 B2B SaaS Design System (Ramp / Mercury / Flexport / Linear Light Mode) */
:root {
  /* Surfaces */
  --bg-canvas: #f7f7f5;
  --bg-sidebar: #f5f5f4;
  --bg-surface: #ffffff;
  --bg-surface-muted: #fafaf9;
  --bg-hover: #efece8;
  --bg-active: #e7e5e4;

  /* Hairline Borders */
  --border-subtle: #e7e5e4;
  --border-strong: #d6d3d1;

  /* Typography / Inks */
  --ink-primary: #111827;
  --ink-secondary: #44403c;
  --ink-muted: #78716c;
  --ink-faint: #a8a29e;

  /* Single Refined Primary Accent */
  --accent-primary: #111827;
  --accent-primary-hover: #1f2937;
  --accent-brand: #1e40af;
  --accent-brand-soft: #eff6ff;

  /* Strict Semantic Money & Urgency Tokens */
  --refund-fg: #047857;
  --refund-bg: #ecfdf5;
  --refund-border: #a7f3d0;

  --warn-fg: #b45309;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;

  --danger-fg: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Geometry & Motion */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --shadow-drawer: -8px 0 28px rgba(17, 24, 39, 0.08);
  --shadow-modal: 0 20px 48px rgba(17, 24, 39, 0.14);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --focus-ring: 0 0 0 3px rgba(30, 64, 175, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.is-hidden {
  display: none !important;
}

/* Tabular Numerals & Monospace */
.mono,
.num,
.banner-hero-figure,
.finding-impact,
.example-refund-badge,
.sidebar-item-badge,
table.ledger-table td.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* View Switching */
.app-root[data-view="start"] .view-start {
  display: flex;
}

.app-root[data-view="start"] .view-workspace {
  display: none;
}

.app-root[data-view="workspace"] .view-start {
  display: none;
}

.app-root[data-view="workspace"] .view-workspace {
  display: grid;
}

/* Status Dots */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-emerald { background: var(--refund-fg); }
.dot-amber { background: #d97706; }
.dot-crimson { background: var(--danger-fg); }
.dot-muted { background: var(--ink-faint); }

/* Brand Lockup */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.upload-inline-btn:focus-visible,
.tab-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-surface-muted);
  border-color: var(--ink-faint);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-xs {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

/* Copy Check State */
.icon-check {
  display: none;
  color: var(--refund-fg);
}

.is-copied .icon-copy {
  display: none;
}

.is-copied .icon-check {
  display: inline-block;
}

.is-copied {
  border-color: var(--refund-border) !important;
  color: var(--refund-fg) !important;
}

/* ============================================================================
   VIEW A — CLEAN START / UPLOAD SCREEN
   ============================================================================ */
.view-start {
  min-height: 100dvh;
  flex-direction: column;
  background: var(--bg-canvas);
}

.start-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}

.start-topbar-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.start-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.usitc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.start-main {
  flex: 1;
  width: 100%;
  max-width: 948px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.start-hero {
  max-width: 680px;
  margin: 0 auto 28px;
  text-align: center;
}

.start-hero h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.start-subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

/* Primary Focal Dropzone Card */
.start-drop-card {
  max-width: 680px;
  margin: 0 auto 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.dropzone-well {
  border: 1.5px dashed var(--border-strong);
  background: var(--bg-surface-muted);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.dropzone-well:hover,
.dropzone-well.drag-over {
  border-color: var(--accent-brand);
  background: var(--accent-brand-soft);
}

.dropzone-well:focus-visible {
  outline: none;
  border-color: var(--accent-brand);
  box-shadow: var(--focus-ring);
}

.dropzone-icon {
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.dropzone-btn {
  margin-top: 2px;
}

.parse-status {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}

.parse-status.visible {
  display: block;
}

.parse-status.info {
  background: var(--accent-brand-soft);
  border: 1px solid #bfdbfe;
  color: var(--accent-brand);
}

.parse-status.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-fg);
}

.dropzone-notes {
  border-top: 1px solid var(--border-subtle);
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropzone-note-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.dropzone-note-row svg {
  color: var(--ink-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

.dropzone-note-row strong {
  font-weight: 600;
  color: var(--ink-primary);
}

/* Preview Examples Grid */
.start-examples {
  max-width: 900px;
  margin: 0 auto;
}

.examples-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.examples-divider::before,
.examples-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.examples-divider span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  white-space: nowrap;
}

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

.example-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.14s ease, transform 0.14s var(--ease-out);
}

.example-card:hover {
  border-color: var(--ink-faint);
  transform: translateY(-1px);
}

.example-card:focus-visible {
  outline: none;
  border-color: var(--accent-brand);
  box-shadow: var(--focus-ring);
}

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

.example-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
}

.example-refund-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--refund-fg);
  background: var(--refund-bg);
  border: 1px solid var(--refund-border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.example-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-primary);
  margin: 0 0 4px;
}

.example-card-sub {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
  margin: 0;
}

.example-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-brand);
}

/* View A Quiet Compliance Footer */
.start-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 24px 28px;
}

.start-footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.legal-notice-text {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.legal-notice-text strong {
  font-weight: 600;
  color: var(--ink-secondary);
}

.start-footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ============================================================================
   VIEW B — MULTI-PANE B2B SAAS APP SHELL
   ============================================================================ */
.view-workspace {
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-surface);
}

.mobile-only {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* Left Sidebar */
.app-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-width: 0;
}

.sidebar-header {
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-action {
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

.sidebar-new-btn {
  height: 36px;
  justify-content: flex-start;
  padding: 0 12px;
}

.sidebar-lists {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}

.sidebar-group {
  margin-bottom: 12px;
}

.sidebar-group-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 10px 8px 6px;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--ink-secondary);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

.sidebar-item.is-active {
  background: var(--bg-active);
  color: var(--ink-primary);
}

.sidebar-item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sidebar-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-item-name-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sidebar-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--refund-fg);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-item-badge.is-clean {
  color: var(--ink-muted);
  font-weight: 500;
}

.sidebar-item-badge.is-risk {
  color: var(--danger-fg);
}

.sidebar-item-sub {
  margin-top: 2px;
  padding-left: 13px;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-promo {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.sidebar-promo-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.sidebar-promo-copy {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.sidebar-status {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
}

/* Main Workspace Pane */
.workspace-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  background: var(--bg-surface);
}

.workspace-topbar {
  min-height: 56px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-title-block {
  min-width: 0;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.example-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  white-space: nowrap;
}

.upload-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-brand-soft);
  border: 1px solid #bfdbfe;
  color: var(--accent-brand);
  border-radius: var(--radius-sm);
  height: 28px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease;
}

.upload-inline-btn:hover {
  background: #dbeafe;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.workspace-scroll {
  flex: 1;
  overflow-y: auto;
}

.workspace-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.ws-status-banner {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Print-only elements hidden on screen */
.print-only-header,
.print-section-heading {
  display: none;
}

/* 5.3 Plain-English Executive Action Banner */
.exec-banner {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 236px;
  gap: 28px;
  align-items: center;
}

.banner-micro-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.banner-hero-figure {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  margin: 4px 0 5px;
}

.banner-hero-figure.is-refund { color: var(--refund-fg); }
.banner-hero-figure.is-danger { color: var(--danger-fg); }

.banner-breakdown {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.banner-zone-verdict {
  border-left: 1px solid var(--border-subtle);
  padding-left: 28px;
}

.banner-verdict {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.banner-next-step {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.banner-zone-deadline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deadline-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
}

.deadline-pill.is-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-fg);
}

.deadline-pill.is-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-fg);
}

.deadline-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.deadline-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ink-primary);
  transition: width 0.25s var(--ease-out);
}

.deadline-fill.is-warn { background: #d97706; }
.deadline-fill.is-danger { background: #dc2626; }

.deadline-dates {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
}

/* 5.4 Clean Tabbed Workspace */
.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  background: none;
  border: none;
  padding: 10px 0 11px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color 0.12s ease;
}

.tab-btn:hover {
  color: var(--ink-primary);
}

.tab-btn.is-active {
  color: var(--ink-primary);
  font-weight: 600;
}

.tab-btn.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink-primary);
}

.tab-count {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-sidebar);
  color: var(--ink-secondary);
}

.tab-panel {
  display: none;
  padding-top: 18px;
}

.tab-panel.is-active {
  display: block;
}

/* Tab 1: Plain-English Findings Action List */
.panel-hint {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.findings-list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.finding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid #f5f5f4;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.finding-row:last-child {
  border-bottom: none;
}

.finding-row:hover {
  background: var(--bg-surface-muted);
}

.finding-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-brand);
}

.finding-row-left {
  flex: 1;
  min-width: 0;
}

.finding-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.35;
}

.finding-explanation {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.finding-meta-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

.origin-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
}

.proof-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-brand);
  text-decoration: none;
}

.proof-link:hover {
  text-decoration: underline;
}

.finding-row-right {
  text-align: right;
  flex-shrink: 0;
}

.finding-impact {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--refund-fg);
  white-space: nowrap;
}

.finding-impact.is-danger {
  color: var(--danger-fg);
}

.finding-inspect-cue {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-muted);
  transition: color 0.12s ease;
}

.finding-row:hover .finding-inspect-cue {
  color: var(--ink-primary);
}

.empty-findings-state {
  padding: 36px 24px;
  text-align: center;
}

.empty-findings-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

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

/* Tab 2: All Line Items (6-Column Clean Financial Ledger) */
.ledger-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.ledger-table th {
  background: var(--bg-surface-muted);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  white-space: nowrap;
}

table.ledger-table th.num,
table.ledger-table td.num {
  text-align: right;
}

table.ledger-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f4;
  vertical-align: middle;
}

table.ledger-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

table.ledger-table tbody tr:hover {
  background: var(--bg-surface-muted);
}

table.ledger-table tbody tr:last-child td {
  border-bottom: none;
}

.ledger-item-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.line-num-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.ledger-item-name {
  font-weight: 500;
  color: var(--ink-primary);
}

.ledger-hts {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-primary);
}

.ledger-amount {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-primary);
  white-space: nowrap;
}

.ledger-subrate {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.ledger-delta {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ledger-delta.is-refund { color: var(--refund-fg); }
.ledger-delta.is-danger { color: var(--danger-fg); }
.ledger-delta.is-clean { color: var(--ink-muted); font-weight: 500; }

.ledger-status-pill {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-sidebar);
  color: var(--ink-secondary);
}

.ledger-status-pill.is-refund {
  background: var(--refund-bg);
  color: var(--refund-fg);
}

.ledger-status-pill.is-danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
}

table.ledger-table tfoot td {
  background: var(--bg-surface-muted);
  border-top: 1px solid var(--border-strong);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.tfoot-label {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* Tab 3: Broker Handoff */
.handoff-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.handoff-email-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px 20px;
}

.handoff-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.handoff-card-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.handoff-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-preview {
  margin: 0;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.handoff-side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.handoff-packet-card,
.handoff-steps-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px 20px;
}

.handoff-packet-card h3,
.handoff-steps-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.handoff-packet-card p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.simple-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.simple-steps li strong {
  display: block;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.legal-card {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.legal-card strong {
  font-weight: 600;
  color: var(--ink-primary);
}

/* ============================================================================
   RIGHT SLIDE-OVER LINE-ITEM INSPECTOR DRAWER (420px DESKTOP)
   ============================================================================ */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.22);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.drawer-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.inspector-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-drawer);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s var(--ease-out);
}

.inspector-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-title-group {
  min-width: 0;
}

.drawer-line-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 5px;
}

.drawer-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-money-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.drawer-money-col {
  min-width: 0;
}

.drawer-money-label {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.drawer-money-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
}

.drawer-money-val.is-refund { color: var(--refund-fg); }
.drawer-money-val.is-danger { color: var(--danger-fg); }

.drawer-money-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.drawer-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.drawer-finding-card {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.drawer-finding-card:last-child {
  margin-bottom: 0;
}

.drawer-finding-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.drawer-finding-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.drawer-finding-amount {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--refund-fg);
  white-space: nowrap;
}

.drawer-finding-amount.is-danger {
  color: var(--danger-fg);
}

.drawer-finding-plain {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.drawer-finding-tech {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.prop-grid {
  display: flex;
  flex-direction: column;
}

.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f5f5f4;
  font-size: 12.5px;
}

.prop-row:last-child {
  border-bottom: none;
}

.prop-key {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.prop-val {
  color: var(--ink-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-proof-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink-primary);
  font-size: 12.5px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.drawer-proof-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-muted);
}

.drawer-proof-row svg {
  color: var(--accent-brand);
  flex-shrink: 0;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-muted);
  flex-shrink: 0;
}

/* ============================================================================
   FOUNDING ACCESS MODAL
   ============================================================================ */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 24px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s var(--ease-out);
}

.modal-dialog.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

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

.modal-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.modal-sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.beta-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.form-field input,
.form-field select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-primary);
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent-brand);
  box-shadow: var(--focus-ring);
}

.beta-success {
  display: none;
  background: var(--refund-bg);
  border: 1px solid var(--refund-border);
  border-radius: var(--radius-md);
  color: #065f46;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
}

.beta-success.visible {
  display: block;
}

/* ============================================================================
   RESPONSIVE / MOBILE ERGONOMICS (<= 1024px & 390px)
   ============================================================================ */
@media (max-width: 1023px) {
  .view-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .workspace-main {
    height: auto;
    min-height: 100dvh;
  }

  .workspace-scroll {
    overflow-y: visible;
  }

  .mobile-only {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.28);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease-out);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .exec-banner {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .banner-zone-verdict {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding-left: 0;
    padding-top: 14px;
  }

  .banner-zone-deadline {
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
  }

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

@media (max-width: 767px) {
  .start-topbar-inner {
    padding: 0 16px;
  }

  .usitc-status-pill {
    display: none;
  }

  .start-main {
    padding: 28px 16px 32px;
  }

  .start-hero h1 {
    font-size: 24px;
  }

  .start-subtitle {
    font-size: 14px;
  }

  .start-drop-card {
    padding: 20px;
  }

  .dropzone-well {
    padding: 24px 16px;
  }

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

  .workspace-topbar {
    padding: 10px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar-left {
    width: 100%;
    gap: 8px;
  }

  .topbar-title-block {
    flex: 1;
  }

  .ws-meta {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .topbar-actions .btn {
    width: 100%;
    padding: 0 8px;
    font-size: 12px;
  }

  .workspace-inner {
    padding: 16px 16px 40px;
  }

  .banner-hero-figure {
    font-size: 28px;
  }

  .finding-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }

  .finding-row-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f5f5f4;
  }

  .inspector-drawer {
    width: 100vw;
  }

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

/* ============================================================================
   PRINT / BROKER PDF EXPORT (@media print)
   ============================================================================ */
@media print {
  @page {
    size: letter portrait;
    margin: 0.55in;
  }

  html,
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 9.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .view-start,
  .app-sidebar,
  .sidebar-backdrop,
  .workspace-topbar,
  .workspace-tabs,
  .drawer-scrim,
  .inspector-drawer,
  .modal-scrim,
  .modal-dialog,
  .no-print,
  .handoff-card-actions,
  #panel-findings {
    display: none !important;
  }

  .app-root[data-view="workspace"] .view-workspace {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .workspace-main,
  .workspace-scroll {
    height: auto !important;
    overflow: visible !important;
  }

  .workspace-inner {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .print-only-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1.5px solid #111827;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }

  .print-brand-name {
    font-size: 16pt;
    font-weight: 600;
    color: #111827;
  }

  .print-brand-sub {
    font-size: 9pt;
    color: #44403c;
  }

  .print-entry-line {
    font-size: 8.5pt;
    color: #44403c;
    margin-top: 4px;
  }

  .print-meta-block {
    text-align: right;
    font-size: 8.5pt;
    color: #44403c;
  }

  .exec-banner {
    grid-template-columns: auto 1fr 190px;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #d6d3d1;
    margin-bottom: 14px;
    break-inside: avoid;
  }

  .banner-hero-figure {
    font-size: 18pt;
  }

  .tab-panel.print-show {
    display: block !important;
    padding-top: 8px;
  }

  .print-section-heading {
    display: block !important;
    font-size: 11pt;
    font-weight: 600;
    color: #111827;
    margin: 14px 0 8px;
  }

  .ledger-card,
  .handoff-email-card,
  .handoff-steps-card,
  .legal-card {
    border: 1px solid #d6d3d1;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
  }

  table.ledger-table {
    font-size: 8.5pt;
  }

  table.ledger-table th,
  table.ledger-table td {
    padding: 6px 8px;
  }

  table.ledger-table tr {
    break-inside: avoid;
  }

  .handoff-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .email-preview {
    font-size: 8.5pt;
    padding: 10px 12px;
  }
}
