/* styles.css · pdf-2up-4up-booklet · 1000HW
 * Vanilla CSS · CSS Variables · BEM · NO Tailwind
 * Cache-bust: ?v=2
 */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface2: #111111;
  --surface3: #161616;
  --border: #222222;
  --border2: #333333;
  --text: #e0e0e0;
  --text-strong: #ffffff;
  --muted: #888888;
  --muted2: #aaaaaa;
  --accent: #ccff00;
  --accent-dim: rgba(204, 255, 0, 0.12);
  --accent-border: rgba(204, 255, 0, 0.4);
  --danger: #ff4444;
  --success: #44ff88;
  --warning: #ffaa00;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --transition: 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

img, svg { display: block; max-width: 100%; }

/* ─── Accessibility ──────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { left: 0; top: 0; }

button:focus { outline: none; }
button:focus-visible,
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(#111 1px, transparent 1px);
  background-size: 40px 40px;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #000; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Offline Banner ─────────────────────────────────────── */
.offline-banner {
  background: var(--accent-dim);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-family: var(--font-mono);
  display: none;
}
.offline-banner.show { display: block; }

/* ─── Nav ────────────────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.nav__back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color var(--transition);
}
.nav__back:hover { color: var(--accent); }
.nav__arrow { transition: transform var(--transition); }
.nav__back:hover .nav__arrow { transform: translateX(-3px); }
.nav__brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-strong);
}
.nav__brand span { color: var(--accent); }
.nav__lang {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.05em;
  min-width: 64px;
}
.nav__lang:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Main ───────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 32px 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.hero__tag {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-strong);
  margin-bottom: 16px;
  max-width: 800px;
}
.hero__lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.hero__disclaimer {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  line-height: 1.6;
  max-width: 720px;
}
.hero__ctas {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ─── Privacy inline ─────────────────────────────────────── */
.privacy-inline {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin: 14px 0 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Sections ───────────────────────────────────────────── */
.section {
  margin-bottom: 40px;
}
.section__title {
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.section__hint {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 8px;
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.card__title {
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ─── Dropzone ───────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border2);
  background: var(--surface2);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--surface3);
  outline: none;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.005);
}
.dropzone__icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}
.dropzone__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 6px;
}
.dropzone__hint {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Loaded file info */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  margin-top: 14px;
  flex-wrap: wrap;
}
.file-info__details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.file-info__icon {
  font-size: 24px;
  flex-shrink: 0;
}
.file-info__text { min-width: 0; }
.file-info__name {
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.file-info__meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ─── Mode selector (radio cards) ────────────────────────── */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.mode-card {
  display: block;
  position: relative;
  cursor: pointer;
}
.mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-card__inner {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  height: 100%;
}
.mode-card:hover .mode-card__inner {
  border-color: var(--border2);
  background: var(--surface3);
}
.mode-card input:checked + .mode-card__inner {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.mode-card input:focus-visible + .mode-card__inner {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mode-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-card__icon {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  padding: 3px;
  flex-shrink: 0;
}
.mode-card__icon span {
  background: var(--muted);
  border-radius: 1px;
}
.mode-card--booklet .mode-card__icon span {
  background: var(--accent);
}
.mode-card input:checked + .mode-card__inner .mode-card__icon span {
  background: var(--accent);
}
.mode-card__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Form fields ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"] {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius);
  transition: border-color var(--transition);
  width: 100%;
}
.form-group select:focus,
.form-group input:focus {
  border-color: var(--accent);
  outline: none;
}
.form-group select { cursor: pointer; }

/* ─── Margins group (4 inputs) ─────────────────────────── */
.margins-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.margins-grid .form-group input {
  text-align: center;
  font-family: var(--font-mono);
}

@media (max-width: 600px) {
  .margins-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: #d4ff33;
  color: var(--bg);
  border-color: #d4ff33;
}
.btn-secondary {
  background: var(--surface2);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: var(--bg);
}
.btn-full { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

/* ─── Preview ───────────────────────────────────────────── */
.preview-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 220px;
}
.preview-empty {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 40px 0;
}
.preview-sheet {
  background: #fafafa;
  border: 1px solid var(--border2);
  border-radius: 4px;
  margin: 0 auto 18px;
  position: relative;
  aspect-ratio: 1 / 1.414;
  max-width: 240px;
  overflow: hidden;
  display: grid;
  /* Default to 2x2 grid; overridden by mode-specific classes below */
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  box-shadow: var(--shadow);
}
/* Mode-specific grid templates. JS adds these classes based on selected mode.
 * Without this, 4 cells would stack into a single 1-column column because
 * display:grid defaults to 1 column when grid-template-columns is unset. */
.preview-sheet--cols-1-rows-2 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}
.preview-sheet--cols-2-rows-1 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.preview-sheet--cols-2-rows-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.preview-sheet--landscape {
  aspect-ratio: 1.414 / 1;
  max-width: 320px;
}
.preview-sheet--a3 {
  max-width: 280px;
}
.preview-sheet--a3.preview-sheet--landscape {
  max-width: 380px;
}
.preview-sheet--a5 {
  max-width: 180px;
}
.preview-sheet--a5.preview-sheet--landscape {
  max-width: 240px;
}
.preview-cell {
  background: #e8e8e8;
  border: 1px dashed #aaa;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #555;
  overflow: hidden;
}
.preview-cell__lines {
  position: absolute;
  inset: 12%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-cell__line {
  height: 2px;
  background: #999;
  border-radius: 1px;
}
.preview-cell__line:nth-child(3) { width: 75%; }
.preview-cell__line:nth-child(5) { width: 85%; }
.preview-cell__line:nth-child(7) { width: 60%; }
.preview-cell__label {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 9px;
  padding: 1px 4px;
  font-weight: 700;
  border-radius: 2px;
}
.preview-cell--blank {
  background: #d4d4d4;
  border-style: dotted;
}
.preview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.preview-summary__item {
  text-align: center;
}
.preview-summary__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  display: block;
  line-height: 1;
}
.preview-summary__label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 6px;
  display: block;
}

/* ─── Status / Progress ──────────────────────────────────── */
.status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  display: none;
  align-items: center;
  gap: 10px;
}
.status.show { display: flex; }
.status--info {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.status--success {
  background: rgba(68, 255, 136, 0.1);
  color: var(--success);
  border: 1px solid rgba(68, 255, 136, 0.4);
}
.status--error {
  background: rgba(255, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 68, 68, 0.4);
}
.status--processing {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.status__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .status__spinner { animation: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Honesty section ────────────────────────────────────── */
.long-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin: 48px 0 32px;
}
.long-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
}
.long-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.long-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  padding-left: 22px;
  position: relative;
}
.long-content li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.5;
}

/* ─── FAQ section ────────────────────────────────────────── */
.faq {
  margin: 48px 0 32px;
}
.faq__heading,
.howto__heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq__q {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background var(--transition);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::marker { content: ""; }
.faq__q:hover { background: var(--surface2); }
.faq__item[open] .faq__q {
  background: var(--surface2);
  color: var(--accent);
}
.faq__arrow {
  transition: transform var(--transition);
  color: var(--muted);
  flex-shrink: 0;
}
.faq__item[open] .faq__arrow { transform: rotate(90deg); color: var(--accent); }
.faq__a {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── HowTo section ──────────────────────────────────────── */
.howto {
  margin: 48px 0 32px;
}
.howto__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  counter-reset: howto;
}
.howto__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  counter-increment: howto;
}
.howto__item::before {
  content: counter(howto, decimal-leading-zero);
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  opacity: 0.3;
  line-height: 1;
}
.howto__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 8px;
  padding-right: 50px;
}
.howto__body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 16px 80px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}
.footer p { margin: 4px 0; }
.footer__disclaimer {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 8px;
}

/* ─── Donation Toast ─────────────────────────────────────── */
.donation-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.7s;
  pointer-events: none;
}
.donation-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.donation-toast__inner {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
}
.donation-toast__icon {
  color: var(--accent);
  flex-shrink: 0;
  display: none;
}
.donation-toast__text {
  flex: 1;
  min-width: 0;
}
.donation-toast__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 2px;
}
.donation-toast__sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.4;
}
.donation-toast__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--border2);
  flex-shrink: 0;
}
.btn-donate {
  background: var(--accent);
  color: var(--bg);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn-donate:hover { background: #d4ff33; }
.donation-toast__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.donation-toast__close:hover { color: var(--text); }

@media (min-width: 640px) {
  .donation-toast__icon { display: block; }
}

/* ─── Modal (alertdialog) ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 10px;
}
.modal__body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── Error specific styling ─────────────────────────────── */
.error-banner {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.4);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  margin: 12px 0;
  display: none;
}
.error-banner.show { display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .main { padding: 24px 16px 48px; }
  .hero { margin-bottom: 32px; padding-bottom: 24px; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .howto__list { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .dropzone { padding: 32px 16px; }
  .donation-toast { right: 8px; left: 8px; bottom: 8px; }
  .donation-toast__inner { max-width: none; }
}

/* ─── Reduced motion (WCAG 2.3.3) ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}