@font-face {
  font-family: 'MICR';
  src: url('../fonts/micr-encoding.ttf') format('truetype');
}

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

:root {
  --brand: #10b981;
  --brand2: #0ea5e9;
  --brand-dark: #059669;
  --ink: #0f172a;
  --ink2: #334155;
  --ink3: #64748b;
  --ink4: #94a3b8;
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --bg3: #e2e8f0;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border2: rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 20px rgba(2, 6, 23, 0.06);
  --shadow-lg: 0 12px 40px rgba(2, 6, 23, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink2: #cbd5e1;
  --ink3: #94a3b8;
  --ink4: #64748b;
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --card: #1e293b;
  --border: rgba(148, 163, 184, 0.15);
  --border2: rgba(148, 163, 184, 0.08);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.3);
}

html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header - matches site */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
[data-theme="dark"] .header {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
}
.logo-text {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.logo-sub {
  font-size: 11px;
  color: var(--ink3);
  font-weight: 500;
  margin-top: -2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 8px 14px;
  color: var(--ink3);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav a:hover {
  color: var(--ink);
  background: var(--bg2);
}
.nav-cta {
  background: var(--ink) !important;
  color: white !important;
  margin-left: 8px;
}
[data-theme="dark"] .nav-cta {
  background: var(--brand) !important;
}
.nav-cta:hover { opacity: 0.9; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { background: var(--bg2); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--ink3);
}
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 500;
}
[data-theme="dark"] .trust-badge { color: var(--brand); }
.trust-badge svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
  .nav { display: none; }
  .trust-badge span { display: none; }
}

/* Main Content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.page-title {
  text-align: center;
  margin-bottom: 32px;
}
.page-title h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-title h1 span {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-title p {
  margin-top: 8px;
  color: var(--ink3);
  font-size: 15px;
}

/* Generator Layout */
.generator {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .generator { grid-template-columns: 1fr; }
}

/* Panel */
.panel {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-weight: 700;
  font-size: 15px;
}
.panel-badge {
  font-size: 11px;
  color: var(--ink4);
  font-weight: 500;
}
.panel-body { padding: 20px; }

/* Form Styles */
.form-section { margin-bottom: 24px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink4);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-grid { display: grid; gap: 12px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.2s;
}
.form-group input::placeholder { color: var(--ink4); }
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.form-group input.valid { border-color: var(--brand); }
.form-group input.error { border-color: #ef4444; }
.hint { font-size: 11px; color: var(--ink4); }
.hint.valid { color: var(--brand); }
.hint.error { color: #ef4444; }

/* Print Mode Toggle */
.print-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.print-mode-btn {
  padding: 14px 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.print-mode-btn:hover { border-color: var(--ink4); }
.print-mode-btn.active {
  border-color: var(--brand);
  background: rgba(16, 185, 129, 0.06);
}
.mode-icon { font-size: 20px; margin-bottom: 4px; }
.mode-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.mode-desc { font-size: 11px; color: var(--ink4); margin-top: 2px; }

/* Style Picker */
.styles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.style-opt {
  position: relative;
  padding: 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.style-opt:hover { border-color: var(--ink4); }
.style-opt.active {
  border-color: var(--brand);
  background: rgba(16, 185, 129, 0.06);
}
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-prev { height: 20px; border-radius: 4px; margin-bottom: 4px; }
.style-prev.green { background: linear-gradient(135deg, #c8e6c9, #e8f5e9); }
.style-prev.blue { background: linear-gradient(135deg, #bbdefb, #e3f2fd); }
.style-prev.tan { background: linear-gradient(135deg, #ffe0b2, #fff8e1); }
.style-prev.safety { background: repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 3px, #e8e8e8 3px, #e8e8e8 6px); }
.style-name { font-size: 10px; font-weight: 600; color: var(--ink3); text-align: center; }

/* Checkbox & Slider */
.cb-group { display: flex; flex-direction: column; gap: 8px; }
.cb-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink2);
}
.cb-label:hover { color: var(--ink); }
.cb-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.slider { display: flex; flex-direction: column; gap: 6px; }
.slider-head { display: flex; justify-content: space-between; align-items: center; }
.slider-val {
  font-family: monospace;
  font-size: 11px;
  color: var(--brand);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
}

/* Validation Badge */
.valid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}
.valid-badge svg { width: 12px; height: 12px; }
.valid-badge.pending { background: var(--bg2); color: var(--ink3); }
.valid-badge.ok { background: rgba(16, 185, 129, 0.1); color: var(--brand-dark); }
[data-theme="dark"] .valid-badge.ok { color: var(--brand); }
.valid-badge.err { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* Preview Panel */
.preview { }
.preview-header { display: flex; align-items: center; justify-content: space-between; }
.preview-meta { display: flex; align-items: center; gap: 12px; }
.preview-dims { font-size: 11px; color: var(--ink4); font-family: monospace; }
.preview-wrap {
  padding: 24px;
  background: var(--bg2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* Check Styles */
.check {
  position: relative;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  overflow: visible;
  font-family: 'Times New Roman', Georgia, serif;
  color: #1a1a2e;
  background: white;
}
.check.personal { width: 576px; height: 264px; }
.check.business { width: 792px; height: 336px; }

/* Business check styling overrides to match PDF template */
.check.business .check-top { top: 26px; left: 24px; right: 24px; }
.check.business .bank-name { font-size: 16px; }
.check.business .bank-addr { font-size: 11px; }
.check.business .check-num { font-size: 14px; }
.check.business .check-frac { font-size: 9px; }
.check.business .holder-name { font-size: 15px; }
.check.business .holder-biz { font-size: 16px; }
.check.business .holder-attn { font-size: 12px; }
.check.business .holder-addr { font-size: 11px; }
.check.business .check-date { top: 80px; right: 24px; }
.check.business .check-date-label { font-size: 9px; }
.check.business .check-date-line { width: 120px; }
.check.business .check-pay { top: calc(50% - 30px); left: 24px; right: 24px; }
.check.business .check-pay-label { font-size: 8px; }
.check.business .check-amount-box { width: 100px; height: 28px; font-size: 14px; }
.check.business .check-written { left: 24px; right: 24px; }
.check.business .check-written-label { font-size: 9px; }
.check.business .check-bank { top: calc(50% + 20px); left: 24px; }
.check.business .check-bottom { bottom: 40px; left: 24px; right: 24px; }
.check.business .check-memo-label { font-size: 8px; }
.check.business .check-memo-line { width: 180px; }
.check.business .check-sig-label { font-size: 7px; }
.check.business .check-sig-line { width: 200px; }
.check.business .check-micr { bottom: 18px; left: 24px; font-size: 14px; }
.check.business .check-microprint { bottom: 45px; }

.check-bg {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
}
.check-gradient { position: absolute; inset: 0; }
.check-pattern { position: absolute; inset: 0; }
.check-security-border {
  position: absolute;
  inset: 4px;
  border: 1px solid;
  border-radius: 4px;
  opacity: 0.15;
  pointer-events: none;
}
.check-linen {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h1v1H0zM2 2h1v1H2z' fill='%23000' fill-opacity='0.02'/%3E%3C/svg%3E");
}
.check-wave-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  opacity: 0.08;
  pointer-events: none;
}
.check-wave-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  opacity: 0.06;
  pointer-events: none;
}
.check-corner-tl, .check-corner-br {
  position: absolute;
  width: 50px;
  height: 50px;
  opacity: 0.1;
  pointer-events: none;
}
.check-corner-tl { top: 6px; left: 6px; }
.check-corner-br { bottom: 6px; right: 6px; transform: rotate(180deg); }
.check-border {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  pointer-events: none;
}

.check-content {
  position: relative;
  height: 100%;
}

/* Top section - account holder + check number */
.check-top {
  position: absolute;
  top: 22px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.check-holder { margin-top: 0; }
.check-num { font-size: 11px; font-weight: 700; color: #333; }
.check-frac { font-size: 8px; color: #666; text-align: right; margin-top: 1px; font-family: monospace; }
.holder-name { font-size: 12px; font-weight: 700; }
.holder-biz { font-size: 13px; font-weight: 800; }
.holder-attn { font-size: 10px; color: #555; }
.holder-addr { font-size: 9px; color: #666; line-height: 1.4; margin-top: 3px; }

/* Date - absolute positioned */
.check-date { position: absolute; top: 58px; right: 16px; display: flex; align-items: baseline; gap: 8px; }
.check-date-label { font-size: 8px; color: #666; text-transform: uppercase; }
.check-date-line { width: 80px; border-bottom: 1px solid #333; }

/* Pay line - above center */
.check-pay {
  position: absolute;
  top: calc(50% - 24px);
  left: 16px;
  right: 16px;
  transform: translateY(-100%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.check-pay-label { font-size: 7px; color: #666; line-height: 1.2; flex-shrink: 0; text-transform: uppercase; white-space: nowrap; }
.check-pay-line { flex: 1; border-bottom: 1px solid #333; }
.check-amount-box {
  width: 70px;
  height: 22px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
}

/* Written/Dollars line - CENTERED VERTICALLY */
.check-written {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.check-written-line { flex: 1; border-bottom: 1px solid #333; }
.check-written-label { font-size: 8px; color: #666; text-transform: uppercase; }

/* Bank info - below dollars line */
.check-bank {
  position: absolute;
  top: calc(50% + 16px);
  left: 16px;
}
.bank-name { font-size: 13px; font-weight: 800; }
.bank-addr { font-size: 9px; color: #666; margin-top: 1px; }


.check-bottom {
  position: absolute;
  bottom: 56px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.check-memo { display: flex; align-items: baseline; gap: 8px; flex: 1; }
.check-memo-label { font-size: 7px; color: #666; text-transform: uppercase; }
.check-memo-line { flex: 1; max-width: 120px; border-bottom: 1px solid #333; }
.check-sig { display: flex; flex-direction: column; align-items: flex-end; }
.check-sig-label { font-size: 6px; color: #666; text-transform: uppercase; }
.check-sig-line { width: 140px; border-bottom: 1px solid #333; margin-bottom: 3px; }

.check-micr {
  position: absolute;
  bottom: 30px;
  left: 16px;
  font-family: 'MICR', monospace;
  font-size: 16px;
  letter-spacing: 2px;
  color: #333;
}

.check-microprint {
  position: absolute;
  bottom: 30px;
  left: 10px;
  right: 10px;
  height: 5px;
  overflow: hidden;
  opacity: 0.35;
}
.check-microprint span {
  font-size: 3px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  color: #333;
  font-family: Arial, sans-serif;
}

/* VOID Overlay */
.void-wrap {
  position: absolute;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.void-wrap:active { cursor: grabbing; }
.void-text {
  font-family: Arial, sans-serif;
  font-weight: 900;
  color: #c41e3a;
  letter-spacing: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  user-select: none;
}
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid var(--brand);
  border-radius: 50%;
  cursor: nwse-resize;
}
.resize-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* ACH Stamp */
.ach-stamp {
  position: absolute;
  padding: 5px 8px;
  border: 2px solid #c41e3a;
  border-radius: 3px;
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: #c41e3a;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.85);
  cursor: grab;
  z-index: 10;
}
.ach-stamp:active { cursor: grabbing; }

/* Actions */
.actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg2); }

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--ink4);
  font-size: 13px;
  border-top: 1px solid var(--border2);
  margin-top: 40px;
}
.footer a {
  color: var(--ink3);
  text-decoration: none;
  margin: 0 8px;
}
.footer a:hover { color: var(--ink); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 16px; height: 16px; color: var(--brand); }

/* Interstitial Ad Modal */
.ad-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ad-overlay.show { display: flex; }
.ad-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: modalIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.ad-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ad-header span { font-size: 13px; color: var(--ink2); }
.ad-timer { font-family: monospace; font-weight: 700; color: var(--brand); }
.ad-content {
  padding: 28px 20px;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-placeholder {
  width: 300px;
  height: 250px;
  background: var(--bg2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink4);
  font-size: 13px;
  border: 2px dashed var(--border);
}
.ad-note { margin-top: 14px; font-size: 12px; color: var(--ink4); }
.ad-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border2);
  display: flex;
  justify-content: center;
}
.ad-skip {
  padding: 10px 28px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ad-skip:disabled { background: var(--ink4); cursor: not-allowed; }
.ad-skip:not(:disabled):hover { filter: brightness(1.1); }

/* Responsive */
@media (max-width: 768px) {
  .check { transform: scale(0.52); transform-origin: top left; }
  .preview-wrap { min-height: 160px; justify-content: flex-start; padding-left: 10px; }
  .form-row { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  body { background: #fff !important; }
  .header, .panel:first-child, .preview-meta, .actions, .resize-handle, .footer, .ad-overlay, .instructions-panel { display: none !important; }
  main { padding: 0.5in; max-width: none; }
  .generator { display: block; }
  .preview-column { position: static; }
  .panel { background: none !important; border: none !important; box-shadow: none !important; }
  .preview-wrap { padding: 0; background: none !important; min-height: auto; }
  .check { box-shadow: none !important; margin: 0 auto; }
  @page { size: letter; margin: 0.5in; }
}

/* Preview Column Container */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
  align-self: start;
}

/* Print Instructions */
.instructions-panel {
}
.instructions-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}
.instructions-content ol {
  margin: 0 0 16px 0;
  padding-left: 20px;
}
.instructions-content li {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.5;
}
.instructions-content li strong {
  color: var(--ink);
}
.instructions-note {
  font-size: 13px;
  color: var(--ink3);
  background: var(--bg2);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--brand);
  margin: 0;
}
.instructions-content .affiliate-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.instructions-content .affiliate-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* Funnel - Email Capture Card */
.funnel-email-panel {
  background: linear-gradient(135deg, rgba(16,185,129,0.05), rgba(14,165,233,0.05));
  border: 1px solid rgba(16,185,129,0.15);
}
.funnel-email-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.funnel-email-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.funnel-email-text h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--ink);
}
.funnel-email-text p {
  font-size: 13px;
  color: var(--ink3);
  margin: 0;
}
.funnel-email-form {
  display: flex;
  gap: 8px;
}
.funnel-email-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
}
.funnel-email-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.funnel-email-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.funnel-email-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.funnel-email-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.funnel-email-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

/* Funnel - Post-Download CTA Modal */
.funnel-cta-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.funnel-cta-overlay.active {
  opacity: 1;
  visibility: visible;
}
.funnel-cta-modal {
  background: var(--card);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s;
}
.funnel-cta-overlay.active .funnel-cta-modal {
  transform: scale(1) translateY(0);
}
.funnel-cta-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--bg2);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.funnel-cta-close:hover {
  background: var(--bg3);
  color: var(--ink);
}
.funnel-cta-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(14,165,233,0.1));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--brand);
}
.funnel-cta-modal h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
}
.funnel-cta-modal p {
  font-size: 15px;
  color: var(--ink2);
  margin: 0 0 24px;
  line-height: 1.5;
}
.funnel-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
}
.funnel-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.funnel-cta-dismiss {
  display: block;
  margin: 16px auto 0;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--ink4);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.funnel-cta-dismiss:hover {
  color: var(--ink2);
}

/* Download Modal (Email Capture + Ads) */
.download-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.download-overlay.show { display: flex; }

.download-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: modalIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Ad Section (when ads enabled) */
.download-ad-section {
  border-bottom: 1px solid var(--border2);
}
.download-ad-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.download-ad-header span {
  font-size: 13px;
  color: var(--ink2);
}
.download-ad-timer {
  font-family: monospace;
  font-weight: 700;
  color: var(--brand);
}
.download-ad-content {
  padding: 24px 20px;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.download-ad-placeholder {
  width: 300px;
  height: 250px;
  background: var(--bg2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink4);
  font-size: 13px;
  border: 2px dashed var(--border);
}
.download-ad-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink4);
}

/* Email Section (always shown) */
.download-email-section {
  padding: 24px 20px;
}
.download-email-header {
  text-align: center;
  margin-bottom: 20px;
}
.download-email-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px 0;
}
.download-email-header p {
  font-size: 14px;
  color: var(--ink3);
  margin: 0;
}
.download-email-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.download-email-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: all 0.2s;
}
.download-email-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.download-email-input::placeholder {
  color: var(--ink4);
}
.download-email-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Terms Checkbox */
.download-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.4;
}
.download-terms-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.download-terms-label a {
  color: var(--brand);
  text-decoration: none;
}
.download-terms-label a:hover {
  text-decoration: underline;
}

/* Continue Button */
.download-continue-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.download-continue-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.download-continue-btn:disabled {
  background: var(--ink4);
  cursor: not-allowed;
  transform: none;
}
.download-continue-btn svg {
  width: 18px;
  height: 18px;
}

/* Privacy Note */
.download-privacy-note {
  text-align: center;
  font-size: 11px;
  color: var(--ink4);
  margin-top: 4px;
}

/* Loading spinner for button */
.download-continue-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.download-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  margin-top: -6px;
}

/* Responsive */
@media (max-width: 500px) {
  .download-modal {
    max-width: 100%;
    border-radius: var(--radius);
  }
  .download-email-section {
    padding: 20px 16px;
  }
  .download-ad-placeholder {
    width: 100%;
    max-width: 300px;
  }
}
