:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: rgba(22, 18, 17, 0.96);
  --panel-strong: rgba(36, 27, 25, 0.96);
  --panel-soft: rgba(18, 14, 13, 0.95);
  --ink: #ffffff;
  --muted: #c9c0ba;
  --line: rgba(240, 198, 78, 0.22);
  --accent: #f0c64e;
  --accent-dark: #c79b28;
  --accent-green: #4da66f;
  --accent-warm: #f0c64e;
  --accent-magenta: #623b81;
  --warn: #ffd36d;
  --warn-bg: rgba(240, 198, 78, 0.11);
  --danger: #ff6f8f;
  --danger-bg: rgba(255, 111, 143, 0.13);
  --input: rgba(5, 5, 5, 0.86);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
  --soft-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  --motion: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  scrollbar-color: rgba(240, 198, 78, 0.42) rgba(3, 10, 13, 0.72);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(3, 10, 13, 0.72);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(3, 10, 13, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 198, 78, 0.72), rgba(240, 198, 78, 0.52));
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, rgba(240, 198, 78, 0.12), transparent 31%),
    linear-gradient(315deg, rgba(240, 198, 78, 0.11), transparent 30%),
    linear-gradient(180deg, #000000 0%, #171010 54%, #000000 100%);
  background-size: 56px 56px, 56px 56px, 150% 150%, 160% 160%, 100% 100%;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, Helvetica, sans-serif;
  animation: backgroundDrift 18s ease-in-out infinite alternate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

body::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.42)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 7px);
}

body::after {
  inset: 7vh 5vw;
  z-index: 0;
  border: 1px solid rgba(240, 198, 78, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, rgba(240, 198, 78, 0.08), rgba(240, 198, 78, 0.08));
  background-size: 72px 72px, 72px 72px, 100% 100%;
  opacity: 0.52;
  transform: rotate(-1deg);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 18px;
  animation: appIn 160ms var(--motion) both;
}

.GuidedWorkflowModal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1000px, calc(100vw - 36px));
  height: min(690px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid rgba(240, 198, 78, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.12), rgba(240, 198, 78, 0.05) 46%, rgba(255, 255, 255, 0.04)),
    rgba(18, 14, 14, 0.99);
  box-shadow:
    0 44px 120px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(240, 198, 78, 0.08),
    0 0 44px rgba(240, 198, 78, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px) saturate(1.16);
}

.GuidedWorkflowModal::before,
.GuidedWorkflowModal::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.GuidedWorkflowModal::before {
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(240, 198, 78, 0.13), transparent 16% 82%, rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 18%);
  opacity: 0.24;
  mix-blend-mode: screen;
}

.GuidedWorkflowModal::after {
  z-index: 3;
  top: 0;
  left: -30%;
  width: 34%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), #ffffff, transparent);
  animation: edgeSweep 4.6s var(--motion) infinite;
}

.top-panel,
.step-panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.wizard-viewport {
  position: relative;
  z-index: 1;
}

.top-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(240, 198, 78, 0.11), transparent 42%, rgba(240, 198, 78, 0.035)),
    rgba(19, 12, 11, 0.82);
  padding: 12px 22px;
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid rgba(240, 198, 78, 0.16);
  border-radius: 0;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-warm);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3 {
  margin: 0 0 6px;
  line-height: 1.2;
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

.muted {
  color: #d4cbc4;
  margin: 0 0 9px;
}

.mini-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 140px;
}

.mini-progress {
  width: min(150px, 36vw);
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(240, 198, 78, 0.28);
  background: rgba(240, 198, 78, 0.1);
  overflow: hidden;
}

.mini-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffea9e);
  transition: width 240ms var(--motion);
  box-shadow: 0 0 14px rgba(240, 198, 78, 0.4);
}

.mini-progress-wrap .small-note {
  margin: 0;
}

.wizard-viewport {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    linear-gradient(180deg, rgba(240, 198, 78, 0.06), transparent 44%),
    rgba(24, 19, 18, 0.99);
}

.step-panel {
  display: none;
  background: transparent;
  min-height: 100%;
  padding: 18px 24px;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.step-screen {
  position: relative;
  --screen-accent: var(--accent);
  --screen-line: rgba(240, 198, 78, 0.18);
  --screen-start: rgba(240, 198, 78, 0.07);
  --screen-end: rgba(10, 18, 22, 0.94);
  --screen-mark-color: rgba(240, 198, 78, 0.9);
}

.step-screen-1 {
  --screen-accent: #f0c64e;
  --screen-line: rgba(240, 198, 78, 0.28);
  --screen-start: rgba(240, 198, 78, 0.14);
  --screen-end: rgba(11, 15, 17, 0.93);
  --screen-mark-color: rgba(255, 255, 255, 0.9);
}

.step-screen-2 {
  --screen-accent: #8ec8e8;
  --screen-line: rgba(142, 200, 232, 0.28);
  --screen-start: rgba(142, 200, 232, 0.1);
  --screen-end: rgba(11, 16, 20, 0.92);
  --screen-mark-color: rgba(190, 228, 253, 0.88);
}

.step-screen-3 {
  --screen-accent: #a6d9bf;
  --screen-line: rgba(166, 217, 191, 0.26);
  --screen-start: rgba(166, 217, 191, 0.1);
  --screen-end: rgba(10, 18, 16, 0.93);
  --screen-mark-color: rgba(223, 248, 235, 0.9);
}

.step-screen-4 {
  --screen-accent: #d6a8df;
  --screen-line: rgba(214, 168, 223, 0.3);
  --screen-start: rgba(214, 168, 223, 0.11);
  --screen-end: rgba(14, 14, 18, 0.93);
  --screen-mark-color: rgba(241, 214, 247, 0.92);
}

.step-screen-5 {
  --screen-accent: #f4ce84;
  --screen-line: rgba(244, 206, 132, 0.25);
  --screen-start: rgba(244, 206, 132, 0.1);
  --screen-end: rgba(11, 14, 17, 0.93);
  --screen-mark-color: rgba(255, 238, 206, 0.9);
}

.step-screen-6 {
  --screen-accent: #9cc9c3;
  --screen-line: rgba(156, 201, 195, 0.26);
  --screen-start: rgba(156, 201, 195, 0.1);
  --screen-end: rgba(12, 14, 16, 0.93);
  --screen-mark-color: rgba(217, 246, 240, 0.9);
}

.step-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 270px at 92% -12%, var(--screen-start), transparent 57%),
    linear-gradient(150deg, var(--screen-end), transparent 58%, rgba(255, 255, 255, 0.06));
  opacity: 0;
  transition: opacity 150ms var(--motion);
}

.step-screen::after {
  content: attr(data-screen-title) "\A" attr(data-screen-subtitle);
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  width: min(230px, calc(100% - 140px));
  color: var(--screen-mark-color);
  text-align: right;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  white-space: pre-wrap;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 150ms var(--motion), transform 150ms var(--motion);
}

.step-screen.active::before {
  opacity: 1;
}

.step-screen.active::after {
  opacity: 1;
  transform: translateY(0);
}

.step-screen.active .panel-main,
.step-screen.active .final-card,
.step-screen.active .review-head,
.step-screen.active .table-wrap,
.step-screen.active .checklist-card,
.step-screen.active .help-card {
  position: relative;
  z-index: 2;
  border-color: var(--screen-line);
}

.step-screen.active .step-graphic {
  border-color: color-mix(in srgb, var(--screen-accent) 26%, transparent);
  color: var(--screen-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--screen-accent) 18%, transparent), rgba(2, 8, 11, 0.9)),
    rgba(6, 18, 22, 0.84);
}

.step-screen.active .panel-main,
.step-screen.active .final-card,
.step-screen.active .review-head,
.step-screen.active .checklist-card,
.step-screen.active .help-card,
.step-screen.active .signature-grid {
  margin-top: 24px;
}

.step-panel.active {
  display: block;
  animation: stepPanelInForward 160ms var(--motion) both;
}

body[data-step-direction="back"] .step-panel.active {
  animation-name: stepPanelInBack;
}

@media (min-width: 901px) {
  .step-panel[data-step="1"].active,
  .step-panel[data-step="2"].active,
  #signPanel.active,
  .step-panel[data-step="6"].active {
    display: grid;
    align-content: center;
  }
}

.step-panel.active .panel-main,
.step-panel.active .final-card,
.step-panel.active .review-head,
.step-panel.active .table-wrap,
.step-panel.active .checklist-card,
.step-panel.active .help-card {
  animation: contentLift 160ms var(--motion) both;
}

.step-panel.active .checklist-card,
.step-panel.active .help-card,
.step-panel.active .table-wrap {
  animation-delay: 80ms;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  gap: 22px;
  align-items: center;
  width: 100%;
}

.panel-main,
.checklist-card,
.help-card,
.final-card {
  min-width: 0;
}

.step-graphic {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 9px;
  border: 1px solid rgba(240, 198, 78, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.16), rgba(98, 59, 129, 0.06)),
    rgba(6, 18, 22, 0.84);
  color: var(--accent);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(240, 198, 78, 0.1);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.step-graphic svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.graphic-export,
.graphic-preview {
  color: var(--accent);
}

.graphic-review,
.graphic-confirm {
  color: var(--accent-warm);
}

.graphic-sign {
  color: var(--accent-magenta);
}

.step-label {
  margin: 0 0 4px;
  color: var(--accent-warm);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0;
}

.field-row {
  display: grid;
  gap: 12px;
  margin: 12px 0 10px;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #d7edf2;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--input);
  color: var(--ink);
  transition: border-color 180ms var(--motion), box-shadow 180ms var(--motion), transform 180ms var(--motion);
}

input:focus {
  outline: 3px solid rgba(240, 198, 78, 0.13);
  border-color: var(--accent);
  box-shadow:
    0 0 0 5px rgba(240, 198, 78, 0.055),
    0 0 20px rgba(240, 198, 78, 0.1);
  transform: translateY(-1px);
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 28, 34, 0.92);
  color: var(--ink);
  padding: 7px 12px;
  margin-right: 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.file-drop {
  border: 1px dashed rgba(240, 198, 78, 0.38);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.055), transparent),
    rgba(3, 10, 13, 0.68);
  padding: 13px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-height: 40px;
  transition: transform 140ms var(--motion), box-shadow 140ms var(--motion), background 140ms var(--motion), border-color 140ms var(--motion), opacity 140ms var(--motion);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary-action,
.generate-button {
  background: linear-gradient(135deg, #fff6d9, var(--accent-warm));
  color: #12100b;
  box-shadow:
    0 12px 26px rgba(240, 198, 78, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-action:hover,
.generate-button:hover {
  background: linear-gradient(135deg, #ffffff, #f0c64e);
}

.secondary-action,
.actions button,
.sig-head button {
  background: rgba(8, 19, 24, 0.88);
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary-action:hover,
.actions button:hover,
.sig-head button:hover {
  background: rgba(17, 36, 43, 0.96);
}

.generate-button {
  min-height: 58px;
  min-width: 280px;
  font-size: 18px;
  background: linear-gradient(135deg, #fff6d9, var(--accent-warm) 64%, #c79b28);
  box-shadow: 0 18px 34px rgba(240, 198, 78, 0.22);
}

.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.panel-footer {
  justify-content: flex-end;
}

.disclaimer {
  border: 1px solid rgba(240, 198, 78, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.12), rgba(98, 59, 129, 0.035)),
    rgba(10, 13, 10, 0.62);
  color: #ffe0a1;
  padding: 10px 12px;
  margin: 12px 0 10px;
  font-size: 13px;
  line-height: 1.34;
  font-weight: 700;
}

.small-note {
  color: var(--muted);
  margin: 8px 0 12px;
  font-size: 13px;
}

.field-error {
  min-height: 20px;
  margin: 0 0 12px;
  color: #ff9aa6;
  font-size: 13px;
  font-weight: 800;
}

.checklist-card,
.help-card {
  position: relative;
  align-self: center;
  background:
    linear-gradient(180deg, rgba(240, 198, 78, 0.16), rgba(240, 198, 78, 0.06)),
    rgba(33, 25, 23, 0.94);
  border: 1px solid rgba(240, 198, 78, 0.2);
  border-radius: 14px;
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(240, 198, 78, 0.12);
}

.checklist-card::before,
.help-card::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-green), var(--accent-warm));
  box-shadow: 0 0 16px rgba(240, 198, 78, 0.22);
}

.checklist-card h3,
.help-card h3 {
  margin-bottom: 8px;
  color: #fff6e8;
  font-size: 16px;
}

.plain-steps,
.check-list {
  margin: 0;
  padding-left: 19px;
}

.plain-steps li,
.check-list li {
  margin: 5px 0;
  line-height: 1.28;
  font-size: 14px;
  color: #f1e8df;
}

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

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

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

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

th {
  position: sticky;
  top: 0;
  background: rgba(10, 24, 29, 0.96);
  z-index: 1;
  color: #d8f8ff;
}

td:first-child {
  width: 54px;
}

td:nth-child(3) {
  width: 120px;
}

td:nth-child(4) {
  width: 110px;
}

td input {
  padding: 7px 8px;
}

.notice-list {
  display: grid;
  gap: 6px;
}

.notice {
  border: 1px solid rgba(240, 198, 78, 0.34);
  border-radius: 10px;
  background: var(--warn-bg);
  color: #ffe0a1;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  animation: noticeIn 150ms var(--motion) both;
}

.cogs-summary {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(240, 198, 78, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.07), rgba(240, 198, 78, 0.035)),
    rgba(4, 13, 17, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cogs-summary[hidden] {
  display: none;
}

.cogs-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.cogs-head p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.cogs-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.cogs-card,
.cogs-variance-panel {
  min-width: 0;
  border: 1px solid rgba(240, 198, 78, 0.15);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(240, 198, 78, 0.075), transparent),
    rgba(2, 8, 11, 0.72);
  padding: 12px;
}

.cogs-card.is-primary {
  border-color: rgba(240, 198, 78, 0.32);
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.16), rgba(240, 198, 78, 0.075)),
    rgba(2, 12, 12, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 28px rgba(240, 198, 78, 0.08);
}

.cogs-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.cogs-card > strong {
  display: block;
  margin: 4px 0 9px;
  color: #effcff;
  font-size: 23px;
  line-height: 1.05;
}

.cogs-card.is-primary > strong {
  color: #dffff1;
  font-size: 27px;
}

.cogs-card.is-primary dl {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.cogs-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.cogs-card div {
  min-width: 0;
}

.cogs-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.cogs-card dd {
  margin: 0;
  color: #dff8fb;
  font-weight: 800;
}

.cogs-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.cogs-variance-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 11px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.085), rgba(98, 59, 129, 0.035)),
    rgba(2, 8, 11, 0.72);
  padding: 14px;
}

.variance-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.variance-panel-head span {
  color: #effcff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.variance-panel-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.variance-line {
  display: grid;
  grid-template-columns: minmax(114px, 1fr) minmax(86px, auto) minmax(78px, auto) minmax(64px, auto) minmax(48px, auto);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(240, 198, 78, 0.1);
  border-radius: 10px;
  background: rgba(2, 8, 11, 0.52);
  padding: 7px 8px;
}

.variance-line.is-flagged {
  border-color: rgba(255, 111, 143, 0.36);
  background: rgba(255, 111, 143, 0.09);
}

.variance-line strong {
  min-width: 0;
  overflow: hidden;
  color: #edfaff;
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variance-line > span:not(.variance-badge) {
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.variance-line .waste-percent {
  color: #b6d3d8;
}

.variance-line .waste-percent::before {
  content: "W ";
  color: var(--muted);
  font-size: 10px;
}

.variance-line .variance-badge {
  min-width: 68px;
  padding: 3px 7px;
  font-size: 12px;
}

.variance-line small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.is-high {
  color: var(--warn) !important;
}

.is-low {
  color: var(--accent-green) !important;
}

.variance-badge {
  display: inline-grid;
  min-width: 70px;
  place-items: center;
  border: 1px solid rgba(240, 198, 78, 0.18);
  border-radius: 999px;
  background: rgba(240, 198, 78, 0.08);
  color: #dff8fb;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.variance-badge.is-ok {
  border-color: rgba(240, 198, 78, 0.38);
  background: rgba(240, 198, 78, 0.13);
  color: var(--accent-green);
}

.variance-badge.is-bad {
  border-color: rgba(255, 111, 143, 0.48);
  background: rgba(255, 111, 143, 0.14);
  color: var(--danger);
  box-shadow: 0 0 18px rgba(255, 111, 143, 0.12);
}

.variance-badge.is-check {
  border-color: rgba(240, 198, 78, 0.42);
  background: rgba(240, 198, 78, 0.14);
  color: var(--warn);
}

.variance-row-flag td {
  background: rgba(255, 111, 143, 0.065);
}

.cogs-details {
  border-top: 1px solid rgba(240, 198, 78, 0.12);
  padding-top: 10px;
}

.cogs-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
}

.cogs-table {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(240, 198, 78, 0.13);
  border-radius: 10px;
}

.missing,
.needs-check {
  background: var(--warn-bg);
}

tbody tr {
  animation: rowIn 150ms var(--motion) both;
  animation-delay: calc(var(--row-index) * 18ms);
}

.missing td:nth-child(5) {
  color: var(--warn);
  font-weight: 700;
}

.pill {
  display: inline-block;
  min-width: 74px;
  text-align: center;
  border-radius: 8px;
  background: rgba(240, 198, 78, 0.11);
  color: #bdfaff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill-warn {
  background: rgba(240, 198, 78, 0.2);
  color: #ffe0a1;
}

.delete-row {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 107, 122, 0.34);
  background: var(--danger-bg);
  color: var(--danger);
  box-shadow: none;
}

.delete-row:hover {
  background: rgba(255, 107, 122, 0.2);
}

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

canvas {
  width: 100%;
  height: 140px;
  border: 1px solid rgba(240, 198, 78, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(#f7fbff, #eef7f8) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 34px, rgba(240, 198, 78, 0.18) 35px) border-box;
  touch-action: none;
}

.consent {
  margin: 0;
  color: #c8d7ce;
  font-weight: 700;
}

.result {
  margin: 14px 0 0;
  font-weight: 700;
}

.result a {
  color: var(--accent);
}

.confirmation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.confirmation-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(240, 198, 78, 0.055), transparent),
    rgba(3, 10, 13, 0.72);
  padding: 12px;
}

.confirmation-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.confirmation-summary strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
}

.pilot-readiness {
  margin: 0 0 18px;
  border: 1px solid rgba(242, 177, 62, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(199, 53, 47, 0.13), rgba(242, 177, 62, 0.07)),
    rgba(12, 8, 7, 0.78);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pilot-readiness h3 {
  margin-bottom: 8px;
  color: #fff4dc;
  font-size: 15px;
  text-transform: uppercase;
}

.pilot-readiness ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pilot-readiness li {
  position: relative;
  padding-left: 23px;
  color: #eaded4;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
}

.pilot-readiness li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(72, 224, 164, 0.62);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(72, 224, 164, 0.28), rgba(255, 223, 154, 0.08)),
    rgba(4, 12, 9, 0.75);
}

.preview-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pdf-preview-shell {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(3, 10, 13, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  max-height: 78vh;
  overflow: auto;
  padding: 16px;
}

.pdf-preview-pages {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.preview-loading {
  color: var(--muted);
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.preview-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid rgba(57, 215, 155, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 760ms linear infinite;
}

.pdf-page-preview {
  width: min(100%, 850px);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 8, 11, 0.9);
  padding: 12px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  animation: pdfPageIn 180ms var(--motion) forwards;
  animation-delay: calc(var(--page-index) * 120ms);
}

.pdf-page-preview figcaption {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.pdf-page-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
}

.modal-open {
  overflow: hidden;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 28% 18%, rgba(57, 215, 155, 0.18), transparent 28%),
    rgba(5, 8, 7, 0.78);
  backdrop-filter: blur(12px);
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid rgba(57, 215, 155, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(57, 215, 155, 0.08), rgba(245, 158, 11, 0.04)),
    #111513;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  padding: 22px;
}

.onboarding-overlay.is-opening {
  animation: overlayFade 150ms var(--motion) both;
}

.onboarding-overlay.is-opening .onboarding-modal {
  animation: modalRise 170ms var(--motion) both;
}

.onboarding-overlay.is-closing {
  pointer-events: none;
  animation: overlayOut 140ms var(--motion) forwards;
}

.onboarding-overlay.is-closing .onboarding-modal {
  animation: modalExit 140ms var(--motion) forwards;
}

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

.onboarding-head h2 {
  margin-bottom: 0;
}

.modal-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #1b231f;
  color: var(--ink);
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
}

.flow-rail {
  position: relative;
  height: 8px;
  margin: 8px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #0b100d;
  border: 1px solid var(--line);
}

.flow-rail span {
  position: absolute;
  inset: 0;
  width: 46%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-warm), transparent);
  animation: railSweep 2.7s var(--motion) infinite;
}

.flow-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-node {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 15, 0.72);
  padding: 12px;
  opacity: 0;
  transform: translateY(8px);
}

.onboarding-overlay.is-opening .flow-node {
  animation: nodeIn 200ms var(--motion) forwards;
  animation-delay: var(--delay);
}

.flow-node span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(57, 215, 155, 0.14);
  color: var(--accent);
  font-weight: 900;
  box-shadow: 0 0 0 0 rgba(57, 215, 155, 0.3);
  animation: nodePulse 2.2s ease-in-out infinite;
  animation-delay: calc(var(--delay) + 700ms);
}

.flow-node strong {
  display: block;
  margin-bottom: 3px;
}

.flow-node p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.onboarding-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  position: sticky;
  bottom: -22px;
  z-index: 1;
  padding: 18px 0 2px;
  background: linear-gradient(180deg, rgba(17, 21, 19, 0), #111513 36%);
}

@keyframes overlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes appIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes backgroundDrift {
  from {
    background-position: 0 0, 0 0, 0% 0%, 100% 0%, 0 0;
  }
  to {
    background-position: 28px 18px, -18px 28px, 16% 10%, 82% 18%, 0 0;
  }
}

@keyframes edgeSweep {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  18% {
    opacity: 0.95;
  }
  72% {
    opacity: 0.95;
  }
  100% {
    transform: translateX(390%);
    opacity: 0;
  }
}

@keyframes activeTabIn {
  0% {
    transform: scale(0.96);
  }
  70% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes stepPanelInForward {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stepPanelInBack {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes contentLift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes noticeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pdfPageIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes railSweep {
  0% {
    transform: translateX(-115%);
  }
  55%,
  100% {
    transform: translateX(250%);
  }
}

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

@keyframes nodePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(57, 215, 155, 0);
  }
  45% {
    box-shadow: 0 0 0 8px rgba(57, 215, 155, 0.08);
  }
}

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

@media (max-width: 900px) {
  .app {
    padding: 12px;
  }

  .GuidedWorkflowModal {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  h1 {
    font-size: 23px;
  }

  .onboarding-overlay {
    padding: 12px;
  }

  .onboarding-modal {
    max-height: calc(100svh - 24px);
    padding: 18px;
  }

  .top-panel,
  .panel-grid,
  .field-row.two,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .top-panel,
  .review-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-panel {
    min-height: 0;
    padding: 18px;
  }

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

  .cogs-head,
  .cogs-cards {
    grid-template-columns: 1fr;
  }

  .cogs-head {
    display: grid;
    align-items: start;
  }

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

  .variance-line {
    grid-template-columns: minmax(94px, 1fr) minmax(76px, auto) minmax(68px, auto);
  }

  .variance-line small {
    display: none;
  }

  .variance-line .waste-percent {
    grid-column: 2 / 4;
    font-size: 12px;
  }

  .preview-actions,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-actions button,
  .button-row button,
  .generate-button {
    width: 100%;
    min-width: 0;
  }

  .pdf-preview-shell {
    max-height: none;
    padding: 10px;
  }

  .onboarding-actions {
    flex-direction: column;
  }

  .onboarding-actions button {
    width: 100%;
  }
}
