*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Platform brands */
  --fb: #1877F2;
  --ig: #E4405F;
  --ig2: #F77737;
  --ig3: #833AB4;
  --tt: #25F4EE;
  --tt-pink: #FE2C55;
  --yt: #FF0000;

  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a24;
  --surface3: #242430;
  --border: #2e2e3c;
  --text: #f4f4f8;
  --muted: #9292a8;
  --accent: var(--fb);
  --accent2: var(--ig);
  --pink: var(--tt-pink);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: var(--yt);
  /* FB → IG → TikTok → YouTube */
  --grad: linear-gradient(125deg, #1877F2 0%, #833AB4 28%, #E4405F 52%, #FE2C55 72%, #FF0000 100%);
  --grad-soft: linear-gradient(135deg, rgba(24,119,242,.9), rgba(228,64,95,.9), rgba(37,244,238,.75), rgba(255,0,0,.9));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --sidebar-w: 260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 50% 38% at 12% 8%, rgba(24,119,242,.22) 0%, transparent 55%),
    radial-gradient(ellipse 40% 32% at 88% 18%, rgba(228,64,95,.16) 0%, transparent 55%),
    radial-gradient(ellipse 35% 30% at 70% 85%, rgba(37,244,238,.10) 0%, transparent 55%),
    radial-gradient(ellipse 30% 28% at 20% 90%, rgba(255,0,0,.10) 0%, transparent 55%);
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

.view { position: relative; z-index: 1; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.accent { color: var(--accent2); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mt { margin-top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: .925rem;
  padding: 10px 20px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 24px rgba(228,64,95,.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(24,119,242,.45); }
.btn-fb {
  background: var(--fb); color: #fff; font-weight: 700;
  border: none;
}
.btn-fb:hover { background: #166fe5; box-shadow: 0 4px 16px rgba(24,119,242,.45); }

/* Social login buttons (Google / Facebook / TikTok) */
.social-login-stack { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.social-cta-row {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px; margin: 0 auto 8px;
}
.btn-social {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; border-radius: 999px; border: 1px solid transparent;
}
.btn-social .brand-icon { width: 20px; height: 20px; }
.btn-google {
  background: #fff; color: #1f1f1f; border-color: #dadce0;
}
.btn-google:hover { background: #f7f8f8; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.btn-tiktok {
  background: #010101; color: #fff; border-color: #25F4EE;
  box-shadow: 0 0 0 1px rgba(254,44,85,.35);
}
.btn-tiktok:hover { box-shadow: 0 4px 16px rgba(37,244,238,.25); }
.linkish {
  background: none; border: none; color: #a5b4fc; font: inherit;
  text-decoration: underline; cursor: pointer; padding: 0;
}
.linkish:hover { color: #c4b5fd; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--muted); font-size: .8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.page-select-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pages-select { grid-template-columns: 1fr 1fr; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkout-summary {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px;
}
.checkout-summary .price-amount { font-size: 2rem; margin: 4px 0; }
.btn-primary:hover { box-shadow: 0 6px 28px rgba(99,102,241,.5); }
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); }
.btn-ghost {
  background: transparent; color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-icon {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; padding: 6px; border-radius: 8px;
}
.btn-icon:hover { color: var(--text); background: var(--surface2); }

/* Logo */
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em;
}
.logo.center { justify-content: center; margin-bottom: 8px; }
.logo-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--grad); border-radius: 10px; font-size: 1.05rem;
  box-shadow: 0 2px 12px rgba(24,119,242,.35);
}
.logo-domain {
  font-size: .72rem; font-weight: 600; color: var(--muted);
  letter-spacing: .02em; margin-left: 2px;
}
.brand-bar {
  display: flex; height: 4px; width: 100%; max-width: 420px;
  margin: 28px auto 0; border-radius: 999px; overflow: hidden;
  box-shadow: 0 0 20px rgba(24,119,242,.25);
}
.brand-bar span { flex: 1; }
.brand-bar .b-fb { background: var(--fb); }
.brand-bar .b-ig { background: linear-gradient(90deg, var(--ig3), var(--ig), var(--ig2)); }
.brand-bar .b-tt { background: linear-gradient(90deg, var(--tt), #000 50%, var(--tt-pink)); }
.brand-bar .b-yt { background: var(--yt); }

.hero-platforms-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 28px;
}
.plat-brand {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  border: 1px solid var(--border); background: var(--surface);
}
.plat-brand.fb { color: #8ab4f8; border-color: rgba(24,119,242,.4); box-shadow: 0 0 0 1px rgba(24,119,242,.15); }
.plat-brand.ig { color: #f48fb1; border-color: rgba(228,64,95,.4); }
.plat-brand.tt { color: #eee; border-color: rgba(37,244,238,.35); }
.plat-brand.yt { color: #ff8a80; border-color: rgba(255,0,0,.4); }

/* Brand logos */
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35em; height: 1.35em; flex-shrink: 0; vertical-align: middle;
}
.brand-icon .brand-svg { width: 100%; height: 100%; display: block; }
.brand-icon.brand-lg { width: 56px; height: 56px; }
.brand-icon.brand-md { width: 28px; height: 28px; }
.brand-icon.brand-sm { width: 18px; height: 18px; }
.plat-brand .brand-icon { width: 20px; height: 20px; margin-right: 2px; }

.platform-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
}
.plat-stat {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color .15s, transform .15s;
}
.plat-stat:hover { border-color: rgba(24,119,242,.4); transform: translateY(-1px); }
.plat-stat .ps-icon { width: 36px; height: 36px; display: grid; place-items: center; }
.plat-stat .ps-icon .brand-icon { width: 32px; height: 32px; }
.plat-stat strong { display: block; font-size: .9rem; }
.plat-stat small { color: var(--muted); font-size: .75rem; }

.dash-header { align-items: center; }
.dash-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.stat-card.kpi { display: flex; flex-direction: column; gap: 4px; }
.stat-hint { font-size: .75rem; color: var(--muted); }
.stat-plan { font-size: 1.4rem !important; }
.dash-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.panel-head h3 { margin: 0; }
.sys-list { display: flex; flex-direction: column; gap: 8px; }
.sys-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: .875rem;
}
.sys-row .ok { color: #86efac; font-weight: 700; }
.sys-row .bad { color: #fcd34d; font-weight: 700; }
.quick-actions { margin-top: 14px; }
.badge-live {
  background: rgba(34,197,94,.15); color: #86efac;
  padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.badge-setup {
  background: rgba(245,158,11,.15); color: #fcd34d;
  padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
@media (max-width: 900px) {
  .platform-strip { grid-template-columns: 1fr 1fr; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}

.side-btn.active {
  background: linear-gradient(90deg, rgba(24,119,242,.18), rgba(228,64,95,.12));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(24,119,242,.25);
}
.user-avatar, .phone-avatar, .pr-icon {
  background: var(--grad) !important;
}
.usage-fill { background: var(--grad) !important; }
.price-card.popular {
  border-color: var(--ig);
  box-shadow: 0 0 0 1px var(--ig), 0 12px 40px rgba(228,64,95,.2);
}
.price-badge { background: var(--grad); }
.hero h1 em { color: var(--ig); }
.step-n { background: var(--grad) !important; color: #fff; }

/* ═══ LANDING ═══ */
.topbar {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; gap: 16px; flex-wrap: wrap;
}
.top-nav { display: flex; gap: 24px; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9rem;
}
.top-nav a:hover { color: var(--text); }
.top-actions { display: flex; gap: 10px; }

.hero {
  max-width: 900px; margin: 0 auto; text-align: center;
  padding: 60px 24px 80px;
}
.hero-badge {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.3);
  color: #c4b5fd; font-size: .85rem; font-weight: 600; margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.15; margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--pink); }
.hero-sub {
  font-size: 1.15rem; color: var(--muted); max-width: 560px;
  margin: 0 auto 32px; line-height: 1.6;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-platforms {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.plat-pill {
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: .9rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
}

.features, .pricing {
  max-width: 1140px; margin: 0 auto; padding: 40px 24px 80px;
}
.features h2, .pricing h2 {
  text-align: center; font-size: 2rem; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 12px;
}
.section-sub { text-align: center; color: var(--muted); margin-bottom: 40px; }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 40px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.f-icon { font-size: 2rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: .925rem; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin-top: 32px;
}
.price-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; position: relative;
  display: flex; flex-direction: column;
}
.price-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 40px rgba(99,102,241,.2);
}
.price-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: .75rem; font-weight: 700;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}
.price-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.price-amount {
  font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em;
  margin: 8px 0 4px;
}
.price-amount small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-features {
  list-style: none; margin: 20px 0 28px; flex: 1;
}
.price-features li {
  padding: 8px 0; font-size: .9rem; color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-start;
}
.price-features li::before { content: "✓"; color: var(--green); font-weight: 700; }
.price-card .btn { margin-top: auto; }
.price-card.current { outline: 2px solid var(--green); }
.price-card .current-tag {
  display: inline-block; margin-bottom: 8px;
  background: rgba(34,197,94,.15); color: var(--green);
  font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}

.landing-footer {
  text-align: center; padding: 40px 24px 60px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem;
}
.landing-footer .logo { justify-content: center; margin-bottom: 12px; }

/* ═══ AUTH ═══ */
#view-auth {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
#view-auth.hidden { display: none !important; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-tabs {
  display: flex; gap: 4px; background: var(--surface2);
  border-radius: 999px; padding: 4px; margin: 24px 0 20px;
}
.auth-tab {
  flex: 1; border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-weight: 600; font-size: .9rem;
  padding: 10px; border-radius: 999px; cursor: pointer;
}
.auth-tab.active { background: var(--surface3); color: var(--text); }
.auth-form label {
  display: block; font-size: .85rem; font-weight: 500;
  color: var(--muted); margin-bottom: 14px;
}
.auth-form input, .modal-card input, #schedule-at {
  width: 100%; margin-top: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-family: inherit; font-size: .95rem;
  outline: none; transition: border-color .15s;
}
.auth-form input:focus, .modal-card input:focus, #schedule-at:focus {
  border-color: var(--accent);
}
.auth-hint { text-align: center; font-size: .8rem; color: var(--muted); margin: 12px 0; }
.form-error {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,.12); color: #fca5a5; font-size: .875rem;
}
.form-msg {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: .9rem;
}
.form-msg.ok { background: rgba(34,197,94,.12); color: #86efac; }
.form-msg.err { background: rgba(239,68,68,.12); color: #fca5a5; }

/* ═══ APP ═══ */
#view-app {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
#view-app.hidden { display: none !important; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo { padding: 8px 10px 24px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-btn {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: var(--muted);
  font-family: inherit; font-size: .925rem; font-weight: 500;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; text-align: left;
  transition: all .15s;
}
.side-btn:hover { background: var(--surface2); color: var(--text); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 10px; border-top: 1px solid var(--border); margin-top: 12px;
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta strong { display: block; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: .75rem; color: var(--muted); }

.main {
  padding: 28px 32px 60px; max-width: 1100px; width: 100%;
  overflow-x: hidden;
}
.page { display: none; }
.page.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.stat-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }

.usage-bar-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px;
}
.usage-head {
  display: flex; justify-content: space-between; font-size: .875rem;
  margin-bottom: 10px; color: var(--muted);
}
.usage-bar {
  height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden;
}
.usage-fill {
  height: 100%; width: 0%; background: var(--grad);
  border-radius: 999px; transition: width .4s ease;
}

.two-col {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px;
}
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.panel h3 { font-size: 1rem; margin-bottom: 16px; }

/* Posts */
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.post-list.full .post-item { background: var(--surface); }
.post-body { flex: 1; min-width: 0; }
.post-body p {
  font-size: .9rem; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; font-size: .75rem; color: var(--muted);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.badge-published { background: rgba(34,197,94,.15); color: #86efac; }
.badge-scheduled { background: rgba(99,102,241,.15); color: #c4b5fd; }
.badge-draft { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-failed { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-partial { background: rgba(245,158,11,.15); color: #fcd34d; }
.plat-tag {
  font-size: .7rem; padding: 2px 8px; border-radius: 6px;
  background: var(--surface3); color: var(--muted);
}
.post-actions { display: flex; flex-direction: column; gap: 4px; }
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: .9rem;
}

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: .8rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.filter-btn.active { background: rgba(99,102,241,.2); color: #c4b5fd; border-color: var(--accent); }

/* Compose */
.compose-layout {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start;
}
.field-label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--muted); margin: 16px 0 8px;
}
.field-label:first-child { margin-top: 0; }
#compose-content {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; color: var(--text);
  font-family: inherit; font-size: .95rem; resize: vertical; min-height: 140px;
  outline: none; line-height: 1.55;
}
#compose-content:focus { border-color: var(--accent); }
.char-count { text-align: right; font-size: .75rem; color: var(--muted); margin-top: 4px; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: rgba(99,102,241,.06); }
.up-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.upload-zone p { font-size: .9rem; }
.upload-zone small { color: var(--muted); font-size: .75rem; }
#upload-preview img, #upload-preview video {
  max-width: 100%; max-height: 180px; border-radius: 8px; margin-bottom: 10px;
}

.platform-select {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.plat-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; user-select: none;
}
.plat-check:hover { border-color: var(--accent); }
.plat-check.selected {
  border-color: var(--accent); background: rgba(99,102,241,.1);
}
.plat-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.plat-check.disabled { opacity: .4; pointer-events: none; }
.plat-check .plat-info { flex: 1; }
.plat-check .plat-info strong { display: block; font-size: .875rem; }
.plat-check .plat-info small { color: var(--muted); font-size: .72rem; }
.plat-icon { font-size: 1.3rem; }

.schedule-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; font-size: .875rem; font-weight: 500;
}
.radio-chip:has(input:checked) {
  border-color: var(--accent); background: rgba(99,102,241,.12); color: #c4b5fd;
}
.radio-chip input { display: none; }
#schedule-fields { margin-top: 12px; }
.compose-actions { margin-top: 24px; }

.phone-preview {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 18px; max-width: 340px; margin: 0 auto;
}
.phone-header { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.phone-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; font-weight: 700;
}
.prev-body {
  font-size: .9rem; white-space: pre-wrap; word-break: break-word;
  min-height: 60px; margin-bottom: 12px; line-height: 1.5;
}
.prev-media img, .prev-media video {
  width: 100%; border-radius: 10px; max-height: 200px; object-fit: cover;
}
.phone-actions {
  display: flex; gap: 18px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 1.1rem;
}

/* Accounts */
.accounts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px;
}
.account-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.account-card .ac-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.account-card .ac-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--surface2);
}
.account-card h3 { font-size: 1.05rem; }
.account-card .ac-status {
  font-size: .8rem; margin-bottom: 14px;
}
.account-card .ac-status.on { color: var(--green); }
.account-card .ac-status.off { color: var(--muted); }
.account-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: .875rem;
}
.account-mini-list { display: flex; flex-direction: column; gap: 8px; }
.account-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface2); border-radius: var(--radius-sm);
  font-size: .875rem;
}

/* Billing */
.current-plan {
  margin-bottom: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal-card.modal-wide { max-width: 520px; }
.modal-card h3 { margin-bottom: 6px; }
.modal-card .muted { margin-bottom: 16px; font-size: .875rem; }
.modal-card input { margin-bottom: 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.info-box {
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .85rem;
  color: #c4b5fd; margin-bottom: 14px; line-height: 1.45;
}
.info-box.warn {
  background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.35); color: #fcd34d;
}
.info-box strong { color: var(--text); }
.help-details {
  margin-top: 12px; font-size: .82rem; color: var(--muted);
  background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px;
}
.help-details summary { cursor: pointer; color: #c4b5fd; font-weight: 600; }
.help-steps { margin: 10px 0 0 18px; line-height: 1.55; }
.help-steps a { color: #a5b4fc; }
.help-steps code {
  background: var(--surface2); padding: 1px 6px; border-radius: 4px; font-size: .78rem;
}

.results-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.result-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
}
.result-row.ok { border-color: rgba(34,197,94,.4); }
.result-row.fail { border-color: rgba(239,68,68,.4); }
.result-row .r-icon { font-size: 1.4rem; }
.result-row .r-body { flex: 1; min-width: 0; }
.result-row .r-body strong { display: block; font-size: .9rem; }
.result-row .r-body p { font-size: .8rem; color: var(--muted); margin-top: 4px; word-break: break-word; }
.result-row a { color: #86efac; font-size: .8rem; }

.live-pill {
  display: inline-block; font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; margin-left: 6px;
  background: rgba(34,197,94,.2); color: #86efac; vertical-align: middle;
}
.live-pill.off { background: rgba(245,158,11,.15); color: #fcd34d; }

/* Simple sell / onboarding */
.hero-tiny { margin-top: 14px; font-size: .85rem; }
.steps-sell {
  display: flex; align-items: stretch; justify-content: center; gap: 12px;
  flex-wrap: wrap; margin-top: 56px; max-width: 720px; margin-left: auto; margin-right: auto;
}
.step-sell {
  flex: 1; min-width: 140px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 16px; text-align: center;
}
.step-n {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--grad); font-weight: 800; margin-bottom: 10px;
}
.step-sell h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step-sell p { color: var(--muted); font-size: .85rem; }
.step-sell-arrow { align-self: center; color: var(--muted); font-size: 1.4rem; font-weight: 700; }
@media (max-width: 600px) { .step-sell-arrow { display: none; } }

.auth-title { text-align: center; font-size: 1.4rem; margin: 8px 0 4px; }
.auth-lead { text-align: center; margin-bottom: 20px; }
.auth-more {
  margin: 18px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; background: var(--bg);
}
.auth-more summary {
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; text-align: center;
}
.auth-more[open] summary { margin-bottom: 12px; }

.wizard { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.wizard-step {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; flex-wrap: wrap;
}
.wizard-step.done { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.06); }
.wizard-step .wiz-left { display: flex; align-items: center; gap: 14px; }
.wiz-num {
  width: 36px; height: 36px; border-radius: 10px; background: var(--surface2);
  display: grid; place-items: center; font-weight: 800; color: var(--muted); flex-shrink: 0;
}
.wizard-step.done .wiz-num { background: rgba(34,197,94,.2); color: #86efac; }
.wiz-done { color: #86efac; font-size: 1.4rem; font-weight: 800; }
.wizard-step h3 { font-size: 1rem; }

.quick-post-card { text-align: center; margin-bottom: 20px; }
.quick-post-card h3 { margin-bottom: 6px; }
.quick-post-card .btn { margin-top: 14px; }
.simple-stats { grid-template-columns: repeat(3, 1fr); }
.usage-bar-wrap.compact { padding: 10px 14px; margin-bottom: 20px; }

.compose-simple { max-width: 640px; }
.field-label.big { font-size: 1rem; color: var(--text); margin-top: 20px; }
.simple-up { padding: 18px; margin-top: 8px; }
.sticky-actions { margin-top: 28px; }
.advanced-box {
  margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--bg); color: var(--muted); font-size: .9rem;
}
.advanced-box summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.advanced-box[open] summary { margin-bottom: 10px; color: var(--text); }

.big-connect { text-align: center; padding: 36px 24px; margin-bottom: 20px; }
.big-connect-icon { font-size: 3rem; margin-bottom: 10px; }
.big-connect h2 { font-size: 1.35rem; margin-bottom: 8px; }
.big-connect .btn { margin-top: 18px; }
.tiny-hint { font-size: .8rem; margin-top: 12px; }
.pages-simple { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.page-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.page-row .pr-left { display: flex; align-items: center; gap: 12px; }
.page-row .pr-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--surface2);
  display: grid; place-items: center; font-size: 1.2rem;
}
.page-row .pr-icon-logo {
  background: #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.page-row .pr-icon-logo .brand-icon { width: 26px; height: 26px; }
.plat-check .plat-icon {
  display: grid; place-items: center; width: 28px; height: 28px;
}
.plat-tag {
  display: inline-flex; align-items: center; gap: 4px;
}
.plat-tag .brand-icon { width: 14px; height: 14px; }
.result-row .r-icon {
  width: 28px; height: 28px; display: grid; place-items: center;
}
.result-row .r-icon .brand-icon { width: 24px; height: 24px; }
.account-mini .brand-icon { width: 18px; height: 18px; }
.empty-cta {
  text-align: center; padding: 24px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); margin-top: 8px;
}
.empty-cta .btn { margin-top: 12px; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0; font-size: .9rem; color: var(--text); cursor: pointer;
}
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.setup-check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.setup-check-item:last-child { border-bottom: none; }
.setup-ok { color: #86efac; font-weight: 700; }
.setup-bad { color: #fcd34d; font-weight: 700; }
#page-setup input[type="text"],
#page-setup input[type="password"],
#page-setup input[type="url"],
#page-setup input[type="email"] {
  width: 100%; margin-top: 6px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-family: inherit; font-size: .95rem;
}

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 200; background: var(--surface3); border: 1px solid var(--border);
  color: var(--text); padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; box-shadow: var(--shadow);
  animation: toastIn .3s ease;
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  #view-app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; flex-direction: row; align-items: center;
    padding: 8px; z-index: 50; border-right: none;
    border-top: 1px solid var(--border);
  }
  .sidebar-logo, .sidebar-user .user-meta, .sidebar-user #btn-logout { display: none; }
  .side-nav {
    flex-direction: row; overflow-x: auto; flex: 1; gap: 2px;
  }
  .side-btn {
    flex-direction: column; font-size: .65rem; padding: 8px 10px;
    white-space: nowrap; gap: 2px;
  }
  .sidebar-user { border: none; margin: 0; padding: 4px; }
  .main { padding: 20px 16px 100px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .two-col, .compose-layout { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}
