/* SocialPulse — single shared stylesheet (landing + auth + app). No external fonts. */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #7c3aed;
  --brand-2: #4f46e5;
  --brand-soft: #f3eefe;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --side: #131534;
  --side-ink: #a5accf;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.btn:hover { border-color: #cdd2dc; box-shadow: var(--shadow); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { color: var(--bad); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f4f7; box-shadow: none; color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #344054; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font: inherit; color: var(--ink); background: #fff; width: 100%;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .13);
}
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 4px 0; }

/* ---------- pills & chips ---------- */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.st-scheduled { background: #eef4ff; color: #1d4ed8; }
.st-published { background: var(--ok-soft); color: var(--ok); }
.st-publishing { background: var(--brand-soft); color: var(--brand); }
.st-partial { background: var(--warn-soft); color: var(--warn); }
.st-failed { background: var(--bad-soft); color: var(--bad); }
.st-draft { background: #f2f4f7; color: var(--muted); }
.pchip {
  display: inline-block; padding: 2px 9px; border-radius: 6px; color: #fff;
  background: var(--pc, #666); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pc, #666); }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.lnav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { flex: 0 0 auto; }
.lnav-links { display: flex; align-items: center; gap: 22px; }
.lnav-links a { color: #475467; font-weight: 600; font-size: 14px; }
.hero {
  max-width: 1120px; margin: 0 auto; padding: 72px 24px 40px; text-align: center;
}
.hero h1 { font-size: 46px; letter-spacing: -.02em; margin-bottom: 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: 18px; color: #475467; max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.hero-cta .btn { padding: 12px 26px; font-size: 15px; }
.hero-note { font-size: 13px; color: var(--muted); }
.platform-strip {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 900px; margin: 34px auto 0; padding: 0 24px;
}
.platform-strip .pchip { font-size: 13px; padding: 7px 14px; }
.section { max-width: 1120px; margin: 0 auto; padding: 64px 24px; }
.section > h2 { text-align: center; font-size: 30px; letter-spacing: -.01em; }
.section > .lead { text-align: center; color: #475467; max-width: 620px; margin: 0 auto 40px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.feature .fico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  color: var(--brand); font-weight: 800; font-size: 17px;
}
.feature h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature p { color: #475467; font-size: 14px; margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .num {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 14px;
}
.step h3 { font-size: 16px; }
.step p { color: #475467; font-size: 14px; margin: 0; }
.why { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.why ul { list-style: none; padding: 0; margin: 0; }
.why li { padding: 9px 0 9px 30px; position: relative; color: #344054; }
.why li::before {
  content: ""; position: absolute; left: 0; top: 14px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23059669" stroke-width="3"><path d="M5 13l4 4L19 7"/></svg>') center/12px no-repeat;
}
.cta-band { text-align: center; padding: 30px 24px 80px; }
.lfooter { border-top: 1px solid var(--line); padding: 26px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 34px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-card .alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-body { background: var(--bg); }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 auto; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; padding: 20px 18px 14px; font-size: 17px; }
.sidebar nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0;
  border-radius: 9px; color: var(--side-ink); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.nav-item svg { flex: 0 0 auto; opacity: .9; }
.sidebar .side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.side-user { color: #d3d8f0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.side-foot .btn { width: 100%; background: transparent; border-color: rgba(255, 255, 255, .18); color: #cdd3ee; }
.side-foot .btn:hover { background: rgba(255, 255, 255, .08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 18px; margin: 0; }
.view { padding: 24px 26px 60px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- dashboard ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-card.attention .num { color: var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; }
.card-b { padding: 14px 18px; }
.up-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.up-item:last-child { border-bottom: none; }
.up-item .t { font-weight: 600; font-size: 14px; }
.up-item .when { color: var(--muted); font-size: 12.5px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.act-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.act-item:last-child { border-bottom: none; }
.act-item .when { color: var(--muted); font-size: 12px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .snippet { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; color: #475467; cursor: pointer;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- composer ---------- */
.composer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.char-meter { font-size: 12px; font-weight: 700; }
.char-meter.over { color: var(--bad); }
.char-meter.warn { color: var(--warn); }
.char-meter.ok { color: var(--ok); }
.target-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 9px; background: #fff; }
.target-row .head { display: flex; align-items: center; gap: 9px; }
.target-row input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
.target-row details { margin-top: 8px; }
.target-row summary { font-size: 12.5px; color: var(--brand-2); cursor: pointer; font-weight: 600; }
.target-row textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; min-height: 56px; }
.assist-card { background: var(--brand-soft); border: 1px solid #e3d7fb; border-radius: var(--radius); padding: 16px; }
.assist-card h3 { font-size: 15px; }
.assist-variant { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; white-space: pre-wrap; font-size: 13.5px; }
.tag-chip { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; margin: 3px 4px 0 0; cursor: pointer; font-weight: 600; color: var(--brand-2); }
.tag-chip:hover { border-color: var(--brand); }
.media-preview { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; display: none; }
.compose-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h2 { margin: 0; font-size: 19px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-height: 96px;
  padding: 7px; cursor: pointer; transition: border-color .12s;
}
.cal-cell:hover { border-color: var(--brand); }
.cal-cell.blank { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.today { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(124, 58, 237, .16); }
.cal-day { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.cal-cell.today .cal-day { color: var(--brand); }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 4px; border-radius: 6px; background: #f4f5f9; margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }

/* ---------- accounts ---------- */
.acct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.acct-card .top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.acct-ico { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; background: var(--pc, #666); }
.acct-card .h { font-weight: 700; font-size: 15px; }
.acct-card .s { color: var(--muted); font-size: 12.5px; }
.acct-meta { font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; line-height: 1.7; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.mode-live { background: var(--ok-soft); color: var(--ok); }
.mode-sandbox { background: var(--warn-soft); color: var(--warn); }

/* ---------- insights ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 6px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); border-radius: 5px 5px 0 0; min-height: 2px; }
.bar-col .bl { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar-col .bv { font-size: 11px; font-weight: 700; }
.hm { border-collapse: collapse; width: 100%; }
.hm th { font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 2px; }
.hm td { width: calc(100% / 24); height: 22px; border: 1px solid #fff; border-radius: 3px; background: #f2f4f7; }
.hm .dow { font-size: 11.5px; color: var(--muted); font-weight: 700; text-align: right; padding-right: 8px; white-space: nowrap; }
.sugg { display: flex; gap: 10px; flex-wrap: wrap; }
.sugg .s { background: var(--brand-soft); border: 1px solid #e3d7fb; color: var(--brand); border-radius: 9px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------- modal / toast / misc ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 20px; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto; padding: 24px; box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.modal h2 { font-size: 18px; margin-bottom: 16px; }
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 16px; font-size: 14px;
  opacity: 0; transform: translateY(8px); transition: all .25s ease; max-width: 380px; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .big { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt0 { margin-top: 0; } .mb16 { margin-bottom: 16px; } .mb22 { margin-bottom: 22px; }
.flex { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

@media (max-width: 960px) {
  .features, .steps, .acct-grid, .grid-4, .settings-grid { grid-template-columns: 1fr 1fr; }
  .composer-grid, .grid-2, .why-grid { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar nav { display: flex; padding: 6px; }
  .sidebar .side-foot { display: none; }
  .sidebar .brand { padding: 12px 16px; white-space: nowrap; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 620px) {
  .features, .steps, .acct-grid, .grid-4 { grid-template-columns: 1fr; }
  .view { padding: 16px 14px 50px; }
  .form-row { flex-direction: column; gap: 0; }
}
