/* ═══════════════════════════════════════════════
   Bank Statement Converter — Main Stylesheet
   No frameworks. System fonts. Fast load.
═══════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #2563eb;
  --blue-dk:   #1d4ed8;
  --blue-lt:   #eff6ff;
  --green:     #16a34a;
  --green-lt:  #f0fdf4;
  --orange:    #ea580c;
  --orange-lt: #fff7ed;
  --red:       #dc2626;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-700:  #374151;
  --gray-900:  #111827;
  --upload-bg: #f1f5f9;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.14);
  --transition: .18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-900);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }

/* ── HEADER / NAV ── */
#header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  height: 60px;
}

.nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo span { letter-spacing: -.01em; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 500;
  transition: background var(--transition);
  text-decoration: none;
}
.nav-link:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-900); }

.btn-nav {
  padding: 7px 16px;
  background: var(--blue);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-left: 4px;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-nav:hover { background: var(--blue-dk); text-decoration: none; }

.nav-burger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-700);
  margin-left: auto;
  padding: 4px 8px;
}

/* ── LANGUAGE PICKER ── */
.lang-picker {
  position: relative;
  margin-left: 4px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--blue); background: var(--blue-lt); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
}

.lang-opt {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition);
}
.lang-opt:hover { background: var(--gray-50); }
.lang-opt.active { background: var(--blue-lt); color: var(--blue); font-weight: 600; }

/* ── HERO ── */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 0;
  text-align: center;
}

.hero-h1 {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--gray-900);
  margin-bottom: 14px;
}

.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ── UPLOAD BOX ── */
.upload-box {
  background: var(--upload-bg);
  border: 2px dashed var(--gray-200);
  border-radius: 16px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  margin-bottom: 32px;
  transition: border-color var(--transition), background var(--transition);
  cursor: default;
}

.upload-box.drag-over {
  border-color: var(--blue);
  background: var(--blue-lt);
}

.upload-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 100%;
}

.upload-icon { margin-bottom: 4px; }

.upload-main {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-700);
}

.upload-or {
  font-size: 13px;
  color: var(--gray-400);
  margin: -4px 0;
}

.upload-sub { font-size: 14px; color: var(--gray-500); }

.btn-upload {
  display: inline-block;
  padding: 12px 28px;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
  user-select: none;
  text-decoration: none;
}
.btn-upload:hover { background: var(--blue-dk); text-decoration: none; transform: translateY(-1px); color: #fff; }
.btn-upload:active { transform: translateY(0); }

.upload-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}
.upload-free-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 10px;
  line-height: 1.5;
}
.free-badge {
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid #bbf7d0;
  flex-shrink: 0;
}
.upload-free-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.upload-free-link:hover {
  text-decoration: underline;
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 42px;
  height: 42px;
  border: 3.5px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text  { font-size: 16px; font-weight: 600; color: var(--gray-700); }
.loading-file  { font-size: 13px; color: var(--gray-500); max-width: 340px; word-break: break-word; }

/* Progress bar */
.progress-wrap {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  width: 0%;
  transition: width .4s ease;
}

/* OCR note */
.loading-ocr-note {
  font-size: 12px;
  color: var(--orange);
  font-weight: 500;
  background: var(--orange-lt);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  max-width: 360px;
}

/* ── PASSWORD STATE ── */
.pass-form {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
}
.pass-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
}
.pass-input:focus { border-color: var(--blue); }

.btn-text {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
  padding: 4px;
}
.btn-text:hover { color: var(--gray-700); }

/* ── ERROR STATE ── */
#errorMsg { color: #b91c1c; }

/* ── RECENT FILES ── */
.recent-wrap {
  text-align: left;
  margin-bottom: 48px;
}

.recent-heading { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.recent-sub { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; }

.recent-list {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--gray-50); }

.recent-check { accent-color: var(--blue); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.recent-file-icon { font-size: 20px; flex-shrink: 0; }
.recent-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--gray-900); word-break: break-word; min-width: 0; }
.recent-meta { font-size: 12px; color: var(--gray-500); white-space: nowrap; flex-shrink: 0; }

.recent-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-convert {
  padding: 7px 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background var(--transition);
}
.btn-convert:hover { background: var(--blue-dk); }

.btn-inspect {
  padding: 7px 14px;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: border-color var(--transition), background var(--transition);
}
.btn-inspect:hover { border-color: var(--blue); background: var(--blue-lt); }

/* ── RESULT VIEW (fullscreen overlay) ── */
.result-view {
  position: fixed;
  inset: 0;
  background: var(--gray-50);
  z-index: 200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.result-topbar {
  position: sticky;
  top: 0;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  flex-wrap: wrap;
  z-index: 10;
}

.btn-back {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-back:hover { background: rgba(255,255,255,.1); }

.result-filename {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* Tool buttons (edit, report) — prominent actions in topbar */
.btn-tool {
  padding: 9px 18px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), transform .1s;
}
.btn-tool:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn-tool.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* Edit button — teal highlight */
.btn-tool-edit {
  background: rgba(20,184,166,.25);
  border-color: rgba(20,184,166,.6);
}
.btn-tool-edit:hover { background: rgba(20,184,166,.4); }
.btn-tool-edit.active { background: #0d9488; border-color: #0d9488; }

/* Report Problem button — red/orange highlight so it's very noticeable */
.btn-tool-report {
  background: rgba(239,68,68,.25);
  border-color: rgba(239,68,68,.55);
  font-size: 14px;
  font-weight: 700;
}
.btn-tool-report:hover { background: rgba(239,68,68,.4); }

/* ── BIG DOWNLOAD BAR ── */
.download-bar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.download-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  margin-right: 4px;
  white-space: nowrap;
}
.btn-dl-big {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
  min-width: 150px;
}
.btn-dl-big.excel  { background: #217346; color: #fff; }
.btn-dl-big.excel:hover  { background: #155e32; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(33,115,70,.3); }
.btn-dl-big.csv    { background: #d97706; color: #fff; }
.btn-dl-big.csv:hover    { background: #b45309; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(217,119,6,.3); }
.btn-dl-big.json   { background: #4f46e5; color: #fff; }
.btn-dl-big.json:hover   { background: #3730a3; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

/* .btn-download removed — replaced by .btn-dl-big */

/* Result body */
.result-body {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.result-table-wrap {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.result-table th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  user-select: none;
}

.result-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-900);
  vertical-align: middle;
}

.result-table tr:last-child td { border-bottom: none; }
.result-table tbody tr:hover td { background: var(--gray-50); }

/* Editable cells */
.result-table td[contenteditable="true"] {
  outline: none;
  cursor: text;
}
.result-table td[contenteditable="true"]:focus {
  background: #fefce8;
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
}

.td-date   { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.td-debit  { text-align: right; font-variant-numeric: tabular-nums; color: #b91c1c; white-space: nowrap; }
.td-credit { text-align: right; font-variant-numeric: tabular-nums; color: var(--green); white-space: nowrap; }
.td-bal    { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.td-desc   { min-width: 180px; max-width: 360px; color: var(--gray-700); }

.row-opening td, .row-closing td { font-style: italic; color: var(--gray-500); }

/* Edit hint banner */
.edit-hint {
  margin-top: 10px;
  padding: 8px 16px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #92400e;
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.modal-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.modal-card > p { font-size: 13.5px; color: var(--gray-500); margin-bottom: 20px; }

/* Feedback form fields */
.fb-field {
  margin-bottom: 12px;
}
.fb-field input, .fb-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
  background: #fff;
}
.fb-field input:focus, .fb-field textarea:focus { border-color: var(--blue); }
.fb-field textarea { resize: vertical; min-height: 90px; }

.feedback-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}
.feedback-textarea:focus { border-color: var(--blue); }

.fb-grant-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--gray-700);
  cursor: pointer;
  margin: 14px 0 18px;
}
.fb-grant-label input[type="checkbox"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.fb-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.fb-actions .btn-cancel {
  padding: 10px 22px;
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
}
.fb-actions .btn-cancel:hover { background: var(--gray-50); border-color: var(--gray-300); }
.fb-actions .btn-send {
  flex: 1;
  padding: 10px 22px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}
.fb-actions .btn-send:hover { background: var(--blue-dk); }
.fb-actions .btn-send:disabled { opacity: .6; cursor: not-allowed; }

/* ── SNACKBAR ── */
.snackbar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── DELETE BUTTON (recent files) ── */
.btn-delete-recent {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .18s;
}
.btn-delete-recent:hover { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }
.btn-delete-recent:disabled { opacity: .5; cursor: not-allowed; }
.btn-delete-recent .del-spinner {
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

/* ── LIMIT MODAL ── */
#limitModal .modal-card { text-align: center; }

/* ── TRUST SECTION ── */
.trust-section {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 56px 24px;
}

.trust-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}

.trust-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.trust-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trust-icon-wrap.green  { background: var(--green-lt); }
.trust-icon-wrap.blue   { background: var(--blue-lt); }
.trust-icon-wrap.orange { background: var(--orange-lt); }

.trust-card h3 { font-size: 16px; font-weight: 700; }
.trust-card p  { font-size: 14px; color: var(--gray-500); line-height: 1.6; max-width: 260px; }
.trust-card a  { color: var(--blue); }

/* ── HOW IT WORKS ── */
.how-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}

.how-section h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }

.steps-grid {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 40px;
  justify-content: center;
}

.step-card {
  flex: 1;
  max-width: 260px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  box-shadow: var(--shadow);
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.step-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.step-card p  { font-size: 13.5px; color: var(--gray-500); line-height: 1.6; }

.step-arrow {
  font-size: 24px;
  color: var(--gray-300);
  margin-top: 50px;
  flex-shrink: 0;
  align-self: flex-start;
}

/* ── OUTPUT FORMATS ── */
.formats-section {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 64px 24px;
  text-align: center;
}

.formats-section h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }

.output-formats-grid {
  max-width: 860px;
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
}

.output-fmt-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow var(--transition);
}
.output-fmt-card:hover { box-shadow: var(--shadow-md); }

.fmt-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.fmt-icon.excel { background: #dcfce7; color: #166534; }
.fmt-icon.csv   { background: #fef9c3; color: #854d0e; }
.fmt-icon.json  { background: #e0e7ff; color: #3730a3; }

.output-fmt-card strong { font-size: 15px; font-weight: 700; display: block; margin-bottom: 4px; }
.output-fmt-card p { font-size: 13px; color: var(--gray-500); line-height: 1.55; }

/* ── PRICING ── */
.pricing-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}

.pricing-section h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }

.section-sub {
  font-size: 15px;
  color: var(--gray-500);
  margin-bottom: 40px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: left;
  max-width: 700px;
  margin: 0 auto;
}

.price-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: box-shadow var(--transition);
}
.price-card:hover { box-shadow: var(--shadow-md); }

.price-card.featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.price-header h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.price-desc { font-size: 13px; color: var(--gray-500); }

.price-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.price-features li { font-size: 14px; color: var(--gray-700); display: flex; gap: 8px; align-items: baseline; }
.check { color: var(--green); font-weight: 700; flex-shrink: 0; }

.price-bottom { margin-top: auto; }
.price-amount { font-size: 30px; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; }

/* Need more bar */
.need-more-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 28px;
  margin-top: 28px;
  text-align: left;
}
.need-more-bar div { font-size: 14px; color: var(--gray-700); }
.need-more-bar strong { color: var(--gray-900); font-size: 15px; }

/* ── FAQ ── */
.faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
}
.faq-section h2 { font-size: 28px; font-weight: 800; margin-bottom: 10px; text-align: center; }
.faq-section .section-sub { text-align: center; }

.faq-list { margin-top: 32px; display: flex; flex-direction: column; gap: 2px; }

.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.faq-item summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--gray-900);
  user-select: none;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--gray-50); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { background: var(--gray-50); }

.faq-answer {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.7;
}
.faq-answer a { color: var(--blue); }

/* ── FOOTER ── */
.site-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,.7);
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }

.logo-footer { color: #fff; }
.logo-footer span { color: #fff; }

.footer-tagline { font-size: 13px; color: rgba(255,255,255,.5); line-height: 1.6; max-width: 240px; }
.footer-trust   { font-size: 12px; color: rgba(255,255,255,.35); line-height: 1.6; }

.footer-links-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.35); margin-bottom: 4px; }
.footer-col a  { font-size: 13px; color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  max-width: 1100px;
  margin: 24px auto 0;
  font-size: 12px;
  color: rgba(255,255,255,.3);
}

/* ── BUTTONS (shared) ── */
.btn-primary {
  display: inline-block;
  padding: 11px 22px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--blue-dk); text-decoration: none; color: #fff; }

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.btn-secondary:hover { border-color: var(--blue); background: var(--blue-lt); text-decoration: none; }

.full-width { display: block; width: 100%; }

/* ── AUTH (login page) ── */
.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 28px; }
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.auth-tab:hover  { color: var(--gray-700); }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.btn-google:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--gray-400);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--gray-900);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.form-error { color: #b91c1c; font-size: 13px; margin-bottom: 10px; }

.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background var(--transition);
}
.auth-submit:hover { background: var(--blue-dk); }
.auth-submit:disabled { opacity: .65; cursor: not-allowed; }

.auth-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 20px;
}

/* ── CONTACT / API / STATIC PAGES ── */
.page-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  text-align: center;
}
.page-hero h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.page-hero p  { font-size: 16px; color: var(--gray-500); }

.page-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.contact-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
}
.contact-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.contact-card p  { font-size: 14px; color: var(--gray-500); line-height: 1.6; }
.contact-card a  { color: var(--blue); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; display: block; }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
  transition: border-color var(--transition);
  background: #fff;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.contact-form textarea { min-height: 120px; resize: vertical; }

/* API docs */
.api-section { margin-bottom: 48px; }
.api-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-200); }
.api-section h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.api-section p, .api-section li { font-size: 14px; color: var(--gray-700); line-height: 1.7; }
.api-section ul { margin-left: 20px; }

.endpoint-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 14px;
  margin-bottom: 12px;
  overflow-x: auto;
  width: 100%;
}
.method { background: var(--blue); padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.method.post { background: #16a34a; }

.code-block {
  background: var(--gray-900);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 12px 0;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 12px 0;
}
.param-table th {
  background: var(--gray-50);
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.param-table td {
  padding: 9px 14px;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  vertical-align: top;
}
.param-table code {
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: var(--blue);
}

/* ── ADMIN PAGE ── */
.admin-body {
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
}

.admin-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 { font-size: 15px; font-weight: 700; color: #f1f5f9; font-family: inherit; }
.admin-badge { background: #dc2626; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700; letter-spacing: .06em; }

.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px 20px;
}
.admin-stat-card .label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.admin-stat-card .value { font-size: 24px; font-weight: 700; color: #f1f5f9; }

.admin-table-wrap {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: #0f172a;
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  border-bottom: 1px solid #334155;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.025); }

.admin-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
}
.admin-btn.run    { background: #1d4ed8; color: #fff; }
.admin-btn.run:hover    { background: #2563eb; }
.admin-btn.dl     { background: #374151; color: #e2e8f0; }
.admin-btn.dl:hover     { background: #4b5563; }
.admin-btn.delete { background: #7f1d1d; color: #fca5a5; }
.admin-btn.delete:hover { background: #991b1b; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.status-badge.ok   { background: #14532d; color: #86efac; }
.status-badge.fail { background: #7f1d1d; color: #fca5a5; }
.status-badge.ocr  { background: #1e3a5f; color: #93c5fd; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .trust-grid         { grid-template-columns: 1fr; max-width: 400px; }
  .pricing-grid       { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .output-formats-grid { grid-template-columns: 1fr; max-width: 480px; margin: 36px auto 0; }
  .footer-inner       { grid-template-columns: 1fr; }
  .footer-links-group { grid-template-columns: repeat(3, 1fr); }
  .steps-grid         { flex-direction: column; align-items: center; }
  .step-arrow         { transform: rotate(90deg); margin: 0; }
  .contact-grid       { grid-template-columns: 1fr; }
  .admin-stats        { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links  { display: none; }
  .nav-burger { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px;
    gap: 4px;
    z-index: 199;
    box-shadow: var(--shadow-md);
  }

  .hero { padding-top: 36px; }
  .upload-box { padding: 28px 20px; min-height: 220px; }
  .upload-main { font-size: 16px; }
  .btn-upload { font-size: 15px; padding: 11px 22px; }

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

  .result-topbar { gap: 8px; padding: 10px 16px; }
  .result-actions { width: 100%; gap: 6px; }
  .btn-download { flex: 1; text-align: center; padding: 7px 8px; }

  .recent-item { flex-wrap: wrap; }
  .recent-btns { width: 100%; justify-content: flex-end; }

  .need-more-bar { flex-direction: column; text-align: center; }

  .admin-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .pass-form { flex-direction: column; }
  .admin-stats { grid-template-columns: 1fr; }
}

/* ── UTILITY ── */
[hidden] { display: none !important; }
.visually-hidden { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
