:root {
  --font-display: "Roboto", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, sans-serif;
  --font-mono: "Roboto Mono", "Fira Mono", monospace;

  --navy-900: #0d1220;
  --navy-800: #15215a;
  --navy-700: #28324b;
  --navy-600: #3a4560;
  --navy-500: #566080;
  --navy-400: #7080a0;
  --navy-300: #96a6be;
  --navy-200: #bfcadc;
  --navy-100: #dde3ee;
  --navy-50: #f0f2f7;

  --neutral-bg: #f3f3ef;
  --neutral-card: rgba(254, 254, 252, 0.96);
  --neutral-card-strong: #fffefc;
  --neutral-200: #e8e8e4;

  --cyan-500: oklch(0.65 0.17 222);
  --cyan-600: oklch(0.58 0.17 222);
  --cyan-100: oklch(0.93 0.05 222);
  --teal-500: oklch(0.53 0.09 192);
  --teal-100: oklch(0.91 0.03 192);
  --amber-500: oklch(0.82 0.16 86);
  --amber-100: oklch(0.96 0.04 86);
  --red-500: oklch(0.48 0.22 25);
  --red-100: oklch(0.93 0.04 25);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  --shadow-sm: 0 1px 3px rgba(21, 33, 90, 0.08);
  --shadow-md: 0 4px 12px rgba(21, 33, 90, 0.1);
  --shadow-lg: 0 8px 24px rgba(21, 33, 90, 0.12);
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(61, 149, 224, 0.14), transparent 26%),
    radial-gradient(circle at right 10%, rgba(27, 158, 140, 0.1), transparent 22%),
    linear-gradient(180deg, #f7f8fb 0%, var(--neutral-bg) 48%, #eef1f6 100%);
  color: var(--navy-700);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--navy-50);
  color: var(--navy-700);
  padding: 0.14rem 0.38rem;
  border: 1px solid var(--navy-100);
  border-radius: 6px;
}

.topbar {
  background: var(--navy-800);
  box-shadow: var(--shadow-md);
}

.topbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: oklch(0.72 0.16 222);
  box-shadow: 0 0 8px oklch(0.72 0.16 222);
}

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

.topnav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: #c8d0e0;
  font-size: 13px;
  font-weight: 500;
}

.topnav-link.is-active {
  color: oklch(0.72 0.16 222);
  border-bottom: 2px solid oklch(0.72 0.16 222);
  border-radius: 0;
}

.topbar-meta {
  margin-left: auto;
  color: var(--navy-300);
  font-family: var(--font-mono);
  font-size: 11px;
}

.topbar-logout {
  margin: 0;
}

.logout-button {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  color: var(--navy-200);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--navy-300);
  color: white;
  box-shadow: none;
  transform: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.hero,
.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
  gap: 20px;
}

.hero {
  margin-bottom: 20px;
  align-items: stretch;
}

.hero-copy-block,
.hero-card,
.panel,
.metric {
  background: var(--neutral-card);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.hero-copy-block {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-copy-block::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 149, 224, 0.18), rgba(61, 149, 224, 0));
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.stat-label,
.field span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  color: var(--navy-400);
  margin: 0 0 10px;
}

.hero h1,
.panel h2,
.detail-header h3,
.config-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--navy-800);
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 0.95;
  margin-bottom: 14px;
  font-weight: 900;
  max-width: 9ch;
}

.hero-copy,
.section-header p,
.hero-card p,
.message,
.metric span,
.info-list dt,
.config-editor-head p,
.detail-header p {
  color: var(--navy-500);
}

.hero-copy {
  max-width: 62ch;
  margin: 0;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-card,
.panel,
.metric {
  padding: 24px;
}

.hero-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 245, 252, 0.96)),
    var(--neutral-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  color: var(--navy-400);
}

.stat-value {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--navy-800);
  line-height: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.section-header.compact {
  margin-top: 8px;
}

.section-header h2 {
  margin-top: -2px;
}

.sim-form,
.metrics {
  display: grid;
  gap: 18px;
}

.form-grid,
.config-grid {
  display: grid;
  gap: 16px;
}

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

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

.field {
  display: grid;
  gap: 8px;
}

.field-file {
  grid-column: span 3;
}

.field-hint {
  font-size: 12px;
  line-height: 1.4;
}

.upload-status {
  padding: 10px 12px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-md);
  background: rgba(247, 249, 252, 0.9);
  color: var(--navy-500);
}

.upload-status[data-tone="info"] {
  border-color: rgba(61, 149, 224, 0.2);
  background: rgba(240, 247, 255, 0.9);
  color: var(--navy-600);
}

.upload-status[data-tone="success"] {
  border-color: rgba(42, 128, 116, 0.18);
  background: rgba(235, 247, 244, 0.95);
  color: var(--teal-500);
}

.upload-status[data-tone="error"] {
  border-color: rgba(166, 69, 50, 0.16);
  background: var(--red-100);
  color: var(--red-500);
}

.upload-mapping {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-lg);
  background: rgba(250, 251, 253, 0.96);
}

.upload-mapping-copy {
  margin: 0 0 12px;
  color: var(--navy-600);
  font-size: 13px;
}

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

.upload-preview-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-md);
  background: white;
}

.upload-preview {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
}

.upload-preview th,
.upload-preview td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--navy-100);
  text-align: left;
  white-space: nowrap;
}

.upload-preview th {
  position: static;
  background: #f7f9fc;
  color: var(--navy-500);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-preview td {
  color: var(--navy-700);
  font-size: 12px;
}

.error-text {
  color: var(--red-500);
}

.field-company-name {
  transition: opacity 0.15s ease;
}

.field-company-name.is-muted span,
.field-company-name.is-muted .field-hint {
  color: var(--navy-400);
}

.field-company-name.is-muted input {
  background: #f2f4f8;
  color: var(--navy-400);
  border-color: var(--navy-100);
}

.customer-settings-panel {
  padding: 18px 20px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(248, 250, 254, 0.95), rgba(255, 255, 255, 0.96));
}

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

.field-checkbox {
  align-content: start;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-700);
  font-weight: 500;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
}

.customer-subsidy-field.is-hidden {
  display: none;
}


.config-editor {
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(240, 244, 251, 0.56), rgba(255, 255, 255, 0.62));
  padding: 16px 18px;
  overflow: hidden;
}

.config-editor summary {
  cursor: pointer;
  color: var(--navy-700);
  font-weight: 700;
}

.config-editor-head {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

.config-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.preset-picker {
  position: relative;
}

.preset-toggle {
  min-width: 160px;
}

.preset-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 8;
}

.preset-picker:hover .preset-popover,
.preset-picker:focus-within .preset-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.preset-popover-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.preset-popover-head strong {
  color: var(--navy-800);
  font-size: 14px;
}

.preset-popover-head span {
  color: var(--navy-500);
  font-size: 12px;
}

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

.preset-item {
  position: relative;
}

.preset-option {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: #f9fbfe;
  border-color: var(--navy-100);
  color: var(--navy-700);
  box-shadow: none;
  text-align: left;
  transform: none;
}

.preset-option:hover,
.preset-option:focus-visible {
  background: white;
  color: var(--navy-800);
  box-shadow: none;
  transform: none;
}

.preset-option-name {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.preset-option-meta {
  color: var(--navy-500);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.preset-hovercard {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: 280px;
  padding: 14px;
  border: 1px solid rgba(61, 149, 224, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(250, 252, 255, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.preset-item:hover .preset-hovercard,
.preset-item:focus-within .preset-hovercard {
  opacity: 1;
  transform: translateX(0);
}

.preset-hovercard-title {
  margin-bottom: 10px;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}

.preset-hovercard-grid {
  display: grid;
  gap: 8px;
}

.preset-hovercard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--navy-100);
}

.preset-hovercard-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.preset-hovercard-row span {
  color: var(--navy-500);
  font-size: 12px;
}

.preset-hovercard-row strong {
  color: var(--navy-800);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.config-matrix-wrap {
  margin-top: 18px;
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-lg);
  background: var(--neutral-card-strong);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.config-source-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-lg);
  background: rgba(250, 251, 253, 0.96);
}

.config-source-panel summary {
  cursor: pointer;
  color: var(--navy-700);
  font-weight: 700;
}

.config-source-panel p {
  margin: 12px 0 0;
  color: var(--navy-500);
}

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

.config-source-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-md);
  background: white;
}

.config-source-item strong {
  color: var(--navy-800);
}

.config-source-item span {
  color: var(--navy-500);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.config-matrix {
  min-width: 1140px;
  width: max-content;
}

.config-matrix th,
.config-matrix td {
  vertical-align: top;
}

.config-matrix thead th {
  top: 0;
  position: sticky;
  z-index: 2;
}

.matrix-stub {
  min-width: 160px;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f7f9fc;
}

.config-matrix tbody .matrix-stub {
  background: rgba(247, 249, 252, 0.98);
}

.matrix-field-label {
  color: var(--navy-700);
  font-size: 13px;
  font-weight: 700;
}

.matrix-field-unit {
  margin-top: 2px;
  color: var(--navy-400);
  font-family: var(--font-mono);
  font-size: 11px;
}

.config-column-head {
  min-width: 248px;
}

.config-column-head.is-changed {
  background: linear-gradient(180deg, rgba(192, 232, 255, 0.96), rgba(247, 249, 252, 0.98));
  box-shadow: inset 0 0 0 1px rgba(61, 149, 224, 0.18);
}

.config-column-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.config-column-index {
  color: var(--navy-400);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.config-column-name {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.matrix-cell {
  min-width: 248px;
}

.matrix-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px;
  border-radius: 10px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.matrix-input-wrap input {
  min-width: 0;
}

.matrix-input-wrap.is-changed {
  background: rgba(61, 149, 224, 0.1);
  box-shadow: 0 0 0 1px rgba(61, 149, 224, 0.2), 0 0 16px rgba(61, 149, 224, 0.12);
}

.matrix-input-wrap.is-changed input {
  border-color: rgba(61, 149, 224, 0.44);
  background: #fafdff;
}

.matrix-input-unit {
  color: var(--navy-400);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.config-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius-md);
  background: var(--neutral-card-strong);
  color: var(--navy-700);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: var(--navy-300);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 3px var(--cyan-100);
}

button {
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  background: var(--cyan-500);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: var(--cyan-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  background: var(--navy-200);
  color: var(--navy-500);
  box-shadow: none;
  transform: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}

.remove-config {
  background: transparent;
  border-color: var(--navy-200);
  color: var(--navy-700);
}

.remove-config:hover {
  background: var(--red-100);
  border-color: rgba(179, 77, 58, 0.22);
  color: var(--red-500);
}

.add-config {
  background: var(--cyan-500);
}

.secondary-button {
  background: white;
  border-color: var(--navy-200);
  color: var(--navy-700);
  box-shadow: none;
}

.secondary-button:hover {
  background: var(--navy-50);
  color: var(--navy-800);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.message.error {
  background: var(--red-100);
  color: var(--red-500);
  border: 1px solid rgba(166, 69, 50, 0.16);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.message.is-success {
  background: var(--teal-100);
  color: var(--teal-500);
  border: 1px solid rgba(42, 128, 116, 0.16);
}

.progress-panel {
  padding: 20px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.85), rgba(255, 255, 255, 0.94));
}

.progress-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.progress-panel-head h3 {
  margin: 0;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.progress-percentage {
  color: var(--cyan-600);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(191, 202, 220, 0.55);
  border: 1px solid rgba(191, 202, 220, 0.82);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-500), var(--teal-500));
  transition: width 0.35s ease;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  align-items: center;
}

.progress-copy strong {
  color: var(--navy-800);
}

.progress-copy span {
  color: var(--navy-500);
  font-family: var(--font-mono);
  font-size: 12px;
}

.progress-panel[data-status="error"] .progress-fill {
  background: linear-gradient(90deg, #cf6a4e, #d78955);
}

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

.metric {
  background: linear-gradient(180deg, rgba(240, 244, 251, 0.7), rgba(255, 255, 255, 0.82));
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
}

.info-list {
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--navy-100);
}

.info-list dd,
.info-list dt {
  margin: 0;
}

.info-list dd {
  color: var(--navy-700);
  font-family: var(--font-mono);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-xl);
  background: var(--neutral-card-strong);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: var(--neutral-card-strong);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--navy-100);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: var(--navy-400);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--navy-700);
  font-size: 14px;
}

tbody tr:hover {
  background: rgba(61, 149, 224, 0.04);
}

.table-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan-600);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: none;
  transform: none;
}

.table-link:hover {
  background: transparent;
  box-shadow: none;
  color: var(--cyan-500);
}

.comparison-row.is-active {
  background: var(--cyan-100);
}

.scenario-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.scenario-pill {
  background: white;
  border-color: var(--navy-200);
  color: var(--navy-700);
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: none;
}

.scenario-pill.is-active {
  background: var(--cyan-500);
  border-color: var(--cyan-500);
  color: white;
}

.scenario-detail {
  display: none;
}

.scenario-detail.is-active {
  display: block;
  animation: reveal 0.22s ease;
}

.detail-header {
  margin-bottom: 14px;
}

.detail-header h3 {
  margin-bottom: 4px;
}

.detail-header p {
  margin: 0;
}

.label-pill {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 500;
}

.label-pill-cat,
.label-pill-val {
  padding: 4px 9px;
}

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

.label-pill-cyan {
  border-color: oklch(0.82 0.09 222);
}

.label-pill-cyan .label-pill-cat {
  background: oklch(0.95 0.03 222);
  color: oklch(0.5 0.08 222);
}

.label-pill-cyan .label-pill-val {
  background: oklch(0.91 0.07 222);
  color: oklch(0.4 0.12 222);
}

.label-pill-teal {
  border-color: oklch(0.8 0.09 192);
}

.label-pill-teal .label-pill-cat {
  background: oklch(0.94 0.03 192);
  color: oklch(0.48 0.07 192);
}

.label-pill-teal .label-pill-val {
  background: oklch(0.9 0.07 192);
  color: oklch(0.38 0.1 192);
}

.label-pill-amber {
  border-color: oklch(0.85 0.1 86);
}

.label-pill-amber .label-pill-cat {
  background: oklch(0.96 0.03 86);
  color: oklch(0.52 0.08 86);
}

.label-pill-amber .label-pill-val {
  background: oklch(0.93 0.07 86);
  color: oklch(0.45 0.13 86);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .hero,
  .results-grid,
  .form-grid,
  .customer-settings-grid,
  .metrics,
  .upload-mapping-grid {
    grid-template-columns: 1fr;
  }

  .field-file {
    grid-column: auto;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .config-editor-head,
  .config-editor-actions,
  .progress-panel-head,
  .progress-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .preset-popover {
    left: 0;
    right: auto;
  }

  .preset-hovercard {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 72px));
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
  }

  .topbar-meta {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .topbar-inner {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy-block,
  .hero-card,
  .panel,
  .metric {
    padding: 18px;
  }

  .hero h1 {
    max-width: none;
    font-size: 2.3rem;
  }

  .customer-settings-panel {
    padding: 16px;
  }

  .config-source-item {
    flex-direction: column;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .preset-toggle,
  .add-config {
    width: 100%;
  }

  .preset-popover {
    width: min(100vw - 40px, 420px);
  }

  .preset-option {
    flex-direction: column;
    align-items: flex-start;
  }

  .preset-option-meta {
    white-space: normal;
  }
}
