:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --sidebar-bg: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #4338ca;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --ok-text: #15803d;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --warn-text: #b45309;
  --err: #dc2626;
  --err-soft: #fee2e2;
  --err-text: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #131822;
  --surface-2: #1b2230;
  --sidebar-bg: #0f131c;
  --border: #252e40;
  --border-strong: #37435c;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-text: #a5b4fc;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --ok-text: #86efac;
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --warn-text: #fcd34d;
  --err: #ef4444;
  --err-soft: rgba(239, 68, 68, 0.15);
  --err-text: #fca5a5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* App Shell: Left Sidebar + Main Content */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 18px 0;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 24px 10px 7px;
}
.sidebar-section-label:first-child { padding-top: 10px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.side-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.side-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--warn-soft);
  color: var(--warn-text);
}
.sidebar-footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 8px;
  margin: 10px 0 6px;
}
.role-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.role-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 24px 32px 48px;
  max-width: 1240px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-header p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.mobile-topbar {
  display: none;
}
.mobile-nav-backdrop {
  display: none;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-head .mobile-close-btn {
  display: none;
}

.split-composer { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr); gap: 20px; align-items: start; }
@media (max-width: 960px) {
  body.mobile-nav-open { overflow: hidden; }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
  }
  .mobile-topbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    min-width: 0;
    margin-right: auto;
  }
  .mobile-topbar-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  .mobile-menu-btn {
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar-head .mobile-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    display: block;
  }
  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .app-shell { flex-direction: column; min-height: calc(100vh - 54px); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(286px, 84vw);
    height: 100dvh;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: var(--shadow-md);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  .main-area { padding: 16px 14px 36px; }
  .split-composer { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: all 0.12s ease; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--err-soft); border-color: transparent; color: var(--err-text); box-shadow: none; }
.btn-danger:hover { filter: brightness(0.96); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* Segmented Controls & Pills */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
  flex-wrap: wrap;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Account Selector Chips (Post Bridge style) */
.account-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.12s ease; user-select: none;
}
.acct-chip:hover { border-color: var(--border-strong); }
.acct-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.plat-logo {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; vertical-align: middle;
}
.plat-logo-sm { width: 16px; height: 16px; border-radius: 4px; }
.plat-logo svg { width: 12px; height: 12px; display: block; }
.plat-logo-sm svg { width: 10px; height: 10px; }
.plat-logo-tiktok { background: #09090b; }
[data-theme="dark"] .plat-logo-tiktok { background: #09090b; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.plat-logo-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.plat-logo-youtube { background: #ff0000; }
.plat-logo-threads { background: #111827; }
[data-theme="dark"] .plat-logo-threads { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.plat-logo-facebook { background: #1877f2; }
.plat-logo-x { background: #0f172a; }
[data-theme="dark"] .plat-logo-x { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.plat-logo-linkedin { background: #0a66c2; }
.plat-logo-bluesky { background: #0085ff; }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Form Inputs */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 86px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox-row input { width: auto; accent-color: var(--accent); }

/* Badges & Callouts */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok-text); }
.badge-warn { background: var(--warn-soft); color: var(--warn-text); }
.badge-err { background: var(--err-soft); color: var(--err-text); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

/* TikTok Compliance Panel */
.tiktok-box {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}
.tooltip-warn {
  font-size: 12.5px; color: var(--warn-text); background: var(--warn-soft);
  padding: 8px 10px; border-radius: 8px; margin-top: 8px; font-weight: 500;
}

/* Phone Mockup Preview (Composer & ManyChat-style DM preview) */
.phone-frame {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 26px;
  padding: 14px;
  border: 4px solid #1e293b;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  margin: 0 auto;
}
.phone-notch { width: 80px; height: 5px; background: #334155; border-radius: 99px; margin: 0 auto 12px; }
.phone-screen {
  background: #111827;
  border-radius: 16px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.phone-media {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #0ea5e9 100%);
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  position: relative;
}
.phone-caption { padding: 12px 14px; font-size: 12.5px; color: #e2e8f0; }

/* Authentic Instagram Phone Preview (Comments sheet + DM screen) */
.ig-phone {
  width: 100%;
  max-width: 332px;
  margin: 0 auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 34px;
  border: 7px solid #111827;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
}
.ig-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 4px; font-size: 11px; font-weight: 700; color: #0f172a; background: #fff;
}
.ig-dynamic-island { width: 76px; height: 18px; border-radius: 99px; background: #0f172a; }
.ig-reel-peek {
  height: 54px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #0284c7 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); font-size: 11px; font-weight: 600;
}
.ig-sheet {
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  margin-top: -12px;
  padding-top: 8px;
  min-height: 315px;
  display: flex;
  flex-direction: column;
}
.ig-grabber { width: 36px; height: 4px; border-radius: 99px; background: #cbd5e1; margin: 0 auto 8px; }
.ig-sheet-title { text-align: center; font-size: 13.5px; font-weight: 700; color: #0f172a; padding-bottom: 10px; border-bottom: 1px solid #efefef; }
.ig-comments-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.ig-comment-row { display: flex; align-items: flex-start; gap: 10px; }
.ig-reply-indent { margin-left: 38px; margin-top: 10px; }
.ig-avatar {
  width: 30px; height: 30px; border-radius: 99px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
}
.ig-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.ig-avatar-viewer { background: linear-gradient(135deg, #f97316, #ec4899); }
.ig-avatar-creator {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #e1306c;
}
.ig-comment-content { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.38; color: #0f172a; }
.ig-handle { font-weight: 700; font-size: 12.5px; color: #0f172a; margin-right: 5px; }
.ig-time { font-size: 11px; color: #737373; }
.ig-creator-tag { font-size: 10px; font-weight: 700; color: #0095f6; margin-left: 4px; }
.ig-comment-actions { font-size: 11px; color: #737373; font-weight: 600; margin-top: 4px; display: flex; gap: 12px; }
.ig-heart { color: #8e8e8e; font-size: 12px; padding-top: 4px; }
.ig-emoji-bar {
  display: flex; justify-content: space-between; padding: 7px 14px 4px;
  border-top: 1px solid #efefef; background: #fff; font-size: 16px; line-height: 1; user-select: none;
}
.ig-input-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px;
  background: #fff;
}
.ig-input-pill {
  flex: 1; border: 1px solid #dbdbdb; border-radius: 999px; padding: 7px 12px;
  font-size: 12px; color: #8e8e8e; background: #fafafa;
}
.ig-home-bar { width: 108px; height: 4px; border-radius: 99px; background: #0f172a; opacity: 0.22; margin: 6px auto 8px; }

/* IG DM Screen */
.ig-dm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 10px; border-bottom: 1px solid #efefef; background: #fff;
}
.ig-dm-body {
  padding: 14px 12px; flex: 1; min-height: 290px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: #fff;
}
.ig-dm-context {
  align-self: flex-end; max-width: 78%; text-align: right;
  font-size: 11px; color: #737373;
}
.ig-dm-context-card {
  display: inline-block; margin-top: 4px; padding: 7px 11px; border-radius: 14px;
  background: #3797f0; color: #fff; font-size: 12.5px; font-weight: 500;
}
.ig-dm-msg-row { display: flex; align-items: flex-end; gap: 8px; }
.ig-dm-bubble {
  max-width: 82%; background: #efefef; color: #0f172a;
  padding: 10px 13px; border-radius: 18px; border-bottom-left-radius: 5px;
  font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
}
.ig-dm-link-btn {
  display: block; margin-top: 8px; text-align: center; padding: 7px 10px;
  background: #ffffff; border-radius: 10px; color: #0095f6; font-weight: 700; font-size: 12px;
  border: 1px solid #e2e8f0;
}
.ig-dm-url { color: #00376b; text-decoration: underline; }
.ig-dm-footer-tag { font-size: 10.5px; color: #8e8e8e; margin-top: 4px; padding-left: 34px; }
.ig-dm-composer {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px; background: #fff;
}
.ig-dm-pill {
  flex: 1; display: flex; align-items: center; gap: 8px; background: #efefef;
  border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 12px; color: #737373;
}
.ig-cam-dot {
  width: 24px; height: 24px; border-radius: 99px; background: #3797f0; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.quick-chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.quick-chip:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* Flow Step Cards (ManyChat Quick Automation style) */
.flow-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  position: relative;
}
.flow-connector { width: 2px; height: 14px; background: var(--border-strong); margin: 0 auto; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 700; margin-right: 6px;
}

/* Analytics KPI & Bars */
.kpi-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }

/* Monthly Calendar Grid */
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 770px; }
.cal-weekday { background: var(--surface-2); padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.cal-day { background: var(--surface); min-height: 112px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.other-month { background: var(--bg); opacity: 0.55; }
.cal-day-head { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.cal-today-num { background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; }
.cal-item {
  font-size: 11px; padding: 4px 6px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-text);
  font-weight: 600; line-height: 1.25; display: flex; align-items: center; gap: 5px; overflow: hidden;
}
.cal-item.posted { background: var(--ok-soft); color: var(--ok-text); }
.cal-item span.cal-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Post Bridge-style 4-Card Picker (Posts & Automations) */
.post-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 960px) { .post-type-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .post-type-grid { grid-template-columns: 1fr; } }
.post-type-card {
  background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: 14px;
  padding: 36px 20px 26px; text-align: center; cursor: pointer; transition: all 0.14s ease;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.post-type-card:hover { border-style: solid; border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-type-icon { width: 44px; height: 44px; color: var(--muted); }
.post-type-card:hover .post-type-icon { color: var(--accent); }
.post-type-title { font-size: 16px; font-weight: 700; color: var(--text); }
.post-type-plats { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; opacity: 0.72; }

/* Post Bridge-style Connections Rows & Upgrade Callout */
.conn-quota-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
.conn-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.conn-row:last-child { border-bottom: 0; }
.conn-btn { min-width: 168px; justify-content: center; background: #1e293b; color: #fff; border-color: #1e293b; }
.conn-btn:hover { background: #334155; color: #fff; }
[data-theme="dark"] .conn-btn { background: #334155; border-color: #475569; }
.conn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text); }
.conn-pill-x { border: 0; background: transparent; color: var(--err); cursor: pointer; font-weight: 700; font-size: 13px; padding: 0 2px; line-height: 1; }
.upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #0ea5e9); color: #fff; margin-bottom: 18px; }
.upgrade-banner h3 { margin: 0 0 2px; font-size: 15px; color: #fff; }
.upgrade-banner p { margin: 0; font-size: 13px; opacity: 0.92; }

/* ManyChat-style My Automations Filter Bar & Cards */
.auto-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.auto-filter-bar input { flex: 1; min-width: 180px; }
.auto-filter-bar select { width: auto; min-width: 148px; }
.auto-row-card {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); margin-bottom: 10px; transition: border-color 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}
.auto-row-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.pill-live { background: #16a34a; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 5px; }
.pill-stopped { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 5px; }
.kw-pill { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 700; margin-left: 3px; }

/* Clean Post Bridge-style Composer Right Rail & Account Caption Tabs */
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .composer-grid { grid-template-columns: 1fr; } }
.acct-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.acct-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.12s ease;
}
.acct-tab:hover { background: var(--surface-2); }
.acct-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.acct-tab-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--ok); }
.switch-toggle { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: 0.18s; }
.switch-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 99px; transition: 0.18s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch-toggle input:checked + .switch-slider { background: var(--accent); }
.switch-toggle input:checked + .switch-slider::before { transform: translateX(18px); }
.dropzone-lg { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 42px 24px; text-align: center; background: var(--surface); cursor: pointer; transition: all 0.14s ease; }
.dropzone-lg:hover { border-color: var(--accent); background: var(--accent-soft); }
.caption-counter { text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* Landing Page */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
nav.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.hero { padding: 68px 0 44px; text-align: center; }
.landing-nav-links { display: flex; align-items: center; gap: 14px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; margin: 0 auto 14px; max-width: 780px; letter-spacing: -0.03em; text-wrap: balance; }
.hero p { font-size: 17.5px; color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.landing-features { margin-bottom: 44px; }
.landing-features .card, .landing-features p { margin-bottom: 0; }
.landing-features p { margin-top: 0; }
.landing-pricing { margin-bottom: 44px; scroll-margin-top: 90px; }
.landing-pricing > h2 { text-align: center; font-size: 30px; margin: 0 0 16px; }
@media (max-width: 650px) {
  nav.landing-nav { padding-inline: 16px; }
  .landing-nav-extra { display: none; }
  .hero { padding: 42px 0 30px; }
  .hero p { font-size: 16px; margin-bottom: 20px; }
  .landing-features { gap: 8px; margin-bottom: 30px; }
  .landing-features .card { padding: 12px 14px; }
  .landing-pricing .grid { gap: 10px; }
  .landing-pricing .pricing-card { padding: 12px; }
  .landing-pricing .pricing-card .btn { padding-inline: 8px; white-space: normal; }
}
@media (min-width: 390px) and (max-width: 650px) {
  .landing-pricing .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.price { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0; color: var(--text); }
.price .price-unit { font-size: 14px; font-weight: 500; color: var(--muted); }
ul.features { list-style: none; padding: 0; margin: 12px 0 20px; font-size: 13.5px; color: var(--text-2); }
ul.features li { margin: 7px 0; padding-left: 18px; position: relative; }
ul.features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.pricing-card { display: flex; flex-direction: column; margin-bottom: 0; }
.pricing-card ul.features { flex: 1; }

pre.code {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  overflow-x: auto; font-size: 12px; color: var(--text-2);
}
.toast {
  position: fixed; bottom: 20px; right: 20px; padding: 11px 16px; border-radius: 10px;
  background: #0f172a; color: #fff; box-shadow: var(--shadow-md);
  z-index: 99; max-width: 420px; font-size: 13.5px; font-weight: 500;
}
footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 56px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* 3-Step Onboarding Wizard & Pre-OAuth Helper Modal (Post Bridge pattern in our style) */
.onb-overlay {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; flex-direction: column; overflow-y: auto;
}
.onb-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.onb-stepper { display: flex; align-items: center; gap: 10px; }
.onb-dot {
  width: 28px; height: 28px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.onb-dot.active, .onb-dot.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.onb-line { width: 52px; height: 2px; background: var(--border); border-radius: 99px; }
.onb-line.done { background: var(--accent); }
.onb-body { flex: 1; max-width: 780px; width: 100%; margin: 0 auto; padding: 40px 20px 32px; }
.onb-eyebrow { text-align: center; font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.onb-title { text-align: center; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.onb-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0 0 28px; }
.role-card-list { display: flex; flex-direction: column; gap: 10px; max-width: 540px; margin: 0 auto; }
.role-card {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; transition: all 0.12s ease; width: 100%;
}
.role-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.role-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.role-radio {
  width: 20px; height: 20px; border-radius: 99px; border: 2px solid var(--border-strong);
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.role-card.selected .role-radio { border-color: var(--accent); }
.role-card.selected .role-radio::after { content: ""; width: 10px; height: 10px; border-radius: 99px; background: var(--accent); }
.plat-connect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .plat-connect-grid { grid-template-columns: repeat(2, 1fr); } }
.plat-connect-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm);
}
.plat-connect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.onb-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--surface); border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
}
.modal-backdrop {
  position: fixed; inset: 0; z-index: 95; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  max-width: 440px; width: 100%; padding: 22px 24px; box-shadow: var(--shadow-md);
}
.modal-bullets { list-style: none; padding: 0; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.modal-bullets li { padding-left: 16px; position: relative; line-height: 1.45; }
.modal-bullets li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }

.pempost-icon { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.review-only { display: none; }
[data-review-mode="true"] .review-only { display: block; }
.phone-media:has(#phoneMedia > *) { height: auto; min-height: 220px; }
