:root {
  color-scheme: light;
  --ink: #2d2f39;
  --muted: #61636f;
  --soft: #f7f7fb;
  --canvas: #f4f4fa;
  --panel: #ffffff;
  --line: #d5d6de;
  --red: #ef312f;
  --red-dark: #d82625;
  --green: #16a36a;
  --shadow: 0 8px 24px rgba(26, 28, 38, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
}

.upload-screen {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 100vh;
  padding: 46px 20px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
  color: var(--muted);
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  font-size: 13px;
}

.upload-nav { display: flex; gap: 24px; margin: -24px 0 32px; color: var(--muted); font-size: 16px; }
.upload-nav a:hover, .site-footer a:hover { text-decoration: underline; }
.upload-privacy { max-width: 560px; color: var(--muted); font-size: 14px; line-height: 1.6; margin: 12px 0; }
.upload-privacy a, .modal-note a { text-decoration: underline; }
.learning-consent { display: flex; align-items: flex-start; gap: 10px; max-width: 560px; text-align: left; font-size: 14px; color: var(--muted); line-height: 1.6; margin: 8px 0 16px; }
.learning-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--red); }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px 32px; padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
button:disabled { cursor: not-allowed; opacity: 0.65; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(44px, 5.6vw, 70px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 940px;
  margin-bottom: 48px;
  color: var(--muted);
  font-size: clamp(22px, 2.6vw, 38px);
  line-height: 1.25;
}

.dropzone {
  position: relative;
  display: inline-grid;
  width: min(520px, calc(100vw - 40px));
  min-height: 128px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.drop-title {
  padding: 0 28px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 900;
}

.drop-subtitle {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 24px;
}

.upload-limit {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.upload-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  color: #a3183f;
  background: #fff0f4;
  border: 1px solid #f0b8c9;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.upload-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.upload-pills span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.loading-card {
  display: grid;
  justify-items: center;
  width: min(520px, 100%);
}

.loading-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin-bottom: 28px;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(238, 48, 44, 0.22);
}

.loading-mark .lucide {
  width: 34px;
  height: 34px;
  animation: pulse 1.4s ease-in-out infinite;
}

.loading-card h2 {
  margin-bottom: 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
}

.loading-card p {
  max-width: 440px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.35;
}

.loading-progress {
  position: relative;
  width: min(420px, 100%);
  height: 8px;
  margin-top: 28px;
  overflow: hidden;
  background: #dedfe8;
  border-radius: 4px;
}

.loading-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  background: var(--red);
  border-radius: inherit;
  animation: loading-sweep 1.45s ease-in-out infinite;
}

.loading-card .loading-quip {
  min-height: 28px;
  margin-top: 18px;
  font-size: 16px;
  font-weight: 800;
}

@keyframes loading-sweep {
  0% { transform: translateX(-110%); }
  55% { width: 52%; }
  100% { transform: translateX(265%); }
}

@keyframes pulse {
  50% { transform: scale(1.12); }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

.preview-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 28px;
  align-content: start;
  justify-items: center;
  padding: clamp(48px, 8vw, 104px) clamp(24px, 6vw, 86px);
}

.floating-add {
  position: fixed;
  top: 82px;
  right: 398px;
  z-index: 15;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.floating-add::before {
  content: "1";
  position: absolute;
  top: -10px;
  left: -10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #11131a;
  border: 4px solid var(--red);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.file-card {
  display: grid;
  justify-items: center;
  width: min(330px, 100%);
  padding: 38px 16px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 16px rgba(26, 28, 38, 0.1);
  text-align: center;
}

.file-icon {
  display: grid;
  width: 154px;
  height: 194px;
  place-items: center;
  color: var(--red);
  background: linear-gradient(#fff, #f9f9fc);
  border: 1px solid #ececf1;
  box-shadow: inset 0 0 0 10px #fff, 0 3px 14px rgba(30, 32, 40, 0.08);
}

.file-icon .lucide {
  width: 70px;
  height: 70px;
  stroke-width: 1.6;
}

.file-card strong {
  display: block;
  width: 100%;
  margin-top: 20px;
  overflow: hidden;
  color: var(--muted);
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card small {
  margin-top: 4px;
  color: #8d8f99;
  font-weight: 700;
}

.preview-table-card {
  width: min(100%, 880px);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e4ea;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(26, 28, 38, 0.08);
}

.preview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 0;
}

.panel-kicker,
.eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.preview-heading h2 {
  margin: 0;
  font-size: 28px;
}

.preview-heading span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(44vh, 420px);
  margin-top: 18px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  text-transform: uppercase;
}

.empty-state {
  height: 96px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.options-panel {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 28px 28px;
  background: #fff;
  border-left: 1px solid #cfd0d6;
}

.options-panel h2 {
  margin: 0 -28px 18px;
  padding: 0 28px 20px;
  border-bottom: 1px solid #cfd0d6;
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1.1;
}

.status {
  min-height: 58px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.status.error {
  color: #b4234d;
}

.controls {
  display: grid;
  gap: 18px;
}

.controls label,
.password-panel label {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

select,
.password-panel input {
  width: 100%;
  min-height: 58px;
  color: var(--muted);
  background: #fff;
  border: 1px solid #8d9099;
  border-radius: 4px;
  padding: 0 14px;
  font-size: 18px;
}

.password-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 55;
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(20, 20, 28, 0.58), 0 30px 90px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.password-panel[hidden] {
  display: none;
}

.password-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.password-panel strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.password-panel button,
.download-button,
.modal-prices button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.password-panel button {
  color: #fff;
  background: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.summary-grid div {
  min-height: 82px;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.summary-grid span {
  display: block;
  font-size: 24px;
  font-weight: 950;
}

.summary-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.download-button {
  width: 100%;
  margin-top: auto;
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 14px rgba(239, 49, 47, 0.24);
}

.download-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.learning-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.result-banner {
  position: fixed;
  top: 22px;
  right: 442px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(480px, calc(100vw - 32px));
  padding: 14px;
  color: #0f5f43;
  background: #eafaf2;
  border: 1px solid #bce9d2;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 94, 89, 0.18);
}

.result-banner[hidden],
.modal[hidden] {
  display: none;
}

.result-banner span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
}

.result-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.result-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.toast-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #0f5f43;
  background: rgba(255, 255, 255, 0.74);
  border: 0;
  border-radius: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 28, 0.58);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  background: #f1f2f6;
  border: 0;
  border-radius: 8px;
}

.modal-card h2 {
  max-width: 520px;
  margin-bottom: 10px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.04;
}

.modal-copy,
.modal-note,
.modal-prices p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 12px;
}

.modal-prices article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  background: #f8f8fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-prices article.featured {
  border-color: var(--red);
}

.modal-prices h3,
.modal-prices p {
  margin: 0;
}

.price {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 38px;
  font-weight: 950;
}

.price span {
  color: var(--muted);
  font-size: 16px;
}

.modal-prices button {
  width: 100%;
  margin-top: 8px;
  color: #fff;
  background: var(--ink);
}

.paypal-button-slot {
  min-height: 54px;
  margin-top: 8px;
}

.modal-prices .featured button {
  background: var(--red);
}

.modal-note {
  display: block;
  font-size: 12px;
}

.processing-modal {
  z-index: 70;
}

.processing-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(100%, 520px);
  padding: 36px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.processing-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
}

.processing-icon .lucide {
  width: 28px;
  height: 28px;
  animation: pulse 1.4s ease-in-out infinite;
}

.processing-card h2 {
  margin: 4px 0 10px;
  font-size: 32px;
}

.processing-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.processing-card .processing-reassurance {
  margin-top: 18px;
  font-size: 13px;
}

.lucide {
  width: 20px;
  height: 20px;
  stroke-width: 2.3;
}

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

  .options-panel {
    position: static;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid #cfd0d6;
  }

  .download-button {
    margin-top: 24px;
  }

  .floating-add,
  .result-banner {
    right: 18px;
  }
}

@media (max-width: 720px) {
  .upload-screen {
    padding: 22px 16px 30px;
  }

  .brand {
    margin-bottom: 26px;
  }

  h1 {
    margin-bottom: 14px;
    font-size: 34px;
    line-height: 1.08;
  }

  .lede {
    max-width: 360px;
    margin-bottom: 28px;
    font-size: 18px;
    line-height: 1.4;
  }

  .dropzone {
    width: 100%;
    min-height: 82px;
    border-radius: 8px;
  }

  .drop-title {
    padding: 0 18px;
    font-size: 22px;
  }

  .drop-subtitle {
    margin-top: 16px;
    font-size: 16px;
  }

  .upload-limit {
    margin-top: 8px;
    font-size: 12px;
  }

  .upload-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    margin-top: 26px;
  }

  .upload-pills span {
    justify-content: center;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.2;
  }

  .upload-pills .lucide {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
  }

  .loading-card h2 {
    font-size: 30px;
  }

  .loading-card p {
    font-size: 17px;
  }

  .loading-card .loading-quip {
    font-size: 14px;
  }

  .preview-stage {
    overflow: hidden;
    padding: 82px 14px 28px;
  }

  .floating-add {
    top: 18px;
    width: 54px;
    height: 54px;
  }

  .file-card {
    width: min(280px, 100%);
  }

  .preview-table-card {
    width: 100%;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    width: 100%;
  }

  tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "date amount"
      "description description"
      "balance balance";
    gap: 12px 16px;
    width: 100%;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  tbody td {
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  tbody td[data-label]::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  tbody td:nth-child(1) {
    grid-area: date;
  }

  tbody td:nth-child(2) {
    grid-area: description;
  }

  tbody td:nth-child(3) {
    grid-area: amount;
    text-align: right;
  }

  tbody td:nth-child(3)::before {
    text-align: right;
  }

  tbody td:nth-child(4) {
    grid-area: balance;
    color: var(--muted);
  }

  tbody .empty-state {
    display: block;
    grid-column: 1 / -1;
    height: auto;
    padding: 24px 16px;
  }

  .preview-heading {
    align-items: start;
    flex-direction: column;
  }

  .options-panel {
    padding: 20px 16px 22px;
  }

  .options-panel h2 {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
    font-size: 28px;
  }

  .summary-grid,
  .modal-prices {
    grid-template-columns: 1fr;
  }

  .result-banner {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .modal-card,
  .processing-card {
    padding: 22px 18px;
  }

  .modal-card h2,
  .processing-card h2 {
    font-size: 26px;
    line-height: 1.15;
  }

  select,
  .password-panel input {
    font-size: 16px;
  }
}
