/* ============================================================
   CopyPaste Any PDF — style.css
   Scandinavian minimal design: clean, functional, generous space
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --bg:          #F9F9F7;
  --surface:     #FFFFFF;
  --border:      #E4E4E0;
  --border-hover:#C8C8C2;
  --text:        #18181B;
  --text-muted:  #71717A;
  --text-light:  #A1A1AA;
  --accent:      #2563EB;
  --accent-hover:#1D4ED8;
  --accent-light:#EFF6FF;
  --success:     #059669;
  --success-bg:  #ECFDF5;
  --error:       #DC2626;
  --error-bg:    #FEF2F2;
  --warn-bg:     #FFFBEB;
  --warn:        #D97706;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.04), 0 1px 6px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 20px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   6px;
  --transition:  150ms ease;
  --max-w:       760px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-muted { color: var(--text-muted); }
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

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

.logo-mark { flex-shrink: 0; }

.logo-text {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-text strong {
  font-weight: 600;
}

.btn-support {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #29ABE0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.btn-support:hover { background: #22A0D5; }

.header-nav { display: flex; align-items: center; gap: 8px; }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); border-color: var(--border-hover); text-decoration: none; }

@media (max-width: 640px) {
  .nav-link { display: none; }
  .logo-text { font-size: 14px; }
}

/* ── Main ────────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 64px 0 80px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Dropzone ─────────────────────────────────────────────── */
.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  position: relative;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.005);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.drop-icon {
  margin-bottom: 6px;
}

.drop-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}

.drop-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.file-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  pointer-events: all;
  text-decoration: none;
}

.file-link:hover { text-decoration: underline; }

.drop-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}
.drop-offline {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}

/* ── Error Message ─────────────────────────────────────────── */
.error-message {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ── How It Works ─────────────────────────────────────────── */
.how-it-works {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.step-arrow {
  color: var(--border-hover);
  font-size: 18px;
  line-height: 1;
}

/* ── Privacy Note ─────────────────────────────────────────── */
/* ── Trust Badges ────────────────────────────────────────── */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.trust-badge {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.trust-badge:last-child {
  border-right: none;
}

.trust-badge svg {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-bottom: 2px;
}

.trust-badge strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.trust-badge span {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.3;
}

@media (max-width: 600px) {
  .trust-badges {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }
  .trust-badge {
    flex-direction: row;
    text-align: left;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .trust-badge:last-child { border-bottom: none; }
  .trust-badge svg { margin-bottom: 0; }
  .trust-badge > div { display: flex; flex-direction: column; gap: 2px; }
}

/* ── OCR Language Selector ───────────────────────────────── */
.ocr-lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.ocr-lang-row svg {
  color: var(--text-light);
  flex-shrink: 0;
}

.ocr-lang-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: default;
}

.ocr-lang-select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.ocr-lang-select:focus {
  border-color: var(--accent);
}

.ocr-lang-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-left: auto;
}

@media (max-width: 600px) {
  .ocr-lang-hint { display: none; }
  .ocr-lang-row  { gap: 10px; }
}

/* ── OCR Result Badge ────────────────────────────────────── */
.ocr-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: #EFF6FF;
  color: var(--accent);
  border: 1px solid #BFDBFE;
  width: fit-content;
  margin-bottom: 4px;
}

.ocr-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── OCR Region Select ───────────────────────────────────── */

/* Crosshair cursor + blocked text-selection while drawing */
.viewer-container.ocr-region-mode .pdf-page-wrapper {
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.viewer-container.ocr-region-mode .textLayer {
  pointer-events: none; /* don't intercept drag while in region mode */
}

/* Dashed selection rectangle drawn over the canvas */
.ocr-selection-rect {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 2px;
  pointer-events: none;
  z-index: 10;
  width: 0;
  height: 0;
}

.ocr-selection-rect.processing {
  border-color: var(--accent);
  animation: ocr-rect-pulse 1s ease-in-out infinite;
}

@keyframes ocr-rect-pulse {
  0%, 100% { background: rgba(37, 99, 235, 0.08); }
  50%       { background: rgba(37, 99, 235, 0.22); }
}

/* Spinner shown inside the rect while OCR is running */
.ocr-region-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Hide spinner when rect is too small to show it */
.ocr-selection-rect:not(.processing) .ocr-region-spinner {
  display: none;
}

/* Hint bar below viewer */
.ocr-region-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.ocr-region-hint svg { flex-shrink: 0; }

.ocr-region-cancel {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition);
}
.ocr-region-cancel:hover { text-decoration-color: currentColor; }

.ocr-region-lang-label {
  font-size: 13px;
  color: var(--text-muted);
}

.ocr-region-lang-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.ocr-region-lang-select:hover { border-color: var(--border-hover); }
.ocr-region-lang-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Active state for the toggle button */
.btn.active,
.btn-outline.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── OCR Result Panel ────────────────────────────────────── */
.ocr-result-panel {
  position: fixed;
  z-index: 250;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ocr-result-panel.hidden { display: none !important; }

.ocr-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.ocr-result-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ocr-result-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ocr-result-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--text);
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.ocr-result-copy:hover { background: #333; }

.ocr-result-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.ocr-result-close:hover { background: var(--border); color: var(--text); }

.ocr-result-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 280px;
  padding: 12px 14px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
}

/* ── Processing Card ─────────────────────────────────────── */
.processing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.processing-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.processing-card p {
  font-size: 14px;
  margin-bottom: 28px;
}

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress bar */
.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  max-width: 280px;
  margin: 0 auto;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 250ms ease;
}

/* ── Result Header ───────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #A7F3D0;
  width: fit-content;
  margin-bottom: 4px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #FDE68A;
}

.result-filename {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  word-break: break-all;
}

.result-info {
  font-size: 13px;
}

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

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.btn-primary:hover {
  background: #333;
  border-color: #333;
}

.btn-outline {
  background: white;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

/* ── PDF Viewer ──────────────────────────────────────────── */
.viewer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  width: 100%;
  overflow-x: auto;
}

.pdf-page-wrapper {
  position: relative;
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  overflow: hidden;
  user-select: text;
  max-width: 100%;
}

.pdf-page-wrapper canvas {
  display: block;
  /* No CSS scaling — scale is computed precisely in JS so canvas
     and text-layer always share the same pixel dimensions. */
}

.pdf-page-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  min-width: 400px;
  background: #F4F4F2;
  color: var(--text-light);
  font-size: 13px;
}

/* ── PDF Text Layer ──────────────────────────────────────── */
.textLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* do NOT clip — spans must not be cut off */
  line-height: 1;
  z-index: 2;
  user-select: text;
  -webkit-user-select: text;
}

.textLayer > span,
.textLayer > div {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  user-select: text;
  -webkit-user-select: text;
}

.textLayer ::selection {
  background: rgba(37, 99, 235, 0.25);
  color: transparent;
}

.textLayer ::-moz-selection {
  background: rgba(37, 99, 235, 0.25);
  color: transparent;
}

/* ── Donation Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 200ms ease;
}

.modal-overlay.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: slideUp 250ms ease;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Modal header (tabs + close in one row) ─────────────── */
.modal-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  padding-right: 6px;
}
.modal-tabs {
  display: flex;
  flex: 1;
}
.modal-tab {
  flex: 1;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.modal-tab:hover  { color: var(--text); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-eth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #627EEA 0%, #9B73F8 100%);
  color: #fff;
  font-size: 11px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
  top: -1px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 36px 32px 28px;
  text-align: center;
}

.modal-coffee {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

.modal-body h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.modal-body > .text-muted {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ─── Report Bug Modal ───────────────────────────────────────── */
.report-modal { max-width: 540px; }
.report-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid #F1F1F4;
}
.report-modal-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.report-modal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: #EEF2FF; color: #4F46E5; font-size: 16px;
  flex-shrink: 0;
}
.report-modal-title {
  margin: 0; font-size: 15px; font-weight: 600; color: #18181B;
  letter-spacing: -.01em; line-height: 1.3;
}
.report-modal-body { padding: 18px 20px 20px; }
.report-modal-desc {
  margin: 0 0 14px; font-size: 13px; color: #52525B; line-height: 1.55;
}
.report-modal-desc strong { color: #18181B; font-weight: 600; }
.report-textarea {
  width: 100%; box-sizing: border-box;
  min-height: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55;
  color: #18181B; background: #FAFAFA;
  border: 1px solid #E4E4E7; border-radius: 10px;
  padding: 12px 14px; resize: vertical; outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.report-textarea:focus {
  border-color: #4F46E5; background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.report-modal-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; flex-wrap: wrap;
}
.report-modal-actions .btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.report-modal-actions .btn:active { transform: translateY(1px); }
.report-modal-actions .btn-primary {
  background: #18181B; color: #fff; border-color: #18181B;
}
.report-modal-actions .btn-primary:hover { background: #27272A; border-color: #27272A; }
.report-modal-actions .btn-secondary {
  background: #fff; color: #18181B; border-color: #E4E4E7;
}
.report-modal-actions .btn-secondary:hover { background: #F4F4F5; border-color: #D4D4D8; }
.report-copied {
  margin-left: auto;
  font-size: 12px; color: #059669; font-weight: 500;
  opacity: 0; transform: translateY(2px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.report-copied.is-visible { opacity: 1; transform: translateY(0); }
@media (max-width: 520px) {
  .report-modal { max-width: 100%; }
  .report-copied { margin-left: 0; flex-basis: 100%; }
}

/* Donation amount grid */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.amount-btn {
  padding: 10px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.amount-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.amount-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.custom-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  margin-bottom: 16px;
  transition: border-color var(--transition);
  outline: none;
}

.custom-input:focus {
  border-color: var(--accent);
}

.custom-input.hidden { display: none !important; }

/* Ko-fi button */
.btn-kofi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #29ABE0;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  margin-top: 8px;
  margin-bottom: 12px;
}

.btn-kofi:hover {
  background: #22A0D5;
  transform: translateY(-1px);
}

.btn-kofi:active {
  transform: translateY(0);
}

.modal-desc {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.modal-note {
  font-size: 12px;
  opacity: 0.8;
}

/* ─── Crypto panel ────────────────────────────────────────── */
.crypto-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0 14px;
  text-align: left;
}
.crypto-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #627EEA 0%, #9B73F8 100%);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crypto-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.crypto-addr {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}
.btn-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  font-family: inherit;
}
.btn-copy:hover  { background: var(--bg); }
.btn-copy.copied { color: #059669; border-color: #6EE7B7; background: #ECFDF5; }
.crypto-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 4px auto 10px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  image-rendering: crisp-edges;
}
.crypto-note { margin-top: 4px; }

/* ─── Supported networks collapsible ─────────────────────── */
.crypto-networks {
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.crypto-networks summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
  user-select: none;
  transition: background var(--transition), border-color var(--transition);
}
.crypto-networks summary:hover {
  border-color: var(--text-muted);
}
.crypto-networks summary::before {
  content: '▶';
  font-size: 8px;
  color: var(--text-muted);
  transition: transform .15s;
}
.crypto-networks[open] summary::before { transform: rotate(90deg); }
.crypto-networks ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.crypto-networks ul li {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--text);
}
.crypto-networks ul li img {
  flex-shrink: 0;
  border-radius: 50%;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: white;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  z-index: 300;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 56px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.footer-copy {
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.report-bug-link {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: #F9FAFB;
  color: #18181B;
  text-decoration: none;
  font-weight: 500;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.report-bug-link:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.footer-version {
  margin: 0;
  font-size: 10px;
  text-align: center;
  color: #D1D5DB;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.footer-support-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
  text-decoration: underline;
  text-decoration-color: transparent;
}

.footer-support-link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.footer-link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-section {
  border-top: 1px solid var(--border);
  padding: 56px 0 48px;
}

.faq-section .container {
  max-width: 680px;
}

.faq-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.faq-label {
  display: inline-block;
  margin-bottom: 0;
}

.faq-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563EB;
  background: #EFF6FF;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.faq-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  list-style: none;
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-item[open] .faq-question {
  color: #2563EB;
}

.faq-item[open] .faq-chevron {
  color: #2563EB;
}

.faq-answer {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 20px;
  padding: 0 32px 0 1px;
  border-left: 2px solid #E5E7EB;
  padding-left: 14px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 40px 0 60px; }

  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 15px; }

  .dropzone { padding: 40px 20px; }

  .how-it-works {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 0 4px;
  }

  .step-arrow { display: none; }

  .result-header { flex-direction: column; }

  .result-actions { width: 100%; }

  .btn { width: 100%; justify-content: center; }

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

  .modal-body { padding: 28px 20px 24px; }

  .footer-copy { white-space: normal; }
}

@media (max-width: 400px) {
  .container { padding: 0 16px; }
}
