:root {
  --ink: #18211d;
  --muted: #66716b;
  --line: #dfe5e1;
  --surface: #ffffff;
  --surface-soft: #f5f7f5;
  --accent: #187b57;
  --accent-dark: #105d41;
  --accent-soft: #e5f4ed;
  --danger: #b63737;
  --shadow: 0 22px 70px rgba(25, 45, 36, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(24, 123, 87, .09), transparent 28rem),
    #f2f5f3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.8);
  border-bottom: 1px solid rgba(223,229,225,.8);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 11px; }
.brand-mark svg { width: 21px; }
.brand-arrow { color: var(--accent); margin: 0 3px; }
.privacy-pill { color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #cce7da; border-radius: 999px; padding: 8px 13px; font-size: .78rem; font-weight: 650; }

main { overflow: hidden; }
.hero { max-width: 1160px; margin: 0 auto; padding: 82px 24px 42px; text-align: center; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .15em; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 5.8rem); line-height: .95; letter-spacing: -.055em; margin: 22px 0; font-weight: 500; }
.hero h1 span { color: var(--accent); font-style: italic; }
.hero > p { max-width: 670px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.steps { max-width: 660px; display: grid; grid-template-columns: repeat(3, 1fr); margin: 46px auto 0; position: relative; }
.steps::before { content: ""; position: absolute; height: 1px; background: var(--line); left: 17%; right: 17%; top: 18px; z-index: -1; }
.step { display: flex; justify-content: center; align-items: flex-start; gap: 10px; color: #8a928e; text-align: left; }
.step > span { width: 36px; height: 36px; display: grid; place-items: center; background: #e7ebe8; border-radius: 50%; font-size: .8rem; font-weight: 800; }
.step div { display: grid; gap: 2px; }
.step strong { font-size: .86rem; }
.step small { font-size: .72rem; }
.step.active { color: var(--ink); }
.step.active > span { background: var(--accent); color: white; box-shadow: 0 0 0 6px var(--accent-soft); }

.workspace { max-width: 1160px; margin: 0 auto; padding: 0 24px 80px; }
.panel { background: var(--surface); border: 1px solid rgba(223,229,225,.85); border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-panel { max-width: 840px; margin: 0 auto; padding: 16px; }
.dropzone { border: 1.5px dashed #b8c7bf; border-radius: 16px; padding: 62px 24px; text-align: center; background: linear-gradient(145deg, #fbfcfb, #f4f8f6); transition: .2s ease; outline: none; }
.dropzone:hover, .dropzone.dragover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.upload-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: white; color: var(--accent); box-shadow: 0 8px 24px rgba(24,123,87,.12); margin: 0 auto 21px; }
.upload-icon svg { width: 29px; }
.dropzone h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; font-weight: 500; margin: 0 0 8px; }
.dropzone p { color: var(--muted); margin: 0 0 22px; }
.file-rule { display: inline-block; color: #738079; background: white; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: .76rem; }
.selected-file { color: var(--accent-dark) !important; font-weight: 700; }
.upload-options { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding: 20px 10px 7px; }
label { display: grid; gap: 7px; }
label > span { font-size: .78rem; font-weight: 750; color: #465049; }
label small { color: var(--muted); font-size: .72rem; }
input, select { width: 100%; border: 1px solid #cfd8d3; background: white; color: var(--ink); border-radius: 10px; min-height: 44px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,123,87,.12); }
#statement-year { max-width: 180px; }

.button { min-height: 44px; border: 0; border-radius: 11px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; transition: .18s ease; }
.button svg { width: 18px; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 8px 22px rgba(24,123,87,.22); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.button.secondary { color: var(--accent-dark); background: var(--accent-soft); }
.button.secondary:hover { background: #d7ede2; }
.button.ghost { color: #4f5b54; background: transparent; border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface-soft); }
.button.large { min-height: 52px; padding: 0 24px; }

.review-panel { padding: 34px; }
.panel-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.panel-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; margin: 8px 0 5px; }
.panel-heading p { color: var(--muted); margin: 0; }
.notice { padding: 13px 15px; border: 1px solid #e7dca9; background: #fff9df; color: #6e5d1d; border-radius: 11px; margin: 24px 0; font-size: .84rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.summary-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); display: grid; gap: 8px; }
.summary-grid span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.summary-grid strong { font-size: 1.12rem; }
.toolbar { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; position: relative; min-width: 240px; }
.search-box svg { position: absolute; left: 12px; width: 17px; color: #7f8a84; }
.search-box input { padding-left: 38px; }
.table-wrap { border: 1px solid var(--line); border-radius: 13px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { color: #6c7771; background: #f7f9f8; text-align: left; text-transform: uppercase; letter-spacing: .07em; font-size: .67rem; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 8px 12px; border-bottom: 1px solid #edf0ee; }
tr:last-child td { border-bottom: 0; }
tr.filtered-out { display: none; }
.amount-column { width: 170px; }
.cell-input { border: 1px solid transparent; border-radius: 7px; min-height: 38px; padding: 8px; background: transparent; }
.cell-input:hover { border-color: var(--line); background: white; }
.cell-input:focus { background: white; }
.amount-input { text-align: right; font-variant-numeric: tabular-nums; }
.delete-button { width: 34px; height: 34px; border: 0; background: transparent; color: #89918d; display: grid; place-items: center; border-radius: 8px; }
.delete-button:hover { color: var(--danger); background: #fff0f0; }
.delete-button svg { width: 17px; }
.empty-search { padding: 36px; text-align: center; color: var(--muted); }
.ofx-settings { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 28px; }
.settings-title h3 { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 500; }
.settings-title p { margin: 0; color: var(--muted); font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 19px; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0 28px 0; padding: 24px 0 24px 0; border-top: 1px solid var(--line);border-bottom: 1px solid var(--line); }
.export-row h3 { margin: 0 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.22rem; font-weight: 500; }
.export-row p { margin: 0; color: var(--muted); font-size: .82rem; }
/* .export-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; } */
/* .export-button { min-width: 150px; } */

.info-section { max-width: 1112px; margin: 0 auto 100px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.info-section article { border-top: 1px solid #cad4ce; padding-top: 20px; }
.info-section article > span { color: var(--accent); font-family: Georgia, serif; font-style: italic; }
.info-section h3 { margin: 15px 0 8px; font-family: Georgia, serif; font-weight: 500; font-size: 1.25rem; }
.info-section p { margin: 0; color: var(--muted); line-height: 1.6; font-size: .86rem; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 390px; background: var(--ink); color: white; padding: 13px 17px; border-radius: 11px; box-shadow: 0 16px 45px rgba(0,0,0,.24); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s ease; z-index: 30; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: #8e2929; }
.loading .button.primary span::after { content: "..."; animation: dots 1s infinite; }
@keyframes dots { 0% { content: "."; } 50% { content: ".."; } 100% { content: "..."; } }

@media (max-width: 850px) {
  .summary-grid, .form-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar, .export-row { align-items: stretch; flex-direction: column; }
  .export-actions { justify-content: stretch; }
  .export-actions .button { flex: 1; }
  .search-box { min-width: 0; }
  .info-section { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .privacy-pill { display: none; }
  .hero { padding-top: 54px; }
  .steps { gap: 6px; }
  .step { flex-direction: column; align-items: center; text-align: center; }
  .step div { display: none; }
  .upload-options { grid-template-columns: 1fr; }
  #statement-year { max-width: none; }
  .review-panel { padding: 22px 14px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .summary-grid, .form-grid { grid-template-columns: 1fr; }
  .button { width: 100%; }
}
