:root {
  --ink: #18201e;
  --muted: #66716d;
  --forest: #123a35;
  --forest-light: #1f5a51;
  --lime: #c7ee74;
  --cream: #f5f3ec;
  --paper: #ffffff;
  --line: #dce2df;
  --blue: #e8f0ff;
  --blue-ink: #285799;
  --amber: #fff3ce;
  --amber-ink: #7a5a00;
  --red: #a13c32;
  --shadow: 0 24px 70px rgba(19, 44, 39, 0.1);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 8%, rgba(199, 238, 116, 0.2), transparent 24rem),
    var(--cream);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px);
  background: rgba(245, 243, 236, 0.9);
  border-bottom: 1px solid rgba(18, 58, 53, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--forest);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--forest);
  color: var(--lime);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.16em;
}

.brand small {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(18, 58, 53, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.54);
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4eb16f;
  box-shadow: 0 0 0 4px rgba(78, 177, 111, 0.12);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: end;
  padding: clamp(64px, 9vw, 110px) 10px 52px;
}

.eyebrow,
.section-number {
  margin: 0 0 12px;
  color: var(--forest-light);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  max-width: 670px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 8vw, 100px);
  line-height: 0.88;
  letter-spacing: -0.06em;
  color: var(--forest);
}

.hero-intro {
  max-width: 590px;
  margin: 28px 0 0;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  color: #4f5b57;
}

.privacy-card {
  display: flex;
  gap: 18px;
  padding: 24px;
  border-radius: 22px;
  background: var(--forest);
  color: white;
  box-shadow: var(--shadow);
}

.privacy-card .shield {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 900;
}

.privacy-card strong {
  font-size: 15px;
}

.privacy-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
}

.step {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-radius: 14px;
  color: #7d8783;
}

.step > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.step strong,
.step small {
  display: block;
}

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

.step small {
  margin-top: 2px;
  font-size: 11px;
}

.step.is-active {
  background: var(--paper);
  color: var(--forest);
  box-shadow: 0 8px 30px rgba(18, 58, 53, 0.08);
}

.step.is-active > span {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--lime);
}

.workspace {
  margin-bottom: 24px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 34px;
}

.section-heading h2,
.ledger-panel h2 {
  margin: 0;
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.035em;
}

.section-heading p:not(.section-number),
.ledger-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.text-button {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 4px 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.period-row {
  display: flex;
  align-items: end;
  gap: 22px;
  margin-bottom: 26px;
  padding: 20px 22px;
  border-radius: 18px;
  background: #f4f7f5;
}

.period-row label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--forest);
}

input[type="date"] {
  min-width: 190px;
  padding: 11px 13px;
  border: 1px solid #cbd5d0;
  border-radius: 10px;
  background: white;
  color: var(--ink);
}

.period-summary {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.upload-card {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border: 1.5px dashed #bdc9c4;
  border-radius: 22px;
  background: #fbfcfb;
  text-align: center;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.upload-card:hover,
.upload-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--forest-light);
  background: #f8fbf9;
}

.upload-card.has-file {
  border-style: solid;
  border-color: #70a892;
  background: #f2faf5;
}

.upload-card input,
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.source-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.source-aud {
  background: var(--blue);
  color: var(--blue-ink);
}

.source-nzd {
  background: #e7f6e9;
  color: #337347;
}

.upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  background: var(--forest);
  color: var(--lime);
  font-size: 24px;
  font-weight: 300;
}

.upload-card strong {
  color: var(--forest);
  font-size: 17px;
}

.upload-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.file-name {
  max-width: 90%;
  margin-top: 16px;
  overflow: hidden;
  color: var(--forest-light);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--forest);
}

.check-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.account-reminder {
  margin-top: 20px;
  padding: 13px 16px;
  border-left: 3px solid #d3ac38;
  background: #fff9e8;
  color: #65582e;
  font-size: 12px;
  line-height: 1.5;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 13px;
  padding: 14px 19px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 220px;
  background: var(--forest);
  color: white;
  box-shadow: 0 12px 24px rgba(18, 58, 53, 0.18);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.secondary-button {
  border: 1px solid #cfd8d4;
  background: white;
  color: var(--forest);
  font-size: 12px;
}

.is-hidden {
  display: none !important;
}

.status-badge,
.review-count {
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--amber-ink);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.status-badge.is-ready {
  background: #e2f4e7;
  color: #2f6e43;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.metric {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfcfb;
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.review-heading h3,
.finish-card h3 {
  margin: 0;
  color: var(--forest);
  font-size: 20px;
}

.review-heading p,
.finish-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f5f7f6;
  color: #6f7975;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

.table-source {
  display: inline-block;
  padding: 5px 7px;
  border-radius: 6px;
  background: #eef2f0;
  color: var(--forest);
  font-size: 9px;
  font-weight: 850;
}

td select,
td input {
  min-width: 150px;
  max-width: 230px;
  padding: 9px 10px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

td input:disabled {
  background: #f1f3f2;
}

.decision-progress {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 12px;
}

.excluded-details {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.excluded-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--forest);
}

.excluded-item {
  display: grid;
  grid-template-columns: 100px 1fr 110px;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0ee;
}

.output-list {
  display: grid;
  gap: 14px;
}

.output-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfb;
}

.output-card h3 {
  margin: 0;
  color: var(--forest);
  font-size: 17px;
}

.output-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.output-target {
  display: inline-flex;
  gap: 7px;
  margin-top: 11px;
}

.output-target span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #edf2ef;
  color: var(--forest);
  font-size: 10px;
  font-weight: 850;
}

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

.copy-button.is-copied {
  background: #e4f4e8;
  color: #2c6d41;
}

.finish-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 32px;
  align-items: center;
  margin-top: 28px;
  padding: 25px;
  border-radius: 20px;
  background: var(--forest);
  color: white;
}

.finish-card h3,
.finish-card .section-number {
  color: white;
}

.finish-card p {
  color: rgba(255, 255, 255, 0.68);
}

.finish-card .check-row {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.finish-card .primary-button {
  grid-column: 2;
  background: var(--lime);
  color: var(--forest);
}

.record-message {
  grid-column: 1 / -1;
  margin: 0 !important;
  color: var(--lime) !important;
  font-weight: 750;
}

.ledger-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin: 24px 0 72px;
  padding: 30px clamp(26px, 5vw, 46px);
  border: 1px solid rgba(18, 58, 53, 0.15);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.56);
}

.ledger-panel h2 {
  font-size: 28px;
}

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

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 44px));
  padding: 14px 17px;
  border-radius: 12px;
  background: var(--forest);
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(120px);
  opacity: 0;
  transition: 200ms ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.is-error {
  background: var(--red);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(22px, 5vw, 72px);
  border-top: 1px solid rgba(18, 58, 53, 0.1);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero h1 {
    font-size: clamp(56px, 15vw, 86px);
  }

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

  .finish-card {
    grid-template-columns: 1fr;
  }

  .finish-card .primary-button,
  .record-message {
    grid-column: 1;
  }

  .ledger-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 72px;
    padding: 0 18px;
  }

  .privacy-pill {
    padding: 8px;
    font-size: 0;
  }

  main {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    padding-top: 54px;
  }

  .hero h1 {
    font-size: 58px;
  }

  .steps {
    gap: 4px;
  }

  .step {
    justify-content: center;
    padding: 10px 5px;
  }

  .step div {
    display: none;
  }

  .workspace {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .section-heading,
  .period-row,
  .action-row,
  .output-card,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .period-row {
    display: flex;
  }

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

  .action-row .primary-button {
    width: 100%;
  }

  .output-card {
    display: flex;
  }

  .output-actions,
  .ledger-actions {
    flex-direction: column;
    width: 100%;
  }

  .output-actions button,
  .ledger-actions > * {
    justify-content: center;
    width: 100%;
  }

  footer {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
