:root {
  --brand-blue: #00B4FF;
  --action-blue: #3DA9FC;
  --action-blue-hover: #2D7BB8;
  --link-blue: #009BDE;
  --cta-green: #4EC27F;
  --cta-green-hover: #48B065;
  --yellow: #FDDF00;
  --yellow-soft: #FDEB5F;
  --coral: #ED6C4C;

  --fg: #222;
  --fg-modern: #111927;
  --fg-muted: #666;
  --fg-tertiary: #6C737F;
  --bg: #FFFFFF;
  --bg-alt: #F4F8FB;
  --bg-soft: #FAFBFC;
  --border: #E6ECEF;
  --border-strong: #CCCCCC;

  --radius-pill: 100px;
  --radius-card: 1.25rem;
  --radius-sm: 0.5rem;

  --shadow-card: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-card-lg: 0 24px 60px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-blue: 0 10px 20px rgba(61,169,252,0.24);
  --shadow-green: 0 10px 20px rgba(78,194,127,0.30);

  --ease-spring: cubic-bezier(.175, .885, .327, 2.322);

  --page-pad-y: 2.5rem;
  --card-gap: 1rem;
  --card-inner-pad: 1rem;
  --section-gap: 2.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Reddit Sans", -apple-system, system-ui, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg-soft);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; color: var(--fg-modern); letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }

/* ---------- Bootstrap loader (before React mounts) ---------- */
.bootstrap-loader {
  min-height: 80vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  color: var(--fg-tertiary);
  font-size: 0.9375rem;
}
.bootstrap-loader .spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--action-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons (lifted from StreetText) ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--action-blue);
  box-shadow:
    inset 3px 5px 9px rgba(255,255,255,0.31),
    inset -6px -3px 12px rgba(0,0,0,0.20),
    var(--shadow-blue);
  cursor: pointer;
  transition: transform .5s var(--ease-spring), box-shadow .5s var(--ease-spring), background-color .25s ease, opacity .2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--action-blue-hover); transform: scale(.97); color: #fff; }
.button:disabled { opacity: 0.4; cursor: not-allowed; filter: saturate(0.4); }

.button.cta {
  background: var(--cta-green);
  box-shadow:
    inset 3px 5px 9px rgba(255,255,255,0.31),
    inset -6px -3px 12px rgba(0,0,0,0.20),
    var(--shadow-green);
}
.button.cta:hover:not(:disabled) { background: var(--cta-green-hover); }

.button.is-ghost {
  background: transparent;
  color: var(--fg-muted);
  box-shadow: none;
  font-weight: 600;
  padding: 0.625rem 1rem;
}
.button.is-ghost:hover:not(:disabled) {
  background: rgba(0,0,0,0.04);
  color: var(--fg-modern);
  transform: none;
}

.button.is-outline {
  background: #fff;
  color: var(--fg-modern);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.button.is-outline:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: #fff;
  color: var(--fg-modern);
}

.button.is-large { padding: 1.125rem 2.25rem; font-size: 1.0625rem; }
.button.is-block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.topbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.logo-mark {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 800; color: var(--fg-modern); font-size: 1.0625rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo-mark .logo-chip {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--fg-modern);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(13,27,42,0.18);
  flex-shrink: 0;
}
.logo-mark .logo-chip img {
  width: 70%; height: 70%;
  object-fit: contain;
}
.topbar-batch {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--fg-tertiary);
  display: inline-flex; align-items: center; gap: 0.375rem;
}
.topbar-batch .dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cta-green);
  box-shadow: 0 0 0 0 rgba(78,194,127,0.7);
  animation: livePulse 2s infinite;
}
.topbar-batch .dot-live.locked { background: var(--fg-tertiary); animation: none; }
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(78,194,127,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(78,194,127,0); }
  100% { box-shadow: 0 0 0 0 rgba(78,194,127,0); }
}

/* ---------- Page container ---------- */
.page {
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--page-pad-y) 1.25rem 10rem;
}

/* ---------- Greeting / hero ---------- */
.greeting { text-align: center; margin-bottom: var(--section-gap); }
.greeting .eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--action-blue);
  background: #E3F4FF;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.greeting h1 {
  font-size: clamp(1.875rem, 3.5vw + 0.5rem, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 0.875rem;
}
.greeting h1 .cursive {
  font-family: "Galada", cursive; font-weight: 400; letter-spacing: 0;
  color: var(--action-blue);
}
.greeting p {
  color: var(--fg-muted);
  font-size: 1.0625rem;
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.5;
}
.greeting .meta-row {
  display: inline-flex; align-items: center; gap: 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--fg-tertiary);
  flex-wrap: wrap;
  justify-content: center;
}
.greeting .meta-row .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.greeting .meta-row b { color: var(--fg-modern); font-weight: 700; }

/* ---------- How it works strip ---------- */
.howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 42rem;
  margin: 1.75rem auto 0;
  padding: 0.875rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.howto-step {
  display: flex; align-items: flex-start; gap: 0.625rem;
  font-size: 0.8125rem; color: var(--fg);
  text-align: left;
}
.howto-step .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--fg-modern);
  font-weight: 800; font-size: 0.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.howto-step b { display: block; font-weight: 700; color: var(--fg-modern); line-height: 1.25; }
.howto-step span { color: var(--fg-tertiary); font-size: 0.75rem; line-height: 1.3; }
@media (max-width: 640px) {
  .howto { grid-template-columns: 1fr; }
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
}

/* ---------- Design card ---------- */
.design-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-inner-pad);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
.design-card:hover {
  border-color: #C9DEEA;
  box-shadow: var(--shadow-card);
}
.design-card.selected {
  border-color: var(--cta-green);
  box-shadow: 0 0 0 4px rgba(78,194,127,0.18), var(--shadow-card);
}
.design-card.is-locked { cursor: default; }
.design-card.is-locked:hover { border-color: var(--border); box-shadow: none; }

/* ---------- Checkbox affordance on card ---------- */
.card-checkbox {
  position: absolute;
  top: 0.625rem; right: 0.625rem;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  border: 1.5px solid rgba(13,27,42,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
  color: transparent;
  font-size: 0.9375rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .25s var(--ease-spring);
}
.design-card:hover .card-checkbox {
  border-color: rgba(13,27,42,0.32);
}
.design-card.selected .card-checkbox {
  background: var(--cta-green);
  border-color: var(--cta-green);
  color: #fff;
  transform: scale(1.08);
}
.design-card.is-locked .card-checkbox { display: none; }

/* per-card 'notes' button */
.card-notes-btn {
  background: transparent;
  border: 0;
  color: var(--fg-tertiary);
  cursor: pointer;
  padding: 0.375rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.375rem;
  transition: background .2s ease, color .2s ease;
}
.card-notes-btn:hover { background: var(--bg-alt); color: var(--fg-modern); }
.card-notes-btn.has-notes { color: var(--action-blue); font-weight: 700; }
.card-notes-btn.has-notes:hover { background: #E3F4FF; color: var(--action-blue-hover); }
.card-notes-btn:disabled { cursor: default; opacity: 0.7; }

.card-image-wrap {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
  isolation: isolate;
}
.card-image-wrap .design-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-image-wrap .badge-platform {
  position: absolute;
  top: 0.625rem; left: 0.625rem;
  background: rgba(255,255,255,0.95);
  color: var(--fg-modern);
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.25rem;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.card-image-wrap .badge-platform i { color: var(--action-blue); }

.card-meta {
  padding: 0.875rem 0.375rem 0.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.625rem;
}
.card-meta .name {
  font-weight: 700; color: var(--fg-modern); font-size: 0.9375rem;
  letter-spacing: -0.005em;
}

/* "Who's in this ad" chip on a team project's library cards (issue #64 / T3).
   The library rotates its featured subject across the whole team and each
   member, so the agent needs to see which ad is which. Solo projects never
   render it (the design carries no featuredSubject). */
.featured-subject {
  display: inline-flex; align-items: center; gap: 0.3125rem;
  margin-left: 0.5rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-subtle, #f1f4f8);
  border: 1px solid var(--border-soft, #e2e8f0);
  color: var(--fg-secondary, #55606e);
  font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap; vertical-align: middle;
}
.featured-subject i { font-size: 0.6875rem; opacity: 0.75; }

/* approved/rejected ribbons on locked cards */
.card-status-ribbon {
  position: absolute;
  top: 0.875rem; left: 0.625rem;
  background: var(--cta-green);
  color: #fff;
  font-size: 0.6875rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.25rem;
  box-shadow: 0 4px 10px rgba(78,194,127,0.40);
  z-index: 4;
}
.card-status-ribbon.iterate { background: var(--action-blue); box-shadow: 0 4px 10px rgba(61,169,252,0.40); }
.card-status-ribbon.passed { background: var(--fg-tertiary); box-shadow: none; }

.card-hover-affordance {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 70%, rgba(13,27,42,0.55) 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity .25s ease;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}
.card-hover-affordance i { margin-right: 0.375rem; }
.design-card:not(.is-locked):hover .card-hover-affordance { opacity: 1; }
.design-card.selected .card-hover-affordance { opacity: 0 !important; }

/* ---------- Per-image adjustment box (library_approve) ---------- */
.card-regen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,27,42,0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem; font-weight: 700;
  z-index: 5;
  border-radius: inherit;
}
.card-regen-overlay i { font-size: 1.5rem; }
.design-card.is-regenerating { cursor: default; }

.card-adjust {
  margin-top: 0.625rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 0.5rem;
  cursor: default;
}
.card-adjust .field-label {
  display: inline-flex; align-items: center; gap: 0.375rem;
  color: var(--fg-tertiary); font-size: 0.8125rem; font-weight: 700;
}
.card-adjust-input {
  min-height: 64px;
  font-size: 0.875rem;
}
/* Small confirmation that a tweak is queued for the single batch regenerate. */
.card-adjust-queued {
  display: inline-flex; align-items: center; gap: 0.375rem;
  color: var(--cta-green-hover);
  font-size: 0.75rem; font-weight: 700;
}
.card-adjust-queued i { font-size: 0.8125rem; }

/* One button regenerates every image that has a queued tweak (library_approve). */
.regen-all-btn { align-self: center; }

/* ---------- Download all (.zip) ---------- */
.download-all-btn { text-decoration: none; }
.download-recap { margin-top: 1.25rem; display: flex; justify-content: center; }

/* ---------- Persistent action bar ---------- */
.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.96);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem calc(0.875rem + env(safe-area-inset-bottom));
  z-index: 40;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.06);
  transform: translateY(110%);
  transition: transform .45s var(--ease-spring);
}
.action-bar.show { transform: translateY(0); }
.action-bar-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex; align-items: center; gap: 0.75rem;
}
.action-bar .count-block {
  display: flex; flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.action-bar .count-block .count-num {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--fg-modern);
  letter-spacing: -0.01em;
}
.action-bar .count-block .count-num .of { color: var(--fg-tertiary); font-weight: 600; }
.action-bar .count-block .count-sub {
  font-size: 0.75rem;
  color: var(--fg-tertiary);
  margin-top: 1px;
}
.action-bar .spacer { flex: 1; }
.action-bar .approve-all-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--fg-modern);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.375rem;
  transition: border-color .2s ease, background .2s ease;
}
.action-bar .approve-all-btn:hover { border-color: var(--border-strong); background: var(--bg-alt); }
.action-bar .approve-all-btn.active {
  border-color: var(--cta-green);
  background: rgba(78,194,127,0.10);
  color: var(--cta-green-hover);
}
.action-bar .approve-all-btn i { font-size: 0.75rem; }
.action-bar-progress {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cta-green), #6DD89A);
  width: 0%;
  transition: width .35s var(--ease-spring);
  border-radius: 0 3px 3px 0;
}
@media (max-width: 640px) {
  .action-bar-inner { gap: 0.5rem; }
  .action-bar .approve-all-btn { padding: 0.5rem 0.625rem; font-size: 0.8125rem; }
  .action-bar .button { padding: 0.75rem 1rem; font-size: 0.9375rem; flex-shrink: 0; }
}
@media (max-width: 380px) {
  .action-bar .approve-all-btn span { display: none; }
}

/* ---------- "Need general feedback" link below gallery ---------- */
.always-visible-actions {
  margin-top: 2rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.always-visible-actions .changes-link {
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  padding: 0.625rem 1rem;
  border-radius: 8px;
}
.always-visible-actions .changes-link:hover { color: var(--fg-modern); background: rgba(0,0,0,0.04); }
.always-visible-actions .changes-link u { text-decoration-color: var(--border-strong); text-underline-offset: 4px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(13, 27, 42, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.design-modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.30);
  animation: modalIn .35s var(--ease-spring);
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0)   scale(1);    opacity: 1; }
}
.design-modal-close {
  position: absolute;
  top: 0.875rem; right: 0.875rem;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.95);
  color: var(--fg-modern);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 10;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.design-modal-content {
  padding: 1.5rem;
  overflow-y: auto;
}
.design-modal-feedback-head {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.25rem 0 1.125rem;
  padding: 0.625rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.design-modal-feedback-head .mini-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-alt);
}
.design-modal-feedback-head .mini-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.design-modal-feedback-head .text-block { min-width: 0; flex: 1; }
.design-modal-feedback-head .text-block .label {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-tertiary);
  line-height: 1;
}
.design-modal-feedback-head .text-block .name {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--fg-modern);
  line-height: 1.2;
}
.design-modal-content h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.375rem;
}
.design-modal-content p.helper {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  margin: 0 0 1.125rem;
}
.design-modal-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.875rem; }
.design-modal-actions .button { width: 100%; }

.field-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg);
  line-height: 1.5;
  resize: vertical;
  min-height: 8rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  background: var(--bg-soft);
}
.field-textarea:focus {
  border-color: var(--action-blue);
  box-shadow: 0 0 0 4px rgba(61,169,252,0.16);
  background: #fff;
}
.field-textarea::placeholder { color: var(--fg-tertiary); }
.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--fg-tertiary);
  margin-top: 0.375rem;
}
.field-label {
  font-size: 0.75rem; font-weight: 700;
  color: var(--fg-tertiary); letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block; margin-bottom: 0.375rem;
}
.field-label em {
  font-style: normal; text-transform: none; letter-spacing: 0;
  font-weight: 500; color: var(--fg-tertiary);
}

/* ---------- Attach a file (proof "request changes" upload, issue #53) ---------- */
.modal-upload { margin-top: 1rem; }
.modal-upload p.helper {
  color: var(--fg-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
}
.field-file {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  color: var(--fg);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--bg-soft);
  cursor: pointer;
}
.field-file:focus { outline: none; border-color: var(--action-blue); }
.upload-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.upload-file-list li {
  font-size: 0.875rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Success / submitted ---------- */
.success-screen {
  text-align: center;
  padding: 3rem 1.25rem 5rem;
  max-width: 38rem;
  margin: 0 auto;
  animation: successIn .5s var(--ease-spring);
}
@keyframes successIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-screen .check-burst {
  width: 96px; height: 96px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4EC27F, #6DD89A);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.25rem;
  box-shadow: 0 20px 40px rgba(78,194,127,0.40);
  animation: pulseOnce .9s var(--ease-spring);
}
@keyframes pulseOnce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.success-screen .check-burst.changes {
  background: linear-gradient(135deg, var(--action-blue), #67B9ED);
  box-shadow: 0 20px 40px rgba(61,169,252,0.40);
}
.success-screen h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.25rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.success-screen p { color: var(--fg-muted); font-size: 1.0625rem; line-height: 1.5; }

.approved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.875rem;
  max-width: 32rem;
  margin: 1.75rem auto 0;
}
.approved-tile { display: flex; flex-direction: column; gap: 0.5rem; text-align: center; }
.approved-tile-img {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--cta-green);
  background: var(--bg-alt);
}
.approved-tile-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.approved-tile-check {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--cta-green);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 4px 10px rgba(78,194,127,0.45);
  z-index: 2;
}
.approved-tile-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fg-modern);
}

.notes-recap {
  margin: 1.75rem auto 0;
  max-width: 32rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  text-align: left;
}
.notes-recap-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--action-blue);
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.notes-recap-item {
  padding: 0.625rem 0;
  border-bottom: 1px dashed var(--border);
}
.notes-recap-item:last-child { border-bottom: 0; padding-bottom: 0; }
.notes-recap-label {
  font-size: 0.6875rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 0.25rem;
}
.notes-recap-body {
  font-size: 0.9375rem; color: var(--fg);
  line-height: 1.5;
  white-space: pre-wrap;
}

.success-screen .next-card {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  text-align: left;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.875rem;
  align-items: flex-start;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.success-screen .next-card .icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #E3F4FF;
  color: var(--action-blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.success-screen .next-card b { color: var(--fg-modern); font-weight: 700; display: block; margin-bottom: 0.125rem; }
.success-screen .next-card span { color: var(--fg-muted); font-size: 0.9375rem; }
.success-screen .small-foot {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--fg-tertiary);
}

/* ---------- Locked-state banner ---------- */
.locked-banner {
  max-width: 38rem;
  margin: 0 auto 1.5rem;
  padding: 0.875rem 1.125rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; gap: 0.625rem;
  color: var(--fg-tertiary);
  font-size: 0.875rem;
}
.locked-banner i { color: var(--fg-muted); }

/* ---------- Error / not-found ---------- */
.error-screen {
  min-height: 70vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
}
.error-screen h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.error-screen p { color: var(--fg-muted); }
.error-screen .icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: var(--fg-tertiary);
  margin-bottom: 1.25rem;
}

/* ---------- Density modes (kept for future use) ---------- */
body[data-density="compact"] {
  --page-pad-y: 1.5rem;
  --card-gap: 0.625rem;
  --card-inner-pad: 0.625rem;
  --section-gap: 1.5rem;
}
body[data-density="compact"] .gallery { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  body[data-density="compact"] .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  body[data-density="compact"] .gallery { grid-template-columns: 1fr; }
}
body[data-density="spacious"] {
  --page-pad-y: 4rem;
  --card-gap: 1.75rem;
  --card-inner-pad: 1.25rem;
  --section-gap: 4rem;
}
body[data-density="spacious"] .gallery { grid-template-columns: 1fr; max-width: 38rem; margin: 0 auto; gap: 1.75rem; }
@media (min-width: 720px) {
  body[data-density="spacious"] .gallery { grid-template-columns: repeat(2, 1fr); max-width: 56rem; }
}

body.no-scroll { overflow: hidden; }

/* ──────────────────────────────────────────────────────────────────────────
   Stage: pick-one (radio cards instead of checkboxes)
   ────────────────────────────────────────────────────────────────────────── */
.pickone-card .card-checkbox { display: none; }
.radio-affordance {
  position: absolute;
  top: 0.625rem; right: 0.625rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  border: 2px solid rgba(13,27,42,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
  transition: background .2s ease, border-color .2s ease, transform .25s var(--ease-spring);
}
.radio-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cta-green);
  transform: scale(0);
  transition: transform .25s var(--ease-spring);
}
.design-card.pickone-card:hover .radio-affordance { border-color: rgba(13,27,42,0.32); }
.design-card.pickone-card.selected .radio-affordance {
  background: #fff;
  border-color: var(--cta-green);
  transform: scale(1.06);
}
.design-card.pickone-card.selected .radio-dot { transform: scale(1); }

.pickone-notes {
  max-width: 38rem;
  margin: 2rem auto 0;
}
.pickone-notes .field-label {
  display: block;
  font-size: 0.75rem; font-weight: 800;
  color: var(--fg-tertiary); letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}
.pickone-notes .field-label em {
  font-style: normal; font-weight: 600; color: var(--fg-tertiary);
  text-transform: none; letter-spacing: 0; margin-left: 0.375rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   Stage: approve-or-iterate (single proof image)
   ────────────────────────────────────────────────────────────────────────── */
.proof-frame {
  max-width: 38rem;
  margin: 1rem auto 0;
}
.proof-image-wrap {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
  box-shadow: var(--shadow-card-lg);
}
.proof-image-wrap .design-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.proof-image-wrap .badge-platform {
  position: absolute;
  top: 0.875rem; left: 0.875rem;
  background: rgba(255,255,255,0.95);
  color: var(--fg-modern);
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.25rem;
  z-index: 2;
}
.proof-image-wrap .badge-platform i { color: var(--action-blue); }
.proof-actions {
  max-width: 38rem;
  margin: 1.75rem auto 0;
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  flex-wrap: wrap;
  justify-content: center;
}
.proof-actions .button { flex: 1 1 240px; }
@media (max-width: 640px) {
  .proof-actions { flex-direction: column; }
  .proof-actions .button { flex: none; }
}

/* ──────────────────────────────────────────────────────────────────────────
   Stage: pick-ad-types (checklist)
   ────────────────────────────────────────────────────────────────────────── */
.ad-types-checklist {
  max-width: 38rem;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 0.5rem;
}
.ad-type-row {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.ad-type-row:hover { border-color: #C9DEEA; }
.ad-type-row.selected {
  border-color: var(--cta-green);
  background: #F4FFF8;
}
.ad-type-row input[type="checkbox"] {
  width: 20px; height: 20px;
  margin: 0;
  accent-color: var(--cta-green);
  flex-shrink: 0;
}
.ad-type-name {
  font-weight: 600;
  color: var(--fg-modern);
  font-size: 1rem;
}
.custom-ad-types {
  margin-top: 0.75rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem 1rem;
}
.custom-ad-types summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--fg-modern);
  font-size: 0.9375rem;
  list-style: none;
}
.custom-ad-types summary::-webkit-details-marker { display: none; }
.custom-ad-types summary::before {
  content: '+ ';
  color: var(--action-blue);
}
.custom-ad-types[open] summary::before { content: '− '; }
.custom-ad-types p.muted { color: var(--fg-muted); margin: 0.5rem 0 0.625rem; }
.custom-ad-types p.muted em { font-style: italic; color: var(--fg-tertiary); }

/* Client testimonials block (library_select) — up to 3 real quote + name slots */
.testimonials-block {
  max-width: 38rem;
  margin: 0 auto 1.5rem;
}
.testimonials-block .block-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--fg-modern);
  margin: 0 0 0.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.testimonials-block .block-title i { color: var(--action-blue); }
.testimonials-block p.muted { color: var(--fg-muted); margin: 0 0 0.875rem; }
.testimonial-slot {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}
.testimonial-field { display: block; }
.testimonial-field + .testimonial-field { margin-top: 0.75rem; }
.testimonial-quote { min-height: 5rem; }
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  background: var(--bg-soft);
}
.field-input:focus {
  border-color: var(--action-blue);
  box-shadow: 0 0 0 4px rgba(61,169,252,0.16);
  background: #fff;
}
.field-input::placeholder { color: var(--fg-tertiary); }

/* ──────────────────────────────────────────────────────────────────────────
   Error banner (shared)
   ────────────────────────────────────────────────────────────────────────── */
.error-banner {
  max-width: 32rem;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1rem;
  background: #FFF1F0;
  border: 1px solid #F8C8C0;
  color: #A02114;
  border-radius: 12px;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 0.5rem;
}
