:root {
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --teal-deep:  #115e59;
  --amber:      #d97706;
  --amber-soft: #fef3c7;
  --rose:       #e11d48;

  --ink: #1c1917;
  --muted: #78716c;
  --paper: #faf8f5;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(28, 25, 23, 0.10);
  --line-strong: rgba(28, 25, 23, 0.16);
  --accent: #0d9488;
  --accent-2: #d97706;
  --danger: #dc2626;
  --shadow: 0 24px 70px rgba(28, 25, 23, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(217, 119, 6, 0.12), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(13, 148, 136, 0.10), transparent 30rem),
    linear-gradient(135deg, #faf8f5 0%, #f5f2ed 48%, #f0ece6 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-mark::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 9px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.10);
}

.brand-mark.has-logo::before {
  display: none;
}

.brand-mark-logo {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* ── Auth pages ───────────────────────────────────────── */
.web-auth-page {
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.78fr);
  gap: 24px;
  align-items: stretch;
}

.auth-brand,
.auth-card,
.callback-card,
.panel,
.referral-card,
.stats-grid article,
.dash-hero {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-brand {
  min-height: 620px;
  padding: 42px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 20px;
  border: 1px solid rgba(13, 148, 136, 0.12);
  background:
    linear-gradient(90deg, rgba(13, 148, 136, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(13, 148, 136, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, #000 38%, #000);
}

.auth-brand > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "Inter", ui-sans-serif, sans-serif;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.auth-brand h1 {
  max-width: 700px;
  margin-bottom: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.auth-brand .muted {
  max-width: 620px;
  font-size: 1.02rem;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.auth-proof span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-card {
  padding: 34px;
  border-radius: 24px;
  align-self: center;
}

.auth-card h2 {
  margin-bottom: 18px;
  font-size: 2.2rem;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.auth-mode-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
  padding: 11px 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-mode-btn.active {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
}

.notice {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(13, 148, 136, 0.06);
  color: var(--teal-deep);
}

.hidden { display: none !important; }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transition: opacity 0.15s ease;
}

.btn-google:hover { opacity: 0.9; }

.google-dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.login-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  outline: none;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.10);
}

.btn-primary-web,
.btn-secondary-web,
.btn-ghost-web {
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  padding: 13px 18px;
  text-align: center;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary-web {
  background: linear-gradient(135deg, var(--accent), var(--teal-dark));
  color: #fff;
}

.btn-primary-web:hover, .btn-ghost-web:hover { opacity: 0.9; }

.btn-secondary-web {
  width: 100%;
  padding: 13px 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary-web:hover { background: var(--card); border-color: var(--line-strong); }

.btn-ghost-web{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-line.error { color: var(--danger); }
.status-line.success { color: var(--accent); }

.fine-print {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.inline-action {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 12px;
  transition: background 0.15s ease;
  font-family: inherit;
  cursor: pointer;
}

.inline-action:hover { background: var(--card); }

/* ── Callback / Verify ────────────────────────────────── */
.callback-card {
  width: min(420px, 100%);
  padding: 38px;
  border-radius: 24px;
  text-align: center;
}

.callback-card h1 { margin: 18px 0 8px; font-size: 2rem; }

.verify-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1.5rem;
  font-weight: 900;
}

.verify-icon.success {
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent);
}

.verify-icon.error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 4px solid rgba(13, 148, 136, 0.15);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Affiliate page ──────────────────────────────────── */
.affiliate-page { padding: 22px; }

.dash-nav {
  width: min(1240px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-nav nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-nav a,
.dash-nav button {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}

.dash-nav a:hover,
.dash-nav button:hover { background: var(--card); }

.dash-nav a[aria-current="page"] {
  color: #fff;
  background: var(--ink);
}

.dash-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.dash-hero {
  padding: 28px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dash-hero h1 {
  max-width: 760px;
  margin-bottom: 10px;
}

.referral-card {
  padding: 18px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.chatbot-shortcut-card {
  padding: 20px 24px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(13,148,136,.10), rgba(217,119,6,.08));
  border: 1px solid rgba(13,148,136,.25);
}

.chatbot-shortcut-card h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.chatbot-shortcut-card .muted {
  margin: 0;
  font-size: 0.85rem;
}

/* ── Global chatbot launcher ─────────────────────────── */
.web-chatbot-launcher {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 68;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}

.web-chatbot-launcher > * {
  pointer-events: auto;
}

.web-chatbot-teaser {
  position: relative;
  width: min(320px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 245, 0.94)),
    linear-gradient(135deg, rgba(13, 148, 136, 0.10), rgba(217, 119, 6, 0.10));
  box-shadow: 0 26px 60px rgba(28, 25, 23, 0.14);
  backdrop-filter: blur(16px);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.web-chatbot-teaser.is-hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  visibility: hidden;
}

.web-chatbot-teaser::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -10px;
  width: 20px;
  height: 20px;
  border-right: 1px solid rgba(13, 148, 136, 0.18);
  border-bottom: 1px solid rgba(13, 148, 136, 0.18);
  background: #fbf8f3;
  transform: rotate(45deg);
}

.web-chatbot-teaser-kicker,
.cb-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.web-chatbot-teaser-kicker::before,
.cb-modal-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(13, 148, 136, 0.10);
}

.web-chatbot-teaser-title {
  display: block;
  margin: 0 32px 8px 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.web-chatbot-teaser-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.web-chatbot-teaser-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.05);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.web-chatbot-teaser-close:hover {
  background: rgba(28, 25, 23, 0.08);
  color: var(--ink);
}

.web-chatbot-teaser-action,
.web-chatbot-bubble {
  border: none;
  font-family: inherit;
}

.web-chatbot-teaser-action {
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.web-chatbot-teaser-action:hover,
.web-chatbot-bubble:hover {
  transform: translateY(-1px);
}

.web-chatbot-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ink), #2b2926);
  color: #fff;
  box-shadow: 0 20px 50px rgba(28, 25, 23, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.web-chatbot-bubble::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(13, 148, 136, 0.22);
  opacity: 0.85;
  animation: chatbotPulse 2.4s ease-out infinite;
}

.web-chatbot-bubble:hover {
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.32);
}

.web-chatbot-bubble-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.web-chatbot-bubble-label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

@keyframes chatbotPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.04);
    opacity: 0;
  }
  100% {
    transform: scale(1.04);
    opacity: 0;
  }
}

/* ── Chatbot picker modal ─────────────────────────────── */
.cb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28, 25, 23, 0.35);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 120;
}

.cb-modal-overlay.hidden { display: none; }

.cb-modal {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 245, 0.96)),
    linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(28, 25, 23, 0.08);
  border-radius: 28px;
  padding: 28px 28px 24px;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 32px 70px rgba(28, 25, 23, 0.16);
}

.cb-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cb-modal-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.cb-modal-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.cb-modal-close {
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.05);
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.cb-modal-close:hover {
  color: var(--ink);
  background: rgba(28, 25, 23, 0.08);
}

.cb-link-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.cb-link-card {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 25, 23, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s, transform .15s ease, box-shadow .15s ease;
}

.cb-link-card:hover {
  border-color: rgba(13, 148, 136, 0.30);
  background: rgba(13, 148, 136, 0.06);
  transform: translateY(-1px);
}

.cb-link-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.10), rgba(217, 119, 6, 0.08));
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

.cb-link-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.cb-link-desc {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cb-loading {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 16px 0;
  text-align: center;
}

.cb-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cb-modal-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.cb-modal-status.is-error {
  color: var(--danger);
}

.cb-btn {
  padding: 11px 22px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(28, 25, 23, 0.08);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  transition: color .15s, border-color .15s, transform .15s ease;
}

.cb-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.cb-btn.primary { background: linear-gradient(135deg, var(--accent), var(--teal-dark)); border-color: transparent; color: #fff; }
.cb-btn.primary:hover { opacity: 0.9; }
.cb-btn.primary:disabled { opacity: .45; cursor: default; }

@media (max-width: 768px) {
  .web-chatbot-launcher {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
  }

  .web-chatbot-teaser {
    width: min(100%, 360px);
  }

  .web-chatbot-bubble {
    min-height: 56px;
    padding: 10px 14px 10px 10px;
  }

  .cb-modal {
    width: min(100vw - 24px, 520px);
    padding: 22px 18px 18px;
    border-radius: 24px;
  }
}

/* ── Stats grid ───────────────────────────────────────── */
.label,
.stats-grid span,
.panel-head span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

code {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  white-space: normal;
  word-break: break-all;
}

.referral-card button,
.panel-head button {
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}

.referral-card button:hover,
.panel-head button:hover { opacity: 0.9; }

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

.stats-grid article {
  padding: 18px;
  border-radius: 20px;
}

.stats-grid strong {
  display: block;
  margin-top: 10px;
  font-family: "Inter", ui-sans-serif, sans-serif;
  font-size: 2rem;
  letter-spacing: -0.04em;
  color: var(--accent-strong, var(--teal-dark));
}

/* ── Dashboard grid ──────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border-radius: 20px;
}

.panel h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.payout-panel,
.guide-panel {
  grid-column: 1 / -1;
}

.payout-form {
  display: grid;
  grid-template-columns: 150px minmax(160px, 1fr) minmax(180px, 1.4fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

td.empty {
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ── Workflow chat ────────────────────────────────────── */
.workflow-chat-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(13, 148, 136, 0.10), transparent 28%),
    linear-gradient(180deg, #faf8f5 0%, #f5f2ed 100%);
  color: var(--ink);
  font-family: "Inter", sans-serif;
}

.workflow-chat-shell {
  width: min(1180px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 10px 0;
  min-height: 100vh;
}

.workflow-chat-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(28, 25, 23, 0.06);
  padding: 16px;
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
}

.workflow-chat-header,
.workflow-chat-composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.workflow-chat-kicker,
.workflow-chat-role,
.workflow-chat-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.workflow-chat-header h1 {
  margin: 4px 0 6px;
  font-family: "Inter", sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.workflow-chat-title-wrap { min-width: 0; }
.workflow-chat-header-actions { display: flex; align-items: flex-start; }

.workflow-chat-meta-row,
.workflow-chat-starters,
.workflow-chat-media-strip,
.workflow-chat-prompts,
.workflow-chat-files {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workflow-chat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.workflow-chat-starters,
.workflow-chat-media-strip,
.workflow-chat-files {
  margin-top: 12px;
}

.workflow-chat-starter {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.workflow-chat-starter:hover { border-color: var(--accent); }

.workflow-chat-thread {
  margin-top: 14px;
  min-height: 280px;
  flex: 1;
  overflow: auto;
  padding: 6px 2px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-chat-bubble {
  max-width: min(720px, 92%);
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-panel, #fff);
}

.workflow-chat-bubble.is-user {
  align-self: flex-end;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.2);
}

.workflow-chat-bubble.is-pending { opacity: 0.72; }

.workflow-chat-role { margin: 0 0 6px; }

.workflow-chat-content {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.95rem;
}

.workflow-chat-prompt-chip,
.workflow-chat-file-chip,
.workflow-chat-media-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
}

.workflow-chat-apply-btn { margin-top: 8px; }

.workflow-chat-composer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-panel, #fff);
  padding: 12px;
}

.workflow-chat-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  max-height: 180px;
  border: none;
  outline: none;
  font: inherit;
  background: transparent;
  color: var(--ink);
}

.workflow-chat-upload input { display: none; }

.workflow-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-shell,
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 30px;
  }

  .auth-card { padding: 26px; }

  .dash-hero,
  .referral-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dash-hero { display: grid; }
  .payout-form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .affiliate-page { padding: 14px; }
  .dash-nav { align-items: flex-start; gap: 12px; flex-direction: column; }
  .dash-nav nav { flex-wrap: wrap; }
  .auth-brand h1 { font-size: 2.4rem; }
}

@media (max-width: 720px) {
  .workflow-chat-shell {
    width: calc(100vw - 18px);
    padding: 6px 0;
  }

  .workflow-chat-panel {
    border-radius: 16px;
    padding: 12px;
    min-height: calc(100vh - 12px);
  }

  .workflow-chat-header,
  .workflow-chat-composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .workflow-chat-thread { min-height: 240px; }
}
.download-popup-actions{
  margin-top: 20px;
}