:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-strong: #111111;
  --text: #151515;
  --muted: #6c6c67;
  --line: #deded8;
  --accent: #111111;
  --radius: 18px;
  --shadow: 0 16px 42px rgba(0,0,0,.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(0,0,0,.045), transparent 30%),
    var(--bg);
}

a {
  color: inherit;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand-text {
  display: grid;
  line-height: 1.02;
}

.brand-text strong {
  font-size: 15px;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.back-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.home-shell,
.client-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  max-width: 840px;
  padding: 92px 0 88px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 24px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.clients {
  padding: 20px 0 110px;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -.03em;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  gap: 22px;
}

.client-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: 190px 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.client-card:hover,
.client-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(0,0,0,.11);
}

.client-card__visual {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent),
    var(--surface-strong);
}

.client-initials,
.client-badge {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  letter-spacing: -.04em;
}

.client-initials {
  width: 92px;
  height: 92px;
  font-size: 30px;
}

.client-card__content {
  padding: 26px;
}

.client-status {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.client-card h3 {
  margin-bottom: 10px;
  font-size: 25px;
  letter-spacing: -.025em;
}

.client-card p {
  min-height: 66px;
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.5;
}

.client-action {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
}

.client-hero {
  min-height: 410px;
  padding: 78px 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  border-bottom: 1px solid var(--line);
}

.client-hero h1 {
  margin-bottom: 20px;
}

.client-badge {
  flex: 0 0 auto;
  width: min(25vw, 220px);
  aspect-ratio: 1;
  background: var(--surface-strong);
  font-size: clamp(36px, 7vw, 72px);
}

.workspace-placeholder {
  padding: 72px 0 110px;
}

.workspace-placeholder__content {
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-placeholder h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.035em;
}

.workspace-placeholder p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.flow-preview {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .site-header,
  .home-shell,
  .client-shell,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    padding: 18px 0;
  }

  .brand-text strong {
    font-size: 14px;
  }

  .hero {
    padding: 66px 0 64px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .clients {
    padding-bottom: 72px;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .client-card {
    grid-template-rows: 160px 1fr;
  }

  .client-hero {
    min-height: auto;
    padding: 56px 0 50px;
    align-items: flex-start;
  }

  .client-badge {
    display: none;
  }

  .workspace-placeholder {
    padding: 48px 0 72px;
  }

  .flow-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .flow-preview span[aria-hidden="true"] {
    transform: rotate(90deg);
  }

  .site-footer {
    flex-direction: column;
  }
}

/* Etapa 2 — galeria de fundos */
.background-section {
  padding: 64px 0 110px;
}

.gallery-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.gallery-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.gallery-help {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.background-count {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.background-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.background-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.background-card:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

.background-card.is-selected {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.12), 0 12px 28px rgba(0,0,0,.10);
}

.background-card__number {
  position: absolute;
  left: 10px;
  bottom: 10px;
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(17,17,17,.88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.background-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .15s ease, transform .15s ease;
}

.background-card.is-selected .background-card__check {
  opacity: 1;
  transform: scale(1);
}

.selection-panel {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  margin: 26px auto 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 14px;
  align-items: center;
  max-width: 720px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(17,17,17,.96);
  color: #fff;
  box-shadow: 0 20px 55px rgba(0,0,0,.25);
  backdrop-filter: blur(16px);
}

.selection-panel[hidden] {
  display: none;
}

.selection-panel__thumb {
  overflow: hidden;
  width: 66px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: #fff;
}

.selection-panel__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selection-panel__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.selection-panel__text strong {
  font-size: 16px;
}

.selection-panel__text > span:last-child {
  color: rgba(255,255,255,.66);
  font-size: 13px;
}

.selection-kicker {
  color: rgba(255,255,255,.56);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.selection-clear {
  min-width: 72px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .background-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0,0,0,.10);
  }

  .selection-clear:hover {
    background: rgba(255,255,255,.08);
  }
}

@media (max-width: 900px) {
  .background-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .background-section {
    padding: 44px 0 80px;
  }

  .gallery-heading {
    margin-bottom: 22px;
    display: block;
  }

  .gallery-heading h2 {
    margin-bottom: 10px;
    font-size: 32px;
  }

  .gallery-help {
    font-size: 16px;
    line-height: 1.5;
  }

  .background-count {
    display: inline-block;
    margin-top: 16px;
    padding: 9px 12px;
    font-size: 12px;
  }

  .background-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .background-card {
    border-radius: 14px;
  }

  .background-card__number {
    left: 8px;
    bottom: 8px;
    min-width: 32px;
    min-height: 32px;
    font-size: 11px;
  }

  .background-card__check {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
  }

  .selection-panel {
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: 54px 1fr auto;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .selection-panel__thumb {
    width: 54px;
    border-radius: 10px;
  }

  .selection-panel__text > span:last-child {
    display: none;
  }

  .selection-panel__text strong {
    font-size: 15px;
  }

  .selection-clear {
    min-width: 64px;
    min-height: 44px;
    padding: 0 12px;
  }
}

@media (max-width: 360px) {
  .background-grid {
    gap: 9px;
  }

  .selection-panel {
    grid-template-columns: 48px 1fr auto;
  }

  .selection-panel__thumb {
    width: 48px;
  }
}

/* Etapa 3 — editor */
.editor-section {
  padding: 72px 0 120px;
  border-top: 1px solid var(--line);
}
.editor-section[hidden] { display: none; }
.editor-heading { max-width: 720px; margin-bottom: 30px; }
.editor-heading h2 { margin-bottom: 12px; font-size: clamp(30px, 4.5vw, 46px); line-height: 1.05; letter-spacing: -.035em; }
.editor-heading > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: clamp(28px, 5vw, 64px); align-items: start; }
.sticker-preview-wrap { position: sticky; top: 18px; }
.sticker-preview { position: relative; width: min(100%, 560px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 16px 45px rgba(0,0,0,.12); }
.sticker-preview > img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.sticker-text-layer { position: absolute; left: 7%; right: 7%; top: 50%; transform: translateY(-50%); text-align: center; pointer-events: none; }
.sticker-text-layer span { display: inline-block; max-width: 100%; color: #fff; font-size: 44px; font-weight: 900; line-height: .98; letter-spacing: -.035em; overflow-wrap: anywhere; white-space: pre-wrap; -webkit-text-stroke: 2px rgba(0,0,0,.55); paint-order: stroke fill; text-shadow: 0 2px 5px rgba(0,0,0,.28); }
.preview-caption { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 13px; font-weight: 700; }
.editor-controls { display: grid; gap: 22px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.field { display: grid; gap: 10px; }
.field-label, .choice-group legend, .control-heading span { font-size: 15px; font-weight: 800; }
.field textarea { width: 100%; min-height: 130px; resize: vertical; padding: 16px; border: 1px solid #cfcfc8; border-radius: 14px; background: #fff; color: var(--text); font: inherit; font-size: 18px; line-height: 1.4; }
.field textarea:focus { outline: 3px solid rgba(17,17,17,.12); border-color: #111; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.control-group { display: grid; gap: 12px; padding-top: 3px; }
.control-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.control-heading output { min-width: 50px; color: var(--muted); font-size: 13px; font-weight: 800; text-align: right; }
.control-group input[type="range"] { width: 100%; min-height: 36px; accent-color: #111; }
.choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 12px; }
.segmented-control, .color-control { display: grid; gap: 8px; }
.segmented-control { grid-template-columns: repeat(3, 1fr); }
.color-control { grid-template-columns: repeat(2, 1fr); }
.segmented-control button, .color-choice, .reset-editor { min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.segmented-control button.is-active, .color-choice.is-active { border-color: #111; background: #111; color: #fff; }
.color-choice { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.color-dot { width: 18px; height: 18px; border: 1px solid #bbb; border-radius: 50%; }
.color-dot--white { background: #fff; }
.color-dot--black { background: #111; border-color: #111; }
.color-choice.is-active .color-dot--black { border-color: #fff; }
.reset-editor { width: 100%; margin-top: 2px; background: #f3f3ef; }

@media (max-width: 820px) {
  .editor-layout { grid-template-columns: 1fr; gap: 24px; }
  .sticker-preview-wrap { position: static; }
  .sticker-preview { width: min(100%, 520px); }
  .editor-controls { width: min(100%, 520px); margin: 0 auto; }
}
@media (max-width: 620px) {
  .editor-section { padding: 48px 0 82px; }
  .editor-heading { margin-bottom: 22px; }
  .editor-heading h2 { font-size: 32px; }
  .editor-heading > p:last-child { font-size: 16px; }
  .sticker-preview { border-radius: 16px; }
  .editor-controls { gap: 20px; padding: 18px; border-radius: 16px; }
  .field textarea { min-height: 116px; padding: 14px; font-size: 17px; }
  .segmented-control button, .color-choice, .reset-editor { min-height: 50px; font-size: 13px; }
}
@media (max-width: 380px) {
  .segmented-control { grid-template-columns: 1fr; }
  .segmented-control button { min-height: 46px; }
}

/* Etapas 4 e 5 — legibilidade e exportação */
.legibility-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 6px;
}
.legibility-panel strong { font-size: 15px; }
.legibility-panel p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.legibility-panel.is-good { background: #f7f7f4; }
.legibility-panel.is-warning { background: #fff7e8; }
.legibility-panel.is-danger { background: #fff0f0; }

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.primary-action,
.secondary-action {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.primary-action { border: 1px solid #111; background: #111; color: #fff; }
.secondary-action { border: 1px solid var(--line); background: #fff; color: var(--text); }
.primary-action:focus-visible,
.secondary-action:focus-visible { outline: 3px solid rgba(17,17,17,.18); outline-offset: 2px; }
.export-note { margin: -6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 620px) {
  .export-actions { grid-template-columns: 1fr; }
  .primary-action, .secondary-action { min-height: 52px; font-size: 15px; }
}

/* Etapa 6 — revisão mobile e estados de uso */
.export-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.primary-action:disabled,
.secondary-action:disabled {
  cursor: wait;
  opacity: .58;
}
@media (max-width: 620px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .client-hero { padding-top: 38px; padding-bottom: 38px; }
  .client-hero h1 { font-size: clamp(38px, 12vw, 52px); line-height: 1; }
  .background-section { padding-top: 38px; }
  .editor-section { padding-top: 42px; }
  .sticker-preview-wrap { width: 100%; }
  .sticker-preview { width: 100%; max-width: 512px; }
  .editor-controls { width: 100%; }
  .field-meta { font-size: 13px; }
  .control-group input[type="range"] { min-height: 44px; }
  .back-link { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 380px) {
  .site-header { gap: 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text small { font-size: 9px; }
  .back-link { font-size: 13px; }
  .client-hero h1 { font-size: 38px; }
  .field-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* Identidade Compass Rose Systems — alinhada ao Feedback Compass Rose */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #0f172a;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef2ff;
  --shadow: 0 16px 40px rgba(15,23,42,.08);
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at top right, rgba(79,70,229,.08), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 46%, #f8fafc 100%);
}

.site-header {
  border-bottom: 1px solid rgba(226,232,240,.78);
}

.brand-mark {
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(79,70,229,.24);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text strong {
  color: #0f172a;
  font-weight: 800;
}

.brand-text small,
.eyebrow {
  color: #6366f1;
}

.back-link {
  color: #475569;
}

.hero h1,
.client-hero h1,
.gallery-heading h2,
.editor-heading h2,
.section-heading h2 {
  color: #0f172a;
}

.client-card,
.editor-controls,
.workspace-placeholder__content {
  border-color: #e2e8f0;
  box-shadow: var(--shadow);
}

.client-card__visual,
.client-badge {
  background:
    radial-gradient(circle at 68% 24%, rgba(99,102,241,.35), transparent 30%),
    linear-gradient(145deg, #0f172a, #312e81);
}

.client-card__visual {
  position: relative;
}

.client-card__visual::after {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
}

.client-action,
.client-status {
  color: #4f46e5;
}

.background-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.14), 0 12px 28px rgba(15,23,42,.10);
}

.background-card__check,
.background-card__number {
  background: rgba(49,46,129,.94);
}

.selection-panel {
  background: rgba(15,23,42,.96);
  border-color: rgba(129,140,248,.22);
}

.field textarea:focus {
  border-color: #6366f1;
  outline: 3px solid rgba(99,102,241,.14);
}

.control-group input[type="range"] {
  accent-color: var(--accent);
}

.segmented-control button.is-active,
.color-choice.is-active,
.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

.reset-editor {
  background: #f8fafc;
  color: #475569;
}

.legibility-panel {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.legibility-panel.is-good {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.legibility-panel.is-warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

.legibility-panel.is-danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

.legibility-panel strong {
  color: #334155;
}

.site-footer {
  color: #64748b;
}

@media (max-width: 620px) {
  .site-header {
    border-bottom-color: rgba(226,232,240,.9);
  }

  .brand-mark {
    border-radius: 12px;
  }
}


/* CRIATIVO — plataforma pública */
.criativo-app {
  --creative-max: 1180px;
}

.app-header {
  position: relative;
  z-index: 50;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav > a,
.client-menu > summary {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.client-menu {
  position: relative;
}

.client-menu > summary::-webkit-details-marker {
  display: none;
}

.client-menu[open] > summary,
.top-nav > a:hover,
.client-menu > summary:hover {
  background: #eef2ff;
  color: #4338ca;
}

.client-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15,23,42,.14);
}

.client-menu__panel a {
  padding: 12px;
  display: grid;
  gap: 3px;
  border-radius: 10px;
  text-decoration: none;
}

.client-menu__panel a:hover {
  background: #f8fafc;
}

.client-menu__panel strong {
  font-size: 14px;
}

.client-menu__panel span {
  color: #64748b;
  font-size: 12px;
}

.creative-shell {
  width: min(var(--creative-max), calc(100% - 40px));
}

.creative-hero {
  max-width: 900px;
  padding: 86px 0 72px;
}

.creative-hero h1 {
  max-width: 900px;
}

.hero-cta {
  min-height: 50px;
  margin-top: 28px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(79,70,229,.22);
}

.format-section {
  padding: 34px 0 72px;
}

.creative-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.creative-heading > p:last-child {
  color: #64748b;
  line-height: 1.55;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.format-card {
  min-width: 0;
  padding: 20px;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,23,42,.05);
}

.format-card.is-active {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.13), 0 10px 28px rgba(15,23,42,.08);
}

.format-shape {
  justify-self: center;
  display: block;
  border: 2px solid #6366f1;
  border-radius: 6px;
  background: #eef2ff;
}

.format-shape--916 { width: 34px; height: 60px; }
.format-shape--45 { width: 44px; height: 55px; }
.format-shape--11 { width: 52px; height: 52px; }
.format-shape--169 { width: 62px; height: 35px; }

.format-card__body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.format-card__body strong {
  font-size: 22px;
  letter-spacing: -.03em;
}

.format-card__body > span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.format-card__body small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.generic-editor-section {
  padding: 56px 0 110px;
  border-top: 1px solid #e2e8f0;
}

.generic-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}

.generic-preview-column {
  min-width: 0;
}

.generic-preview-stage {
  min-height: 600px;
  display: grid;
  place-items: center;
  padding: 28px;
  border-radius: 22px;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.generic-preview {
  --preview-ratio: 9 / 16;
  width: min(100%, 520px);
  max-height: 70vh;
  aspect-ratio: var(--preview-ratio);
  display: grid;
  place-items: center;
}

.generic-preview__canvas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15,23,42,.20);
}

.generic-preview__canvas > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.generic-text-layer {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
}

.generic-text-layer span {
  display: inline-block;
  max-width: 100%;
  color: #fff;
  font-weight: 800;
  line-height: 1.03;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  paint-order: stroke fill;
  -webkit-text-stroke-color: rgba(0,0,0,.55);
  text-shadow: 0 2px 5px rgba(0,0,0,.20);
}

.generic-controls {
  display: grid;
  gap: 14px;
}

.control-card {
  padding: 20px;
  display: grid;
  gap: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(15,23,42,.05);
}

.control-step {
  color: #6366f1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}

.upload-zone {
  min-height: 112px;
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1.5px dashed #a5b4fc;
  border-radius: 14px;
  background: #f8faff;
  cursor: pointer;
  text-align: center;
}

.upload-zone__title {
  color: #3730a3;
  font-weight: 800;
}

.upload-zone__hint {
  color: #64748b;
  font-size: 12px;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-actions {
  display: grid;
}

.image-actions[hidden] {
  display: none;
}

.generic-segment {
  grid-template-columns: repeat(2, 1fr);
}

.control-help {
  margin: -6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.background-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 8px;
}

.background-choice,
.custom-color-choice {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.background-choice {
  cursor: pointer;
}

.background-choice.is-active {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,.12);
}

.swatch {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
}

.swatch--white { background: #fff; }
.swatch--black { background: #000; border-color: #000; }

.custom-color-choice input {
  width: 27px;
  height: 27px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.export-card .primary-action {
  width: 100%;
}

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

  .generic-editor-layout {
    grid-template-columns: 1fr;
  }

  .generic-preview-stage {
    min-height: 480px;
  }

  .generic-controls {
    width: min(100%, 620px);
    margin: 0 auto;
  }
}

@media (max-width: 620px) {
  .creative-shell {
    width: min(100% - 28px, var(--creative-max));
  }

  .app-header {
    align-items: center;
  }

  .top-nav > a {
    display: none;
  }

  .client-menu > summary {
    padding: 0 8px;
    font-size: 13px;
  }

  .client-menu__panel {
    right: 0;
    width: min(260px, calc(100vw - 28px));
  }

  .creative-hero {
    padding: 54px 0 48px;
  }

  .creative-hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .format-section {
    padding: 26px 0 54px;
  }

  .format-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .format-card {
    padding: 15px;
    grid-template-columns: 56px 1fr;
  }

  .format-card__body strong {
    font-size: 20px;
  }

  .generic-editor-section {
    padding: 42px 0 80px;
  }

  .generic-preview-stage {
    min-height: 420px;
    padding: 16px;
    border-radius: 16px;
  }

  .generic-preview {
    max-height: 66vh;
  }

  .control-card {
    padding: 17px;
    border-radius: 15px;
  }

  .background-options {
    grid-template-columns: 1fr 1fr;
  }

  .custom-color-choice {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .brand-text small {
    max-width: 120px;
    white-space: normal;
    line-height: 1.15;
  }

  .generic-preview-stage {
    min-height: 360px;
  }
}


/* Logo do cliente e manipulação direta do texto */
.client-logo-wrap {
  flex: 0 0 auto;
  width: min(25vw, 220px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.client-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drag-hint {
  margin: 4px 0 0;
  color: #64748b;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}

.sticker-text-layer,
.generic-text-layer {
  width: 86%;
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.sticker-text-layer.is-dragging,
.generic-text-layer.is-dragging {
  cursor: grabbing;
}

.sticker-text-layer::after,
.generic-text-layer::after {
  content: "";
  position: absolute;
  inset: -12px -8px;
  border: 1px dashed transparent;
  border-radius: 10px;
  pointer-events: none;
}

.sticker-text-layer:hover::after,
.generic-text-layer:hover::after,
.sticker-text-layer.is-dragging::after,
.generic-text-layer.is-dragging::after {
  border-color: rgba(99,102,241,.55);
}

@media (max-width: 720px) {
  .client-logo-wrap {
    width: 116px;
  }
}

@media (max-width: 620px) {
  .client-logo-wrap {
    width: 96px;
  }

  .drag-hint {
    font-size: 12px;
  }
}


/* Correção de escala da logo Atacadão */
.client-hero {
  overflow: hidden;
}

.client-hero > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.client-logo-wrap {
  flex: 0 0 120px !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  overflow: hidden;
  border-radius: 50%;
}

.client-logo {
  display: block !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  object-fit: contain !important;
}

@media (max-width: 720px) {
  .client-hero {
    align-items: center;
  }

  .client-logo-wrap,
  .client-logo {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
  }

  .client-logo-wrap {
    flex-basis: 88px !important;
  }
}

@media (max-width: 520px) {
  .client-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .client-logo-wrap,
  .client-logo {
    width: 72px !important;
    height: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
  }

  .client-logo-wrap {
    flex-basis: 72px !important;
  }
}
