:root {
  --navy-900: #1a1a2e;
  --navy-800: #232f3e;
  --green-700: #2d6a4f;
  --green-600: #3e8a66;
  --orange-500: #ff9900;
  --orange-400: #ffb347;
  --white: #ffffff;
  --slate-50: #f4f7fa;
  --slate-100: #e9edf3;
  --slate-200: #d9e1ea;
  --slate-400: #8b97a8;
  --slate-700: #425268;
  --success: #2f9e44;
  --warning: #d48806;
  --error: #d63939;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-sm: 0 8px 24px rgba(26, 26, 46, 0.08);
  --shadow-md: 0 14px 44px rgba(26, 26, 46, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--navy-900);
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 153, 0, 0.11) 0, transparent 46%),
    radial-gradient(circle at 4% 16%, rgba(45, 106, 79, 0.1) 0, transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f2f5f9 68%, #edf1f6 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.75;
  z-index: 0;
}

.bg-orb-1 {
  background: rgba(45, 106, 79, 0.2);
  top: -160px;
  right: -110px;
}

.bg-orb-2 {
  background: rgba(255, 153, 0, 0.18);
  bottom: -180px;
  left: -120px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 94vw);
  margin: 28px auto;
}

.panel {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(35, 47, 62, 0.09);
  box-shadow: var(--shadow-sm);
}

.card-soft {
  background: linear-gradient(180deg, #fbfcff, #f6f9fd);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.brand-text {
  font-size: 1.52rem;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.03em;
  line-height: 1;
  width: fit-content;
  position: relative;
}

.brand-text span {
  color: var(--green-700);
}

.brand-arrow {
  width: 100px;
  height: 12px;
  border-bottom: 3px solid var(--orange-500);
  border-radius: 0 0 80px 80px;
  margin-top: -1px;
  margin-left: 43px;
  position: relative;
}

.brand-arrow::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 3px solid var(--orange-500);
  border-bottom: 3px solid var(--orange-500);
  position: absolute;
  right: -2px;
  bottom: -4px;
  transform: rotate(-42deg);
}

.app-subtitle {
  margin: 6px 0 0;
  color: var(--slate-700);
  font-size: 0.92rem;
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 220ms ease;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.neutral {
  color: var(--slate-700);
  border-color: var(--slate-200);
  background: #f7f9fc;
}

.status-pill.success {
  color: #1d6b31;
  border-color: rgba(47, 158, 68, 0.28);
  background: rgba(47, 158, 68, 0.12);
}

.status-pill.error {
  color: #9f2323;
  border-color: rgba(214, 57, 57, 0.28);
  background: rgba(214, 57, 57, 0.11);
}

.wizard {
  margin-top: 14px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 0;
  margin-bottom: 24px;
}

.step {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--slate-700);
  font: inherit;
  position: relative;
  padding: 0;
}

.step::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 57%;
  width: 86%;
  height: 2px;
  background: var(--slate-200);
  z-index: 0;
}

.step:last-child::after {
  display: none;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--slate-400);
  color: var(--slate-700);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  background: var(--white);
  position: relative;
  z-index: 1;
  transition: all 220ms ease;
}

.step-label {
  font-size: 0.8rem;
  text-align: center;
  font-weight: 600;
}

.step.is-active .step-dot {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--white);
  transform: scale(1.03);
}

.step.is-active .step-label {
  color: var(--navy-900);
}

.step.is-complete .step-dot {
  border-color: var(--green-700);
  background: var(--green-700);
  color: var(--white);
}

.step.is-complete::after {
  background: linear-gradient(90deg, var(--green-700), rgba(45, 106, 79, 0.35));
}

.step.is-skipped .step-dot {
  border-color: #999;
  background: #e0e0e0;
  color: #999;
}

.step.is-skipped .step-label {
  color: #999;
}

.step.is-skipped .step-label::after {
  content: "skipped";
  display: block;
  font-size: 0.65em;
  color: #d32f2f;
  font-weight: 600;
  margin-top: 1px;
}

.wizard-panel {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(14px);
  transition: opacity 280ms ease, transform 280ms ease, max-height 280ms ease;
  pointer-events: none;
}

.wizard-panel.is-active {
  opacity: 1;
  max-height: 2200px;
  transform: translateY(0);
  pointer-events: auto;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.42rem;
  color: var(--navy-900);
}

h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--navy-900);
}

.muted {
  color: var(--slate-700);
  margin: 0 0 16px;
  line-height: 1.5;
}

.upload-zone {
  border: 1.5px dashed #9fb3c7;
  border-radius: 14px;
  padding: 24px 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.upload-zone:hover {
  border-color: var(--orange-500);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(35, 47, 62, 0.09);
}

.upload-zone input {
  display: none;
}

.upload-zone strong {
  font-size: 1rem;
}

.upload-zone small {
  color: var(--slate-700);
  font-size: 0.8rem;
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(26, 26, 46, 0.14);
  background: linear-gradient(160deg, rgba(45, 106, 79, 0.16), rgba(45, 106, 79, 0.04));
  position: relative;
}

.upload-icon::before {
  content: "PDF";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green-700);
}

.upload-icon.is-csv {
  background: linear-gradient(160deg, rgba(255, 153, 0, 0.2), rgba(255, 153, 0, 0.05));
}

.upload-icon.is-csv::before {
  content: "CSV";
  color: #975d00;
}

.inline-message {
  margin: 12px 0;
  font-size: 0.92rem;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.inline-message.neutral {
  background: #f5f8fc;
  color: var(--slate-700);
  border-color: var(--slate-200);
}

.inline-message.success {
  color: #1f6e33;
  border-color: rgba(47, 158, 68, 0.27);
  background: rgba(47, 158, 68, 0.1);
}

.inline-message.warn {
  color: #916000;
  border-color: rgba(212, 136, 6, 0.25);
  background: rgba(212, 136, 6, 0.11);
}

.inline-message.error {
  color: #9f2323;
  border-color: rgba(214, 57, 57, 0.25);
  background: rgba(214, 57, 57, 0.1);
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
}

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

th {
  background: #f7f9fc;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.73rem;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--navy-900);
  font-weight: 500;
}

input[type="text"] {
  border: 1px solid #c8d1dd;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--navy-900);
  background: #fdfefe;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.18);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.formula-box,
.inline-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfdff, #f6f9fc);
}

.formula {
  margin: 0;
  color: var(--slate-700);
}

.cogs-input {
  max-width: 380px;
}

.transfer-input {
  margin-top: 14px;
}

.transfer-reference {
  margin: 0;
  font-size: 0.82rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.summary-card {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px;
  background: #fcfdff;
}

.summary-card.full {
  grid-column: 1 / -1;
}

.line-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(139, 151, 168, 0.35);
}

.line-row strong {
  color: var(--navy-900);
}

.help-tip {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  margin-left: 6px;
  font-size: 11px;
  background: #edf2f8;
  color: var(--slate-700);
  cursor: help;
}

.value.warn {
  color: var(--warning);
}

.value.bad {
  color: var(--error);
}

.checklist {
  margin: 0;
  padding-left: 18px;
  columns: 2;
  gap: 24px;
}

.checklist li {
  margin: 6px 0;
  color: var(--slate-700);
}

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

.btn {
  appearance: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  padding: 10px 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 180ms ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, var(--orange-400), var(--orange-500));
  border-color: #d67f00;
  color: #1d1d1d;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 153, 0, 0.3);
}

.btn.secondary {
  background: #ffffff;
  border-color: #b1bfd0;
  color: var(--navy-900);
}

.btn.secondary:hover {
  border-color: var(--navy-900);
}

.wizard-nav {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}

.legend {
  margin-top: 16px;
}
.download-success {
  margin-top: 16px;
  padding: 16px 20px;
  background: #dcfce7;
  border: 2px solid #22c55e;
  border-radius: 10px;
  color: #166534;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.app-footer {
  margin-top: 14px;
  padding: 14px 20px;
  background: linear-gradient(120deg, var(--navy-800), #1e2834);
  border-color: rgba(255, 255, 255, 0.05);
}

.app-footer p {
  margin: 0;
  color: #dbe3ec;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.app-footer strong {
  color: #ffffff;
  letter-spacing: 0.01em;
}

.pdf-template {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 850px;
  background: #ffffff;
  color: #111;
}

.pdf-template.is-rendering {
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.pdf-report {
  width: 7.3in;
  min-height: 10in;
  margin: 0 auto;
  padding: 0.2in 0.1in 0.3in;
  font-family: "Inter", sans-serif;
  font-size: 11pt;
  color: #1e293b;
  background: #ffffff;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid #e5e7eb;
  background: #ffffff;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-logo-block {
  text-align: left;
}

.pdf-logo-text {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.pdf-logo-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 600;
}

.pdf-header h1 {
  margin: 0;
  font-size: 2rem;
}

.pdf-tagline {
  margin: 3px 0 0;
  color: #64748b;
  font-weight: 700;
  font-size: 0.95rem;
}

.pdf-meta {
  font-size: 0.9rem;
  text-align: right;
  color: #475569;
}

.pdf-section {
  margin: 0;
  padding-top: 0;
  page-break-before: auto;
  break-before: auto;
  page-break-inside: auto;
}
.pdf-section:first-child {
  page-break-before: avoid;
  break-before: avoid;
}
.pdf-section h2 {
  margin: 0 0 8px;
  color: #ffffff;
  background: linear-gradient(90deg, #1e40af, #3b82f6);
  font-size: 1.1rem;
  padding: 9px 14px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  page-break-after: avoid !important;
  break-after: avoid !important;
}

.pdf-section h3 {
  margin: 8px 0 6px;
  color: #2563eb;
  font-size: 1rem;
  font-weight: 800;
}

/* Section B — Net Profit: Forest Green theme */
.pdf-section-profit h2 {
  background: linear-gradient(90deg, #166534, #22c55e);
}
.pdf-section-profit h3,
.pdf-section-profit h4 {
  color: #166534;
}
.pdf-section-profit .pdf-step h4 {
  color: #166534;
}
.pdf-section-profit .pdf-row-subtotal td {
  background: #dcfce7;
  color: #166534;
}
.pdf-section-profit .pdf-validation-note {
  color: #166534;
}

/* Section C — Write-Offs/Tax Deductions: Red theme */
.pdf-section-writeoffs h2 {
  background: linear-gradient(90deg, #991b1b, #dc2626);
}
.pdf-section-writeoffs h3 {
  color: #b91c1c;
}
.pdf-section-writeoffs .pdf-row-subtotal td {
  background: #fee2e2;
  color: #991b1b;
}
.pdf-section-writeoffs .pdf-table th {
  background: #fef2f2;
  color: #991b1b;
}
.pdf-additions-header {
  color: #166534 !important;
  page-break-after: avoid;
  break-after: avoid;
}
.pdf-table-additions th {
  background: #dcfce7 !important;
  color: #166534 !important;
}
.pdf-table-additions td {
  background: #f0fdf4;
}

.pdf-filing-note {
  margin: 6px 0 12px;
  padding: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

.pdf-filing-note p {
  margin: 0 0 4px;
}

.pdf-filing-note strong {
  color: #475569;
}

.pdf-note {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #334155;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  font-size: 10pt;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #d8e2ed;
  padding: 7px 8px;
  vertical-align: top;
}

.pdf-table th {
  background: #eff6ff;
  color: #1e3a5f;
  text-transform: none;
  letter-spacing: normal;
  font-size: 10pt;
}

.pdf-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.pdf-callout {
  margin: 8px 0 0;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-step {
  margin: 0 0 10px;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-step h4 {
  margin: 0 0 5px;
  color: #2563eb;
  font-size: 0.95rem;
  font-weight: 800;
}

.pdf-step-line {
  padding-left: 14px;
}

.pdf-crosscheck {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: #1e3a5f;
}

.pdf-warning-box {
  margin-top: 8px;
  padding: 8px 10px;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-warning-box p {
  margin: 0 0 4px;
  color: #92400e;
}

.pdf-warning-box ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.88rem;
}

.pdf-bullet-list {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 0.9rem;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-checklist {
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.9rem;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-checklist li {
  margin: 0 0 4px;
  border-bottom: 1px solid #e7edf4;
  padding-bottom: 4px;
}

.pdf-brand-banner {
  border: 2px solid #232f3e;
  border-left: 10px solid #ff9900;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 8px;
  background: linear-gradient(90deg, #fff4e5 0%, #edf5fc 100%);
}

.pdf-brand-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
}

.pdf-brand-simplify {
  color: #232f3e;
}

.pdf-brand-amz {
  color: #ff9900;
  margin-left: 2px;
}

.pdf-header .pdf-brand-simplify {
  color: #232f3e;
}

.pdf-header .pdf-brand-amz {
  color: #ff9900;
}

.pdf-brand-subtitle {
  margin: 4px 0 0;
  color: #146eb4;
  font-size: 0.78rem;
  font-weight: 700;
}

.pdf-row-group td {
  background: linear-gradient(90deg, #1e40af, #3b82f6);
  color: #ffffff;
  font-weight: 800;
}

.pdf-row-item td:first-child {
  padding-left: 14px;
}

.pdf-row-subtotal td {
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
}
.pdf-row-subtotal-green td {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.pdf-table-section-c {
  page-break-inside: avoid;
  break-inside: avoid-page;
}

/* PDF Redesign styles */
.pdf-tax-summary-box {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 2px solid #3b82f6;
  border-left: 8px solid #f59e0b;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #fffbeb 100%);
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-tax-summary-box h2 {
  margin: 0 0 8px;
  color: #1e40af;
  font-size: 1.15rem;
  font-weight: 900;
  background: none !important;
  padding: 0;
}

.pdf-tax-summary-box .pdf-table {
  margin-bottom: 6px;
}

.pdf-schedule-c {
  font-size: 8pt;
  color: #1d4ed8;
  font-weight: 600;
}

.pdf-action {
  font-size: 8pt;
  color: #334155;
  line-height: 1.3;
}

.pdf-scorp {
  font-size: 8pt;
  color: #6d28d9;
  font-weight: 600;
  line-height: 1.3;
}

/* Table footer rows */
.pdf-footer-subtotal td {
  font-weight: 700;
  background: #f1f5f9 !important;
  color: #1e293b;
  border-top: 2px solid #94a3b8;
  font-size: 10pt;
}
.pdf-footer-cogs td {
  font-weight: 700;
  background: #fefce8 !important;
  color: #854d0e;
  border-top: 2px solid #ca8a04;
  font-size: 10pt;
}
.pdf-footer-cogs td.pdf-schedule-c,
.pdf-footer-cogs td:nth-child(4) {
  color: #1d4ed8 !important;
}
.pdf-footer-cogs td.pdf-scorp,
.pdf-footer-cogs td:nth-child(5) {
  color: #6d28d9 !important;
}
.pdf-footer-total td {
  font-weight: 800;
  background: #1e293b !important;
  color: #ffffff;
  font-size: 11pt;
  border-top: 2px solid #0f172a;
}

/* CHANGE 7: FBA Fee Sub-Items Visual Hierarchy */
.pdf-row-fee-parent td {
  font-weight: 700;
  font-size: 10pt;
  background: #f8fafc !important;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  border-top: 2px solid #cbd5e1;
  page-break-after: avoid;
  break-after: avoid;
}

.pdf-row-breakdown {
  border-left: 3px solid #e2e8f0;
}

.pdf-row-breakdown td {
  font-size: 9pt;
  color: #64748b;
  background: #fafbfc !important;
  border-bottom: 1px dashed #e2e8f0;
  padding: 4px 7px;
}

.pdf-breakdown-indent {
  padding-left: 24px !important;
}

.pdf-row-net-total {
  border-left: 3px solid #3b82f6;
}

.pdf-row-net-total td {
  font-weight: 700;
  font-size: 9pt;
  color: #1e293b;
  background: #f0f7ff !important;
  border-top: 1px solid #93c5fd;
  border-bottom: 2px solid #3b82f6;
}

.pdf-row-net-total td.pdf-schedule-c {
  color: #1d4ed8 !important;
}

.pdf-row-net-total td.pdf-scorp {
  color: #6d28d9 !important;
}

.pdf-row-net-total td.pdf-action {
  color: #334155 !important;
}

/* Write-off table column widths for portrait */
.pdf-table-writeoffs th:nth-child(1),
.pdf-table-writeoffs td:nth-child(1) { width: 20%; }
.pdf-table-writeoffs th:nth-child(2),
.pdf-table-writeoffs td:nth-child(2) { width: 12%; }
.pdf-table-writeoffs th:nth-child(3),
.pdf-table-writeoffs td:nth-child(3) { width: 28%; }
.pdf-table-writeoffs th:nth-child(4),
.pdf-table-writeoffs td:nth-child(4) { width: 20%; }
.pdf-table-writeoffs th:nth-child(5),
.pdf-table-writeoffs td:nth-child(5) { width: 20%; }

.pdf-row-zero td {
  color: #888;
  font-style: italic;
}

.pdf-table-compact {
  font-size: 9pt;
}

.pdf-table-compact th,
.pdf-table-compact td {
  padding: 5px 6px;
}

.pdf-crosscheck-note {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
  padding: 4px 7px 8px;
  border-bottom: 2px solid #d8e2ed;
}

.pdf-validation-note {
  margin: 5px 0 0;
  font-size: 0.74rem;
  color: #166534;
  font-style: italic;
}

/* ── Page break fixes ───────────────────────────────────── */
@media print {
  @page {
    size: letter portrait;
    margin: 0.4in 0.35in;
  }
}

/* CHANGE 6: Portrait-mode page break rules */
.pdf-section-group {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-section h2 {
  break-after: avoid;
  page-break-after: avoid;
}

.pdf-section {
  break-before: auto;
  page-break-before: auto;
}

.pdf-table tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

.pdf-table {
  page-break-inside: auto;
  break-inside: auto;
}

.pdf-table thead {
  display: table-header-group;
}

.pdf-step {
  page-break-inside: avoid;
  break-inside: avoid;
}

.pdf-section-writeoffs,
.pdf-section-profit {
  page-break-before: auto;
}

@media (max-width: 980px) {
  .wizard {
    padding: 20px;
  }

  .wizard-steps {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 14px 8px;
  }

  .step::after {
    display: none;
  }

  .summary-grid,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .checklist {
    columns: 1;
  }
}

@media (max-width: 680px) {
  .accounting-method-cards {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .brand-arrow {
    width: 94px;
    margin-left: 39px;
  }

  .fork-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Top Navigation (Change 1) ──────────────────────────── */
.wizard-nav-top {
  margin-bottom: 16px;
  margin-top: 0;
  display: flex;
  justify-content: space-between;
}

/* ── Fork Screen Cards (Change 2) ───────────────────────── */
.fork-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.fork-card {
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  background: linear-gradient(180deg, #fcfdff, #f6f9fc);
  text-align: center;
  cursor: pointer;
  transition: all 240ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fork-card:hover {
  border-color: var(--orange-500);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(26, 26, 46, 0.12);
}

.fork-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 4px;
}

.fork-title {
  margin: 0;
  font-size: 1.18rem;
  color: var(--navy-900);
  font-weight: 800;
}

.fork-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: var(--green-700);
  font-weight: 600;
  font-style: italic;
}

.fork-desc {
  margin: 4px 0 12px;
  color: var(--slate-700);
  font-size: 0.88rem;
  line-height: 1.5;
}

.fork-btn {
  margin-top: auto;
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
}

/* CHANGE 1: Fork card styling — basic is muted/amber, full is recommended */
.fork-card-basic {
  border-color: #e0c88a;
  background: linear-gradient(180deg, #fffcf5, #fdf6e8);
}

.fork-card-basic:hover {
  border-color: #d4a843;
}

.fork-warning {
  margin: 4px 0 12px;
  padding: 10px 14px;
  background: #fff3cd;
  border: 1px solid #f0d78c;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #856404;
  line-height: 1.5;
  text-align: left;
}

.fork-card-full {
  border-color: var(--green-600);
  border-width: 2.5px;
  background: linear-gradient(180deg, #f0faf4, #e8f5ee);
  position: relative;
}

.fork-card-full:hover {
  border-color: var(--green-700);
}

.fork-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 0.03em;
}

/* CHANGE 2: Upload zone success state */
.upload-zone.upload-success {
  border-color: var(--success);
  border-style: solid;
  background: linear-gradient(180deg, #f0fdf4, #e8f8ed);
}

.upload-zone.upload-success:hover {
  border-color: #1d7a33;
}

.upload-zone.upload-success .upload-icon {
  background: linear-gradient(160deg, rgba(47, 158, 68, 0.2), rgba(47, 158, 68, 0.06));
  border-color: rgba(47, 158, 68, 0.3);
}

.upload-zone.upload-success .upload-icon::before {
  content: "✓";
  font-size: 1.1rem;
  color: var(--success);
}

/* CHANGE 3: Helper text for input fields */
.input-helper-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--slate-400);
  font-weight: 400;
  line-height: 1.5;
}

/* ── Accounting Method Toggle ───────────────────────────── */
.accounting-method-section {
  margin-bottom: 24px;
}

.accounting-method-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-700);
  margin: 0 0 6px;
}

.accounting-method-intro {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin: 0 0 14px;
  line-height: 1.5;
}

.accounting-method-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.method-card {
  position: relative;
  display: block;
  padding: 16px;
  background: #f8fafc;
  border: 2px solid var(--slate-200);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.method-card:hover {
  border-color: var(--brand);
  background: #f0f7ff;
}

.method-card-selected {
  border-color: var(--brand) !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.method-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.method-card-content h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800);
}

.method-card-content p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--slate-600);
  line-height: 1.4;
}

.method-card-hint {
  font-size: 0.78rem !important;
  color: var(--slate-400) !important;
  line-height: 1.6 !important;
}

.method-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #166534;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ── Accrual Fields Container ───────────────────────────── */
.accrual-fields {
  margin-bottom: 14px;
}

.accrual-fields .cogs-input {
  margin-bottom: 10px;
}

.accrual-cogs-display {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 14px;
  background: #fefce8;
  border: 1px solid #ca8a04;
  border-radius: 8px;
  max-width: 580px;
}

.accrual-cogs-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #854d0e;
}

.accrual-cogs-value {
  font-size: 1rem;
  font-weight: 700;
  color: #854d0e;
}

.accrual-cogs-formula {
  font-size: 0.78rem;
  color: #a16207;
  font-style: italic;
  margin-left: auto;
}

/* ── PDF: COGS-Total Row (Accrual) ──────────────────────── */
.pdf-footer-cogs-total td {
  font-weight: 800;
  background: #fef9c3 !important;
  color: #713f12;
  border-top: 2px solid #ca8a04;
  font-size: 10.5pt;
}

.pdf-footer-cogs-total td.pdf-schedule-c,
.pdf-footer-cogs-total td:nth-child(4) {
  color: #1d4ed8 !important;
}

.pdf-footer-cogs-total td.pdf-scorp,
.pdf-footer-cogs-total td:nth-child(5) {
  color: #6d28d9 !important;
}

/* ── Amber Callout (Change 3) ───────────────────────────── */
.amber-callout {
  background: #FFF8E1;
  border-left: 4px solid #FF9800;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #5D4037;
  line-height: 1.5;
}

.amber-callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.amber-callout a {
  color: #E65100;
  font-weight: 600;
}

.value.amber {
  color: #E65100;
  font-weight: 600;
}

/* PDF amber callout */
.pdf-amber-callout {
  background: #FFF8E1;
  border-left: 4px solid #FF9800;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 6px 0;
  font-size: 0.78rem;
  color: #5D4037;
  line-height: 1.4;
}

/* DDR Instructions Info Box */
.ddr-instructions-box {
  background: #f0f7ff;
  border: 1px solid #b3d4fc;
  border-left: 4px solid #2196F3;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.ddr-instructions-box h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #1565C0;
}

.ddr-instructions-box ol {
  margin: 0 0 12px 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--slate-700);
}

.ddr-instructions-box ol li {
  margin-bottom: 2px;
}

.ddr-instructions-warning {
  margin: 0;
  font-size: 0.85rem;
  color: #b45309;
  font-weight: 500;
}

/* ── Settlement Gap Analysis (Section F) ─────────────────── */
.pdf-section-gap-header h2 {
  background: #232f3e;
  color: #ffffff;
  padding: 10px 16px;
  margin: 0 0 16px 0;
  border-radius: 4px;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.pdf-gap-numbers-table {
  margin-bottom: 16px;
}

.pdf-gap-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pdf-gap-pct {
  font-size: 0.82em;
  color: #666;
  margin-left: 6px;
}

.pdf-gap-divider-row td {
  padding: 2px 0;
}

.pdf-gap-rule {
  border: none;
  border-top: 2px solid #374151;
  margin: 4px 0;
}

.pdf-gap-total-row td {
  font-size: 1rem;
  padding-top: 4px;
  border-top: none;
}

.pdf-gap-info-box {
  background: #e8f4fd;
  border-left: 4px solid #2196F3;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 0 0 14px 0;
  font-size: 0.88rem;
  color: #0d47a1;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-gap-pro-box {
  background: #e8f5e9;
  border-left: 4px solid #4CAF50;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 0 0 14px 0;
  font-size: 0.88rem;
  color: #1B5E20;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-gap-warning-box {
  background: #FFF8E1;
  border-left: 4px solid #FF9800;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 14px 0;
  font-size: 0.88rem;
  color: #5D4037;
  page-break-inside: avoid;
  break-inside: avoid-page;
}

.pdf-gap-disclaimer {
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
  margin: 12px 0 0 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}

/* PDF global footer disclaimer */
.pdf-page-footer-disclaimer {
  font-size: 0.70rem;
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  padding: 6px 0 10px 0;
  margin-bottom: 12px;
}

/* Export page disclaimer */
.export-disclaimer {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  margin: 12px 0 0 0;
  font-style: italic;
}

/* ── Step 4 Two-Column Layout ──────────────────────────────────────────── */
.step4-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 680px) {
  .step4-columns {
    grid-template-columns: 1fr;
  }
}

/* ── DDR Preview Table — Sales Tax type badge ──────────────────────────── */
.type-sales-tax {
  color: #6b7280;
  font-style: italic;
  font-size: 0.85em;
}
