
:root {
  color-scheme: dark;
  /* ===== Forge design system tokens ===== */
  --canvas:#0a0b12; --surface-1:#14161f; --surface-2:#1c1f2b; --surface-3:#252837;
  --border-strong:rgba(255,255,255,.14);
  --brand-purple:#2E7CF6; --brand-blue:#2E7CF6; --brand-cyan:#2BD0C5;
  --gradient-brand:linear-gradient(100deg,#2E7CF6,#2E7CF6,#2BD0C5); --gradient-action:linear-gradient(135deg,#2E7CF6 0%,#2BD0C5 100%); --gradient-action-hover:linear-gradient(135deg,#1688ff 0%,#5de2e8 100%);
  --gradient-brand-soft:linear-gradient(100deg,rgba(46,124,246,.18),rgba(46,124,246,.18),rgba(43,208,197,.18));
  --gradient-text:linear-gradient(100deg,#6EA8FF,#4E9BFF,#3BE0D5);
  --success:#2BD66F; --warning:#F5B642; --danger:#F2545B; --info:#2BD0C5;
  --success-bg:rgba(43,214,111,.14); --warning-bg:rgba(245,182,66,.14); --danger-bg:rgba(242,84,91,.14); --info-bg:rgba(43,208,197,.14);
  --focus-ring:#2BD0C5;
  --st-new:#2BD0C5; --st-contacted:#3B9DFF; --st-qualified:#2E7CF6; --st-proposal:#0E8FAC; --st-booked:#F5B642; --st-won:#2BD66F; --st-lost:#F2545B;
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:24px; --r-pill:999px;
  --shadow-1:0 1px 2px rgba(0,0,0,.4),0 4px 16px rgba(0,0,0,.24); --shadow-2:0 8px 40px rgba(0,0,0,.55);
  --glow-brand:0 0 0 1px rgba(43,208,197,.25),0 8px 30px rgba(46,124,246,.35);
  --ease:cubic-bezier(.22,.61,.36,1); --dur-fast:.14s; --dur:.24s; --dur-slow:.4s;
  /* ===== Back-compat aliases: existing portal vars repointed to the new palette ===== */
  --green:#2BD0C5; --green-dim:#1FA8A0; --green-glow:rgba(43,208,197,0.15);
  --cyan:#2BD0C5; --cyan-dim:#1FA8A0; --cyan-glow:rgba(43,208,197,0.15);
  --black:#0a0b12; --surface:#14161f; --surface2:#1c1f2b; --surface3:#252837;
  --border:rgba(255,255,255,0.08); --border2:rgba(255,255,255,0.05);
  --text:#F4F6FB; --text-muted:#A8B0C2; --text-dim:#6B7488; --text-1:#F4F6FB; --text-2:#A8B0C2; --text-3:#6B7488;
  /* Canonical type scale (px) - use these instead of ad-hoc sizes. h1=page title, h2=section, body=default, label=field label, hint=helper, micro=meta. */
  --fs-h1:22px; --fs-h2:16px; --fs-body:13px; --fs-label:12px; --fs-hint:11.5px; --fs-micro:11px; --lh-body:1.55;
  --red:#F2545B; --amber:#F5B642; --blue:#2E7CF6; --purple:#2E7CF6;
  --sidebar-w: 232px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-head: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--black); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }

/* ─── FORGE BRAND GRADIENT LINE ─── */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #2BD0C5 0%, #2E7CF6 50%, #2BD0C5 100%); z-index: 9999; pointer-events: none; }

/* ─── LOGIN ─── */
#loginScreen {
  position: fixed; inset: 0; z-index: 300; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; align-items: flex-start; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(43,208,197,0.06) 0%, rgba(46,124,246,0.04) 40%, var(--black) 70%);
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
#loginScreen::before, #loginScreen::after { content:''; position:absolute; border-radius:50%; filter:blur(80px); pointer-events:none; z-index:0; opacity:.55; }
#loginScreen::before { width:560px; height:560px; top:-180px; left:-140px; background:radial-gradient(circle, rgba(46,124,246,.55), transparent 70%); animation: loginFloatA 17s ease-in-out infinite; }
#loginScreen::after { width:500px; height:500px; bottom:-180px; right:-140px; background:radial-gradient(circle, rgba(46,124,246,.5), transparent 70%); animation: loginFloatB 21s ease-in-out infinite; }
@keyframes loginFloatA { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(90px,70px) scale(1.18)} 66%{transform:translate(40px,-50px) scale(.92)} }
@keyframes loginFloatB { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-80px,-60px) scale(1.14)} }
#loginScreen .login-card { z-index: 1; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 400px;
  position: relative; overflow: hidden; margin: auto;
}
.login-card::before {
  content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 280px; height: 280px;
  background: radial-gradient(ellipse at 30% -10%, rgba(43,208,197,0.18) 0%, rgba(46,124,246,0.10) 55%, transparent 80%);
  pointer-events: none;
}
.login-logo { text-align:center; margin-bottom: 6px; }
.login-logo img { display:inline-block; }
.login-tagline { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.5; }
.login-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.login-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 13px 14px; border-radius: 10px;
  font-size: 15px; font-family: var(--font); margin-bottom: 16px;
  outline: none; transition: border-color 0.2s;
}
.login-input:focus { border-color: rgba(43,208,197,0.5); }
.login-btn {
  width: 100%; background: linear-gradient(135deg, #2BD0C5, #2E7CF6); color: #fff;
  border: none; padding: 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; font-family: var(--font); margin-top: 4px;
}
.login-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.login-btn:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.login-error { font-size: 13px; color: var(--red); margin-top: 12px; text-align: center; display: none; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); border-radius: 8px; padding: 10px 14px; }
.login-error.success { color: var(--green); background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.25); } /* "reset link sent" is a confirmation, not an error: green box, not red */
.login-hint { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 20px; }
.login-hint a { color: var(--green); text-decoration: none; }

/* ─── SIGN-UP (multi-step, deep-linked via #signup) ─── */
#loginScreen.signup-mode .login-card { max-width: 520px; }
#loginScreen.signup-mode #cfTurnstilePortal { display: none !important; }
.su-steps { display: flex; gap: 8px; margin: 2px 0 24px; }
.su-step-pill { flex: 1; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.su-step-pill::before { content: ''; display: block; height: 4px; border-radius: 2px; background: var(--surface2); margin-bottom: 7px; transition: background 0.2s; }
.su-step-pill.on { color: var(--text); }
.su-step-pill.on::before { background: linear-gradient(90deg, #2BD0C5, #2E7CF6); }
.su-step-pill.done { cursor: pointer; } /* completed pills navigate BACK only (suPillGo) */
.su-step-pill.done:hover { color: var(--text); }
.su-step-pill.done:focus-visible { outline: 2px solid rgba(43,208,197,0.6); outline-offset: 2px; border-radius: 4px; }
.su-row { display: flex; gap: 12px; }
.su-row > div { flex: 1; min-width: 0; }
.su-field-error { display: none; font-size: 11.5px; color: var(--red); margin: -10px 0 12px; }
.login-input.su-invalid { border-color: rgba(248,113,113,0.55); }
.su-pass-wrap { position: relative; }
.su-pass-wrap .login-input { padding-right: 62px; }
.su-pass-toggle { position: absolute; right: 8px; top: 10px; background: none; border: none; color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; cursor: pointer; font-family: var(--font); padding: 5px 7px; border-radius: 6px; }
.su-pass-toggle:hover { color: var(--text); background: var(--surface); }
.su-strength { display: flex; gap: 6px; margin: -8px 0 6px; }
.su-strength span { flex: 1; height: 3px; border-radius: 2px; background: var(--surface2); transition: background 0.2s; }
.su-strength.s1 span:nth-child(1) { background: var(--red); }
.su-strength.s2 span:nth-child(-n+2) { background: #FBBF24; }
.su-strength.s3 span { background: var(--green); }
.su-hint { font-size: 11px; color: var(--text-dim); margin: 0 0 14px; line-height: 1.5; }
.su-plan { display: block; border: 1px solid var(--border); background: var(--surface2); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; position: relative; transition: border-color 0.15s, box-shadow 0.15s; }
.su-plan input { position: absolute; opacity: 0; pointer-events: none; }
.su-plan.sel { border-color: rgba(43,208,197,0.65); box-shadow: 0 0 0 1px rgba(43,208,197,0.35), 0 0 18px rgba(43,208,197,0.08); }
.su-plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-right: 26px; } /* clears the .su-plan-tick circle so the price + /mo never sit under it */
.su-plan:focus-within { border-color: rgba(43,208,197,0.55); box-shadow: 0 0 0 2px rgba(43,208,197,0.30); } /* keyboard focus is VISIBLE on the whole card (the radio itself is opacity:0) */
.su-plan-name { font-size: 14px; font-weight: 800; }
/* Price is inline-flex with an explicit gap so the amount and /mo can never collide, even when a
   browser extension (price trackers, coupon tools) injects its own badge over the number. */
.su-plan-price { font-size: 17px; font-weight: 800; color: var(--text); white-space: nowrap; display: inline-flex; align-items: baseline; gap: 3px; }
.su-plan-price small { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: .02em; }
.su-plan-credits { font-size: 12px; font-weight: 700; color: var(--text); margin-top: 4px; }
.su-plan-feat { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.su-plan-badge { position: absolute; top: -9px; left: 16px; background: linear-gradient(90deg, #2E7CF6, #2BD0C5); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 10px; border-radius: 20px; }
.su-plan-tick { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; }
.su-plan.sel .su-plan-tick { border-color: var(--green); background: rgba(43,208,197,0.15); color: var(--green); }
.su-nav { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.su-nav .login-btn { flex: 1; margin-top: 0; }
.su-back { background: none; border: none; color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); padding: 12px 10px; border-radius: 8px; }
.su-back:hover { color: var(--text); background: var(--surface2); }
.su-summary { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.8; }
.su-summary b { color: var(--text); font-weight: 700; }
@media (max-width: 520px) { .su-row { display: block; } }

/* ─── APP SHELL ─── */
#app { display: none; height: 100vh; }
.app-layout { display: flex; height: 100vh; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}
.sidebar-header { padding: 22px 18px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-logo { line-height:1; }
.sidebar-logo span { background: linear-gradient(135deg, #2BD0C5, #2E7CF6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-client { font-size: 12px; color: var(--text-muted); margin-top: 5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-tier { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 100px; margin-top: 6px; }
.tier-free { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.tier-autopilot { background: var(--green-glow); color: var(--green); }
.tier-premium { background: rgba(46,124,246,0.15); color: var(--purple); }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); padding: 10px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s; margin-bottom: 1px;
  border: none; background: none; width: 100%; text-align: left; font-family: var(--font);
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(43,208,197,0.18), rgba(46,124,246,0.08)); color: var(--green); }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 18px; flex-shrink: 0; }
.nav-icon svg, .nav-item svg, .side-nav svg, .sidebar svg { width:18px; height:18px; flex:none; }
.fc-good{color:#4ade80 !important;} .fc-warn{color:#f5b642 !important;} .fc-bad{color:#f87171 !important;}
.nav-badge { margin-left: auto; background: var(--green); color: #000; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 100px; min-width: 18px; text-align: center; }
.nav-badge.amber { background: var(--amber); }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.referral-cta{ display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:linear-gradient(135deg,rgba(43,208,197,.10),rgba(46,124,246,.08));border:1px solid rgba(43,208,197,.25);border-radius:12px;padding:10px 12px;margin-bottom:10px;cursor:pointer;transition:border-color .15s,transform .1s;color:var(--text);}
.referral-cta:hover{ border-color:rgba(43,208,197,.55);transform:translateY(-1px);}
.referral-cta-icon{ display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9px;background:rgba(43,208,197,.14);color:var(--cyan);flex-shrink:0;}
.referral-cta-text{ display:flex;flex-direction:column;line-height:1.25;flex:1;min-width:0;}
.referral-cta-text strong{ font-size:13px;font-weight:700;color:var(--text);}
.referral-cta-text span{ font-size:11px;color:var(--text-muted);}
.referral-cta-arrow{ color:var(--text-dim);flex-shrink:0;}
.logout-btn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); background: none; border: none; cursor: pointer; font-family: var(--font); padding: 6px 4px; border-radius: 6px; width: 100%; transition: color 0.2s; }
.logout-btn:hover { color: var(--red); }

/* ─── MAIN CONTENT ─── */
.main { flex: 1; overflow-y: auto; height: 100vh; background: var(--black); }
.tab-pane { display: none; padding: 36px 40px; min-height: 100%; max-width: 1560px; margin: 0 auto; }
.tab-pane.active { display: block; }
.tab-pane.wide { max-width: none; }
.page-header { margin-bottom: 32px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
/* ─── BRAND FONTS - Plus Jakarta Sans for headings ─── */
.page-title, .section-title, .empty-title, .modal-title, .billing-plan, .login-card h2 {
  font-family: 'Plus Jakarta Sans', var(--font);
}
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
/* Funnel screens (Landing/Forms/Pipeline/Outreach) use page-head/page-sub; unify with the rest of the portal. */
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom: 24px; }
.page-sub { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

/* ─── STAT CARDS ─── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.dash-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; align-items: start; margin-bottom: 24px; }
.dash-row > .section { margin-bottom: 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.pipeline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px){ .pipeline-grid { grid-template-columns: 1fr; } }
.pipe-stage { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.pipe-stage-head { display: flex; align-items: center; gap: 8px; }
.pipe-step { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pipe-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pipe-empty { font-size: 13px; color: var(--text-dim); }
.refreshed-stamp { text-align: right; font-size: 11px; color: var(--text-dim); margin-top: 18px; }
.eng-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.eng-chip-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.eng-chip-val { font-size: 17px; font-weight: 700; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ─── SECTION ─── */
.section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px; overflow: hidden; }
.section-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title { font-size: 14px; font-weight: 700; }
.section-body { padding: 22px; }
.section-meta { font-size: 13px; color: var(--text-muted); }

/* ─── BATCH VIEW ─── */
.batch-group { margin-bottom: 32px; }
.batch-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.batch-week-label { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.batch-count { font-size: 12px; color: var(--text-muted); }
.batch-actions { display: flex; gap: 8px; align-items: center; }
.btn-approve-all { font-size: 12px; font-weight: 700; background: var(--green-glow); color: var(--green); border: 1px solid rgba(43,208,197,0.25); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.btn-approve-all:hover { background: rgba(43,208,197,0.2); }
.btn-approve-all:disabled { opacity: 0.3; cursor: not-allowed; }

.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1100px){ .post-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px){ .post-list { grid-template-columns: 1fr; } }
.post-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.post-card-body { padding: 12px 14px; display: flex; flex-direction: column; flex: 1 1 auto; }
.type-toggle-btn { padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface3); color: var(--text-muted); font-size: 12px; font-weight: 400; cursor: pointer; transition: all .2s; font-family: inherit; }
.type-toggle-btn.active { border-color: var(--cyan); background: rgba(0,212,204,.12); color: var(--cyan); font-weight: 600; }
.type-toggle-btn:hover { border-color: rgba(255,255,255,.2); }
.post-card:hover { border-color: rgba(43,208,197,0.5); background: rgba(43,208,197,0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(43,208,197,0.25); transform: translateY(-3px); }
.post-card.needs-action { border-color: rgba(43,208,197,0.2); }
.post-card.revision { border-color: rgba(252,211,77,0.2); }

.post-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.platform-icon { font-size: 15px; flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--surface3); display: flex; align-items: center; justify-content: center; }
.post-meta { flex: 1; min-width: 0; }
.post-platform { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.post-caption { font-size: 14px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.status-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; white-space: nowrap; }
.gen-bar { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 18px; }
.gen-bar-top { display: flex; gap: 10px; align-items: center; }
.gen-bar-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; }
.gen-bar-input:focus { border-color: var(--cyan); }
.gen-bar-go { display: inline-flex; align-items: center; gap: 7px; padding: 11px 20px; white-space: nowrap; }
.gen-bar-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gen-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.gen-seg-btn { background: none; border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-family: inherit; }
.gen-seg-btn.active { background: var(--surface2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.gen-bar-select { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; color: var(--text); font-size: 12.5px; font-family: inherit; outline: none; cursor: pointer; }
.gen-bar-accounts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.gen-acct-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 100px; padding: 4px 10px; }
.gen-acct-chip.none { color: var(--amber); border-color: rgba(252,211,77,.3); }
.tile-menu-wrap { position: relative; display: inline-block; }
.tile-sound-btn { position:absolute; left:10px; bottom:10px; display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:5px 10px; border-radius:100px; border:none; background:rgba(0,212,204,0.92); color:#04243a; cursor:pointer; backdrop-filter:blur(6px); box-shadow:0 2px 8px rgba(0,0,0,.4); }
.tile-sound-btn:hover { background:#2BD0C5; }
.tile-menu-btn { width: 30px; height: 30px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s; }
.tile-menu-btn:hover { color: var(--text); border-color: var(--cyan); }
.tile-menu { position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 196px; max-width: 240px; width: max-content; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 44px rgba(0,0,0,.55); padding: 6px; display: none; z-index: 60; }
.tile-menu.open { display: block; }
.tile-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; }
.tile-menu-item:hover { background: var(--bg); }
.tile-menu-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); padding: 9px 10px 4px; }
.tm-check { width: 13px; display: inline-block; color: var(--cyan); font-weight: 800; }
.chip-pending { background: rgba(43,208,197,0.15); color: var(--green); }
.chip-approved { background: rgba(43,208,197,0.08); color: var(--green-dim); }
.chip-published { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.chip-review { background: rgba(96,165,250,0.12); color: var(--blue); }
.chip-revision { background: rgba(252,211,77,0.12); color: var(--amber); }
.chip-draft { background: rgba(255,255,255,0.04); color: var(--text-dim); }
.chip-scheduled { background: rgba(46,124,246,0.12); color: var(--purple); }
.post-date { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

.post-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.btn-sm {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  border: 1px solid var(--border); cursor: pointer; font-family: var(--font);
  background: var(--surface3); color: var(--text-muted); transition: all 0.15s;
}
.btn-sm:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.btn-sm:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-sm.primary { background: var(--green); color: #000; border-color: transparent; font-weight: 700; }
.btn-sm.primary:hover { opacity: 0.85; }
.btn-sm.danger { color: var(--red); border-color: rgba(248,113,113,0.2); }
.btn-sm.danger:hover { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.4); }

/* ─── PRIMARY GRADIENT BUTTON ─── */
.btn-primary {
  background: linear-gradient(135deg, #2BD0C5 0%, #5b6cf5 50%, #2E7CF6 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  box-shadow: 0 4px 18px rgba(43,208,197,0.22);
  transition: all 0.2s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(46,124,246,0.28); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--surface3, #1b1b25);
  color: var(--text, #e9e9f2);
  border: 1px solid var(--border, #2a2a36);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: all 0.18s;
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-secondary:hover { border-color: var(--cyan, #2BD0C5); color: var(--cyan, #2BD0C5); background: rgba(43,208,197,0.06); }
.btn-secondary:active { transform: translateY(1px); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted, #a9a9bd); border: 1px solid var(--border, #2a2a36); border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.18s; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-ghost:hover { color: var(--text, #e9e9f2); border-color: var(--cyan, #2BD0C5); background: rgba(43,208,197,0.05); }
.btn-ghost:active { transform: translateY(1px); }
.regen-count { font-size: 11px; color: var(--text-dim); margin-left: 2px; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-text { font-size: 14px; color: var(--text-muted); max-width: 340px; margin: 0 auto; line-height: 1.6; }

/* ─── BRAND FORM ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: -4px; }
.form-input, .form-textarea, .form-select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 11px 14px; border-radius: 10px;
  font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color 0.2s; width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: rgba(43,208,197,0.4); }
.form-textarea { resize: vertical; line-height: 1.6; }
.form-select { cursor: pointer; }
.form-divider { border: none; border-top: 1px solid var(--border); grid-column: 1 / -1; margin: 8px 0; }
.form-section-title { font-size: 14px; font-weight: 700; grid-column: 1 / -1; padding-bottom: 4px; }
.form-section-sub { font-size: 13px; color: var(--text-muted); grid-column: 1 / -1; margin-top: -12px; line-height: 1.5; }
/* Offers tab uses a block (not grid) form layout, so the grid negative-margin must be neutralised to stop the description overlapping the title. */
#tab-offers .form-grid .form-section-title { padding-bottom: 6px; margin-top: 10px; }
#tab-offers .form-grid .form-section-sub { margin-top: 0; margin-bottom: 12px; }
#tab-offers .form-grid .form-divider { margin: 18px 0; }

/* Platform checkboxes */
.platform-grid { display: flex; gap: 10px; flex-wrap: wrap; grid-column: 1 / -1; }
.platform-check { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; user-select: none; }
.platform-check input { display: none; }
.platform-check.checked { background: var(--green-glow); border-color: rgba(43,208,197,0.3); color: var(--green); }

.save-bar { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--border); margin-top: 8px; grid-column: 1 / -1; }
.save-status { font-size: 13px; color: var(--green); opacity: 0; transition: opacity 0.3s; }
.save-status.visible { opacity: 1; }
.btn-save { background: var(--green); color: #000; border: none; padding: 11px 28px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--font); transition: all 0.2s; }
.btn-save:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-save:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

/* ─── SETTINGS ─── */
.settings-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-info { flex: 1; }
.settings-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.settings-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: var(--surface3); border-radius: 100px; transition: background 0.2s; border: 1px solid var(--border); }
.toggle-slider::before { content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: all 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--green); border-color: var(--green); }
.toggle input:checked + .toggle-slider::before { left: calc(100% - 19px); background: #000; }

/* ─── CONNECTED ACCOUNTS ─── */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; margin-top: 4px; }
.account-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s; }
.account-card.connected { border-color: rgba(43,208,197,0.25); }
.account-card.locked { opacity: 0.45; pointer-events: none; }
.account-card.soon { opacity: 0.6; }
.accounts-soon-label { font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-dim);margin:22px 0 12px; }
.account-card-top { display: flex; align-items: center; gap: 10px; }
.account-icon { font-size: 18px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--surface3); border-radius: 8px; flex-shrink: 0; }
.account-name { font-size: 13px; font-weight: 600; }
.account-status { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.account-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--surface3); border: 1.5px solid rgba(255,255,255,0.15); flex-shrink: 0; }
.account-dot.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 5px rgba(43,208,197,0.5); }
.account-handle { font-size: 11px; color: var(--green); font-weight: 600; }
.account-btn { width: 100%; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: var(--font); border: 1px solid transparent; background: var(--gradient-brand,linear-gradient(100deg,#2E7CF6,#2BD0C5)); color: var(--ink,#0B0F1A); transition: all 0.15s; display:flex;align-items:center;justify-content:center;gap:7px;min-height:38px; }
.account-btn:hover { filter:brightness(.97); transform:translateY(-1px); }
.account-btn.disconnect { border-color: rgba(248,113,113,0.3); color: var(--red); background:transparent; }
.account-btn.disconnect:hover { background: rgba(248,113,113,0.08); filter:none; }
@keyframes dunSlide { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.dun-banner { animation: dunSlide .35s ease; border-radius: 12px; padding: 13px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.dun-banner .dun-msg { flex: 1; min-width: 220px; line-height: 1.45; }
.dun-banner .dun-act { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dun-banner button { padding: 8px 14px; font-size: 12.5px; font-weight: 700; border-radius: 9px; cursor: pointer; border: none; }
.dun-x { background: none !important; border: none; color: inherit; opacity: .55; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
/* P5 out-of-credits banner: slim, dismissible, top of the app content flow (pushes content down,
   never overlaps). Cyan accent on the low state, amber accent when the balance is zero. */
.credit-banner { animation: dunSlide .35s ease; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid rgba(43,208,197,0.35); border-left: 3px solid var(--cyan); border-radius: 12px; padding: 9px 14px; margin-bottom: 14px; font-size: 13px; color: var(--text-muted); }
.credit-banner.zero { border-color: rgba(245,158,11,0.4); border-left-color: var(--warning); }
.credit-banner .cb-msg { flex: 1; min-width: 200px; line-height: 1.45; }
.credit-banner .cb-act { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.credit-banner .cb-upgrade { background: linear-gradient(120deg,#2BD0C5,#2E7CF6); color: #fff; border: none; border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.credit-banner .cb-buy { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.credit-banner .cb-x { background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.no-accounts-banner { background: var(--surface); border: 1px solid rgba(43,208,197,0.18); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.no-accounts-banner-icon { font-size: 20px; flex-shrink: 0; }
.no-accounts-banner-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.no-accounts-banner-text strong { color: var(--text); }
.upgrade-hook { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.upgrade-hook a { color: var(--green); cursor: pointer; font-weight: 600; text-decoration: none; }

/* ─── BILLING ─── */
.billing-card { border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.billing-tier { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.billing-plan { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 4px; }
.billing-price { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.billing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.billing-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.billing-features li::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--green-glow); border: 1.5px solid var(--green); flex-shrink: 0; background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%234ADE80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.progress-bar-wrap { margin-bottom: 20px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar { height: 6px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2BD0C5, #2E7CF6); border-radius: 100px; transition: width 0.5s ease; }
.btn-billing { font-size: 14px; font-weight: 700; padding: 13px 24px; border-radius: 10px; border: none; cursor: pointer; font-family: var(--font); transition: all 0.2s; width:100%; }
.btn-billing.primary { background: linear-gradient(135deg,#2BD0C5,#2E7CF6); color: #fff; box-shadow:0 4px 16px rgba(43,208,197,0.25); }
.btn-billing.primary:hover { opacity: 0.9; transform:translateY(-1px); box-shadow:0 6px 20px rgba(43,208,197,0.35); }
.btn-billing.outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-billing.outline:hover { border-color: rgba(43,208,197,0.4); color:var(--green); }
.btn-billing.manage { background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text-muted); }
.btn-billing.manage:hover { border-color:rgba(255,255,255,0.2); color:var(--text); }

/* ─── MODAL ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.edit-textarea { width: 100%; min-height: 160px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 14px; border-radius: 10px; font-size: 14px; font-family: var(--font); outline: none; resize: vertical; line-height: 1.6; }
.edit-textarea:focus { border-color: rgba(43,208,197,0.4); }
.revision-textarea { width: 100%; min-height: 100px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 14px; border-radius: 10px; font-size: 14px; font-family: var(--font); outline: none; resize: vertical; line-height: 1.6; margin-top: 12px; }
.revision-textarea:focus { border-color: rgba(43,208,197,0.4); }

/* ─── LOADING ─── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: fc-spin 0.7s linear infinite; display: inline-block; }
@keyframes fc-spin { to { transform: rotate(360deg); } }
/* Forge branded generation spinner */
.forge-spinner-wrap { display:flex;flex-direction:column;align-items:center;gap:20px;padding:32px 0; }
.forge-spinner { position:relative;width:64px;height:64px;flex-shrink:0; }
.forge-spinner-ring { position:absolute;inset:0;border-radius:50%;border:3px solid transparent;animation:fc-spin 1.2s linear infinite; }
.forge-spinner-ring:nth-child(1) { border-top-color:#2BD0C5;border-right-color:rgba(43,208,197,0.2);animation-duration:1.2s; }
.forge-spinner-ring:nth-child(2) { inset:9px;border-top-color:#2E7CF6;border-left-color:rgba(46,124,246,0.2);animation-duration:1.8s;animation-direction:reverse; }
.forge-spinner-ring:nth-child(3) { inset:18px;border-top-color:rgba(43,208,197,0.6);animation-duration:2.4s; }
.forge-spinner-core { position:absolute;inset:24px;background:radial-gradient(circle at 40% 40%,rgba(43,208,197,0.5),rgba(46,124,246,0.3),transparent);border-radius:50%;animation:forge-pulse 1.6s ease-in-out infinite; }
@keyframes forge-pulse { 0%,100% { opacity:0.4;transform:scale(0.7); } 50% { opacity:1;transform:scale(1.2); } }
/* Forging character: hammer strikes anvil, sparks fly (all generation loaders) */
.forge-anvil-scene{ position:absolute; inset:0; }
.forge-anvil-scene .fa-anvil{ position:absolute; left:50%; bottom:8px; transform:translateX(-50%); width:32px; height:12px; background:linear-gradient(#40454f,#23262e); border-radius:3px 7px 4px 3px; box-shadow:0 3px 5px rgba(0,0,0,.45); }
.forge-anvil-scene .fa-anvil::before{ content:''; position:absolute; left:-9px; top:2px; width:0; height:0; border:5px solid transparent; border-right-color:#40454f; border-left:0; }
.forge-anvil-scene .fa-anvil::after{ content:''; position:absolute; left:50%; bottom:-7px; transform:translateX(-50%); width:16px; height:8px; background:#20232a; border-radius:0 0 3px 3px; }
.forge-anvil-scene .fa-hammer{ position:absolute; left:52%; top:4px; width:5px; height:24px; background:linear-gradient(#9a6531,#6b431f); border-radius:3px; transform-origin:50% 100%; transform:translateX(-50%) rotate(-52deg); animation:fa-swing 1s cubic-bezier(.5,0,.6,1) infinite; }
.forge-anvil-scene .fa-hammer::before{ content:''; position:absolute; top:-5px; left:-8px; width:21px; height:11px; background:linear-gradient(135deg,#2BD0C5,#2E7CF6); border-radius:3px; box-shadow:0 1px 3px rgba(0,0,0,.4); }
.forge-anvil-scene .fa-spark{ position:absolute; left:50%; top:32px; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:#ffd36a; opacity:0; box-shadow:0 0 7px 2px rgba(255,196,80,.85); animation:fa-spark 1s ease-out infinite; }
.forge-anvil-scene .fa-spark::before,.forge-anvil-scene .fa-spark::after{ content:''; position:absolute; width:3px; height:3px; border-radius:50%; background:#ffb020; box-shadow:0 0 5px 1px rgba(255,176,32,.8); animation:inherit; }
.forge-anvil-scene .fa-spark::before{ left:-7px; top:-2px; } .forge-anvil-scene .fa-spark::after{ left:7px; top:-1px; }
@keyframes fa-swing{ 0%,100%{ transform:translateX(-50%) rotate(-52deg); } 46%{ transform:translateX(-50%) rotate(-9deg); } 54%{ transform:translateX(-50%) rotate(-5deg); } }
@keyframes fa-spark{ 0%,44%{ opacity:0; transform:translateX(-50%) scale(.3); } 50%{ opacity:1; transform:translateX(-50%) scale(1.3); } 74%{ opacity:0; transform:translateX(-50%) translateY(-7px) scale(.5); } 100%{ opacity:0; } }
@media (prefers-reduced-motion: reduce){ .forge-anvil-scene .fa-hammer,.forge-anvil-scene .fa-spark{ animation:none; } }
.loading-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; gap: 12px; color: var(--text-muted); font-size: 14px; }

/* ─── TOAST ─── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 12px 22px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 100001; opacity: 0; transition: all 0.3s; white-space: normal; max-width: min(92vw, 520px); text-align: center; line-height: 1.4; pointer-events: none; box-sizing: border-box; }
@media (max-width:768px){ #toast{ bottom: calc(72px + env(safe-area-inset-bottom,0px)); max-width: calc(100vw - 24px); } body.editor-open #toast{ bottom: calc(72px + env(safe-area-inset-bottom,0px)); } }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: rgba(43,208,197,0.4); color: var(--green); }
#toast.error { border-color: rgba(248,113,113,0.4); color: var(--red); }

/* ─── DASHBOARD ALERTS ─── */
.alert-box { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; display: flex; align-items: flex-start; gap: 12px; }
.alert-box.info { background: rgba(96,165,250,0.08); border: 1px solid rgba(96,165,250,0.2); color: var(--blue); }
.alert-box.success { background: var(--green-glow); border: 1px solid rgba(43,208,197,0.2); color: var(--green); }
.alert-box.warning { background: rgba(252,211,77,0.08); border: 1px solid rgba(252,211,77,0.2); color: var(--amber); }
.alert-icon { font-size: 16px; flex-shrink: 0; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .rail { display: none; }
  .tab-pane { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
.dash-row { grid-template-columns: 1fr; }
  .post-top { flex-wrap: wrap; }
}


/* ─── MOBILE BOTTOM NAV ─── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 4px env(safe-area-inset-bottom, 0px);
  z-index: 200;
  justify-content: space-around; align-items: center;
}
/* E3/UI-A: single mobile bottom nav - hide the duplicate reskin tabbar (mobileBottomNav is canonical) */
#forgeTabbar.mobile-tabbar{display:none!important;}
/* Tap-to-submenu popup for Create / Leads on mobile bottom nav */
.mob-sub-scrim{position:fixed;inset:0;z-index:210;display:none;background:rgba(0,0,0,.28);}
.mob-sub-scrim.open{display:block;}
.mob-submenu{position:fixed;bottom:70px;z-index:220;display:none;flex-direction:column;gap:2px;min-width:172px;background:var(--surface-1,#12151d);border:1px solid var(--border);border-radius:14px;padding:6px;box-shadow:0 14px 38px rgba(0,0,0,.45);}
.mob-submenu.open{display:flex;animation:mobSubIn .16s ease;}
@keyframes mobSubIn{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}
.mob-sub-item{display:flex;align-items:center;justify-content:space-between;gap:10px;background:none;border:none;color:var(--text-1);font-family:inherit;font-size:14px;font-weight:600;text-align:left;padding:12px 14px;border-radius:10px;cursor:pointer;width:100%;-webkit-tap-highlight-color:transparent;}
.mob-sub-item:hover,.mob-sub-item:active{background:var(--surface-2,#1b1f2a);}
.mob-sub-item.active{color:var(--brand-cyan,#22d3ee);}
.mob-sub-dot{width:7px;height:7px;border-radius:50%;background:var(--brand-cyan,#22d3ee);flex:0 0 auto;}
.mob-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-family: var(--font); font-size: 10px; font-weight: 600;
  padding: 6px 8px; border-radius: 10px; transition: color 0.15s; flex: 1; max-width: 64px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.mob-nav-btn svg { width: 18px; height: 18px; }
.mob-nav-btn.active { color: var(--green); }
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .main { padding-bottom: 62px; }

  /* Post cards: wrap action buttons */
  .post-actions { flex-wrap: wrap; gap: 6px; }
  .post-actions .btn { flex: 1; min-width: 80px; justify-content: center; }

  /* Calendar: horizontal scroll */
  .cal-grid, .cal-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-list table { min-width: 500px; }

  /* Analytics: single column */
  .analytics-grid, .anal-grid { grid-template-columns: 1fr !important; }
  .usage-grid { grid-template-columns: 1fr 1fr; }

  /* Settings tab: full width */
  .settings-section, .billing-section { padding: 16px; }

  /* Login screen: tighter on mobile */
  #loginScreen { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .login-card { padding: 28px 18px; }
  .login-input { font-size: 16px; } /* prevent zoom on iOS */

  /* Post card image: full width */
  .post-image-wrap img, .post-image-wrap video { height: 190px; max-height: 190px; }

  /* Tab pane: account for bottom nav */
  .tab-pane { padding-bottom: 80px; }

  /* Section head on mobile */
  .section-head { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: 1fr; }
  .tab-pane { padding: 16px 12px 80px; }
}

/* ─── MOBILE: prevent iOS focus-zoom on inputs (text fields must be >=16px on phones) ─── */
@media (max-width: 768px) {
  input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]),
  textarea, select,
  .form-input, .form-select, .form-textarea, .caption-edit-textarea,
  .fed-screen .field input, .fed-screen .field textarea, .e2-panel input, .e2-panel textarea {
    font-size: 16px !important;
  }
}

/* ─── INLINE CAPTION EDIT ─── */
.caption-display { cursor: text; border-radius: 6px; padding: 4px 6px; margin: -4px -6px; transition: background 0.15s; position: relative; }
.caption-display:hover { background: rgba(255,255,255,0.04); }
.caption-display::after { content: '✎'; position: absolute; right: -18px; top: 2px; font-size: 11px; color: var(--text-dim); opacity: 0; transition: opacity 0.15s; }
.caption-display:hover::after { opacity: 1; }
.caption-display { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
input[type="date"], input[type="time"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: none; opacity: 0.9; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.caption-edit-wrap { display: none; }
.caption-edit-wrap.active { display: block; margin-top: 6px; }
.caption-edit-textarea {
  width: 100%; min-height: 80px; background: var(--surface3); border: 1px solid rgba(43,208,197,0.4);
  color: var(--text); padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-family: var(--font); outline: none; resize: vertical; line-height: 1.6;
}
.caption-edit-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ─── IMAGE PREVIEW ON CARD ─── */
.post-image-wrap { position: relative; overflow: hidden; background: var(--surface3); height: 190px; flex: 0 0 auto; }
.post-image-wrap img, .post-image-wrap video { width: 100%; height: 190px; object-fit: contain; display: block; cursor: pointer; background: var(--surface3); }
.post-image-placeholder { height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 28px; opacity: 0.3; background: var(--surface2); }
@keyframes spin { to { transform: rotate(360deg); } }
.img-gen-spin { width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.14); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.gen-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; text-align: center; }
.gen-state-label { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.gen-state-sub { font-size: 10px; color: var(--text-dim); }
.gen-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); border-radius: 10px; color: #fff; }
.img-options-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.15);
  color: var(--text); border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: var(--font); backdrop-filter: blur(4px); z-index: 10;
}
.img-options-btn:hover { background: rgba(0,0,0,0.9); }
.img-dropdown {
  position: absolute; top: 34px; right: 8px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: none;
}
.img-dropdown.open { display: block; }
.img-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; cursor: pointer; transition: background 0.12s;
}
.img-dropdown-item:first-child { border-radius: 10px 10px 0 0; }
.img-dropdown-item:last-child { border-radius: 0 0 10px 10px; }
.img-dropdown-item:hover { background: var(--surface2); }
.img-dropdown-item span { color: var(--text-dim); font-size: 15px; }

/* ─── REGEN MODAL ─── */
.regen-prompt-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: 10px;
  font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color 0.2s; margin-top: 12px;
}
.regen-prompt-input:focus { border-color: rgba(43,208,197,0.4); }
.regen-remaining { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* ─── SOCIAL LOGIN ─── */
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-divider span { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font); border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); margin-bottom: 10px;
  transition: all 0.15s;
}
.social-btn:hover { border-color: rgba(255,255,255,0.2); background: var(--surface3); }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.social-btn:last-child { margin-bottom: 0; }

/* ─── MEDIA LIBRARY MODAL ─── */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.media-thumb { border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s; aspect-ratio: 1; background: var(--surface3); }
.media-thumb:hover { border-color: var(--green); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 24px; opacity: 0.3; }


/* ── CALENDAR ── */
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.cal-nav-btn { background:none; border:1px solid var(--border); color:var(--text); padding:6px 14px; border-radius:8px; cursor:pointer; font-size:13px; transition:all 0.2s; }
.cal-nav-btn:hover { border-color:var(--green); color:var(--green); }
.cal-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
.cal-day-label { text-align:center; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); padding:6px 0; }
.cal-cell { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:8px 6px; min-height:70px; position:relative; }
.cal-cell.empty { background:transparent; border-color:transparent; }
.cal-cell.today { border-color:var(--green); background:rgba(43,208,197,0.08); }
.cal-date { font-size:12px; font-weight:700; color:var(--text-muted); margin-bottom:4px; }
.cal-cell.today .cal-date { color:var(--green); }
.cal-post-dot { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:2px 5px; border-radius:4px; margin-bottom:2px; background:var(--surface2); color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-post-dot.client_approval_pending { background:rgba(245,182,66,0.15); color:var(--amber); }
.cal-post-dot.approved, .cal-post-dot.scheduled { background:rgba(43,208,197,0.15); color:var(--green); }
.cal-post-dot.published { background:rgba(43,208,197,0.25); color:var(--green); }
.cal-post-dot.draft { background:var(--surface2); color:var(--text-muted); }
.cal-legend { display:flex; gap:16px; flex-wrap:wrap; margin-top:12px; }
.cal-legend-item { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); }
.cal-legend-dot { width:10px; height:10px; border-radius:50%; }
.cal-view-toggle { display:flex; gap:4px; }
.cal-view-btn { background:var(--surface2); border:1px solid var(--border); color:var(--text-muted); padding:5px 12px; border-radius:6px; cursor:pointer; font-size:12px; font-weight:600; transition:all 0.2s; }
.cal-view-btn.active { background:var(--green); border-color:var(--green); color:#000; }
.cal-list-view { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.cal-list-row { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:12px 16px; display:flex; align-items:center; gap:12px; cursor:pointer; transition:border-color 0.2s; }
.cal-list-row:hover { border-color:var(--green); }
.cal-list-date { font-size:12px; font-weight:700; color:var(--text-muted); min-width:84px; flex-shrink:0; }
.cal-list-platform { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; padding:2px 7px; border-radius:4px; background:var(--surface2); color:var(--text-muted); flex-shrink:0; }
.cal-list-caption { flex:1; font-size:13px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-list-status { font-size:10px; font-weight:700; padding:2px 7px; border-radius:4px; text-transform:uppercase; letter-spacing:0.04em; flex-shrink:0; }
.cal-list-empty { padding:40px 0; text-align:center; color:var(--text-muted); font-size:14px; }

/* ── Analytics Tab ── */
.analytics-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:16px; margin-bottom:28px; }
.analytics-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px 22px; }
.analytics-label { font-size:11px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted); margin-bottom:10px; }
.analytics-value { font-size:28px; font-weight:900; letter-spacing:-0.03em; color:var(--text); }
.analytics-sub { font-size:12px; color:var(--text-dim); margin-top:6px; }
.analytics-table { width:100%; border-collapse:collapse; font-size:13px; }
.analytics-table th { text-align:left; font-size:10px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-dim); padding:0 0 10px; border-bottom:1px solid var(--border); }
.analytics-table td { padding:10px 0; border-bottom:1px solid var(--border); color:var(--text-muted); }
.analytics-table th + th, .analytics-table td + td { padding-left:16px; }
.status-pill { display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:100px; background:var(--surface2); color:var(--text-muted); }
/* ── Brand Health Score ── */
.bhs-wrap { display:flex; align-items:flex-start; gap:28px; padding:20px 0 4px; flex-wrap:wrap; }
.bhs-dial { position:relative; flex-shrink:0; }
.bhs-score-text { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.bhs-score-num { font-size:24px; font-weight:900; letter-spacing:-0.04em; color:var(--text); }
.bhs-score-label { font-size:11px; color:var(--text-dim); margin-top:1px; }
.bhs-details { flex:1; min-width:200px; }
.bhs-title { font-size:15px; font-weight:700; color:var(--text); margin-bottom:6px; }
.bhs-desc { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:14px; }
.bhs-items { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.bhs-item { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted); }
.bhs-item-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; background:var(--green); }
.bhs-item-dot.miss { background:var(--amber); }
.bhs-cta { font-size:13px; color:var(--green); cursor:pointer; font-weight:600; background:none; border:none; padding:0; }
.bhs-cta:hover { text-decoration:underline; }
.ob-banner { background:linear-gradient(135deg,rgba(43,208,197,0.08),rgba(46,124,246,0.08)); border:1px solid rgba(43,208,197,0.22); border-radius:14px; padding:18px 20px; margin-bottom:8px; }
.ob-banner-head { margin-bottom:14px; }
.ob-banner-head strong { display:block; font-size:15px; }
.ob-banner-head span { font-size:12.5px; color:var(--text-muted); }
.ob-step { display:flex; align-items:center; gap:14px; padding:12px 0; border-top:1px solid var(--border); }
.ob-step-num { width:30px;height:30px;flex-shrink:0;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;background:rgba(43,208,197,0.15);color:var(--cyan);border:1.5px solid rgba(43,208,197,0.35); }
.ob-step.done .ob-step-num { background:rgba(43,208,197,0.2);border-color:var(--cyan); }
.ob-step-text { flex:1;min-width:0; }
.ob-step-title { font-size:13.5px;font-weight:700; }
.ob-step-sub { font-size:12px;color:var(--text-muted);margin-top:1px; }
.ob-step-done { font-size:12px;font-weight:700;color:var(--cyan); }
.referral-link-row { display:flex;gap:8px;align-items:center; }
.gen-pulse { animation:genPulse 1.5s ease; }
@keyframes genPulse { 0%,100%{box-shadow:0 0 0 0 rgba(43,208,197,0)} 30%{box-shadow:0 0 0 4px rgba(43,208,197,0.35)} }

/* ── VIRTUAL TOUR ───────────────────────────────────── */
#forgeTour { position:fixed; inset:0; z-index:99999; pointer-events:none; }
#forgeTour.tour-active { pointer-events:all; }
#tourBackdrop {
  position:absolute; inset:0;
  background:rgba(6,6,14,0.78);
  backdrop-filter:blur(2px);
}
#tourBox {
  position:absolute;
  background:linear-gradient(135deg,rgba(20,20,40,0.98),rgba(10,10,30,0.98));
  border:1px solid rgba(43,208,197,0.35);
  border-radius:16px;
  padding:28px 30px 22px;
  width:340px;
  box-shadow:0 8px 40px rgba(43,208,197,0.18), 0 0 0 1px rgba(46,124,246,0.15);
  animation:tourIn 0.28s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tourIn {
  from { opacity:0; transform:translateY(12px) scale(0.96); }
  to   { opacity:1; transform:none; }
}
#tourStepBadge {
  font-size:11px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase;
  color:rgba(43,208,197,0.7); margin-bottom:10px;
}
#tourTitle {
  font-size:18px; font-weight:700; color:#fff; margin-bottom:8px; line-height:1.3;
}
#tourBody {
  /* P8: near-full contrast against the dark scrim (0.72 read dim in the owner's screenshot). */
  font-size:13.5px; color:rgba(255,255,255,0.92); line-height:1.6; margin-bottom:20px;
}
#tourArrow {
  position:absolute; width:14px; height:14px;
  background:inherit; border:inherit;
  border-right:none; border-bottom:none;
  transform:rotate(45deg);
}
.tour-actions {
  display:flex; gap:10px; align-items:center; justify-content:flex-end;
}
#tourSkip {
  background:none; border:none; color:rgba(255,255,255,0.4);
  font-size:12px; cursor:pointer; padding:6px 0; margin-right:auto;
}
#tourSkip:hover { color:rgba(255,255,255,0.7); }
#tourBack {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  color:rgba(255,255,255,0.7); font-size:13px; font-weight:600;
  padding:8px 16px; border-radius:8px; cursor:pointer;
}
#tourBack:hover { background:rgba(255,255,255,0.12); }
#tourNext {
  background:linear-gradient(135deg,#2BD0C5,#2E7CF6);
  border:none; color:#fff; font-size:13px; font-weight:700;
  padding:8px 20px; border-radius:8px; cursor:pointer;
}
#tourNext:hover { opacity:0.9; }
#tourHighlight {
  position:absolute; border-radius:10px;
  box-shadow:0 0 0 9999px rgba(6,6,14,0.78), 0 0 0 3px rgba(43,208,197,0.7), 0 0 30px rgba(43,208,197,0.4);
  transition:all 0.35s cubic-bezier(.4,0,.2,1);
  pointer-events:none;
}
/* ─────────────────────────────────────────────────── */

/* ─── MUSIC LIBRARY ─── */
.music-picker-modal { position:fixed;inset:0;z-index:9000;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,0.6);backdrop-filter:blur(4px); }
.music-picker-panel { background:var(--surface2);border:1px solid var(--border);border-bottom:none;border-radius:20px 20px 0 0;width:100%;max-width:680px;max-height:75vh;display:flex;flex-direction:column;overflow:hidden; }
.music-picker-head { padding:20px 24px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0; }
.music-picker-title { font-size:16px;font-weight:700;color:var(--text); }
.music-picker-close { background:none;border:none;cursor:pointer;color:var(--text-dim);font-size:22px;line-height:1;padding:0; }
.music-category-tabs { display:flex;gap:8px;padding:14px 24px;overflow-x:auto;flex-shrink:0;scrollbar-width:none; }
.music-category-tabs::-webkit-scrollbar { display:none; }
.music-cat-btn { padding:5px 14px;border-radius:20px;border:1px solid var(--border);background:none;color:var(--text-dim);font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap; }
.music-cat-btn.active { background:linear-gradient(135deg,#2BD0C5,#2E7CF6);color:#fff;border-color:transparent; }
.music-track-list { overflow-y:auto;flex:1;padding:8px 24px 24px; }
.music-track { display:flex;align-items:center;gap:12px;padding:11px 14px;border-radius:10px;cursor:pointer;transition:background 0.15s; }
.music-track:hover { background:var(--bg); }
.music-track.selected { background:rgba(43,208,197,0.1);border:1px solid rgba(43,208,197,0.3); }
.music-play-btn { width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,#2BD0C5,#2E7CF6);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#fff;font-size:13px; }
.music-track-info { flex:1;min-width:0; }
.music-track-name { font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.music-track-meta { font-size:11px;color:var(--text-dim);margin-top:2px; }
.music-track-check { width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#2BD0C5,#2E7CF6);display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;flex-shrink:0;display:none; }
.music-track.selected .music-track-check { display:flex; }
.music-none-btn { margin:20px 0 0;width:100%;padding:10px;border:1px dashed var(--border);border-radius:10px;background:none;color:var(--text-dim);font-size:13px;cursor:pointer; }
.music-none-btn:hover { border-color:var(--text-dim); }


/* Studio "Add media" source menu (#11) entrance */
@keyframes fsMenuIn { from { opacity:0; transform:translateY(-4px) scale(0.98); } to { opacity:1; transform:none; } }

/* ─── ONBOARDING TOUR ─── */
.tour-overlay { position:fixed;inset:0;z-index:10000;pointer-events:none; }
/* Backdrop starts transparent: on a spotlight step the spotlight's cut-out shadow does ALL the dimming
   (so the highlighted element stays bright), and renderTourStep() only re-dims the backdrop on centred
   steps that have no spotlight. Two opaque layers used to stack to near-black  -  the "too dark" report. */
.tour-backdrop { position:absolute;inset:0;background:transparent;pointer-events:all;transition:background 0.3s ease; }
.tour-spotlight { position:absolute;border-radius:12px;box-shadow:0 0 0 9999px rgba(6,8,18,0.38), 0 0 0 3px rgba(43,208,197,0.98), 0 0 32px rgba(43,208,197,0.65);pointer-events:none;transition:all 0.4s cubic-bezier(.4,0,.2,1); }
/* P8: max-width keeps the card inside a 390px viewport; flex column + scrollable body mean the
   footer (Next/Skip) is ALWAYS visible even when JS caps the card height to fit the screen. */
.tour-card { position:absolute;width:320px;max-width:calc(100vw - 24px);display:flex;flex-direction:column;background:var(--surface2);border:1px solid rgba(43,208,197,0.35);border-radius:16px;padding:22px 24px 20px;box-shadow:0 16px 48px rgba(0,0,0,0.4),0 0 0 1px rgba(43,208,197,0.2);pointer-events:all;z-index:10001; }
.tour-card-step { font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.1em;color:#2BD0C5;margin-bottom:8px;flex:none; }
/* P8 contrast: titles at full --text, body near-full (was --text-dim, too dim on the scrim). */
.tour-card-title { font-size:16px;font-weight:700;color:var(--text,#fff);margin-bottom:8px;flex:none; }
.tour-card-body { font-size:13px;color:var(--text-muted,rgba(255,255,255,0.9));line-height:1.6;margin-bottom:18px;overflow-y:auto;min-height:0; }
.tour-card-footer { flex:none; }
.tour-card-footer { display:flex;align-items:center;justify-content:space-between; }
.tour-dots { display:flex;gap:5px; }
.tour-dot { width:6px;height:6px;border-radius:50%;background:var(--border);transition:background 0.2s; }
.tour-dot.active { background:linear-gradient(135deg,#2BD0C5,#2E7CF6);width:18px;border-radius:3px; }
.tour-btns { display:flex;gap:8px; }
.tour-skip-btn { background:none;border:none;cursor:pointer;color:var(--text-dim);font-size:12px;padding:0; }
.tour-skip-btn:hover { color:var(--text); }
.tour-next-btn { background:linear-gradient(135deg,#2BD0C5,#2E7CF6);color:#fff;border:none;border-radius:8px;padding:8px 18px;font-size:13px;font-weight:700;cursor:pointer; }
.tour-next-btn:hover { opacity:0.88; }
.tour-arrow { position:absolute;width:0;height:0; }


/* ─── HELP BAR ─── */
#helpFab { position:fixed;bottom:28px;left:28px;z-index:8000;width:48px;height:48px;border-radius:50%;background:linear-gradient(135deg,#2BD0C5,#2E7CF6);border:none;cursor:pointer;color:#fff;font-size:20px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 20px rgba(43,208,197,0.35);transition:all 0.2s; }
#helpFab:hover { transform:scale(1.08);box-shadow:0 6px 28px rgba(46,124,246,0.4); }
#helpPanel { position:fixed;bottom:80px;left:220px;z-index:8001;width:300px;background:var(--surface2);border:1px solid var(--border);border-radius:16px;box-shadow:0 16px 48px rgba(0,0,0,0.35);padding:20px;display:none;flex-direction:column;gap:4px; }
#helpPanel.open { display:flex; }
.help-panel-title { font-size:13px;font-weight:700;color:var(--text);margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--border); }
.help-item { display:flex;align-items:center;gap:12px;padding:11px 10px;border-radius:10px;cursor:pointer;transition:background 0.15s;text-decoration:none;color:var(--text); }
.help-item:hover { background:var(--bg); }
.help-item-icon { width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0; }
.help-item-text { font-size:13px;font-weight:600; }
.help-item-sub { font-size:11px;color:var(--text-dim);margin-top:1px; }
.help-acc::after{content:'⌄';margin-left:auto;font-size:16px;color:var(--text-muted);transition:transform .2s ease;line-height:1;padding-left:8px;}
.help-acc.acc-open::after{transform:rotate(180deg);}
.help-acc.acc-open{background:var(--bg);}
.lead-act-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:9px;}
.lead-act-tab{background:var(--surface2,#15151d);border:1px solid var(--border,#23232e);color:var(--text-dim,#9a9aac);font-size:11.5px;font-weight:600;padding:5px 11px;border-radius:100px;cursor:pointer;}
.lead-act-tab.on{background:rgba(43,208,197,0.14);border-color:rgba(43,208,197,0.4);color:var(--cyan,#2BD0C5);}
.help-acc-body{max-height:0;overflow:hidden;opacity:0;transition:max-height .28s ease,opacity .2s ease,padding .2s ease;font-size:13px;color:var(--text-dim);line-height:1.7;padding:0 14px 0 56px;}
.help-acc-body.open{max-height:480px;opacity:1;padding:2px 14px 14px 56px;}
.help-articles-list { display:none;flex-direction:column;gap:2px;margin-top:4px;padding:8px 0; }
.help-articles-list.open { display:flex; }
.help-article { font-size:12px;color:var(--text-dim);padding:6px 10px 6px 44px;border-radius:8px;cursor:pointer;text-decoration:none; }
.help-article:hover { background:var(--bg);color:var(--text); }
.help-quick-tile { transition:border-color 0.18s,background 0.18s,transform 0.18s,box-shadow 0.18s; }
.help-menu { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--border); margin-bottom:22px; }
.help-menu-btn { background:none; border:none; border-bottom:2px solid transparent; color:var(--text-muted); font-size:14px; font-weight:600; padding:10px 14px; cursor:pointer; font-family:inherit; margin-bottom:-1px; }
.help-menu-btn:hover { color:var(--text); }
.help-menu-btn.active { color:var(--cyan); border-bottom-color:var(--cyan); }
/* ===== UI-C: Help & Support -> reskin fidelity ===== */
#tab-help .page-header{display:flex;align-items:center;gap:12px;margin-bottom:20px;}
#tab-help .page-header::before{content:"";width:34px;height:34px;flex:none;border-radius:var(--r-md,12px);background:var(--gradient-brand-soft);border:1px solid var(--border-strong);background-image:var(--gradient-brand-soft),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2336D7DF' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .8-1 1.7M12 17h.01'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:cover,17px 17px;}
#tab-help .page-title{font-family:var(--font-head);font-weight:800;font-size:20px;}
#tab-help .page-subtitle{display:none;}
/* Tab bar -> reference .help-tabs spacing/typography */
#tab-help .help-menu{gap:22px;border-bottom:1px solid var(--border);margin-bottom:20px;}
#tab-help .help-menu-btn{padding:11px 0;font-size:13.5px;color:var(--text-3,#6B7488);}
#tab-help .help-menu-btn:hover{color:var(--text-1,#fff);}
#tab-help .help-menu-btn.active{color:var(--brand-cyan,#2BD0C5);border-bottom-color:var(--brand-cyan,#2BD0C5);}
/* Panels sit on the plain canvas (no double-card); inner cards use reskin surfaces */
#tab-help .section.help-panel{background:transparent;border:none;padding:0;}
#tab-help .section.help-panel .section-head{margin-bottom:14px;}
#tab-help .section.help-panel .section-title{font-family:var(--font-head);font-weight:800;font-size:16px;}
/* Ask: input + suggested chips */
#tab-help #helpChatMessages{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--r-lg,16px);padding:14px;}
#tab-help #helpChatMessages:empty{display:none;}
#tab-help #helpSuggestedQuestions .btn-sm{background:var(--surface-2)!important;border:1px solid var(--border-strong)!important;color:var(--text-1,#fff)!important;border-radius:var(--r-pill,999px);padding:8px 14px;font-weight:600;}
#tab-help #helpSuggestedQuestions .btn-sm:hover{background:var(--surface-3)!important;}
/* Article rows -> reference .help-art card rows */
#tab-help #helpArticlesSection .section-body{gap:9px!important;}
#tab-help .help-item{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--r-md,12px);padding:13px 15px!important;gap:14px;margin-bottom:0;transition:border-color .15s,background .15s;}
#tab-help .help-item:hover{background:var(--surface-2);border-color:var(--border-strong);}
#tab-help .help-acc.acc-open{background:var(--surface-2);border-color:var(--border-strong);}
#tab-help .help-item-icon{width:38px;height:38px;border-radius:var(--r-md,12px);}
#tab-help .help-item-text{font-family:var(--font-head);font-size:14px;font-weight:700;}
#tab-help .help-item-sub{font-size:12.5px;color:var(--text-3,#8a8a9a);}
#tab-help .help-acc-body{color:var(--text-2,#c7c9d3);}
/* Contact: reskin field/label + card */
#tab-help #helpTicketSection .section-body{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--r-lg,16px);padding:18px;}
#tab-help .label{font-size:13px;font-weight:600;color:var(--text-2,#c7c9d3);margin-bottom:6px;display:block;}
.help-quick-tile:hover { border-color:rgba(43,208,197,0.4) !important; background:rgba(43,208,197,0.06) !important; transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,0.25) !important; }
.help-divider { height:1px;background:var(--border);margin:6px 0; }
.help-ticket-form { display:none;flex-direction:column;gap:10px;margin-top:8px;padding-top:10px;border-top:1px solid var(--border); }
.help-ticket-form.open { display:flex; }
.help-ticket-input { background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12px;color:var(--text);resize:none;min-height:70px;font-family:var(--font); }
.help-ticket-input:focus { outline:none;border-color:#2BD0C5; }
.help-ticket-send { background:linear-gradient(135deg,#2BD0C5,#2E7CF6);color:#fff;border:none;border-radius:8px;padding:9px;font-size:13px;font-weight:700;cursor:pointer; }


/* ── Generate Brand from Website ── */
.gen-from-site{background:linear-gradient(135deg,rgba(43,208,197,0.08),rgba(167,139,250,0.08));border:1px solid rgba(43,208,197,0.2);border-radius:12px;padding:18px 20px;margin-bottom:20px;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.gen-from-site-text{flex:1;min-width:180px}
.gen-from-site-text strong{display:block;font-size:14px;margin-bottom:3px}
.gen-from-site-text span{font-size:12px;color:var(--text-dim,#9aa0aa)}
.btn-gen-site{background:linear-gradient(135deg,var(--cyan),var(--purple));color:#fff;font-weight:700;font-size:13px;padding:10px 18px;border:none;border-radius:8px;cursor:pointer;white-space:nowrap;flex-shrink:0}
.btn-gen-site:disabled{opacity:0.6;cursor:not-allowed}

.ind-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:9px;}
.ind-card{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:11px 12px;border:1px solid var(--border,#23232e);border-radius:11px;background:var(--surface2,#15151d);cursor:pointer;transition:border-color .12s,transform .12s,background .12s;text-align:left;color:var(--text,#e9e9f2);font-size:12.5px;font-weight:600;line-height:1.25;}
.ind-card:hover{border-color:var(--cyan,#2BD0C5);transform:translateY(-1px);}
.ind-card.sel{border-color:var(--cyan,#2BD0C5);background:linear-gradient(180deg,rgba(43,208,197,.12),transparent);}
.ind-card svg{width:22px;height:22px;opacity:.9;}
.ind-empty{grid-column:1/-1;color:var(--text-dim,#8a8a9a);font-size:12.5px;padding:8px 2px;}
.obchip{background:var(--surface2,#1b1e2b);border:1px solid var(--border);color:var(--text-muted);font-size:12px;font-weight:600;padding:5px 12px;border-radius:999px;cursor:pointer;font-family:inherit;}
.obchip.on{background:linear-gradient(100deg,rgba(46,124,246,.25),rgba(43,208,197,.25));border-color:var(--cyan);color:#fff;}
