
/* ── Campaign Modal (موحّد لجميع الحملات) ── */
.cm-overlay {
  --cm-accent: #FF9900;
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cm-overlay.hidden {
  display: none !important;
}

body.cm-open,
html.cm-open {
  overflow: hidden;
  touch-action: none;
}

.cm-sheet {
  width: 100%;
  max-width: 440px;
  max-height: min(92vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface, #fff);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  animation: cm-slide-up 0.28s ease-out;
}

body.dark .cm-sheet {
  background: var(--surface, #1c1c1e);
}

@keyframes cm-slide-up {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 640px) {
  .cm-overlay {
    align-items: center;
    padding: 24px;
  }
  .cm-sheet {
    border-radius: 24px;
    max-height: min(88vh, 680px);
  }
}

.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

body.dark .cm-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cm-header .modal-close {
  min-width: 44px;
  min-height: 44px;
}

.cm-body {
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.cm-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 8px auto 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--cm-accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-icon {
  font-size: 28px;
  line-height: 1;
}

.cm-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text, #111);
  line-height: 1.45;
}

.cm-entry {
  font-size: 14px;
  color: var(--muted, #666);
  margin: 0 0 10px;
}

.cm-entry strong {
  color: var(--text, #111);
  font-family: "SF Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
}

.cm-desc,
.cm-footer,
.cm-note {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted, #666);
  margin: 0 0 12px;
}

.cm-footer {
  margin-top: 4px;
}

.cm-extra {
  margin-bottom: 12px;
}

.cm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.cm-btn-block {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

#btn-campaign-modal-primary {
  background: var(--cm-accent);
  border-color: var(--cm-accent);
}

.cm-manual {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  text-align: right;
}

.cm-manual label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.cm-manual input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 16px;
}

.cm-code-display {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 14px;
  border-radius: 12px;
  background: color-mix(in srgb, #34c759 12%, transparent);
  border: 1px solid color-mix(in srgb, #34c759 35%, transparent);
  margin-bottom: 12px;
  word-break: break-all;
}

.cm-timer.is-urgent {
  color: #e53935;
  font-weight: 600;
}
