/* ═══════════════════════════════════════════════════════════════
   PECB Flyers — Design System v2  (Poppins, PECB palette)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── PECB Brand Palette ──────────────────────────────────── */
  --bg:           #eef2f6;   /* PECB light blue-gray page bg   */
  --surface:      #ffffff;   /* card / panel white             */
  --surface-2:    #f4f7fa;   /* secondary surface (inputs)     */
  --border:       #d5dfe9;   /* PECB cool border               */
  --border-mid:   #b0c4d6;   /* stronger border / divider      */
  --text:         #0e1e2b;   /* near-black, cool undertone     */
  --text-2:       #546878;   /* secondary label                */
  --text-3:       #8fa3b1;   /* tertiary / placeholder         */
  --navy:         #03304d;   /* PECB navy primary              */
  --navy-dim:     #04426a;   /* navy hover                     */
  --navy-light:   #e8f0f7;   /* navy tint background           */
  --navy-mid:     #b5ccde;   /* navy tint border               */
  --red:          #a11e29;   /* PECB brand red                 */
  --red-dim:      #861720;   /* red hover                      */
  --red-light:    #fdf1f2;   /* red tint background            */
  --red-mid:      #e8b4b8;   /* red tint border                */

  /* ── Semantic / Notification Colors (NOT brand) ─────────── */
  /* Success — green                                           */
  --success:        #15803d;
  --success-light:  #f0fdf4;
  --success-border: #86efac;
  /* Warning — amber                                          */
  --warning:        #b45309;
  --warning-light:  #fffbeb;
  --warning-border: #fcd34d;
  /* Info — blue                                              */
  --info:           #1d4ed8;
  --info-light:     #eff6ff;
  --info-border:    #93c5fd;

  /* ── Radius scale ───────────────────────────────────────── */
  --r-xs:  4px;
  --r-sm:  6px;
  --r:     8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ── Fonts ──────────────────────────────────────────────── */
  --font-ui:   'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: 'Syne', 'Poppins', sans-serif;

  /* ── Dark photo-overlay wash (layouts 3/4/7) — JS overrides these to the
     brand color's hue; defaults below match the original PECB navy so the
     app looks identical until app.js runs. ─────────────────────────── */
  --dark-ov-top:    #03304d;
  --dark-ov-bottom: #01192c;
  --dark-ov-rgb:    3,48,77;
  --dark-ov-accent: #ff5a62;
}

/* ── Accessibility Utilities ──────────────────────────────────── */

/* Visually hidden but readable by screen readers (WCAG 2.4.1) */
.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;
}

/* Skip to main content link (WCAG 2.4.1) — visible on focus only */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r);
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 16px;
}

/* ─────────────────────────────────────────────────────────────── */

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

html, body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
body { padding: 24px; }
@media (max-width: 700px) { body { padding: 12px; } }

/* ─── Page header ─── */
.page-header {
  max-width: 1400px; margin: 0 auto 22px; padding: 0 8px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.page-header-main { flex: 1; }
.page-header h1 {
  margin-bottom: 5px; line-height: 1;
}
.page-header h1 .pecb-title {
  font-family: var(--font-ui);    /* Poppins — crisp, no Syne wide-stretch */
  font-size: 26px; font-weight: 800;
  color: var(--red);
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.page-header p {
  color: var(--text-2); font-size: 13.5px; line-height: 1.55;
  max-width: 620px;
}
.page-header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 2px;
}

/* ─── Layout ─── */
.app {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 480px; gap: 24px; align-items: start;
}
@media (max-width: 1000px) { .app { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 1.5px solid var(--border);
}
@media (max-width: 700px) { .panel { padding: 18px; } }

/* ─── Sticky wizard header ─── */
.sticky-wizard-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  margin: -28px -28px 22px;
  padding: 22px 28px 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
@media (max-width: 700px) {
  .sticky-wizard-header { margin: -18px -18px 18px; padding: 16px 18px 0; }
}
.sticky-header-top {
  display: flex; align-items: center;
}
.sticky-header-top .steps { flex: 1; margin-bottom: 18px; }

/* Home button — circle pip, same style as step-pips */
.btn-home-sticky {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; flex: 1;
  background: none; border: none; padding: 0;
}
.btn-home-sticky .dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy); border: 2px solid var(--navy);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(3,48,77,0.2);
  transition: all 0.2s;
}
.btn-home-sticky .label {
  font-family: var(--font-ui);
  font-size: 10.5px; font-weight: 600;
  color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.btn-home-sticky:hover .dot {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(161,30,41,0.14), 0 3px 10px rgba(161,30,41,0.28);
}
.btn-home-sticky:hover .label { color: var(--red); }

/* ─── Step indicator ─── */
.steps {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; position: relative;
}
/* Gray track — full width background line (4 pips: Home + 3 steps) */
.steps::before {
  content: ''; position: absolute; top: 17px; left: calc(50% / 4); right: calc(50% / 4);
  height: 2px; background: var(--border); z-index: 0; border-radius: 2px;
}
/* Colored progress fill — width set by JS via --step-progress */
.steps::after {
  content: ''; position: absolute; top: 17px; left: calc(50% / 4);
  width: var(--step-progress, 33%);
  max-width: calc(100% - 50% / 4 * 2);
  height: 2px;
  background: linear-gradient(to right, var(--navy), var(--red));
  z-index: 1; border-radius: 2px;
  transition: width 0.45s cubic-bezier(.4,0,.2,1);
}

.step-pip {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; flex: 1;
  background: none; border: none; padding: 0;
}
.step-pip .dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-3);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  font-family: var(--font-ui);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.step-pip.active .dot {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 0 0 4px rgba(161,30,41,0.14), 0 3px 10px rgba(161,30,41,0.28);
  transform: scale(1.1);
}
.step-pip.done .dot {
  background: var(--navy); border-color: var(--navy); color: #fff;
  box-shadow: 0 2px 6px rgba(3,48,77,0.2);
}
.step-pip:hover:not(.active) .dot {
  border-color: var(--navy-mid); color: var(--navy);
}
.step-pip .label {
  font-family: var(--font-ui);
  font-size: 10.5px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.step-pip.active .label { color: var(--red); font-weight: 700; }
.step-pip.done  .label { color: var(--navy); }
@media (max-width: 500px) {
  .step-pip .label { font-size: 9.5px; letter-spacing: 0.4px; }
  .step-pip .dot   { width: 30px; height: 30px; font-size: 12px; }
}

/* ─── Step content ─── */
.step-content { display: none; }
.step-content.active { display: block; animation: stepEnter 0.22s ease; }
@keyframes stepEnter { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.nav-back .step-content.active { animation: stepEnterBack 0.22s ease; }
@keyframes stepEnterBack { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.step-title {
  font-family: var(--font-ui);
  font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px;
}
.step-subtitle { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }

/* ─── Form elements ─── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  font-family: var(--font-ui);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
/* Native <select> — hidden by JS once custom dropdown wraps it.
   Kept as graceful fallback for any un-wrapped select elements. */
.field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  cursor: pointer;
}
/* ─── Custom Select Component ─────────────────────────────────────────── */
/* Replaces the native <select> so we can fully brand the dropdown panel.  */

.cs-wrapper {
  position: relative;
  width: 100%;
}

/* The visible trigger button — matches .field input height/style */
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 10px 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  gap: 8px;
}
.cs-trigger:hover  { border-color: var(--navy-mid); }
.cs-trigger:focus  { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(3,48,77,0.08); }
.cs-open .cs-trigger {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(3,48,77,0.08);
}

.cs-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Placeholder style */
.cs-trigger-text[data-placeholder="1"] { color: var(--text-3); }

.cs-chevron {
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.2s ease, color 0.15s;
}
.cs-open .cs-chevron { transform: rotate(180deg); color: var(--navy); }

/* Dropdown panel */
.cs-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--navy-mid);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(3,48,77,0.14);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  list-style: none;
  margin: 0; padding: 4px 0;
  /* Scroll styling */
  scrollbar-width: thin;
  scrollbar-color: var(--navy-mid) transparent;
}
.cs-panel::-webkit-scrollbar       { width: 5px; }
.cs-panel::-webkit-scrollbar-track { background: transparent; }
.cs-panel::-webkit-scrollbar-thumb { background: var(--navy-mid); border-radius: 99px; }

/* Flip up if not enough space below */
.cs-panel.cs-above {
  top: auto;
  bottom: calc(100% + 4px);
}

/* Individual option */
.cs-option {
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: var(--font-ui);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}
.cs-option:hover {
  background: var(--navy);
  color: #ffffff;
}
.cs-option[aria-selected="true"] {
  background: var(--navy-light);
  color: var(--navy);
  font-weight: 600;
}
.cs-option[aria-selected="true"]:hover {
  background: var(--navy);
  color: #ffffff;
}
/* Placeholder option — slightly dimmed */
.cs-option.cs-placeholder {
  color: var(--text-3);
  font-style: normal;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(3,48,77,0.08);
}
.field input::placeholder { color: var(--text-3); }
/* Native date/time inputs — hide the browser's default icon padding */
.field input[type="date"],
.field input[type="time"] {
  padding-right: 10px;
}
.field textarea { resize: vertical; min-height: 60px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* ─── Course search ─── */
.search-box {
  position: relative; margin-bottom: 14px;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search-box:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(161,30,41,0.08);
  background: var(--surface);
}
.search-box input {
  flex: 1; background: transparent; border: none !important;
  box-shadow: none !important; outline: none !important;
  padding: 11px 36px 11px 40px;
  font-size: 14px; font-family: var(--font-ui); color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }
.search-icon {
  position: absolute; left: 13px; color: var(--text-3);
  pointer-events: none; flex-shrink: 0; transition: color 0.15s;
}
.search-box:focus-within .search-icon { color: var(--red); }
.search-clear {
  position: absolute; right: 9px; background: none; border: none;
  color: var(--text-3); cursor: pointer; display: flex; align-items: center;
  justify-content: center; padding: 4px; border-radius: var(--r-xs); transition: all 0.12s;
}
.search-clear:hover { background: var(--border); color: var(--text); }

/* ─── Category pills ─── */
.category-pills {
  display: flex; flex-wrap: nowrap; gap: 5px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  padding: 6px 13px; font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--text-2);
  white-space: nowrap; transition: all 0.15s;
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
}
.cat-pill:hover {
  border-color: var(--red); color: var(--red); background: var(--red-light);
}
.cat-pill.active {
  background: var(--red); border-color: var(--red); color: white; font-weight: 700;
  box-shadow: 0 2px 6px rgba(161,30,41,0.25);
}

/* ─── Selected trainings bar ─── */
.selected-bar {
  background: var(--navy-light);
  border: 1.5px solid var(--navy-mid);
  border-radius: var(--r);
  padding: 12px; margin-bottom: 16px; min-height: 56px;
}
.selected-bar.empty {
  background: var(--surface-2); border-color: var(--border); border-style: dashed;
}
.selected-bar-title {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 600; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.selected-bar.empty .selected-bar-title { color: var(--text-3); }

/* ─── Active flyer tag ─── */
.flyer-active-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 600;
  /* Prevent inheritance from uppercase/letter-spaced parent containers */
  text-transform: none;
  letter-spacing: 0.1px;
  padding: 3px 9px 3px 7px; border-radius: var(--r-xs);
  flex-shrink: 0; white-space: nowrap;
  transition: all 0.15s;
}
.flyer-active-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.flyer-active-tag.tag-empty   { background: var(--surface-2); color: var(--text-3); border: 1.5px solid var(--border); }
.flyer-active-tag.tag-empty::before   { background: var(--text-3); }
.flyer-active-tag.tag-partial { background: var(--warning-light); color: var(--warning); border: 1.5px solid var(--warning-border); }
.flyer-active-tag.tag-partial::before { background: var(--warning); }
.flyer-active-tag.tag-full    { background: var(--success-light); color: var(--success); border: 1.5px solid var(--success-border); }
.flyer-active-tag.tag-full::before    { background: var(--success); }

.setup-section-label { justify-content: flex-start; }
.setup-section-label .flyer-active-tag { margin-left: auto; }

.selected-bar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.selected-bar-header .selected-bar-title { margin-bottom: 0; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-chip {
  background: var(--surface);
  border: 1.5px solid var(--navy-mid);
  border-radius: var(--r-xs);
  padding: 5px 8px 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.selected-chip:hover { border-color: var(--red); }
.selected-chip .remove {
  background: none; border: none; color: var(--navy-mid); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); transition: all 0.12s;
}
.selected-chip .remove:hover { background: var(--red-light); color: var(--red); }
.empty-state { color: var(--text-3); font-size: 13px; font-style: italic; }

/* Meta-hidden warning — shown when 3+ courses selected */
.meta-hidden-warn {
  display: none;
  align-items: flex-start; gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  background: #fff8ed;
  border: 1.5px solid #f5a623;
  border-left: 3px solid #f5a623;
  border-radius: var(--r);
  font-size: 12.5px; color: #7a4a00;
  line-height: 1.45;
}
.meta-hidden-warn svg { flex-shrink: 0; margin-top: 1px; stroke: #f5a623; }

/* ─── Course list ─── */
.course-list { max-height: 480px; overflow-y: auto; padding-right: 4px; }
.course-list::-webkit-scrollbar { width: 5px; }
.course-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.course-category-heading {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1.5px solid var(--border);
  font-family: var(--font-ui);
}
.course-category-heading:first-child { margin-top: 0; }

.course-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r); margin-bottom: 5px;
  cursor: pointer; transition: all 0.16s; background: var(--surface);
  position: relative; overflow: hidden;
}
.course-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent; transition: background 0.16s;
}
.course-item:hover {
  border-color: var(--warning-border);
  background: var(--warning-light);
  transform: translateX(2px);
}
.course-item:hover::before { background: var(--warning); }
.course-item:hover .course-name { color: var(--warning); }
.course-item.selected {
  background: var(--red-light); border-color: var(--red-mid);
}
.course-item.selected::before { background: var(--red); }
.course-item.disabled { opacity: 0.38; cursor: not-allowed; }
.course-item.disabled:hover {
  border-color: var(--border); background: var(--surface); transform: none;
}
.course-item.disabled:hover::before { background: transparent; }
.course-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.course-check {
  width: 20px; height: 20px;
  border-radius: var(--r-xs);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--surface);
  transition: all 0.16s;
}
.course-item:hover .course-check { border-color: var(--warning); }
.course-item.selected .course-check {
  background: var(--red); border-color: var(--red); color: white;
  box-shadow: 0 0 0 3px rgba(161,30,41,0.15);
}
.course-item.selected .course-check::after { content: '✓'; font-size: 12px; font-weight: 800; }
.course-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }
.course-item.selected .course-name { font-weight: 600; color: var(--red-dim); }
.course-days {
  font-size: 11px; color: var(--text-3); white-space: nowrap;
  background: var(--surface-2); padding: 3px 9px;
  border-radius: var(--r-xs); font-weight: 600;
  border: 1px solid var(--border);
}

/* ─── Photo selector ─── */
/* Masonry, not a cropped grid — each photo keeps its own shape (tall photos
   stay tall, wide photos stay wide) instead of being force-cropped into a
   uniform box. */
.photo-grid { column-count: 4; column-gap: 8px; margin-bottom: 12px; }
@media (max-width: 600px) { .photo-grid { column-count: 3; } }
.photo-thumb {
  break-inside: avoid; margin-bottom: 8px;
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  border: 2px solid transparent; position: relative; background: var(--border); transition: transform 0.15s;
}
.photo-thumb:hover { transform: scale(1.04); }
.photo-thumb.selected { border-color: var(--red); }
.photo-thumb.selected::after {
  content: '✓'; position: absolute; top: 4px; right: 4px;
  background: var(--red); color: white;
  width: 20px; height: 20px; border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold;
}
.photo-thumb img { width: 100%; height: auto; display: block; }
.photo-thumb { position: relative; }
.photo-thumb.suggested { outline: 2px solid var(--red); outline-offset: 1px; }
.photo-badge {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  font-size: 9px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: 20px; font-family: var(--font-ui);
  background: var(--red); color: #fff; pointer-events: none;
}
.photo-badge.pecb { background: rgba(3,48,77,0.82); }
.photo-thumb .fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3); padding: 8px; text-align: center;
}
.photo-grid-empty {
  grid-column: 1 / -1; font-size: 13px; color: var(--text-2); padding: 30px;
  text-align: center; background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--r);
}
.photo-grid-more { display: flex; justify-content: center; margin-top: 4px; }
.photo-show-more { font-size: 12.5px; padding: 9px 16px; }
.photo-grid-count { font-size: 11.5px; color: var(--text-3); margin: -6px 0 8px; }

.upload-btn {
  background: var(--surface-2); border: 1.5px dashed var(--border-mid);
  border-radius: var(--r); padding: 12px; font-size: 13px; color: var(--text-2);
  cursor: pointer; text-align: center;
  display: block; width: 100%; font-family: var(--font-ui); transition: all 0.15s;
}
.upload-btn:hover { background: var(--border); border-color: var(--text-2); color: var(--text); }
#photo-upload { display: none; }

/* ─── Navigation buttons ─── */
.nav-hint {
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  margin: 22px 0 -6px; font-family: var(--font-ui); letter-spacing: 0.01em;
}
.nav-hint-warn {
  color: var(--red);
}
.nav-row {
  display: flex; gap: 10px; margin-top: 24px;
  padding-top: 20px; border-top: 1.5px solid var(--border);
}
.btn {
  padding: 11px 20px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; font-family: var(--font-ui);
  letter-spacing: 0.01em;
}
.btn-back {
  background: var(--surface-2); color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-back:hover { background: var(--border); color: var(--text); }
.btn-next { background: var(--navy); color: white; margin-left: auto; }
.btn-next:hover { background: var(--navy-dim); }
.btn-next:disabled { background: var(--border-mid); cursor: not-allowed; }
.btn-download { background: var(--red); color: white; margin-left: auto; padding: 11px 24px; }
.btn-download:hover { background: var(--red-dim); }
.btn-download:disabled { background: var(--border-mid); cursor: wait; }

/* ─── Preview panel ─── */
.preview-wrap { position: sticky; top: 24px; }
@media (max-width: 1000px) { .preview-wrap { position: static; margin-bottom: 24px; order: -1; } }
.preview-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
  font-family: var(--font-ui);
}
.flyer-preview-bg { background: var(--border); border-radius: var(--r-lg); padding: 14px; }
.flyer-frame { width: 100%; max-width: 420px; margin: 0 auto; }

/* ─── Flyer (4:5 format) ─── */
.flyer {
  width: 100%;
  aspect-ratio: 4/5;
  background: linear-gradient(180deg, #fef7f9 0%, #fbe6ed 100%);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text);
  container-type: inline-size;
  font-family: 'Poppins', Arial, sans-serif;
}
.flyer * { box-sizing: border-box; }

.flyer-header {
  background: white;
  padding: 4% 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.bdo-logo {
  font: 600 4.2cqw/1 'Poppins', Arial, sans-serif;
  color: #03304d;
  border-bottom: 0.5cqw solid #d8232a;
  padding: 0 0.4cqw 0.3cqw;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 22cqw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pecb-logo {
  font: 800 6.5cqw/1 'Poppins', Arial, sans-serif;
  color: #b81d23;
  letter-spacing: 0.05em;
}

.flyer-body { flex: 1; display: flex; padding: 0 0 0 6%; gap: 4%; min-height: 0; overflow: hidden; }
.flyer-left { width: 42%; display: flex; flex-direction: column; gap: 3%; padding: 5% 0; flex-shrink: 0; overflow: hidden; }

.flyer-titles {
  font-weight: 700;
  line-height: 1.12;
  white-space: pre-line;
  color: #1a1a1a;
  font-family: 'Poppins', Arial, sans-serif;
  flex-shrink: 1;
  min-height: 0;
  overflow: hidden;
  order: 1;
}
/* Meta section: pinned to bottom (order 2), never compress */
#prv-meta-section { flex-shrink: 0; order: 2; display: flex; flex-direction: column; gap: 2%; }

/* When meta section is hidden (4 courses), titles fill space */
.flyer-left:has(#prv-meta-section[style*="display: none"]) .flyer-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  order: 1;
}
.flyer-titles > div + div { margin-top: 4%; }

.flyer-meta {
  background: #fff;
  padding: 2.2cqw 2.5cqw;
  border-radius: 1.2cqw;
  flex-shrink: 0;
}
.flyer-meta .lbl { color: #666; font-size: 2.8cqw; margin-bottom: 0.3cqw; font-weight: 400; }
.flyer-meta .val { font-size: 3.2cqw; font-weight: 600; line-height: 1.3; white-space: pre-line; color: #1a1a1a; word-break: break-word; overflow-wrap: break-word; }
#prv-date { font-size: 2.9cqw; }

.delivery-badge {
  display: inline-block;
  font-size: 2.6cqw;
  font-weight: 700;
  padding: 0.5cqw 1.4cqw;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.delivery-badge.delivery-in-person   { background: #dcfce7; color: #166534; }
.delivery-badge.delivery-online-live { background: #dbeafe; color: #1e40af; }
.delivery-badge.delivery-elearning   { background: #ede9fe; color: #5b21b6; }
.delivery-badge.delivery-hybrid      { background: #ffedd5; color: #9a3412; }

.flyer-right {
  flex: 1;
  border-radius: 1.5cqw 0 0 1.5cqw;
  background-color: #d1d5db;
  background-size: cover;
  background-position: center;
  position: relative;
}
.flyer-right.empty::after {
  content: 'Pick a photo →';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #6b7280; font-size: 2.8cqw; text-align: center;
}

.flyer-footer {
  background: #f5d8e0;
  padding: 3% 5%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-shrink: 0;
  gap: 2cqw;
}
.flyer-footer span {
  display: flex; align-items: center; gap: 1cqw;
  color: #1a1a1a; font-size: 2.7cqw;
  font-family: 'Poppins', Arial, sans-serif;
  white-space: nowrap;
}
.flyer-footer svg { color: #b81d23; width: 3.2cqw; height: 3.2cqw; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PICKER UI
   ═══════════════════════════════════════════════════════════════ */
.layout-switcher {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}
.layout-switcher-label {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.7px;
  flex-shrink: 0;
}
.layout-switcher-btns {
  display: flex; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.layout-switcher-btns::-webkit-scrollbar { display: none; }
.layout-btn {
  width: 48px; height: 46px; padding: 4px 3px 3px;
  border: 2px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px; position: relative; overflow: hidden;
}
.layout-btn:hover { border-color: var(--navy); background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(3,48,77,0.12); }
.layout-btn.active { border-color: var(--red); background: var(--red-light); box-shadow: 0 0 0 2px var(--red-mid); }
.layout-btn svg { flex-shrink: 0; }
.layout-btn-name {
  font-family: var(--font-ui); font-size: 7.5px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.3px;
  line-height: 1;
}
.layout-btn.active .layout-btn-name { color: var(--red); }
.layout-btn { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT VARIANTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout 2: Mirror – photo left, text right ──────────── */
.flyer-layout-2 .flyer-body { flex-direction: row-reverse; padding: 0 6% 0 0; }
.flyer-layout-2 .flyer-right { border-radius: 0 1.5cqw 1.5cqw 0; }

/* ── Layout 3: Dark Navy ─────────────────────────────────── */
/* Wash follows the brand color's hue (JS sets --dark-ov-*); defaults = PECB navy. */
.flyer-layout-3 { background: linear-gradient(175deg, var(--dark-ov-top) 0%, var(--dark-ov-bottom) 100%); }
/* Header (logos) always stays white — never recolored per layout. */
.flyer-layout-3 .flyer-header { background: #ffffff; }
.flyer-layout-3 .flyer-left { width: 44%; }
.flyer-layout-3 .flyer-titles { color: #ffffff; }
.flyer-layout-3 .flyer-meta { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); }
.flyer-layout-3 .flyer-meta .lbl { color: rgba(255,255,255,0.5); }
.flyer-layout-3 .flyer-meta .val { color: #fff; }
.flyer-layout-3 .flyer-right { border-radius: 1.5cqw 0 0 1.5cqw; }
.flyer-layout-3 .flyer-footer { background: rgba(var(--dark-ov-rgb),0.9) !important; }
.flyer-layout-3 .flyer-footer span { color: rgba(255,255,255,0.75); }
.flyer-layout-3 .flyer-footer svg  { color: var(--dark-ov-accent); }

/* ── Layout 4: Cinematic – photo full bg, overlay left ───── */
.flyer-layout-4 .flyer-body { position: relative; padding: 0; gap: 0; }
.flyer-layout-4 .flyer-right {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 0; z-index: 0;
}
.flyer-layout-4 .flyer-left {
  position: relative; z-index: 1;
  width: 58%;
  background: linear-gradient(to right, rgba(var(--dark-ov-rgb),0.94) 60%, transparent 100%);
  padding: 6% 6%;
}
/* Header (logos) always stays white — never recolored per layout. */
.flyer-layout-4 .flyer-header { background: #ffffff; position: relative; z-index: 2; }
.flyer-layout-4 .flyer-titles { color: #fff; }
.flyer-layout-4 .flyer-meta {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.flyer-layout-4 .flyer-meta .lbl { color: rgba(255,255,255,0.6); }
.flyer-layout-4 .flyer-meta .val { color: #fff; }
.flyer-layout-4 .flyer-footer { background: rgba(var(--dark-ov-rgb),0.88) !important; }
.flyer-layout-4 .flyer-footer span { color: rgba(255,255,255,0.75); }
.flyer-layout-4 .flyer-footer svg  { color: var(--dark-ov-accent); }

/* ── Layout 5: Stacked – photo top, courses + meta below ─── */
.flyer-layout-5 .flyer-body { flex-direction: column; padding: 0; gap: 0; }
.flyer-layout-5 .flyer-right { width: 100%; flex: 0 0 44%; border-radius: 0; order: -1; }
.flyer-layout-5 .flyer-left  { width: 100%; flex: 1; flex-direction: row; gap: 4%; padding: 3.5% 5%; }
.flyer-layout-5 .flyer-titles { order: 1; flex: 1; min-width: 0; margin-bottom: 0; }
.flyer-layout-5 #prv-meta-section { order: 2; flex: 0 0 42%; width: 42%; }

/* ── Layout 7: Movie Poster – photo full bg, gradient + content bottom ── */
.flyer-layout-7 .flyer-body { position: relative; padding: 0; gap: 0; }
.flyer-layout-7 .flyer-right {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 0; z-index: 0;
}
.flyer-layout-7 .flyer-left {
  flex: 1; width: 100%; position: relative; z-index: 1;
  background: linear-gradient(to top, rgba(var(--dark-ov-rgb),0.97) 30%, rgba(var(--dark-ov-rgb),0.5) 54%, transparent 80%);
  padding: 4% 6%;
  justify-content: flex-end;
}
.flyer-layout-7 .flyer-titles { color: #fff; white-space: nowrap; margin-bottom: 0; }
.flyer-layout-7 #prv-meta-section { flex-direction: row; flex-wrap: wrap; gap: 2%; margin-top: 3%; }
.flyer-layout-7 .flyer-meta { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); flex: 0 0 auto; }
.flyer-layout-7 .flyer-meta .lbl { color: rgba(255,255,255,0.6); }
.flyer-layout-7 .flyer-meta .val { color: #fff; }
/* Header (logos) always stays white — never recolored per layout. */
.flyer-layout-7 .flyer-header { background: #ffffff; position: relative; z-index: 2; }
.flyer-layout-7 .flyer-footer { background: rgba(var(--dark-ov-rgb),0.93) !important; }
.flyer-layout-7 .flyer-footer span { color: rgba(255,255,255,0.8); }
.flyer-layout-7 .flyer-footer svg { color: var(--dark-ov-accent); }

/* ── Layout 8: Top Hero – photo 58% top, text+meta 42% below ── */
.flyer-layout-8 .flyer-body { flex-direction: column; padding: 0; gap: 0; position: relative; }
.flyer-layout-8 .flyer-right { width: 100%; flex: 0 0 66%; border-radius: 0; order: -1; }
.flyer-layout-8 .flyer-left { width: 100%; flex: 1; flex-direction: row; padding: 3% 5%; gap: 4%; align-items: center; justify-content: center; }
.flyer-layout-8 .flyer-titles { flex: 1; order: 1; min-width: 0; margin-bottom: 0; white-space: nowrap; }
.flyer-layout-8 #prv-meta-section { order: 2; flex: 0 0 38%; width: 38%; }

/* ── Info cards over the photo (layouts 7 & 8): date, location, format ──
   White cards with a label + bold value, stacked in the top-right of the photo.
   NB: item class is .photo-info-card (NOT .photo-badge — that name is already
   used by the photo-library thumbnail badge and is position:absolute). */
.photo-badges { display: none; }
.flyer-layout-7 .photo-badges,
.flyer-layout-8 .photo-badges {
  display: flex; flex-direction: column; align-items: stretch; gap: 1.7cqw;
  position: absolute; top: 5%; right: 5.5%; left: auto; z-index: 3;
  width: 35%;
}
.photo-info-card {
  background: #ffffff; border-radius: 2cqw;
  padding: 1.7cqw 2cqw;
  border: 0.12cqw solid rgba(16,32,43,0.05);
  box-shadow: 0 1.3cqw 3cqw rgba(16,32,43,0.13);
}
.photo-info-card .pic-lbl {
  font-size: 1.65cqw; color: #94a1ad; font-weight: 600;
  font-family: var(--font-ui); line-height: 1; letter-spacing: 0.07em;
  text-transform: uppercase; margin-bottom: 0.9cqw;
}
.photo-info-card .pic-val {
  font-size: 2.75cqw; color: #16202b; font-weight: 700;
  font-family: var(--font-ui); line-height: 1.16; white-space: nowrap;
}
/* All info now sits on the photo — hide the old meta list for these two. */
.flyer-layout-7 #prv-meta-section,
.flyer-layout-8 #prv-meta-section { display: none; }
/* Tighter title rhythm so the bigger multi-course title fits cleanly.
   overflow:visible + no shrink stops the base rule from clipping the title. */
.flyer-layout-7 .flyer-titles,
.flyer-layout-8 .flyer-titles { line-height: 1.06; overflow: visible; flex-shrink: 0; text-align: center; }
.flyer-layout-7 .flyer-titles > div + div,
.flyer-layout-8 .flyer-titles > div + div { margin-top: 2%; }

/* ─── Step 0: Flyer count ─── */
.flyer-count-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 32px;
}
@media (max-width: 600px) { .flyer-count-grid { grid-template-columns: repeat(3, 1fr); } }

.count-btn {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all 0.15s; font-family: var(--font-ui);
}
.count-btn:hover { border-color: var(--navy); background: var(--navy-light); }
.count-btn.active { border-color: var(--red); background: var(--red-light); }
.count-num {
  font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1;
  font-family: var(--font-ui);
}
.count-lbl { font-size: 12px; font-weight: 600; color: var(--text-3); }
.count-btn.active .count-num { color: var(--red); }
.count-btn.active .count-lbl { color: var(--red); }

/* ─── Stepper row ─── */
.stepper-row {
  display: flex; align-items: center; gap: 12px; margin-top: 20px;
  padding-top: 18px; border-top: 1.5px solid var(--border); flex-wrap: wrap;
}
.stepper-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stepper {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--border); border-radius: var(--r); overflow: hidden;
}
.stepper-btn {
  background: var(--surface-2); border: none; width: 40px; height: 40px;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--navy);
  font-family: var(--font-ui); transition: background 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover { background: var(--border); }
.stepper-btn:active { background: var(--border-mid); }
.stepper-val {
  min-width: 48px; text-align: center; font-size: 18px; font-weight: 700;
  color: var(--navy); padding: 0 4px;
  border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border);
  line-height: 40px; font-family: var(--font-ui);
}

/* ─── Flyer slot preview (step 0) ─── */
.flyer-slot-preview {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; min-height: 0;
}
.flyer-slot-chip {
  background: var(--navy-light); border: 1.5px solid var(--navy-mid);
  border-radius: var(--r-xs);
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
}
.flyer-slot-chip .slot-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--navy-mid);
}

/* ─── Start button (step 0) ─── */
.start-btn {
  display: block; width: 100%; margin-top: 20px;
  background: var(--red); color: white; border: none;
  border-radius: var(--r-lg);
  padding: 15px 24px; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: var(--font-ui); transition: background 0.15s;
  text-align: center; letter-spacing: 0.01em;
}
.start-btn:hover { background: var(--red-dim); }

/* ─── Flyer tabs ─── */
.flyer-tabs {
  display: flex; gap: 5px; margin-bottom: 0;
  flex-wrap: wrap; padding-bottom: 10px;
}

.flyer-tab {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  position: relative; overflow: hidden;
}
.flyer-tab:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-light); }
.flyer-tab.active {
  background: var(--navy); border-color: var(--navy); color: white;
  box-shadow: 0 2px 8px rgba(3,48,77,0.2);
}
.tab-count { font-size: 10px; font-weight: 500; opacity: 0.8; }

.tab-full-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--success-light); color: var(--success);
  border: 1.5px solid var(--success-border);
  border-radius: 999px;
  padding: 2px 8px 2px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em;
  line-height: 1.4; flex-shrink: 0;
  transition: all 0.15s;
}
.flyer-tab.active .tab-full-badge {
  background: rgba(255,255,255,0.15); color: #86efac;
  border-color: rgba(134,239,172,0.5);
}
.tab-full-dot { display: none; } /* replaced by badge */

.flyer-tabs.compact { gap: 3px; }
.flyer-tabs.compact .flyer-tab {
  padding: 4px 9px; border-radius: var(--r-xs); font-size: 11px;
  gap: 4px; white-space: nowrap;
}
.flyer-tabs.compact .tab-status { width: 6px; height: 6px; }
.flyer-tabs.compact .tab-full-badge { font-size: 9px; padding: 1px 5px; }

/* ─── Tab course-completion — progress fill bar ─── */
/*
  ::before  = the full-width gray track (only on tabs that have ≥1 course)
  ::after   = the colored fill, width driven by --tab-progress (set by JS)
*/
.flyer-tab.tab-partial::before,
.flyer-tab.tab-full-color::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 0;
  pointer-events: none;
}
.flyer-tab.active.tab-partial::before,
.flyer-tab.active.tab-full-color::before {
  background: rgba(255,255,255,0.18);
}

.flyer-tab.tab-partial::after,
.flyer-tab.tab-full-color::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: var(--tab-progress, 0%);
  border-radius: 0 2px 0 0;
  transition: width 0.4s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.flyer-tab.tab-partial::after        { background: var(--warning); }
.flyer-tab.tab-full-color::after     { background: var(--success); }
.flyer-tab.active.tab-partial::after     { background: #fbbf24; }
.flyer-tab.active.tab-full-color::after  { background: #4ade80; }

/* ─── When & Where grid ─── */
.ww-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 14px;
  row-gap: 14px;
}
.ww-grid .field { margin-bottom: 0; }
.ww-grid .field label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}
/* Inputs/selects inside the grid inherit the global 42px height — no override needed */
.lbl-opt { font-weight: 400; color: var(--text-3); font-size: 10.5px; text-transform: none; letter-spacing: 0; }

/* Sync toggle spans both columns — no awkward empty cell next to it */
.ww-sync-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;   /* span full width */
  padding: 4px 0 2px;
}
.ww-sync-field label { margin-bottom: 0; }
.ww-toggle-wrap { height: 28px; display: flex; align-items: center; gap: 10px; }

/* ─── When & Where action row ─── */
.ww-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.apply-all-btn {
  display: none; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1.5px dashed var(--navy-mid);
  border-radius: var(--r);
  padding: 0 14px; height: 40px; font-size: 13px; font-weight: 600; color: var(--navy);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; white-space: nowrap;
}
.apply-all-btn:hover { background: var(--navy-light); border-color: var(--navy); }
.apply-all-btn.success {
  background: var(--success-light); border-color: var(--success); color: var(--success); border-style: solid;
}
.setup-done-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--navy); color: white; border: none;
  border-radius: var(--r);
  padding: 0 18px; height: 40px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s;
  margin-left: auto; white-space: nowrap;
}
.setup-done-btn:hover { background: var(--navy-dim); }

/* ─── Setup section (step 1 combined) ─── */
.setup-section {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 0;
}
.setup-section-label {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 600; color: var(--navy); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.setup-section .field { margin-bottom: 10px; }
.setup-section .field:last-of-type { margin-bottom: 0; }

/* Collapsed summary */
.setup-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0 4px; font-size: 13px; color: var(--text);
}
.setup-summary span { flex: 1; font-weight: 500; }
.setup-summary span:empty::before,
.setup-summary span[data-empty]  { color: var(--text-3); font-weight: 400; font-style: italic; }
.setup-summary-edit {
  background: none; border: 1.5px solid var(--navy-mid);
  border-radius: var(--r-sm);
  padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--navy);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; white-space: nowrap;
}
.setup-summary-edit:hover { background: var(--navy-light); border-color: var(--navy); }
/* "Add" variant — dashed border, muted */
.setup-summary-edit.is-empty {
  border-style: dashed; color: var(--text-2); border-color: var(--border);
}
.setup-summary-edit.is-empty:hover { background: var(--navy-light); border-color: var(--navy); color: var(--navy); border-style: solid; }

/* ─── Setup divider — text LEFT, line extends to the right ─── */
.setup-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
}
/* Line comes AFTER the text (right side) */
.setup-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
}
.setup-divider span:first-child {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.setup-divider .flyer-active-tag { margin-left: 0; }

/* ─── Trainings hint — amber accent, stands out from the navy UI ─── */
.trainings-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--warning-light);
  border: 1.5px solid var(--warning-border);
  border-left: 3px solid var(--warning);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #78450a;
  line-height: 1.5;
}
.trainings-hint svg {
  flex-shrink: 0;
  color: var(--warning);
}
.trainings-hint strong {
  color: var(--warning);
  font-weight: 700;
}

/* ─── Tab status dot ─── */
.tab-status {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; vertical-align: middle; margin: 0 2px;
}
.tab-status.complete { background: var(--success); }
.tab-status.partial  { background: var(--warning); }
.tab-status.empty    { background: var(--border-mid); }

/* ─── Toast notification ─── */
.flyer-toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy); color: white;
  padding: 11px 22px; border-radius: var(--r);
  font-size: 13px; font-weight: 600; font-family: var(--font-ui);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}
.flyer-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Schedule complete banner ─── */
.schedule-complete-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-light); border: 1.5px solid var(--success-border);
  border-radius: var(--r); padding: 12px 16px; margin-top: 16px;
  font-size: 13px; font-weight: 600; color: var(--success);
  animation: fadeIn 0.25s ease;
}
.scb-icon {
  width: 24px; height: 24px; background: var(--success); color: white;
  border-radius: var(--r-xs); display: flex; align-items: center;
  justify-content: center; font-size: 13px; flex-shrink: 0;
}

/* ─── Progress bar (step 2) ─── */
.flyers-progress { margin-bottom: 14px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px;
}
.progress-pct { color: var(--success); }
.progress-track {
  height: 6px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, #22c55e 100%);
  border-radius: 999px; transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* ─── Course-list full hint ─── */
.course-list-full-hint {
  background: var(--warning-light); border: 1.5px solid var(--warning-border);
  border-radius: var(--r);
  padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--warning);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}

/* ─── Misc ─── */
.export-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-3); line-height: 1.5; margin-top: 8px;
}
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-right: 8px; vertical-align: -2px;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Sync toggle ─── */
.sync-toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-switch {
  position: relative; width: 44px; height: 24px;
  background: var(--border-mid); border: none; border-radius: 12px;
  cursor: pointer; transition: background 0.2s ease; flex-shrink: 0; padding: 0;
}
.toggle-switch.on { background: #16a34a; }
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.22);
}
.toggle-switch.on .toggle-knob { transform: translateX(20px); }

/* ─── Photo source tabs ─── */
.photo-source-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: var(--surface-2); border-radius: var(--r);
  padding: 4px; border: 1.5px solid var(--border);
}
.photo-source-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border: none; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui);
  background: transparent; transition: all 0.15s;
}
.photo-source-tab.active {
  background: var(--surface); color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1.5px solid var(--border);
}
.photo-source-tab:not(.active):hover { color: var(--navy); }

/* ─── AI section label ─── */
.ai-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
  font-family: var(--font-ui);
}

/* ─── AI provider cards ─── */
.ai-providers {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
@media (max-width: 600px) { .ai-providers { grid-template-columns: repeat(2, 1fr); } }
.ai-provider-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: all 0.15s; font-family: var(--font-ui); text-align: center;
}
.ai-provider-card:hover { border-color: var(--navy); background: var(--navy-light); }
.ai-provider-card.active { border-color: var(--red); background: var(--red-light); }
.aip-icon { color: var(--text-3); line-height: 1; }
.ai-provider-card.active .aip-icon { color: var(--red); }
.aip-name { font-size: 12px; font-weight: 700; color: var(--text); }
.aip-model { font-size: 10px; color: var(--text-3); font-weight: 500; }
.ai-provider-card.active .aip-name { color: var(--red); }
.aip-compat {
  font-size: 9px; font-weight: 700; padding: 2px 5px;
  border-radius: var(--r-xs); letter-spacing: 0.2px; line-height: 1.4;
}
.aip-compat.ok   { background: var(--success-light); color: var(--success); }
.aip-compat.warn { background: var(--warning-light); color: var(--warning); }

/* ─── AI key field ─── */
.ai-key-saved-badge {
  background: var(--success-light); color: var(--success);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-xs); letter-spacing: 0.3px; margin-left: 6px;
}
.field label { display: flex; align-items: center; flex-wrap: wrap; }

/* ─── AI generate button ─── */
.ai-generate-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dim) 100%);
  color: white; border: none; border-radius: var(--r);
  padding: 13px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(161,30,41,0.28);
}
.ai-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(161,30,41,0.38); }
.ai-generate-btn:active { transform: translateY(0); }
.ai-generate-btn:disabled { background: var(--border-mid); box-shadow: none; cursor: wait; transform: none; }

/* ─── AI error ─── */
.ai-error {
  background: #fef2f2; border: 1.5px solid #fecaca; border-radius: var(--r);
  padding: 12px 14px; font-size: 12.5px; color: #b91c1c;
  line-height: 1.55; margin-bottom: 12px;
  display: flex; gap: 9px; align-items: flex-start;
}
.ai-error::before { content: '⚠'; font-size: 15px; flex-shrink: 0; line-height: 1.3; }

/* ─── AI result preview ─── */
.ai-result { margin-top: 4px; animation: fadeIn 0.25s ease; }
.ai-result img {
  width: 100%; border-radius: var(--r); display: block;
  border: 1.5px solid var(--border); margin-bottom: 10px;
  max-height: 300px; object-fit: cover;
}
.ai-result-actions { display: flex; gap: 8px; }
.ai-use-btn {
  flex: 1; background: #16a34a; color: white; border-color: #16a34a;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ai-use-btn:hover { background: #15803d; }
.ai-regen-btn {
  background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ai-regen-btn:hover { background: var(--border); }

/* ─── Logo upload area (step 3) ─── */
.field-optional { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.logo-upload-area { margin-top: 8px; }
.logo-current-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px;
}
.logo-thumb {
  height: 36px; max-width: 100px; object-fit: contain;
  border-radius: var(--r-xs); border: 1px solid var(--border);
}
.logo-remove-btn {
  background: none; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s;
  white-space: nowrap; margin-left: auto;
}
.logo-remove-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.logo-upload-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1.5px dashed var(--border-mid);
  border-radius: var(--r); padding: 11px 16px; font-size: 13px; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; font-weight: 500;
}
.logo-upload-label:hover { background: var(--navy-light); border-color: var(--navy); color: var(--navy); }
#bdo-logo-upload { display: none; }

/* ─── Logos section (Step 3) ─── */
.logos-section { margin-top: 0; }
.logos-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
}
.logos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.logo-slot-name { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.logo-slot-area { position: relative; }

/* ─── Logo images in flyer header ─── */
.bdo-logo-wrap    { display: flex; align-items: center; overflow: hidden; max-width: 38cqw; flex-shrink: 1; }
.partner-logo-wrap { display: flex; align-items: center; overflow: visible; }
.right-logos { display: flex; align-items: center; gap: 2.5cqw; }
.client-logo-wrap {
  display: flex; align-items: center;
  padding-right: 2.5cqw;
  border-right: 1px solid #e0e0e3;
}

/* Browser preview: object-fit + width:auto works fine in real DOM */
.client-logo-img, .client-company-img {
  display: block;
  height: 6.5cqw;
  max-height: 6.5cqw;
  max-width: 20cqw;
  width: auto;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}
.bdo-logo-img {
  display: block;
  height: 6.5cqw;
  max-height: 6.5cqw;
  max-width: 22cqw;
  width: auto;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}
.partner-logo-img {
  display: block;
  height: 6.5cqw;
  max-height: 6.5cqw;
  max-width: 22cqw;
  width: auto;
  object-fit: contain;
  object-position: right center;
  flex-shrink: 0;
}

/* Company name text — shown in flyer header when no client logo is uploaded */
.client-company-text {
  font: 500 5.2cqw/1 'Poppins', Arial, sans-serif;
  color: #03304d;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 20cqw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-company-img {
  display: block;
  height: 6.5cqw;
  max-height: 6.5cqw;
  max-width: 20cqw;
  width: auto;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.bdo-logo-svg, .partner-logo-svg {
  height: 6.5cqw; max-width: 22cqw;
  display: flex; align-items: center; overflow: visible; flex-shrink: 0;
}
.bdo-logo-svg svg, .partner-logo-svg svg {
  height: 100%; width: auto; max-width: 22cqw;
  display: block; overflow: visible;
}

/* ─── Admin button + chip ─── */
.admin-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--navy); border: none; border-radius: var(--r-sm);
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: white;
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; white-space: nowrap;
}
.admin-btn:hover { background: var(--navy-dim); }
.client-mode-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gold-light); border: 1.5px solid var(--gold-border);
  border-radius: var(--r-xs);
  padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--gold);
  white-space: nowrap;
}

/* ─── Admin Panel Overlay + Drawer ─── */
.admin-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: none; align-items: stretch; justify-content: flex-end;
  backdrop-filter: blur(2px);
  animation: fadeOverlay 0.2s ease;
}
.admin-overlay.open { display: flex; }
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.admin-drawer {
  width: 360px; max-width: 92vw; background: var(--surface);
  box-shadow: -12px 0 40px rgba(0,0,0,0.2);
  overflow-y: auto; display: flex; flex-direction: column;
  animation: slideDrawer 0.25s cubic-bezier(0.4,0,0.2,1);
  border-left: 1.5px solid var(--border);
}
@keyframes slideDrawer { from { transform: translateX(100%); } to { transform: translateX(0); } }

.admin-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px; border-bottom: 1.5px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.admin-hdr-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 700; color: var(--navy);
}
.admin-close-btn {
  background: none; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all 0.15s;
}
.admin-close-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

.admin-mode-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; background: var(--surface-2); border-bottom: 1.5px solid var(--border);
}
.admin-mode-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px;
}
.admin-mode-desc { font-size: 11px; color: var(--text-3); }

.admin-section-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 18px 22px 10px;
  border-top: 1.5px solid var(--border); font-family: var(--font-ui);
}

.admin-logo-row { padding: 0 22px 16px; }
.admin-logo-lbl { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.admin-logo-side { color: var(--text-3); font-weight: 400; }
.adm-logo-current {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px;
}
.adm-thumb {
  height: 32px; max-width: 90px; object-fit: contain;
  border-radius: var(--r-xs); border: 1px solid var(--border);
}
.adm-remove-btn {
  margin-left: auto; background: none; border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 9px; font-size: 11px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s;
}
.adm-remove-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.adm-upload-label {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); border: 1.5px dashed var(--border-mid);
  border-radius: var(--r); padding: 10px 14px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s; font-weight: 500;
}
.adm-upload-label:hover { background: var(--navy-light); border-color: var(--navy); color: var(--navy); }
#adm-bdo-upload, #adm-pecb-upload { display: none; }

.admin-drawer .field { padding: 0 22px 12px; }
.admin-drawer .hint  { padding: 0 22px; }

/* ─── Contact preview (Step 3) ─── */
.contact-preview-block {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 20px;
}
.cpb-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
  font-family: var(--font-ui);
}
.partner-fields { display: flex; flex-direction: column; gap: 10px; }
.partner-fields .field { margin-bottom: 0; }
.partner-fields-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .partner-fields-row { grid-template-columns: 1fr; } }

/* ─── Publishing mode selector ──────────────────────────────────────── */
.publish-mode-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 560px) { .publish-mode-group { grid-template-columns: 1fr; } }

.publish-mode-option {
  cursor: pointer;
}
.publish-mode-option input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.pmo-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.publish-mode-option:hover .pmo-card {
  border-color: var(--navy-mid); background: var(--navy-light);
}
.publish-mode-option input:checked + .pmo-card {
  border-color: var(--navy); background: #fff;
  box-shadow: 0 0 0 3px var(--navy-light);
}
.pmo-icon {
  flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 50%; background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.publish-mode-option input:checked + .pmo-card .pmo-icon {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.pmo-text { flex: 1; min-width: 0; }
.pmo-label { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.pmo-desc  { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.pmo-check {
  flex-shrink: 0; width: 20px; height: 20px;
  border-radius: 50%; background: transparent; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.publish-mode-option input:checked + .pmo-card .pmo-check {
  background: var(--navy); border-color: var(--navy); color: #fff;
}

/* PECB locked option — red accent */
#pmo-pecb input:checked + .pmo-card {
  border-color: var(--red); box-shadow: 0 0 0 3px var(--red-light);
}
#pmo-pecb input:checked + .pmo-card .pmo-icon {
  background: var(--red); border-color: var(--red);
}
#pmo-pecb input:checked + .pmo-card .pmo-check {
  background: var(--red); border-color: var(--red);
}

/* ─── Footer color block — locked state ─── */
#footer-color-block.color-locked {
  opacity: 0.55; pointer-events: none; position: relative; user-select: none;
}
#footer-color-block.color-locked::after {
  content: '🔒 Locked — PECB standard brand';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--red);
  background: rgba(253,241,242,0.72);
  border-radius: inherit;
  pointer-events: none;
  letter-spacing: 0.01em;
}

/* ─── Brand color (single smart picker) ─── */
.brand-color-hint {
  font-size: 11.5px; line-height: 1.5; color: var(--text-3);
  margin: 0 0 12px; font-family: var(--font-ui);
}
.brand-color-hint strong { color: var(--text-2); font-weight: 700; }
.brand-color-main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
/* Live mini-preview: body tint + footer chip with icon dot & sample text */
.brand-preview {
  display: flex; align-items: center; gap: 6px;
}
.bp-chip {
  height: 34px; border-radius: 8px; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.bp-body { width: 30px; }
.bp-footer {
  min-width: 56px; gap: 6px; padding: 0 10px; border: none;
}
.bp-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.bp-text { font-size: 13px; font-weight: 700; font-family: var(--font-ui); }

/* ─── Footer color customizer ─── */
.footer-color-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
}
@media (max-width: 700px) { .footer-color-row { grid-template-columns: 1fr; } }

.footer-color-field label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px; font-family: var(--font-ui);
}
.color-picker-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.color-picker-wrap input[type="color"] {
  width: 36px; height: 36px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 2px; cursor: pointer;
  background: none; flex-shrink: 0;
}
.color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-wrap input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-hex-label {
  font-size: 12px; font-weight: 600; font-family: var(--font-ui);
  color: var(--text-2); letter-spacing: 0.5px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 8px;
}
.color-swatches {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  padding: 0; flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.selected { border-color: var(--navy); transform: scale(1.15); }
.color-swatch[data-color="#ffffff"] { border-color: var(--border) !important; }

.cpb-edit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto; background: var(--navy); color: white;
  border: none; border-radius: var(--r-sm); padding: 4px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui); transition: all 0.15s;
}
.cpb-edit-btn:hover { background: var(--navy-dim); }
.cpb-values { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cpb-val { font-size: 13px; font-weight: 500; color: var(--text); }
.cpb-sep { color: var(--border-mid); font-size: 12px; }

/* ─── Step 3 partner logo ─── */
.step3-logo-wrap {
  display: flex; align-items: center; min-height: 48px; margin-bottom: 12px;
}
.step3-logo-wrap img {
  max-height: 48px; max-width: 180px; width: auto;
  object-fit: contain; display: block;
}
.step3-logo-placeholder { font-size: 13px; color: var(--text-3); font-style: italic; }
.step3-logo-actions { display: flex; align-items: center; gap: 8px; }
.step3-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: white; border-radius: var(--r);
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-ui);
  transition: background 0.15s; white-space: nowrap; border: none;
}
.step3-upload-btn:hover { background: var(--navy-dim); }
.step3-remove-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1.5px solid var(--border); border-radius: var(--r);
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: all 0.15s;
}
.step3-remove-btn:hover { border-color: var(--red); color: var(--red); }

/* ─── Client Mode overrides ─── */
body.client-mode .admin-btn { background: var(--border-mid); }
body.client-mode .admin-btn:hover { background: var(--text-3); }

/* ─── Admin drawer padded section ─── */
.admin-drawer-padded { padding: 0 22px 16px; }
.adm-pw-msg { font-size: 12px; margin-bottom: 10px; min-height: 16px; }
.adm-pw-msg.success { color: var(--success); }
.adm-pw-msg.error   { color: var(--red); }
.adm-save-pw-btn {
  width: 100%; padding: 9px; background: var(--navy); color: white;
  border: none; border-radius: var(--r); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font-ui); transition: background 0.15s;
}
.adm-save-pw-btn:hover { background: var(--navy-dim); }

/* ─── Admin Password Modal ─── */
.pw-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pw-modal {
  background: var(--surface); border-radius: var(--r-xl);
  border: 1.5px solid var(--border);
  padding: 36px 32px 28px;
  width: 100%; max-width: 360px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  animation: pwModalIn 0.2s ease;
}
@keyframes pwModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.pw-modal-icon {
  width: 56px; height: 56px; background: var(--navy-light);
  border: 1.5px solid var(--navy-mid);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: var(--navy);
}
.pw-modal-title {
  font-family: var(--font-ui);
  font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 6px;
}
.pw-modal-sub { font-size: 13px; color: var(--text-2); margin-bottom: 22px; }
.pw-modal-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r); font-size: 15px; font-family: var(--font-ui);
  text-align: center; letter-spacing: 0.1em; box-sizing: border-box;
  transition: border 0.15s, box-shadow 0.15s; margin-bottom: 6px;
  background: var(--surface); color: var(--text);
}
.pw-modal-input:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(3,48,77,0.1);
}
.pw-modal-input.shake {
  animation: pwShake 0.35s ease; border-color: var(--red);
}
@keyframes pwShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.pw-modal-error { font-size: 12px; color: var(--red); min-height: 18px; margin-bottom: 18px; }
.pw-modal-actions { display: flex; gap: 10px; }
.pw-modal-cancel {
  flex: 1; padding: 10px; background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r); font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font-ui); transition: background 0.15s;
}
.pw-modal-cancel:hover { background: var(--border); }
.pw-modal-submit {
  flex: 2; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; background: var(--navy); color: white; border: none;
  border-radius: var(--r); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font-ui); transition: background 0.15s;
}
.pw-modal-submit:hover { background: var(--navy-dim); }

/* ═══════════════════════════════════════════════════════════════
   DOWNLOAD ANALYTICS DASHBOARD
   ═══════════════════════════════════════════════════════════════ */
.dash-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 48, 77, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.dash-window {
  background: var(--surface); width: 100%; max-width: 1080px;
  max-height: 92vh; border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(3, 48, 77, 0.3);
}
.dash-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1.5px solid var(--border);
  background: var(--navy); color: #fff; flex-shrink: 0;
}
.dash-hdr-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; font-family: var(--font-ui); }
.dash-close {
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.dash-close:hover { background: rgba(255,255,255,0.25); }
.dash-body { padding: 22px; overflow-y: auto; }

.dash-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; color: var(--text-2); gap: 6px;
}
.dash-state svg { color: var(--navy-mid); margin-bottom: 8px; }
.dash-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; font-family: var(--font-ui); }
.dash-state p { font-size: 13.5px; line-height: 1.6; max-width: 420px; margin: 0; }
.dash-state code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
.dash-login-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 12px; }
.dash-login-form input {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: 14px; font-family: var(--font-ui);
}
.dash-login-form input:focus { outline: none; border-color: var(--navy); }
.dash-login-error { font-size: 12px; color: var(--red); min-height: 16px; }
.dash-login-btn, .dash-tool-btn {
  background: var(--navy); color: #fff; border: none; border-radius: var(--r);
  padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui); transition: background 0.15s;
}
.dash-login-btn:hover { background: var(--navy-dim); }

.dash-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.dash-kpi { background: var(--surface-2); border-radius: var(--r); padding: 14px 16px; }
.dash-kpi-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.dash-kpi-value { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.dash-kpi-value.small { font-size: 14px; font-weight: 600; color: var(--text); }

.dash-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.dash-search-wrap { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.dash-search-wrap svg { position: absolute; left: 11px; color: var(--text-2); pointer-events: none; }
.dash-search-wrap input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1.5px solid var(--border);
  border-radius: var(--r); font-size: 13.5px; font-family: var(--font-ui);
}
.dash-search-wrap input:focus { outline: none; border-color: var(--navy); }
.dash-range {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; font-family: var(--font-ui); background: var(--surface); cursor: pointer;
}
.dash-tool-btn { background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border); display: inline-flex; align-items: center; gap: 6px; }
.dash-tool-btn:hover { background: var(--border); }

.dash-table-wrap { border: 1.5px solid var(--border); border-radius: var(--r); overflow: hidden; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--font-ui); }
.dash-table th {
  text-align: left; padding: 11px 14px; background: var(--surface-2);
  font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; white-space: nowrap;
}
.dash-table th.num { text-align: right; }
.dash-table th:hover { color: var(--navy); }
.dash-table td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.dash-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table tbody tr { cursor: pointer; transition: background 0.12s; }
.dash-table tbody tr:hover { background: var(--navy-light); }
.dash-row-company { font-weight: 600; color: var(--text); }
.dash-row-email { font-size: 11.5px; color: var(--text-2); }
.dash-row-inactive { color: var(--red); }
.dash-empty { padding: 40px; text-align: center; color: var(--text-2); font-size: 13.5px; }

.dash-detail-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(3, 48, 77, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dash-detail {
  background: var(--surface); width: 100%; max-width: 640px; max-height: 86vh;
  border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(3, 48, 77, 0.3);
}
.dash-detail-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1.5px solid var(--border); background: var(--surface-2);
}
.dash-detail-name { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--font-ui); }
.dash-detail-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.dash-detail-body { padding: 8px 20px 20px; overflow-y: auto; }
.dash-event { padding: 12px 0; border-bottom: 1px solid var(--border); }
.dash-event:last-child { border-bottom: none; }
.dash-event-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.dash-event-date { font-size: 12px; color: var(--text-2); }
.dash-event-badge {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: var(--navy-light); color: var(--navy);
}
.dash-event-badge.pecb { background: var(--red-light); color: var(--red); }
.dash-event-courses { font-size: 13px; color: var(--text); font-weight: 500; }
.dash-event-meta { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

@media (max-width: 640px) {
  .dash-body { padding: 14px; }
  .dash-table th:nth-child(3), .dash-table td:nth-child(3) { display: none; }
}
