:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #0077b6;
  --primary-600: #0069a3;
  --primary-50: #eaf6fc;
  --warn: #b45309;
  --ok: #15803d;
  --soft: #eff6ff;
  --radius: 14px;
  --shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: GeistSans, "GeistSans Fallback", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
.button,
select,
textarea {
  font: inherit;
}

button,
.button {
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  min-height: 36px;
  padding: 0 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

button:hover,
.button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

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

.secondary {
  background: #ffffff;
  color: var(--primary);
}

.secondary:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.container {
  margin-inline: auto;
  max-width: 1200px;
  padding-inline: 24px;
}

.platform-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 24px;
  height: 56px;
  justify-content: space-between;
}

.brand {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  margin-left: -4px;
  padding: 4px;
}

.brand-logo {
  display: block;
  height: 24px;
  width: auto;
}

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

.locale-switcher {
  align-items: center;
  display: flex;
  gap: 4px;
}

.locale {
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
}

.locale.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(0, 119, 182, 0.18);
}

.ghost-action {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  min-height: 40px;
  padding-inline: 14px;
}

.ghost-action:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.primary-action {
  min-height: 40px;
  padding-inline: 14px;
}

.shell {
  min-height: calc(100vh - 116px);
  padding-block: 32px;
}

.page-title {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}

body[data-current-view="start"] .page-title,
body[data-current-view="start"] .workflow-top,
body[data-current-view="start"] .wizard-progress {
  display: none;
}

body[data-current-view="start"] .shell {
  padding-block-start: 20px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.12;
}

h2 {
  font-size: 16px;
}

.subtitle {
  color: var(--muted);
  margin: 8px 0 0;
}

.file-button {
  position: relative;
}

.file-button input {
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  pointer-events: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 16px;
}

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

.workflow-top,
.view-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.workflow-shell {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.start-screen {
  gap: 14px;
  min-height: 300px;
}

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

.start-copy {
  max-width: 680px;
}

.start-screen h2 {
  font-size: 24px;
  line-height: 1.2;
}

.start-lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.start-flow {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.start-flow li {
  align-items: center;
  border-left: 3px solid var(--primary);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 44px;
  padding-left: 10px;
}

.start-flow span {
  align-items: center;
  background: var(--primary);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.start-flow strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

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

.start-actions {
  border-top: 0;
  flex-shrink: 0;
  justify-content: flex-start;
  padding-top: 0;
}

.start-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.workflow-top {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.badge {
  background: var(--primary-50);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  line-height: 1.45;
  min-height: 220px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.raw-data[hidden] {
  display: none;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 272px;
  overflow: auto;
  scrollbar-gutter: stable;
}

[data-view-panel="file"] .table-wrap + .wizard-actions {
  background: #ffffff;
  border-top: 1px solid var(--line);
  bottom: 0;
  margin-top: -2px;
  padding-top: 14px;
  position: sticky;
  z-index: 5;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
  width: 100%;
}

#previewTable th,
#previewTable td {
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-meta {
  margin-bottom: 0;
}

.steps [role="listitem"] {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--ink);
  transform: none;
}

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

.step-number {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.steps .done {
  border-color: #bbf7d0;
}

.steps .done span {
  color: var(--ok);
}

.steps .active {
  border-color: #fde68a;
}

.steps .active span {
  color: var(--warn);
}

.steps .current {
  background: var(--primary-50);
  border-color: var(--primary);
}

.steps .current .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.summary-metrics {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin-top: 8px;
  min-height: 24px;
}

.user-message {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.4;
  margin: 10px 0 0;
  padding: 9px 10px;
}

.explainer {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.explainer.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: var(--ok);
}

.explainer strong {
  font-size: 13px;
}

.explainer p,
.preview-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.preview-note {
  margin-top: -4px;
}

.source-hint {
  background: var(--primary-50);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  padding: 9px 10px;
}

.workflow-view {
  display: grid;
  gap: 16px;
  min-height: 360px;
}

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

.phase-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.wizard-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 14px;
}

.primary-actions {
  border-top: 0;
  justify-content: flex-start;
  padding-top: 0;
}

.compact-button {
  min-height: 36px;
  padding-inline: 12px;
}

.flow-actions {
  background: #ffffff;
  border-top: 1px solid var(--line);
  bottom: 0;
  margin-top: -2px;
  padding-top: 14px;
  position: sticky;
  z-index: 5;
}

.flow-actions button:not(.secondary) {
  min-height: 44px;
  padding-inline: 18px;
}

.mapping-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(430px, calc(100vh - 360px));
  overflow: auto;
  padding-right: 2px;
}

.mapping-row {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.mapping-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.mapping-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mapping-row.secondary-field {
  opacity: 0.8;
}

.mapping-extra {
  border: 1px solid var(--line);
  border-radius: 10px;
  grid-column: 1 / -1;
  padding: 10px;
}

.mapping-extra summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

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

.review-queue {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.review-card-header,
.review-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.review-card-header span {
  background: #fef3c7;
  border-radius: 999px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.candidate-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.candidate {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 8px;
}

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

.review-actions {
  justify-content: flex-start;
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 36px;
  padding: 0 10px;
  width: 100%;
}

pre {
  background: #0f172a;
  border-radius: 10px;
  color: #eef2ff;
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0 0;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  white-space: pre;
}

.export-primary {
  align-items: center;
  background: var(--primary-50);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  min-height: 112px;
  padding: 20px;
}

.export-primary button {
  min-height: 44px;
  padding-inline: 22px;
}

.export-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.export-details summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.export-details select {
  margin-top: 10px;
}

.monitoring-shell {
  gap: 18px;
}

.monitoring-title {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dashboard-grid,
.monitoring-columns,
.duration-grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid,
.duration-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.monitoring-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 14px;
}

.monitoring-card span,
.funnel-label span,
.friction-item span {
  color: var(--muted);
  font-size: 12px;
}

.monitoring-card strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.duration-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.monitoring-panel {
  box-shadow: none;
}

.funnel-list,
.friction-list {
  display: grid;
  gap: 10px;
}

.funnel-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 44px;
}

.funnel-label {
  display: grid;
  gap: 3px;
}

.funnel-label strong,
.friction-item strong {
  color: var(--ink);
  font-size: 13px;
}

.funnel-bar {
  background: #e5e7eb;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.funnel-bar span {
  background: var(--primary);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.funnel-dropoff {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.friction-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px;
}

.monitoring-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 420px;
  overflow: auto;
}

.monitoring-table {
  min-width: 880px;
}

.stats-overlay,
.process-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 80;
}

.stats-overlay[hidden],
.process-overlay[hidden] {
  display: none;
}

.stats-modal,
.process-modal {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: 560px;
  padding: 22px;
  width: min(100%, 560px);
}

.stats-modal {
  grid-template-columns: 1fr;
  max-width: 520px;
}

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

.stats-modal-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.icon-button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.stats-summary {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.stats-progress {
  background: #e5e7eb;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.stats-progress span {
  background: var(--ok);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 8px;
  transition: width 0.25s ease;
}

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

.stats-metrics div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 8px;
}

.stats-metrics dt {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-metrics dd {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  margin: 2px 0 0;
}

.process-spinner {
  border: 3px solid var(--primary-50);
  border-radius: 999px;
  border-top-color: var(--primary);
  height: 34px;
  margin-top: 2px;
  width: 34px;
  animation: process-spin 0.9s linear infinite;
}

.process-content {
  min-width: 0;
}

.process-content h2 {
  font-size: 18px;
  line-height: 1.25;
}

.process-example {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  margin: 12px 0 0;
  padding: 9px 10px;
}

.process-realtime {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
}

.process-progress-head {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 12px;
  justify-content: space-between;
  line-height: 1.35;
}

.process-progress-head span:first-child {
  min-width: 0;
}

.process-progress-head span:last-child {
  color: var(--primary);
  flex: 0 0 auto;
}

.process-progress-track {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.process-progress-track span {
  background: var(--primary);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 18px;
  transition: width 0.25s ease;
}

.process-progress-track span.done {
  background: var(--ok);
}

.process-progress-track span.failed {
  background: var(--danger);
}

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

.process-metrics div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
}

.process-metrics dt {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-metrics dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-messages {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 5px;
  line-height: 1.35;
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-messages li {
  padding-left: 12px;
  position: relative;
}

.process-messages li::before {
  background: var(--primary);
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  top: 7px;
  width: 4px;
}

.process-steps {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.process-steps li {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: 16px minmax(0, 1fr);
}

.process-steps li::before {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  content: "";
  height: 10px;
  justify-self: center;
  width: 10px;
}

.process-steps li.done {
  color: var(--ok);
}

.process-steps li.done::before {
  background: var(--ok);
  border-color: var(--ok);
}

.process-steps li.active {
  color: var(--primary);
  font-weight: 700;
}

.process-steps li.active::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
}

@keyframes process-spin {
  to {
    transform: rotate(360deg);
  }
}

.platform-footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  min-height: 60px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner nav {
  display: flex;
  gap: 24px;
}

.footer-inner a {
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--ink);
}

@media (max-width: 1040px) {
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .start-hero {
    flex-direction: column;
  }

  .steps,
  .start-flow,
  .dashboard-grid,
  .monitoring-columns,
  .duration-grid,
  .mapping-grid,
  .mapping-extra-grid,
  .process-metrics,
  .stats-metrics {
    grid-template-columns: 1fr;
  }

  .steps [role="listitem"] {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .steps [role="listitem"] > span:last-child {
    grid-column: 2;
  }

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

  .funnel-dropoff {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .container {
    padding-inline: 16px;
  }

  .header-inner {
    align-items: flex-start;
    height: auto;
    padding-block: 12px;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .ghost-action,
  .primary-action {
    display: none;
  }

  h1 {
    font-size: 26px;
  }

  .workflow-top,
  .monitoring-title,
  .view-header,
  .wizard-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .wizard-actions button,
  .wizard-actions .button {
    width: 100%;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-block: 16px;
  }

  .process-modal,
  .stats-modal {
    grid-template-columns: 1fr;
  }
}

/* ---------- Upsell (Erfolgs-Screen: weitere Datenanreicherung) ---------- */
.upsell {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--primary-50) 0%, rgba(234, 246, 252, 0) 55%),
    var(--panel);
  box-shadow: var(--shadow);
}
.upsell[hidden] { display: none; }

.upsell-hero { max-width: 62ch; }
.upsell-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(21, 128, 61, 0.1);
  color: var(--ok);
  font-size: 0.82rem;
  font-weight: 600;
}
.upsell-hero h2 {
  margin: 14px 0 8px;
  font-size: 1.5rem;
  line-height: 1.25;
}
.upsell-hero h2 #upsellCompanyCount { color: var(--primary); }

.upsell-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 18px 0 0;
}
.upsell-stats > div { min-width: 96px; }
.upsell-stats dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.upsell-stats dd {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.upsell-section-label {
  margin: 26px 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.upsell-offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.upsell-offer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 16px 44px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.upsell-offer:hover {
  border-color: var(--line-strong);
  background: var(--panel);
  transform: none;
}
.upsell-offer:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.upsell-offer.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.upsell-offer-icon { font-size: 1.5rem; line-height: 1; }
.upsell-offer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}
.upsell-offer-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
}
.upsell-offer-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
}
.upsell-offer-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.7rem;
  background: transparent;
}
.upsell-offer.selected .upsell-offer-check {
  background: var(--primary);
  border-color: var(--primary);
}

.upsell-cta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.upsell-cta-note {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--ink);
}
.upsell-cta-note strong { color: var(--primary); }
.upsell-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.upsell-confirm {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(21, 128, 61, 0.1);
  color: var(--ok);
  font-size: 0.9rem;
}
.upsell-confirm[hidden] { display: none; }

@media (max-width: 640px) {
  .upsell { padding: 20px; }
  .upsell-cta-actions button { flex: 1 1 100%; }
}
