* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 30%),
    #f8fafc;
  color: #0f172a;
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px 32px;
}

.card {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.layer-card {
  padding: 14px;
}

.layer-card > details {
  border: 0;
  background: transparent;
  padding: 0;
}

.layer-card > details > summary {
  font-size: 16px;
}

h1, h2 {
  margin: 0 0 12px;
}

.container h2 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.flow-hint {
  font-weight: 600;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  min-height: 680px;
  overflow: hidden;
  position: relative;
  padding: 58px 28px;
  background:
    radial-gradient(circle at 78% 18%, rgba(99, 102, 241, 0.52), transparent 28%),
    radial-gradient(circle at 18% 12%, rgba(14, 165, 233, 0.2), transparent 28%),
    linear-gradient(135deg, #020617 0%, #111827 50%, #312e81 100%);
  border-color: rgba(99, 102, 241, 0.34);
  color: #fff;
}

.landing-hero::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent);
}

.landing-hero-copy,
.landing-hero-card {
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  max-width: 700px;
  font-size: clamp(48px, 8vw, 86px);
  line-height: 0.92;
  letter-spacing: -0.075em;
  margin-bottom: 26px;
  color: #fff;
}

.landing-eyebrow {
  margin: 0 0 10px;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-subtitle {
  max-width: 680px;
  color: #111827;
  font-size: 26px;
  line-height: 1.32;
  margin: 0;
}

.landing-description {
  max-width: 640px;
  margin: 14px 0 0;
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1.7;
}

.landing-actions {
  align-items: stretch;
  flex-direction: column;
  margin-top: 28px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.26);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button-link:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.32);
  transform: translateY(-2px);
}

.button-link.secondary {
  background: #fff;
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.22);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.button-link.secondary:hover {
  background: #f8fafc;
}

.landing-trust-text {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.landing-hero .landing-trust-text {
  color: #cbd5e1;
}

.landing-hero .landing-eyebrow {
  color: #a5b4fc;
}

.landing-hero .button-link {
  min-height: 56px;
  padding: 15px 22px;
  background: linear-gradient(135deg, #ffffff, #e0e7ff);
  color: #312e81;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.28);
}

.landing-hero .button-link:hover {
  background: linear-gradient(135deg, #ffffff, #c7d2fe);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.36);
}

.landing-hero .button-link.secondary {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
}

.landing-hero .button-link.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.landing-hero-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 26px;
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.landing-hero-card:hover {
  box-shadow: 0 38px 105px rgba(0, 0, 0, 0.44);
  transform: translateY(-4px);
}

.landing-hero-card::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.5), rgba(14, 165, 233, 0.2));
  content: "";
  transform: rotate(-2deg);
}

.landing-mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.landing-mock-header strong,
.landing-mock-header span {
  display: block;
}

.landing-mock-header strong {
  color: #fff;
  font-size: 16px;
}

.landing-mock-header span {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.landing-live-pill,
.landing-popular-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #dcfce7;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
}

.landing-chat-bubble {
  max-width: 92%;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #1e1b4b;
  font-size: 15px;
  font-weight: 700;
}

.landing-chat-bubble span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.landing-progress-panel {
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.landing-progress-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.landing-progress-panel span {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
}

.landing-progress-panel strong {
  color: #fff;
  font-size: 28px;
}

.landing-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.landing-progress-track span {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #a3e635);
}

.landing-campaign-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.landing-campaign-progress div,
.landing-result-grid div {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 14px;
  background: #f8fafc;
}

.landing-hero-card .landing-campaign-progress div {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.landing-campaign-progress span,
.landing-result-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.landing-campaign-progress strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}

.landing-hero-card .landing-campaign-progress strong {
  color: #fff;
}

.landing-status-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.landing-status-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  color: #cbd5e1;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.07);
}

.landing-status-list strong {
  margin-left: auto;
  color: #fff;
}

.landing-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.landing-status-dot.sent {
  background: #22c55e;
}

.landing-status-dot.pending {
  background: #f59e0b;
}

.landing-status-dot.failed {
  background: #ef4444;
}

.landing-chat-bubble.alt {
  margin-left: auto;
  border-radius: 16px 16px 5px 16px;
  background: #ecfdf5;
  color: #047857;
}

.landing-chat-status {
  padding-top: 4px;
  color: #94a3b8;
  font-size: 13px;
  text-align: right;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.landing-list {
  margin: 0;
  padding-left: 20px;
  color: #64748b;
  line-height: 1.85;
}

.landing-warning {
  margin: 18px 0 0;
  color: #b91c1c;
  font-size: 18px;
  font-weight: 800;
}

.landing-solution {
  text-align: center;
}

.landing-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 22px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.landing-flow span {
  padding: 16px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  border-radius: 16px;
  background: #eef2ff;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.08);
}

.landing-flow strong {
  color: #4f46e5;
}

.landing-steps,
.landing-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.landing-steps div,
.landing-feature-grid div {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 18px;
  background: #f8fafc;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.landing-steps div:hover,
.landing-feature-grid div:hover,
.landing-pricing-grid .card:hover {
  border-color: rgba(79, 70, 229, 0.26);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
  transform: translateY(-3px);
}

.landing-steps strong,
.landing-feature-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.landing-steps span,
.landing-feature-grid span {
  display: block;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.landing-pricing {
  text-align: center;
  border-color: #c7d2fe;
}

.landing-pricing-section {
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.1), transparent 28%),
    #fff;
}

.landing-pricing-header {
  max-width: 680px;
  margin: 0 auto 26px;
  text-align: center;
}

.landing-pricing-header h2 {
  margin-bottom: 10px;
}

.landing-pricing-grid .card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.landing-pricing-grid .button-link {
  margin-top: auto;
}

.landing-price-card {
  padding: 26px;
}

.landing-price-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.landing-price-label {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-price {
  color: #0f172a;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.landing-price span {
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-price-features {
  display: grid;
  gap: 12px;
  margin: 4px 0 8px;
  padding: 0;
  color: #475569;
  list-style: none;
}

.landing-price-features li {
  position: relative;
  padding-left: 28px;
  line-height: 1.45;
}

.landing-price-features li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  content: "✓";
  font-size: 12px;
  font-weight: 900;
}

.landing-pricing-highlight {
  border-color: #4f46e5;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #4f46e5, #a855f7) border-box;
  border: 1px solid transparent;
  box-shadow: 0 28px 70px rgba(79, 70, 229, 0.2);
  transform: scale(1.02);
}

.landing-pricing-highlight:hover {
  transform: translateY(-3px) scale(1.03);
}

.landing-popular-badge {
  align-self: flex-start;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.landing-pricing-note {
  margin: 24px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.landing-cta {
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.36), transparent 34%),
    linear-gradient(135deg, #0f172a, #1e1b4b);
  border-color: rgba(129, 140, 248, 0.36);
  color: #fff;
}

.landing-cta .muted {
  color: #cbd5e1;
}

.landing-cta .button-link {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
}

.landing-trust {
  text-align: center;
}

.landing-results {
  text-align: center;
}

.landing-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.landing-result-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #4f46e5;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1;
}

#authScreen > .card,
#authScreen > .landing-grid {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

#authScreen > .card.is-visible,
#authScreen > .landing-grid.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-pricing h2 {
  font-size: 36px;
  letter-spacing: -0.04em;
}

.landing-pricing .button-link,
.landing-cta .button-link {
  margin-top: 10px;
}

.muted {
  color: #64748b;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.import-data-row {
  align-items: center;
}

.project-name-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #cbd5e1;
  text-underline-offset: 3px;
}

.project-name-clickable:hover {
  color: #1d4ed8;
}

.project-name-edit-input {
  max-width: 280px;
}

.status-bar {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 14px;
}

.preview-secondary {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.active-campaign-primary {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px #dbeafe inset;
}

.active-campaign-completed {
  opacity: 0.72;
  border-color: #d1d5db;
  background: #f9fafb;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.active-campaign-card-list {
  display: none;
}

.campaign-history-card-list {
  display: none;
}

.active-campaign-card,
.campaign-history-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.active-campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.active-campaign-card-progress {
  margin-top: 10px;
  color: #2563eb;
  font-size: 15px;
  font-weight: 700;
}

.active-campaign-card-filtered {
  border-color: #e5e7eb;
  background: #fff;
}

.active-campaign-card-filtered .active-campaign-card-progress {
  color: #166534;
}

.active-campaign-card-note {
  margin-top: 4px;
  color: #4b5563;
  font-size: 14px;
}

.active-campaign-card-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 10px;
  color: #4b5563;
  font-size: 14px;
}

.active-campaign-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.active-campaign-card-actions button {
  width: 100%;
}

.campaign-completed-row {
  color: #6b7280;
  background: #f9fafb;
}

.instance-onboarding {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.instance-onboarding strong {
  color: #1e3a8a;
}

.instance-onboarding span {
  color: #4b5563;
  font-size: 14px;
}

.instance-onboarding small {
  color: #6b7280;
  font-size: 13px;
}

.instance-onboarding button {
  margin-top: 2px;
  width: fit-content;
}

.instance-connect-form {
  align-items: stretch;
}

.instance-card-list {
  display: none;
}

.instance-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.instance-card-needs-setup {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.instance-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.instance-card-phone {
  margin-top: 10px;
  color: #4b5563;
  font-size: 15px;
}

.instance-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.instance-card-actions button {
  width: 100%;
}

.instance-status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.instance-status-pill.connected {
  background: #dcfce7;
  color: #166534;
}

.instance-status-pill.paused {
  background: #fef3c7;
  color: #92400e;
}

.instance-status-pill.disconnected {
  background: #fee2e2;
  color: #991b1b;
}

.campaign-onboarding-card {
  margin: 14px 0 16px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.campaign-onboarding-card h2 {
  margin-bottom: 6px;
}

.campaign-mini-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.campaign-mini-guide div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #fff;
}

.campaign-mini-guide strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
}

.campaign-mini-guide span {
  font-size: 14px;
  font-weight: 600;
}

.campaign-warning {
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.progress-track {
  width: 100%;
  max-width: 420px;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 0.2s ease;
}

.active-campaign-all-filtered .progress-track {
  display: none;
}

.active-campaign-all-filtered #activeCampaignProgressText {
  color: #166534;
  font-weight: 700;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid.three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

#stepUploadProgressWrap {
  width: 100%;
  max-width: 420px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

#stepUploadProgressBar {
  width: 0%;
  height: 100%;
  background: #3b82f6;
  transition: width 0.15s linear;
}

#stepMediaPreview img {
  max-width: 240px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

label {
  font-size: 14px;
  color: #374151;
}

input {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

input[readonly] {
  background: #f3f4f6;
  color: #4b5563;
}

textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

select {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

button {
  border: 0;
  background: #2563eb;
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

button.secondary {
  background: #374151;
}

button.secondary:hover {
  background: #1f2937;
}

button.danger {
  background: #dc2626;
}

button.danger:hover {
  background: #b91c1c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sub-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.import-step-card h3 {
  margin-bottom: 6px;
}

.sub-card h3 {
  margin: 0 0 10px;
}

.selected-project-row {
  background: #eff6ff;
}

.top-gap {
  margin-top: 12px;
}

details {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fafb;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
  color: #111827;
}

.steps-card-list {
  display: grid;
  gap: 18px;
  margin-top: 12px;
  justify-items: center;
}

.step-flow-item {
  position: relative;
  width: 100%;
  max-width: 760px;
  padding-bottom: 8px;
}

.step-flow-item.with-connector {
  padding-bottom: 34px;
}

.step-flow-item.with-connector::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% - 8px);
  width: 4px;
  height: 24px;
  background: #94a3b8;
  border-radius: 999px;
}

.step-flow-item.with-connector::before {
  content: "↓";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 16px);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
}

.step-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 12px;
  background: #f8fbff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.step-card-number {
  font-weight: 700;
}

#stepsTitle {
  margin-bottom: 4px;
}

.step-card-preview {
  font-size: 14px;
  color: #374151;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.step-card-delay {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

.step-card-actions {
  display: flex;
  gap: 8px;
}

.carousel-card-preview {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  background: #f8fafc;
}

.carousel-card-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.carousel-card-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f9fafb;
  white-space: nowrap;
}

.message-log-failed-row {
  background: #fff1f2;
}

.message-log-failed-row td {
  border-bottom-color: #fecdd3;
}

.message-log-card-list {
  display: none;
}

.message-log-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.message-log-card-attention {
  background: #f9fafb;
}

.message-log-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.message-log-card-phone {
  margin-top: 8px;
  color: #4b5563;
  font-size: 14px;
}

.message-log-card-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.message-log-card-counts span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.message-log-card-reason {
  margin-top: 10px;
  color: #6b7280;
  font-size: 13px;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #f9fafb;
}

.admin-summary-card span {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.admin-summary-card strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 26px;
}

.admin-card-list {
  display: none;
}

.admin-mobile-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
}

.admin-mobile-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #111827;
}

.admin-detail-panel {
  margin: 12px 0;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-action-row button {
  flex: 1 1 120px;
}

.admin-setting-field,
.admin-setting-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-setting-field {
  justify-content: space-between;
  margin: 8px 0;
}

.admin-setting-field input[type="number"],
#adminPlanSettingsTable input[type="number"] {
  max-width: 120px;
}

.admin-setting-check {
  margin: 8px 0;
}

.admin-usage {
  min-width: 120px;
}

.admin-usage-track {
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.admin-usage-track span {
  display: block;
  height: 100%;
  background: #2563eb;
}

.admin-risk-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

.admin-risk-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.admin-risk-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.admin-risk-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.admin-card-list.always-visible {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.hidden {
  display: none;
}

.result-box {
  margin-top: 12px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  min-height: 40px;
  overflow-x: auto;
}

#detailsTitle {
  margin: 4px 0 10px;
}

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

.preview-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.preview-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  padding: 12px;
}

.preview-summary-label {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 6px;
}

.preview-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.label {
  font-weight: 600;
}

.skipped-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.skipped-list li {
  margin: 4px 0;
  color: #4b5563;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-yellow {
  background: #fef9c3;
  color: #854d0e;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-gray {
  background: #e5e7eb;
  color: #374151;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.type-badge-text {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #bfdbfe;
}

.type-badge-image {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}

.type-badge-document {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

.type-badge-carousel {
  background: #ecfeff;
  color: #155e75;
  border-color: #a5f3fc;
}

#messageBox.success {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

#messageBox.error {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: #16a34a;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #dc2626;
}

.toast.warning {
  background: #f59e0b;
}

@media (min-width: 761px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
    gap: 38px;
    padding: 62px 54px;
  }

  .landing-actions {
    align-items: center;
    flex-direction: row;
  }

  .button-link {
    width: auto;
    min-width: 150px;
  }

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

  .landing-flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .landing-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-feature-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .landing-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .landing-result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    margin: 12px auto;
    padding: 0 12px 28px;
  }

  #authScreen > .card,
  #authScreen > .landing-grid {
    margin-bottom: 24px;
  }

  .landing-hero,
  .landing-grid,
  .landing-steps,
  .landing-feature-grid,
  .campaign-mini-guide,
  .grid.two,
  .grid.three,
  .preview-grid,
  .preview-summary-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
    padding: 38px 22px;
    text-align: center;
  }

  .landing-hero h1 {
    font-size: clamp(46px, 16vw, 64px);
  }

  .landing-subtitle {
    font-size: 22px;
  }

  .landing-description {
    font-size: 16px;
  }

  .landing-hero-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
  }

  .landing-campaign-progress {
    grid-template-columns: 1fr;
  }

  .landing-status-list div {
    font-size: 12px;
  }

  .landing-pricing-highlight {
    transform: none;
  }

  .landing-pricing-highlight:hover {
    transform: translateY(-3px);
  }

  .landing-pricing-section {
    padding: 22px;
  }

  .landing-price-card {
    padding: 22px;
  }

  .landing-price {
    font-size: 38px;
  }

  .landing-price-card .button-link {
    width: 100%;
  }

  .landing-flow {
    gap: 14px;
  }

  .landing-steps {
    gap: 18px;
  }

  .campaign-onboarding-card {
    margin-top: 12px;
    padding: 14px;
  }

  .campaign-mini-guide {
    gap: 8px;
  }

  .campaign-mini-guide div {
    padding: 9px;
  }

  #activeCampaignTable {
    display: none;
  }

  .active-campaign-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  #activeCampaignSection {
    overflow: hidden;
  }

  #activeCampaignSection .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  #activeCampaignSection button {
    width: 100%;
  }

  #activeCampaignProgressCount {
    display: grid;
    gap: 4px;
    margin-top: 8px;
  }

  #messageLogsTable {
    display: none;
  }

  #campaignsTable {
    display: none;
  }

  .campaign-history-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  .campaign-history-card button {
    width: 100%;
  }

  .message-log-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  #deliveryLogsDetails {
    overflow-x: auto;
  }

  .admin-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  #adminUsersTable,
  #adminCompaniesTable,
  #adminPlanSettingsTable,
  #adminInstancesTable {
    display: none;
  }

  .admin-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  .admin-action-row {
    display: grid;
  }

  .admin-action-row button,
  .admin-mobile-card button {
    width: 100%;
  }

  .landing-actions .button-link {
    width: 100%;
  }

  .landing-pricing-grid .button-link,
  .landing-cta .button-link {
    width: 100%;
  }

  .landing-pricing h2 {
    font-size: 38px;
  }

  #instancesTab {
    padding: 14px;
  }

  .instance-connect-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
  }

  .instance-connect-form input,
  .instance-connect-form button {
    width: 100%;
    max-width: none;
  }

  #instanceName {
    display: none;
  }

  .instance-onboarding button {
    width: 100%;
  }

  #instanceTable {
    display: none;
  }

  .instance-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  th:nth-child(4),
  td:nth-child(4) {
    display: none;
  }

  #instancesTab button {
    width: 100%;
  }
}
