/* SAFE Net Community Scam Handout & Flyer Generator
 * Editorial v2 Design System + Progressive base-select + Guaranteed 1-Page US Letter Print
 */

:root {
  --sn-ink: #102639;
  --sn-navy: #0a1d2c;
  --sn-blue: #147cb3;
  --sn-blue-deep: #0d567f;
  --sn-sky: #38a3e8;
  --sn-ice: #8ed6f6;
  --sn-tint: #e6f2f8;
  --sn-mist: #f2f5f7;
  --sn-surface: #ffffff;
  --sn-muted: #4b5d6b;
  --sn-slate: #566a7b;
  --sn-alert: #a92323;
  --sn-border: #cedae3;
  --sn-border-strong: #b6c8d6;
  --sn-display: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sn-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --preview-scale: 1;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--sn-mist);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: var(--sn-mist);
  color: var(--sn-ink);
  font-family: var(--sn-body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   App Chrome & Top Header
   ========================================================================== */

.app-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--sn-navy) 0%, var(--sn-ink) 100%);
  color: #ffffff;
  border-bottom: 3px solid var(--sn-blue);
}

.app-header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.app-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.app-header-emblem {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
}

.app-title-block {
  min-width: 0;
}

.app-eyebrow {
  display: block;
  font-family: var(--sn-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  color: var(--sn-ice);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.app-title {
  margin: 0;
  font-family: var(--sn-display);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: #ffffff;
  text-transform: uppercase;
}

.app-lead {
  margin: 5px 0 0;
  font-size: 0.94rem;
  color: #d7e4ee;
  line-height: 1.38;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Buttons (All touch targets >= 44px) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--sn-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
}

.btn:focus-visible,
.edition-btn:focus-visible,
.photo-option-btn:focus-visible,
.control-select:focus-visible,
.control-input:focus-visible {
  outline: 3px solid var(--sn-sky);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-header-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.btn-header-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
}

.btn-header-light {
  background: #ffffff;
  color: var(--sn-ink);
  border-color: #ffffff;
}

.btn-header-light:hover {
  background: var(--sn-tint);
  border-color: var(--sn-tint);
}

.btn-header-primary {
  background: var(--sn-blue);
  color: #ffffff;
  border-color: var(--sn-blue);
}

.btn-header-primary:hover {
  background: var(--sn-blue-deep);
  border-color: var(--sn-blue-deep);
}

.btn-outline-sm {
  background: #ffffff;
  color: var(--sn-ink);
  border-color: var(--sn-border-strong);
  border-radius: 9px;
  padding: 0 14px;
  font-size: 0.8rem;
}

.btn-outline-sm:hover {
  background: var(--sn-tint);
  border-color: var(--sn-blue);
  color: var(--sn-blue-deep);
}

.btn-danger-outline-sm {
  background: #ffffff;
  color: var(--sn-alert);
  border-color: #d9a7a7;
  border-radius: 9px;
  padding: 0 14px;
  font-size: 0.8rem;
}

.btn-danger-outline-sm:hover {
  background: #fdf2f2;
  border-color: var(--sn-alert);
}

/* ==========================================================================
   Main Two-Column Workspace
   ========================================================================== */

.workspace-grid {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px 24px 36px;
  display: grid;
  grid-template-columns: minmax(360px, 448px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Left Controls Card */
.controls-panel {
  background: var(--sn-surface);
  border: 1px solid #d7e2ea;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(16, 38, 57, 0.06);
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--sn-mist);
}

.panel-title {
  margin: 0;
  font-family: var(--sn-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--sn-ink);
  text-transform: uppercase;
}

.panel-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sn-tint);
  color: var(--sn-blue-deep);
  font-family: var(--sn-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.controls-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.control-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.control-fieldset > legend {
  width: 100%;
  padding: 0;
  margin-bottom: 2px;
}

.control-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.control-label {
  font-family: var(--sn-display);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--sn-ink);
  text-transform: uppercase;
}

.control-hint {
  font-size: 0.78rem;
  color: var(--sn-slate);
}

/* Inputs & Native Select Baseline (>= 16px prevents iOS zoom, >= 46px touch height) */
.control-input,
.control-select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--sn-border);
  border-radius: 10px;
  background-color: #ffffff;
  color: var(--sn-ink);
  font-family: var(--sn-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.control-select {
  font-weight: 600;
  cursor: pointer;
}

.control-input::placeholder {
  color: #6d7f8f;
}

.control-input:hover,
.control-select:hover {
  border-color: var(--sn-blue);
}

/* Progressive Editorial v2 base-select styling (Chromium/Edge; graceful native fallback in Firefox) */
@supports (appearance: base-select) {
  .control-select,
  .control-select::picker(select) {
    appearance: base-select;
  }

  .control-select {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .control-select::picker-icon {
    color: var(--sn-blue);
    margin-inline-start: auto;
    transition: transform 160ms ease;
  }

  .control-select:open::picker-icon {
    transform: rotate(180deg);
  }

  .control-select::picker(select) {
    background: #ffffff;
    border: 1.5px solid var(--sn-border-strong);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(16, 38, 57, 0.16);
    margin-block: 6px;
    max-height: min(360px, 60vh);
    overflow-y: auto;
    padding: 6px;
  }

  .control-select optgroup {
    font-family: var(--sn-display);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--sn-slate);
    text-transform: uppercase;
    padding: 6px 8px 4px;
  }

  .control-select option {
    font-family: var(--sn-body);
    font-size: 0.96rem;
    font-weight: 500;
    color: var(--sn-ink);
    border-radius: 8px;
    min-height: 44px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .control-select option:hover,
  .control-select option:focus-visible {
    background: var(--sn-tint);
  }

  .control-select option:checked {
    background: var(--sn-tint);
    color: var(--sn-blue-deep);
    font-weight: 700;
  }

  .control-select option::checkmark {
    color: var(--sn-blue);
    content: "\2713";
    font-weight: 800;
    margin-inline-end: 4px;
  }
}

.partner-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sub-fields-grid[hidden] {
  display: none;
}

.sub-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sub-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sn-muted);
}

.event-banner-box {
  background: #f8fafc;
  border: 1px solid #dde6ee;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-section-heading {
  font-family: var(--sn-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--sn-blue-deep);
  text-transform: uppercase;
}

/* Upload Dropzone */
.upload-zone {
  border: 1.5px dashed var(--sn-border-strong);
  border-radius: 12px;
  background: #f8fbfd;
  padding: 12px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.upload-zone.is-dragover {
  border-color: var(--sn-blue);
  background: var(--sn-tint);
}

.upload-empty-state,
.upload-loaded-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-empty-state[hidden],
.upload-loaded-state[hidden] {
  display: none;
}

.upload-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.upload-copy strong {
  font-size: 0.88rem;
  color: var(--sn-ink);
}

.upload-copy span {
  font-size: 0.78rem;
  color: var(--sn-muted);
}

.upload-thumb {
  width: 48px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--sn-border);
  background: #ffffff;
  padding: 3px;
  flex: 0 0 auto;
}

.upload-file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.upload-file-meta strong {
  font-size: 0.86rem;
  color: var(--sn-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-meta span {
  font-size: 0.76rem;
  color: var(--sn-muted);
}

.control-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sn-alert);
  background: #fdf2f2;
  border: 1px solid #ebc9c9;
  border-radius: 8px;
  padding: 8px 10px;
}

/* Photo Picker Grid + Ink-Saver */
.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.photo-option-btn {
  position: relative;
  min-height: 66px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid var(--sn-border);
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.photo-option-btn:hover {
  border-color: var(--sn-blue);
}

.photo-option-btn.is-selected {
  border-color: var(--sn-blue);
  box-shadow: 0 0 0 2px rgba(20, 124, 179, 0.22);
}

.photo-option-img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
}

.photo-selected-tag {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: rgba(16, 38, 57, 0.88);
  color: #ffffff;
  font-family: var(--sn-display);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  border-radius: 4px;
  padding: 2px 4px;
}

.photo-option-inksaver {
  padding: 8px;
  background: #f5f8fa;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.photo-option-inksaver.is-selected {
  background: var(--sn-tint);
}

.inksaver-title {
  font-family: var(--sn-display);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--sn-ink);
  text-transform: uppercase;
  line-height: 1.15;
}

.inksaver-sub {
  font-size: 0.68rem;
  color: var(--sn-muted);
  line-height: 1.18;
}

/* Print Edition Segmented Toggle */
.edition-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: var(--sn-mist);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid #d9e3eb;
}

.edition-btn {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--sn-ink);
  font-family: var(--sn-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.edition-btn.is-active {
  background: var(--sn-ink);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(16, 38, 57, 0.18);
}

.edition-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.edition-dot-color {
  background: var(--sn-sky);
  border: 1.5px solid #ffffff;
}

.edition-dot-bw {
  background: linear-gradient(90deg, #000000 50%, #ffffff 50%);
  border: 1.5px solid currentColor;
}

/* ==========================================================================
   Right Preview Panel & Dynamic US Letter Scaler
   ========================================================================== */

.preview-panel {
  background: #e5edf3;
  border: 1px solid #d2dde6;
  border-radius: 16px;
  padding: 18px 20px 24px;
  min-width: 0;
  position: sticky;
  top: 16px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.preview-heading {
  margin: 0;
  font-family: var(--sn-display);
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--sn-ink);
  text-transform: uppercase;
}

.preview-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c9d7e2;
  color: var(--sn-ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.preview-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.preview-scaler {
  position: relative;
  width: 816px;
  height: 1056px;
  flex: 0 0 auto;
}

/* ==========================================================================
   US Letter 8.5" x 11" Flyer Sheet (816px x 1056px @ 96 DPI)
   Inner printable area: 744px x 984px (0.38in margins)
   ========================================================================== */

.flyer-sheet {
  width: 816px;
  height: 1056px;
  padding: 36px;
  background: #ffffff;
  color: var(--sn-ink);
  box-shadow: 0 18px 42px rgba(10, 29, 44, 0.16);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow: hidden;
  transform-origin: top left;
  transform: scale(var(--preview-scale));
  font-family: var(--sn-body);
}

/* 1. Brand & Co-Brand Header */
.flyer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--sn-blue);
  flex: 0 0 auto;
}

.flyer-brand-left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.flyer-safenet-logo {
  height: 50px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.flyer-partner-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.flyer-partner-divider {
  width: 2px;
  height: 40px;
  background: #c8d7e2;
  flex: 0 0 auto;
}

.flyer-partner-logo {
  max-height: 44px;
  max-width: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.flyer-partner-logo[hidden] {
  display: none;
}

.flyer-partner-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 0;
}

.flyer-cobrand-eyebrow {
  font-family: var(--sn-display);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sn-blue);
  line-height: 1.15;
}

.flyer-partner-heading {
  font-family: var(--sn-display);
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--sn-ink);
  text-transform: uppercase;
  line-height: 1.12;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 2. Optional Event Banner */
.flyer-event-banner {
  background: var(--sn-ink);
  color: #ffffff;
  border-radius: 6px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.flyer-event-banner[hidden] {
  display: none;
}

.flyer-event-title {
  font-family: var(--sn-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flyer-event-meta {
  font-family: var(--sn-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sn-ice);
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 3. Hero Section */
.flyer-hero {
  background: #f2f8fc;
  border: 1px solid #d5e6f1;
  border-radius: 10px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 16px;
  align-items: center;
  flex: 0 0 auto;
}

.flyer-sheet[data-ink-saver="true"] .flyer-hero {
  grid-template-columns: 1fr;
  padding: 14px 18px;
}

.flyer-sheet[data-ink-saver="true"] .flyer-hero-photo-wrap {
  display: none;
}

.flyer-badge {
  font-family: var(--sn-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sn-alert);
  margin-bottom: 4px;
}

.flyer-headline {
  margin: 0 0 6px;
  font-family: var(--sn-display);
  font-size: 27px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--sn-ink);
  text-transform: uppercase;
}

.flyer-intro {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.38;
  color: #263c4f;
}

.flyer-hero-photo-wrap {
  width: 216px;
  height: 136px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #c9dbe8;
  background: #dce8f0;
  flex: 0 0 auto;
}

.flyer-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 4. Two-Column Body */
.flyer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

.flyer-card {
  background: #ffffff;
  border: 1.5px solid #d5e0e8;
  border-radius: 10px;
  padding: 13px 15px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.flyer-card-flags {
  border-top: 4px solid var(--sn-alert);
}

.flyer-card-steps {
  border-top: 4px solid var(--sn-blue);
  background: #fafcfe;
}

.flyer-card-title {
  margin: 0 0 11px;
  font-family: var(--sn-display);
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sn-ink);
}

.flyer-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11.5px;
  font-size: 12.2px;
  line-height: 1.42;
  color: #213647;
}

.flyer-list-bullets {
  list-style: none;
}

.flyer-list-bullets li {
  position: relative;
  padding-left: 15px;
}

.flyer-list-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--sn-alert);
}

.flyer-list-steps {
  list-style: none;
  counter-reset: sn-step;
}

.flyer-list-steps li {
  position: relative;
  padding-left: 21px;
  counter-increment: sn-step;
}

.flyer-list-steps li::before {
  content: counter(sn-step) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--sn-display);
  font-weight: 900;
  font-size: 12.8px;
  color: var(--sn-blue-deep);
}

.flyer-item-lead {
  font-weight: 700;
  color: var(--sn-ink);
}

/* 5. Verified Reporting Contacts */
.flyer-contacts {
  border: 1.5px solid var(--sn-ink);
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 auto;
}

.flyer-contacts-bar {
  background: var(--sn-ink);
  color: #ffffff;
  padding: 6px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.flyer-contacts-title {
  font-family: var(--sn-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.flyer-contacts-911 {
  font-family: var(--sn-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sn-ice);
}

.flyer-contacts-grid {
  background: #f5f9fc;
  padding: 9px 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
}

.flyer-contact-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.flyer-contact-name {
  font-size: 10.8px;
  font-weight: 700;
  color: var(--sn-ink);
  line-height: 1.24;
}

.flyer-contact-detail {
  font-size: 10.2px;
  color: #2f4659;
  line-height: 1.28;
  word-break: break-word;
}

/* 6. Mandatory QR Code & Legal Attribution Footer */
.flyer-footer {
  display: grid;
  grid-template-columns: 354px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-top: 9px;
  border-top: 1.5px solid #cfdbe4;
  flex: 0 0 auto;
}

.flyer-qr-box {
  background: #f4f8fb;
  border: 1.5px solid #cbd9e4;
  border-radius: 9px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flyer-qr-svg {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border: 1px solid #d4e0e9;
  border-radius: 5px;
  padding: 3px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flyer-qr-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.flyer-qr-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flyer-qr-heading {
  font-family: var(--sn-display);
  font-size: 10.6px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sn-ink);
  line-height: 1.15;
}

.flyer-qr-url {
  font-size: 9.6px;
  font-weight: 700;
  color: var(--sn-blue-deep);
  line-height: 1.22;
  overflow-wrap: anywhere;
  word-break: normal;
}

.flyer-qr-sub {
  font-size: 9.4px;
  color: var(--sn-muted);
  line-height: 1.22;
}

.flyer-legal-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.flyer-legal-notice {
  margin: 0;
  font-size: 9.2px;
  line-height: 1.36;
  color: #364b5c;
}

.flyer-couryn-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.flyer-couryn-ribbon {
  height: 26px;
  width: auto;
  object-fit: contain;
}

/* ==========================================================================
   Black & White Copier Edition (100% Pure #000000 Ink on #FFFFFF Paper)
   ========================================================================== */

.flyer-sheet[data-edition="bw"] {
  background: #ffffff;
  color: #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-header {
  border-bottom: 2pt solid #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-partner-divider {
  background: #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-partner-logo {
  filter: grayscale(100%) contrast(1.25);
}

.flyer-sheet[data-edition="bw"] .flyer-cobrand-eyebrow,
.flyer-sheet[data-edition="bw"] .flyer-partner-heading,
.flyer-sheet[data-edition="bw"] .flyer-badge,
.flyer-sheet[data-edition="bw"] .flyer-headline,
.flyer-sheet[data-edition="bw"] .flyer-intro,
.flyer-sheet[data-edition="bw"] .flyer-card-title,
.flyer-sheet[data-edition="bw"] .flyer-list,
.flyer-sheet[data-edition="bw"] .flyer-item-lead,
.flyer-sheet[data-edition="bw"] .flyer-contact-name,
.flyer-sheet[data-edition="bw"] .flyer-contact-detail,
.flyer-sheet[data-edition="bw"] .flyer-qr-heading,
.flyer-sheet[data-edition="bw"] .flyer-qr-url,
.flyer-sheet[data-edition="bw"] .flyer-qr-sub,
.flyer-sheet[data-edition="bw"] .flyer-legal-notice {
  color: #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-event-banner {
  background: #000000;
  color: #ffffff;
  border-radius: 4px;
}

.flyer-sheet[data-edition="bw"] .flyer-event-meta {
  color: #ffffff;
}

.flyer-sheet[data-edition="bw"] .flyer-hero {
  background: #ffffff;
  border: 1.5pt solid #000000;
  border-radius: 6px;
}

.flyer-sheet[data-edition="bw"] .flyer-hero-photo-wrap {
  border: 1.5pt solid #000000;
  background: #ffffff;
}

.flyer-sheet[data-edition="bw"] .flyer-photo {
  filter: grayscale(100%) contrast(1.18);
}

.flyer-sheet[data-edition="bw"] .flyer-card,
.flyer-sheet[data-edition="bw"] .flyer-card-flags,
.flyer-sheet[data-edition="bw"] .flyer-card-steps {
  background: #ffffff;
  border: 1.5pt solid #000000;
  border-top: 3pt solid #000000;
  border-radius: 6px;
}

.flyer-sheet[data-edition="bw"] .flyer-list-bullets li::before {
  background: #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-list-steps li::before {
  color: #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-contacts {
  border: 1.5pt solid #000000;
  border-radius: 6px;
}

.flyer-sheet[data-edition="bw"] .flyer-contacts-bar {
  background: #000000;
  color: #ffffff;
}

.flyer-sheet[data-edition="bw"] .flyer-contacts-911 {
  color: #ffffff;
}

.flyer-sheet[data-edition="bw"] .flyer-contacts-grid {
  background: #ffffff;
}

.flyer-sheet[data-edition="bw"] .flyer-footer {
  border-top: 1.5pt solid #000000;
}

.flyer-sheet[data-edition="bw"] .flyer-qr-box {
  background: #ffffff;
  border: 1.5pt solid #000000;
  border-radius: 6px;
}

.flyer-sheet[data-edition="bw"] .flyer-qr-svg {
  border-color: #000000;
}

/* ==========================================================================
   Sticky Mobile Action Bar
   ========================================================================== */

.mobile-action-bar {
  display: none;
}

/* ==========================================================================
   Responsive Breakpoints (1080px, 768px Tablet, 390px Mobile: 0px Overflow)
   ========================================================================== */

@media (max-width: 1079px) {
  .app-shell {
    padding-bottom: 78px;
  }

  .app-header-inner {
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
  }

  .app-header-actions {
    width: auto;
    justify-content: flex-end;
  }

  #download-png-btn,
  #print-pdf-btn {
    display: none;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    padding: 16px 16px 24px;
    gap: 18px;
  }

  .preview-panel {
    position: static;
    padding: 14px 14px 20px;
  }

  .mobile-action-bar {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(10, 29, 44, 0.97);
    border-top: 2px solid var(--sn-blue);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(10, 29, 44, 0.24);
  }

  .btn-mobile-outline {
    background: #ffffff;
    color: var(--sn-ink);
    border-color: #ffffff;
    min-height: 48px;
  }

  .btn-mobile-primary {
    background: var(--sn-blue);
    color: #ffffff;
    border-color: var(--sn-blue);
    min-height: 48px;
  }
}

@media (max-width: 600px) {
  .app-header-inner {
    padding: 14px 14px;
  }

  .app-header-emblem {
    width: 36px;
    height: 36px;
  }

  .app-brand-group {
    gap: 12px;
  }

  .app-header-actions {
    display: flex;
  }

  #reset-btn {
    padding: 0 14px;
  }

  .workspace-grid {
    padding: 12px 12px 20px;
  }

  .controls-panel {
    padding: 15px 14px;
    border-radius: 14px;
  }

  .panel-header {
    flex-wrap: wrap;
  }

  .sub-fields-grid {
    grid-template-columns: 1fr;
  }

  .photo-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edition-toggle {
    grid-template-columns: 1fr;
  }

  .upload-empty-state,
  .upload-loaded-state {
    flex-wrap: wrap;
  }

  .preview-panel {
    padding: 12px 10px 16px;
    border-radius: 14px;
  }
}

/* ==========================================================================
   Guaranteed Single-Page 8.5" x 11" US Letter Print Stylesheet
   ========================================================================== */

@page {
  size: letter portrait;
  margin: 0.38in;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 7.74in !important;
    height: 10.18in !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  .app-header,
  .controls-panel,
  .preview-toolbar,
  .mobile-action-bar,
  .sr-only {
    display: none !important;
  }

  .app-shell,
  .workspace-grid,
  .preview-panel,
  .preview-stage,
  .preview-scaler {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 7.74in !important;
    height: 10.18in !important;
    max-width: none !important;
    min-height: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: static !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .flyer-sheet {
    width: 7.74in !important;
    height: 10.18in !important;
    max-height: 10.18in !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
