:root {
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Noto Sans Tamil', sans-serif;
  --rail: #ffffff; --rail-2: #f8fafc; --rail-ic: #71809a; --rail-active: #eaf1ff;
  --nav: #ffffff; --nav-text: #405572; --nav-muted: #8a99ae; --nav-hover: #f2f6fc; --nav-active: #e8f0ff;
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #edf2f8;
  --text: #172b4d; --text-2: #5b6b83; --text-3: #8795a9; --line: #dfe7f2; --line-2: #edf1f6;
  --primary: #4F46E5; --primary-h: #1d56c7; --primary-soft: #eaf1ff;
  --brand: #59cb59; --brand-dark: #2f9a4a; --accent: #7c3aed; --accent-soft: #f3edff;
  --ok: #1f9d55; --ok-soft: #e4f6ea; --warn: #b7791f; --warn-soft: #fdf3dc; --danger: #d63b3b; --danger-soft: #fdeaea;
  --pos: #2f6fe0; --neg: #e5484d; --neu: #c3c9ca;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.08);
  --r: 8px; --r-sm: 6px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111718; --surface: #1a2223; --surface-2: #202a2b; --surface-3: #283334;
  --text: #e6eded; --text-2: #a9b6b6; --text-3: #7c8a8a; --line: #2d393a; --line-2: #253031;
  --primary: #4b82e6; --primary-h: #6b98ea; --primary-soft: #1d2c44; --accent-soft: #2a2140;
  --ok-soft: #173325; --warn-soft: #3a2f16; --danger-soft: #3d1c1c; --neu: #56605f;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--text); background: var(--rail); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
button { font: inherit; color: inherit; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--text-3); } .small { font-size: 12px; } .tiny { font-size: 11px; } .bold { font-weight: 600; }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; } .wrap { flex-wrap: wrap; }
.gap-xs { gap: 4px; } .gap-sm { gap: 8px; } .gap { gap: 12px; } .gap-lg { gap: 20px; }
.grow { flex: 1; min-width: 0; } .between { justify-content: space-between; } .center { justify-content: center; } .end { justify-content: flex-end; }
.mt-xs { margin-top: 4px; } .mt-sm { margin-top: 8px; } .mt { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mb { margin-bottom: 16px; } .mb-sm { margin-bottom: 8px; }
.w-full { width: 100%; } .pad-sm { padding: 8px 10px; } .hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tamil, :lang(ta) { font-family: 'Noto Sans Tamil', var(--font); }

/* ---------- shell ---------- */
#app { display: flex; height: 100vh; }
.rail { width: 52px; flex: none; background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; z-index: 20; }
.mobile-nav-btn { display:none; border:0; background:transparent; color:var(--rail-ic); font-size:20px; width:36px; height:36px; cursor:pointer; }
.rail-logo { width: 30px; height: 30px; margin-bottom: 10px; display: grid; place-items: center; }
.rail-btn { position: relative; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--rail-ic); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.rail-btn:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.rail-btn.active { background: var(--rail-active); color: var(--primary); }
.rail-btn.compose { background: var(--primary); color: #fff; margin-bottom: 14px; box-shadow:0 4px 10px rgba(79,70,229,.2); }
.rail-btn.compose:hover { background: #e7f7e7; }
.rail-sep { height: 18px; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-dot { position: absolute; top: 5px; right: 5px; min-width: 8px; height: 8px; border-radius: 8px; background: #e5484d; border: 2px solid var(--rail-2); }
.rail-me { width: 30px; height: 30px; border-radius: 50%; margin-top: 6px; cursor: pointer; border: 0; padding: 0; }
.tip { position: relative; }
.tip[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: #111; color: #fff; padding: 5px 9px; border-radius: 5px; white-space: nowrap; font-size: 12px; pointer-events: none; z-index: 50; }

.subnav { width: 232px; flex: none; background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; overflow-y: auto; transition: width .15s; border-right:1px solid var(--line); }
.subnav.collapsed { width: 0; overflow: hidden; }
.subnav-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 16px; }
.subnav-h h2 { font-size: 16px; color: #fff; }
.subnav-h .icon-btn { color: var(--nav-muted); }
.subnav a, .subnav .nav-i { display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin: 1px 8px; border-radius: 6px; color: var(--nav-text); text-decoration: none; cursor: pointer; border: 0; background: none; width: calc(100% - 16px); text-align: left; font-size: 13px; }
.subnav a:hover, .subnav .nav-i:hover { background: var(--nav-hover); text-decoration: none; }
.subnav a.active { background: var(--nav-active); color: var(--primary); font-weight: 650; }
.subnav .nav-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.14); padding: 1px 7px; border-radius: 10px; }
.subnav .nav-section { font-size: 11px; color: var(--nav-muted); padding: 14px 20px 4px; display: flex; align-items: center; justify-content: space-between; text-transform: none; font-weight: 600; }
.subnav .nav-section button { background: none; border: 0; color: var(--nav-muted); cursor: pointer; padding: 0; }
.subnav .nav-child { padding-left: 26px; }
.subnav .new-post { margin: 4px 12px 8px; }
.subnav-foot { margin-top: auto; padding: 12px; }
.subnav-card { background: #fff; color: #1c2526; border-radius: 8px; padding: 12px; font-size: 12px; }
.subnav .subnav-card a.btn { margin: 8px 0 0; width: 100%; color: #fff; background: var(--primary); padding: 0 12px; justify-content: center; }
.subnav .new-post.btn { background: var(--primary); color: #fff; }
@media (max-width: 1200px) { .thread { grid-template-columns: 1fr 260px; } .thread-l { display: none; } }
.subnav .subnav-card a.btn:hover { background: var(--primary-h); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.page-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 22px; min-height: 66px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.page-h h1 { font-size: 17px; }
.page-h .sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.page-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-body { flex: 1; overflow: auto; padding: 22px; }
.page-body.flush { padding: 0; }
.page-inner { max-width: 1180px; margin: 0 auto; }
.page-narrow { max-width: 900px; margin: 0 auto; }

/* Analytics workspace: calm, comparison-first surfaces inspired by modern research tools. */
.ig-analytics-shell { margin: -16px -16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ig-analytics-toolbar { min-height: 58px; padding: 10px 18px; display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid var(--line); }
.ig-product-mark { font-size:15px; font-weight:750; letter-spacing:-.02em; color:var(--text); }
.ig-analytics-tabs { display:flex; gap:4px; padding:0 18px; background:var(--surface); }
.ig-analytics-tabs button { border:0; border-bottom:2px solid transparent; background:none; color:var(--text-2); padding:12px 14px 10px; font-weight:650; cursor:pointer; }
.ig-analytics-tabs button:hover { color:var(--primary); background:var(--primary-soft); }
.ig-analytics-tabs button.active { color:var(--primary); border-bottom-color:var(--primary); }
.ig-truth-banner { display:flex; align-items:center; gap:10px; margin:0 18px 12px; padding:9px 11px; border:1px solid var(--line); border-radius:6px; background:var(--surface-2); font-size:11px; }
.ig-truth-banner span:nth-child(2) { flex:1; color:var(--text-2); }
.ig-kpis { border:1px solid var(--line); border-radius:var(--r); background:var(--surface); box-shadow:var(--shadow); }
.ig-kpis > div { min-width:130px; }
.ig-kpis small { display:block; margin-top:3px; color:var(--text-3); font-size:10px; }
.ig-table-note { padding:9px 12px; border-top:1px solid var(--line); color:var(--text-3); font-size:11px; }
@media (max-width: 760px) { .ig-analytics-toolbar { align-items:flex-start; flex-direction:column; } .ig-truth-banner { align-items:flex-start; flex-direction:column; } .ig-analytics-tabs { overflow-x:auto; } }
@media (max-width: 760px) {
  body { overflow:hidden; }
  .rail { width:48px; padding-top:8px; }
  .rail > .rail-btn, .rail > .rail-logo { display:none; }
  .rail > .rail-bottom { display:flex; position:absolute; bottom:8px; flex-direction:column; }
  .mobile-nav-btn { display:block; }
  .subnav { position:fixed; left:48px; top:0; bottom:0; width:224px; transform:translateX(-110%); transition:transform .18s ease; box-shadow:var(--shadow-lg); z-index:40; }
  body.mobile-nav-open .subnav { transform:translateX(0); }
  body.mobile-nav-open::after { content:''; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:30; }
  .main { border-radius:0; }
  .page-h { padding:10px 12px; }
  .page-body { padding:12px; }
  .ig-analytics-shell { margin:-12px -12px 14px; }
  .ig-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .table { min-width:760px; }
  .yt-table { overflow-x:auto; }
}

/* Focused analytics workspace. This is intentionally a separate visual system from the operations shell. */
/* The analytics workspace brings its own chrome, so the app's sub-navigation steps aside — but the
   global rail stays, otherwise this route is a dead end. */
body.analytics-focus { background:#fff; }
body.analytics-focus .subnav { display:none; }
body.analytics-focus .main { border-radius:0; background:#f4f7fb; }
.analytics-body { height:100%; overflow:auto; }
.fp-shell { min-height:100%; background:#f4f7fb; color:#172b4d; font-family:Inter,'Segoe UI',sans-serif;
  display:grid; grid-template-columns:220px minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr); }
.fp-topbar, .fp-subbar { grid-column:1 / -1; }
.fp-topbar { height:54px; display:flex; align-items:center; gap:34px; padding:0 22px; background:#fff; border-bottom:1px solid #e5eaf2; color:#52627b; }
.fp-brand { min-width:180px; font-size:19px; color:#40577c; letter-spacing:-.03em; font-weight:650; }
.fp-diamond { color:#6f8fbd; font-size:22px; margin-right:7px; }
.fp-topbar nav { display:flex; align-self:stretch; gap:26px; }
.fp-topbar nav a { display:flex; align-items:center; color:#70809a; font-size:13px; font-weight:600; text-decoration:none; border-bottom:3px solid transparent; }
.fp-topbar nav a.active { color:#152b4c; border-bottom-color:#4F46E5; }
.fp-account { margin-left:auto; display:flex; align-items:center; gap:12px; font-size:12px; }
.fp-avatar { width:28px; height:28px; border-radius:50%; display:inline-grid; place-items:center; flex:none; background:#dce7f8; color:#3564a3; font-size:11px; font-weight:700; }
.fp-user { background:#7b42b6; color:#fff; }
.fp-subbar { height:50px; display:flex; align-items:center; padding:0 20px; background:#fff; border-bottom:1px solid #e5eaf2; color:#3e5576; }
.fp-subbar > span { margin-left:10px; color:#9aa9bf; }
.fp-subtabs { display:flex; align-self:stretch; margin-left:50px; gap:24px; }
.fp-subtabs a,.fp-subtabs button { display:flex; align-items:center; border:0; border-bottom:2px solid transparent; background:none; color:#71829c; font:inherit; font-size:12px; text-decoration:none; }
.fp-subtabs a.active { color:#1e4e9a; border-bottom-color:#4F46E5; font-weight:700; }
.fp-subtabs a.fp-tab-off { opacity:.42; cursor:default; }
.fp-subtabs a:not(.fp-tab-off) { cursor:pointer; }
.fp-profile-rail { padding:18px 14px; background:#fff; border-right:1px solid #e5eaf2; display:flex; flex-direction:column; gap:4px; min-height:0; }
.fp-rail-list { overflow-y:auto; min-height:0; margin:0 -4px; padding:0 4px; }
.fp-rail-title { padding:0 10px 12px; color:#7c8da5; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.fp-profile { display:flex; align-items:center; gap:9px; padding:9px 10px; color:#4a5c78; text-decoration:none; border-radius:5px; }
.fp-profile:hover,.fp-profile.active { background:#edf3ff; color:#1f4e9b; }
.fp-profile b { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.fp-profile small { display:block; color:#95a3b7; font-size:10px; margin-top:2px; }
/* Collection state: green = collected recently, amber = stale, red = last collection failed. */
.fp-profile i { margin-left:auto; width:8px; height:8px; border-radius:50%; background:#d8a062; flex:none; }
.fp-profile i.ok { background:#38a169; } .fp-profile i.bad { background:#d63b3b; }
.fp-manage { margin-top:auto; height:32px; flex:none; border:1px solid #9bb9ef; border-radius:4px; background:#fff; color:#2968d4; font-weight:600; cursor:pointer; }
.fp-clear { margin-left:10px; border:0; background:none; color:#2968d4; font-size:11.5px; font-weight:600; cursor:pointer; text-decoration:underline; }
.fp-canvas { min-width:0; overflow:auto; padding:0 20px 36px; }
.fp-canvas .ig-analytics-shell { margin:0 -20px 16px; border-bottom:1px solid #dce5f3; }
.fp-canvas .ig-analytics-toolbar { padding:14px 20px; background:#fff; }
.fp-canvas .ig-analytics-toolbar .ig-product-mark { display:none; }
.fp-canvas .ig-truth-banner { margin:0 20px 12px; background:#fff8dc; border-color:#f0e2a9; color:#6f5b1c; }
.fp-canvas .yt-metrics { border:0; box-shadow:none; background:transparent; gap:10px; }
.fp-canvas .yt-metrics > div { background:#fff; border:1px solid #e1e8f2; border-radius:6px; padding:12px 14px; }
.fp-canvas .card { border-color:#dfe7f2; border-radius:6px; box-shadow:0 2px 5px rgba(28,54,90,.05); }
.fp-canvas .card-h { padding:14px 16px 9px; }
.fp-canvas .card-h h3 { color:#19365f; }
.fp-canvas .table th { background:#f8fafc; color:#8291a8; border-color:#e3eaf4; }
.fp-canvas .table td { border-color:#edf1f6; }
.fp-canvas .btn-primary { background:#4F46E5; border-color:#4F46E5; }
.fp-report-toolbar { min-height:48px; display:flex; align-items:center; gap:6px; padding:0 20px; background:#fff; border-top:1px solid #edf1f7; border-bottom:1px solid #dce5f3; }
.fp-report-toolbar .icon-btn { color:#6d7e97; }
.fp-report-toolbar .icon-btn:hover { color:#4F46E5; background:#edf3ff; }
.fp-toolbar-divider { width:1px; height:22px; background:#e1e8f2; margin:0 5px; }
.fp-period-label { color:#1f4e9b; font-size:12px; font-weight:700; }
.fp-metrics-overview .card-b { padding:0; }
.fp-metrics-overview .table { min-width:760px; }
.fp-metric-profile { display:flex; align-items:center; gap:9px; min-width:170px; }
.fp-metric-profile small { display:block; color:#8a9ab0; font-size:10px; margin-top:2px; }
.fp-metric-profile b { display:block; color:#24466f; font-size:12px; }
.fp-metrics-overview tbody tr:nth-child(even) { background:#fbfcfe; }
.fp-metrics-overview tbody tr:hover { background:#f0f5ff; }
.fp-secondary-comparison { display:none; }
.fp-editing .card { outline:2px dashed #8eb1f2; outline-offset:2px; }
.reports-home { max-width:1240px; }
.reports-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:16px; padding:24px 28px; border-radius:8px; color:#fff; background:linear-gradient(105deg,#183c67,#4F46E5); }
.reports-hero .tiny { color:#b9d0f5; letter-spacing:.08em; }
.reports-hero h2 { margin:7px 0 5px; font-size:22px; }
.reports-hero p { color:#d6e3f7; max-width:620px; margin:0; }
.reports-hero .btn { background:#fff; border-color:#fff; color:#1e55a6; }
.reports-section { display:grid; grid-template-columns:230px 1fr; gap:24px; align-items:start; padding:18px 0; border-bottom:1px solid var(--line); }
.reports-section-copy h3 { color:var(--text); font-size:15px; }
.reports-section-copy p { margin-top:6px; color:var(--text-3); font-size:12px; line-height:1.45; }
.reports-links { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }
.report-tile { display:flex; flex-direction:column; gap:6px; min-height:82px; padding:14px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--text); text-decoration:none; transition:border-color .15s,box-shadow .15s,transform .15s; }
.report-tile:hover { border-color:#7ea7eb; box-shadow:0 4px 12px rgba(38,91,175,.12); transform:translateY(-1px); text-decoration:none; }
.report-tile b { font-size:12px; }
.report-tile small { color:var(--text-3); font-size:11px; line-height:1.35; }
.report-tile-primary { border-color:#82aaf0; background:#f0f5ff; color:#1d4f9b; }
.nav-primary-link { color:#8bb7ff !important; background:rgba(79,70,229,.18) !important; }
@media (max-width:760px) { .reports-hero { align-items:flex-start; flex-direction:column; padding:18px; } .reports-section { grid-template-columns:1fr; gap:12px; } }
@media (max-width: 760px) {
  /* One column: the section nav and the profile rail scroll sideways instead of disappearing. */
  .fp-shell { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto minmax(0,1fr); }
  .fp-topbar { height:auto; flex-wrap:wrap; padding:8px 12px; gap:8px; }
  .fp-brand { min-width:auto; font-size:16px; }
  .fp-topbar nav { order:3; width:100%; gap:18px; overflow-x:auto; padding-bottom:2px; }
  .fp-topbar nav a { white-space:nowrap; }
  .fp-subbar { height:auto; flex-wrap:wrap; padding:8px 12px; }
  .fp-subtabs { margin-left:0; width:100%; gap:16px; overflow-x:auto; }
  .fp-subtabs a { white-space:nowrap; }
  .fp-profile-rail { flex-direction:row; align-items:center; gap:8px; padding:8px 12px; border-right:0; border-bottom:1px solid #e5eaf2; }
  .fp-rail-title { display:none; }
  .fp-rail-list { display:flex; gap:8px; overflow-x:auto; flex:1; }
  .fp-profile { white-space:nowrap; }
  .fp-manage { margin-top:0; padding:0 10px; height:28px; font-size:11.5px; max-width:96px; overflow:hidden; text-overflow:ellipsis; }
  .fp-canvas { padding:0 10px 24px; }
  .fp-canvas .ig-analytics-shell { margin:0 -10px 12px; }
  .fp-report-toolbar { padding:0 10px; overflow-x:auto; }
  .fp-report-toolbar .grow { min-width:10px; }
  .fp-period-label { white-space:nowrap; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-dark { background: #253536; border-color: #253536; color: #fff; } .btn-dark:hover { background: #33474a; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; } .btn-accent:hover { filter: brightness(1.08); background: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; } .btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; } .btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group .btn.on { background: #253536; color: #fff; border-color: #253536; z-index: 1; }
.split { display: inline-flex; } .split .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } .split .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 1px solid rgba(255,255,255,.3); padding: 0 8px; }
.icon-btn { width: 30px; height: 30px; border-radius: 6px; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.on { color: var(--primary); } .icon-btn.on-red { color: #e5484d; } .icon-btn.on-green { color: var(--ok); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; font-weight: 500; font-size: 12px; text-decoration: underline; }
.input, select.input, textarea.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; outline: none; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-sm { height: 28px; font-size: 12px; }
.search { position: relative; } .search .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); } .search .input { padding-left: 30px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; } .fld > span { font-size: 12px; font-weight: 600; color: var(--text-2); } .fld small { color: var(--text-3); font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.toggle { position: relative; width: 34px; height: 20px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: #b8c2c2; border-radius: 20px; cursor: pointer; transition: .15s; }
.toggle span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.toggle input:checked + span { background: #253536; } .toggle input:checked + span::before { transform: translateX(14px); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-demo { background: var(--warn-soft); color: var(--warn); font-size: 10px; padding: 0 5px; }
.badge-live { background: var(--ok-soft); color: var(--ok); }
.badge-blue { background: var(--primary-soft); color: var(--primary); } .badge-green { background: var(--ok-soft); color: var(--ok); }
.badge-red { background: var(--danger-soft); color: var(--danger); } .badge-amber { background: var(--warn-soft); color: var(--warn); } .badge-purple { background: var(--accent-soft); color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; cursor: default; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-3); display: grid; }
.hashtag { color: var(--primary); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { padding: 14px 16px 10px; display: flex; align-items: flex-start; gap: 8px; }
.card-h h3 { font-size: 15px; } .card-h p { color: var(--text-3); font-size: 12px; margin: 2px 0 0; }
.card-b { padding: 0 16px 16px; }
.card-pad { padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; overflow: visible; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface); }
.av-badge { position: absolute; right: -3px; bottom: -3px; background: var(--surface); border-radius: 50%; padding: 1.5px; display: grid; line-height: 0; }
.ni { display: inline-block; flex: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; vertical-align: middle; }
.ni-fallback { display: inline-grid; }
.pchip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; } .pchip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- filter bar ---------- */
.fbar { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 44px; flex: none; }
.fcol { flex: 0 1 220px; min-width: 120px; border: 0; border-right: 1px solid var(--line); background: none; text-align: left; padding: 6px 30px 6px 12px; cursor: pointer; position: relative; display: flex; flex-direction: column; justify-content: center; }
.fcol:hover { background: var(--surface-2); }
.fcol-l { font-weight: 600; font-size: 12px; } .fcol-v { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcol-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.fbar-r { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 0 12px; }

/* ---------- popovers/menus/modals ---------- */
.popover { position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 180px; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
.menu { padding: 5px; }
.menu-i { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.menu-i:hover { background: var(--surface-2); } .menu-i:disabled { opacity: .45; cursor: default; } .menu-i.danger { color: var(--danger); }
.menu-check { margin-left: auto; color: var(--primary); } .menu-sep { height: 1px; background: var(--line); margin: 5px 0; } .menu-h { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 6px 10px 3px; text-transform: uppercase; letter-spacing: .03em; }
.fpop { padding: 10px; } .fpop-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fpop-list { max-height: 320px; overflow: auto; } .fpop-g { font-size: 11px; font-weight: 700; color: var(--text-3); margin: 8px 0 3px; }
.fpop-i { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 4px; cursor: pointer; } .fpop-i:hover { background: var(--surface-2); }
.fpop-search { margin-bottom: 6px; } .fpop-extra { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.modal-wrap { position: fixed; inset: 0; background: rgba(10,18,20,.45); display: grid; place-items: center; z-index: 500; padding: 20px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); } .modal-h h3 { font-size: 16px; }
.modal-b { padding: 16px; overflow: auto; } .modal-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; gap: 8px; align-items: center; background: #1c2526; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-weight: 500; transition: opacity .3s, transform .3s; max-width: 560px; }
.toast-error { background: #9b2c2c; } .toast-warn { background: #8a5a14; } .toast.out { opacity: 0; transform: translateY(8px); }
.drawer { position: fixed; top: 0; bottom: 0; left: 52px; width: 380px; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 400; display: flex; flex-direction: column; animation: slide .15s; }
@keyframes slide { from { transform: translateX(-20px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); } .drawer-b { flex: 1; overflow: auto; }

.empty { text-align: center; padding: 56px 20px; color: var(--text-3); } .empty h3 { color: var(--text); margin: 12px 0 4px; font-size: 16px; } .empty p { max-width: 380px; margin: 0 auto 14px; }
.loading { display: grid; place-items: center; padding: 50px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sent { display: inline-block; width: 8px; height: 8px; border-radius: 50%; } .sent-positive { background: var(--pos); } .sent-negative { background: var(--neg); } .sent-neutral { background: var(--neu); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; color: var(--text-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line); } .kpi:last-child { border-right: 0; }
.kpi-l { font-size: 12px; color: var(--text-2); border-bottom: 1px dashed var(--line); display: inline-block; }
.kpi-v { font-size: 24px; font-weight: 650; margin-top: 6px; display: flex; align-items: baseline; gap: 8px; letter-spacing: -.02em; }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; } .delta.up { color: var(--ok); } .delta.down { color: var(--danger); } .delta.flat { color: var(--text-3); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chart-box { position: relative; height: 260px; } .chart-box.sm { height: 180px; } .chart-box.lg { height: 320px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--text-2); margin-top: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tabs { display: flex; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 16px; flex: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 12px 16px; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; text-decoration: none; }
.tabs .on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.stretch > * { flex: 1; text-align: center; }

/* ---------- dashboard ---------- */
.hero { background: radial-gradient(1200px 300px at 20% -20%, #e3f5ec 0%, transparent 60%), radial-gradient(900px 300px at 100% 0%, #efe9ff 0%, transparent 60%), var(--surface-2); border-bottom: 1px solid var(--line); padding: 28px 16px; }
:root[data-theme="dark"] .hero { background: var(--surface-2); }
.heat { display: grid; grid-template-columns: 40px repeat(6, 1fr); gap: 4px; font-size: 11px; color: var(--text-2); }
.heat .h { text-align: center; } .heat .d { display: flex; align-items: center; }
.heat .c { height: 18px; border-radius: 3px; cursor: pointer; transition: transform .1s; } .heat .c:hover { transform: scale(1.06); outline: 2px solid var(--primary); }
.heat-legend { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.heat-legend .bar { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #d7f3ef, #0cb8a4); }
.news-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .news-item:last-child { border: 0; }
.news-thumb { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex: none; }
.feature-card { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; text-decoration: none; color: inherit; } .feature-card:hover { border-color: var(--primary); text-decoration: none; }
.feature-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; }

/* ---------- inbox ---------- */
.inbox-list { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
.inbox-toolbar { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 12px auto 0; padding: 0 16px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; box-shadow: var(--shadow); }
.msg.complete { opacity: .72; } .msg.selected { outline: 2px solid var(--primary); }
.msg-h { display: flex; gap: 10px; padding: 12px 14px 6px; align-items: flex-start; }
.msg-who { flex: 1; min-width: 0; } .msg-who b { font-weight: 650; } .msg-who .handle { color: var(--text-3); margin-left: 6px; }
.msg-ctx { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.msg-meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 11.5px; }
.msg-b { padding: 4px 14px 8px 56px; line-height: 1.55; word-wrap: break-word; }
.msg-inreply { margin: 0 14px 6px 56px; padding: 6px 10px; border-left: 3px solid var(--line); font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.msg-bubble { display: inline-block; background: var(--primary-soft); border-radius: 14px; padding: 8px 12px; }
/* attachments that arrived in a direct message */
.msg-media { padding: 2px 14px 10px 56px; }
.msg-media-el { max-width: 320px; max-height: 320px; width: auto; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--surface-2); }
.msg-media-cap { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.msg-media-dur { font-size: 11px; color: var(--text-3); }
.msg-media.gone { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-2);
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; max-width: 420px; margin-left: 56px; }
.msg-media.gone b { color: var(--text); }
.msg-media-note { font-size: 11.5px; color: var(--text-3); margin: 3px 0 5px; line-height: 1.45; }
.msg-media.audio { display: flex; align-items: center; gap: 9px; }
.msg-media.audio audio { height: 34px; max-width: 320px; }
.msg-media.shared { display: flex; gap: 11px; align-items: flex-start; max-width: 420px; margin-left: 56px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.msg-media.shared:hover { background: var(--surface-2); text-decoration: none; }
.msg-media.shared img, .msg-media-ph { width: 62px; height: 62px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.msg-media-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 760px) { .msg-media, .msg-media.shared { padding-left: 14px; margin-left: 0; } .msg-media-el { max-width: 100%; } }
.msg-f { display: flex; align-items: center; padding: 4px 8px 8px 56px; gap: 2px; }
.msg-f .view-thread { margin-right: auto; font-weight: 650; background: none; border: 0; cursor: pointer; padding: 4px 0; color: var(--text); }
.msg-tags { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 14px 6px 56px; }
.msg-replies { margin: 0 14px 8px 56px; border-top: 1px dashed var(--line); padding-top: 6px; }
.msg-reply { display: flex; gap: 8px; font-size: 12.5px; padding: 4px 0; color: var(--text-2); }
.msg-note { background: var(--warn-soft); border-radius: 6px; padding: 6px 10px; margin: 0 14px 8px 56px; font-size: 12px; }
.promo { background: linear-gradient(120deg, #3c5ae8, #7c3aed); color: #fff; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.thread { display: grid; grid-template-columns: 200px 1fr 300px; height: 100%; min-height: 0; }
.thread-l { border-right: 1px solid var(--line); background: var(--surface); padding: 10px 8px; overflow: auto; }
.thread-l button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.thread-l button.on { background: var(--surface-3); }
.thread-c { display: flex; flex-direction: column; min-height: 0; padding: 16px; overflow: hidden; }
.thread-scroll { flex: 1; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 14px; }
.bubble-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; } .bubble-row.out { flex-direction: row-reverse; }
.bubble { max-width: 70%; background: var(--primary-soft); padding: 9px 12px; border-radius: 14px; line-height: 1.5; word-wrap: break-word; }
.bubble-row.out .bubble { background: #253536; color: #fff; }
.bubble-t { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.reply-box { border: 1px solid var(--primary); border-radius: 0 0 8px 8px; background: var(--surface); }
.reply-box textarea { border: 0; width: 100%; resize: none; padding: 10px 12px; font: inherit; outline: none; background: transparent; color: var(--text); min-height: 64px; }
.reply-tools { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-top: 1px solid var(--line-2); }
.reply-foot { display: flex; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line-2); gap: 10px; }
.thread-r { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; }
.contact-cover { height: 60px; background: linear-gradient(120deg, #e4405f, #f58529); }
.contact-field { padding: 8px 16px; } .contact-field label { font-size: 12px; font-weight: 600; display: block; }
.contact-field input { border: 0; background: none; width: 100%; padding: 3px 0; font: inherit; color: var(--text); outline: none; font-style: italic; }
.contact-field input:not(:placeholder-shown) { font-style: normal; } .contact-field input:focus { border-bottom: 1px solid var(--primary); }

/* ---------- publishing ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.cal-head div { padding: 8px; text-align: center; font-weight: 600; font-size: 12px; color: var(--text-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(120px, auto); background: var(--line); gap: 1px; }
.cal-grid.compact { grid-auto-rows: minmax(92px, auto); }
.cal-cell { background: var(--surface); padding: 6px; position: relative; min-width: 0; }
.cal-cell.other { background: var(--surface-2); } .cal-cell.other .cal-d { color: var(--text-3); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--primary); } .cal-cell.past { background: var(--surface-2); }
.cal-cell.drop { background: var(--primary-soft); }
.cal-d { font-size: 12px; font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.cal-add { opacity: 0; display: flex; gap: 3px; } .cal-cell:hover .cal-add { opacity: 1; }
.cal-add button { border: 1px dashed var(--line); background: var(--surface); border-radius: 4px; padding: 0 5px; height: 20px; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
.cal-add button:hover { border-color: var(--primary); color: var(--primary); }
.cal-post { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 3px; cursor: pointer; font-size: 11.5px; min-width: 0; border-left-width: 3px; }
.cal-post:hover { border-color: var(--primary); }
.cal-post .t { color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; } .cal-post .x { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-post.st-published { border-left-color: var(--ok); } .cal-post.st-scheduled { border-left-color: var(--primary); } .cal-post.st-draft { border-left-color: #9ca3af; border-style: dashed; }
.cal-post.st-pending_approval { border-left-color: var(--warn); } .cal-post.st-failed, .cal-post.st-partial { border-left-color: var(--danger); } .cal-post.st-reminded { border-left-color: var(--accent); }
.cal-note { font-size: 11.5px; padding: 3px 6px; border-radius: 4px; margin-bottom: 3px; background: #fde68a; color: #5b4500; cursor: pointer; }
.cal-hint { border: 1px solid #d8b4fe; border-radius: 8px; padding: 8px; text-align: center; font-size: 11.5px; background: var(--surface); }
.week { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.week .hr { font-size: 11px; color: var(--text-3); text-align: right; padding-right: 6px; height: 48px; border-top: 1px solid var(--line-2); }
.week .slot { border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); height: 48px; padding: 2px; position: relative; background: var(--surface); }
.week .slot:hover { background: var(--surface-2); }
.post-row { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; align-items: flex-start; }
.post-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.day-h { font-weight: 650; margin: 18px 0 8px; font-size: 13px; color: var(--text-2); }

/* composer */
.composer { position: fixed; inset: 12px 12px 12px 64px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 450; display: flex; flex-direction: column; overflow: hidden; }
.composer-h { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.composer-h.draft { background: #fdf0d5; } :root[data-theme="dark"] .composer-h.draft { background: #3a2f16; }
.composer-h h2 { font-size: 16px; } .composer-h .sub { font-size: 11.5px; color: var(--text-2); }
.composer-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); min-height: 0; }
.composer-l { overflow: auto; padding: 18px 24px 40px; border-right: 1px solid var(--line); }
.composer-l > * { max-width: 620px; margin-left: auto; margin-right: auto; }
.composer-r { overflow: auto; background: var(--surface-2); display: flex; flex-direction: column; }
.composer-f { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.pick-profiles { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; cursor: pointer; }
.pick-profiles:hover { border-color: var(--primary); }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 16px; background: var(--surface-3); font-weight: 600; font-size: 12px; }
.editor { border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
.editor:focus-within { border-color: var(--primary); }
.editor-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.editor textarea { width: 100%; border: 0; resize: vertical; min-height: 130px; padding: 12px; font: inherit; font-size: 14px; line-height: 1.55; outline: none; background: transparent; color: var(--text); }
.editor-media { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 10px; }
.media-tile { width: 86px; height: 86px; border-radius: 6px; position: relative; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.media-tile .vid { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 4px; padding: 1px 4px; font-size: 10px; }
.media-add { border: 1px dashed var(--line); cursor: pointer; color: var(--text-3); background: var(--surface); } .media-add:hover { border-color: var(--primary); color: var(--primary); }
.editor-tools { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-top: 1px solid var(--line-2); }
.counter { margin-left: auto; font-size: 12px; color: var(--text-3); display: flex; gap: 10px; } .counter .over { color: var(--danger); font-weight: 700; }
.acc { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.acc-h { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; cursor: pointer; font-weight: 600; user-select: none; }
.acc-b { padding: 0 14px 14px; } .acc:not(.open) .acc-b { display: none; } .acc.open .acc-h .ic { transform: rotate(180deg); }
.net-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.net-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12px; }
.net-tabs button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: 420px; margin: 0 auto 16px; overflow: hidden; }
.preview-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.preview-txt { padding: 0 12px 10px; line-height: 1.5; word-wrap: break-word; font-size: 13px; }
.preview-media { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-3); }
.preview-actions { display: flex; gap: 16px; padding: 10px 12px; color: var(--text-2); border-top: 1px solid var(--line-2); }
.ai-opt { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); cursor: pointer; line-height: 1.5; } .ai-opt:hover { border-color: var(--accent); }
.time-sugg { display: flex; flex-wrap: wrap; gap: 6px; } .time-sugg button { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 4px 10px; cursor: pointer; font-size: 12px; } .time-sugg button:hover { border-color: var(--primary); color: var(--primary); }
.grid-planner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; max-width: 480px; margin: 0 auto; }
.grid-planner .cell { aspect-ratio: 1; background: var(--surface-3); position: relative; overflow: hidden; cursor: grab; }
.grid-planner .cell img { width: 100%; height: 100%; object-fit: cover; } .grid-planner .cell .lbl { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 5px; border-radius: 4px; }
.grid-planner .cell.sched { outline: 2px solid var(--primary); outline-offset: -2px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.asset { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; } .asset:hover { border-color: var(--primary); }
.asset.sel { outline: 2px solid var(--primary); }
.asset-img { aspect-ratio: 4/3; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; } .asset-img img, .asset-img video { width: 100%; height: 100%; object-fit: cover; }
.asset-m { padding: 8px 10px; font-size: 12px; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 26px; text-align: center; color: var(--text-3); } .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--c, #e4405f); }
.post-card .pc-h { display: flex; gap: 8px; padding: 10px; align-items: center; } .post-card .pc-t { padding: 0 10px 8px; font-size: 12.5px; }
.post-card .pc-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; background: var(--surface-3); display: block; }
.post-card .pc-m { padding: 8px 10px; font-size: 12px; } .post-card .pc-m div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line-2); } .post-card .pc-m div:last-child { border: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

/* ---------- listening ---------- */
.term-row { display: grid; grid-template-columns: 130px 1fr 50px; gap: 10px; align-items: center; padding: 6px 0; }
.term-row .term { font-size: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar { height: 12px; border-radius: 3px; display: flex; overflow: hidden; background: var(--surface-3); }
.sbar span { display: block; height: 100%; } .sbar .p { background: var(--pos); } .sbar .n { background: var(--neg); } .sbar .u { background: var(--neu); }
.wordcloud { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; padding: 10px; line-height: 1.1; min-height: 200px; }
.wordcloud span { font-weight: 650; cursor: default; }
.mention { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; } .mention:hover { background: var(--surface-2); }
.topic-card { padding: 16px; } .topic-card h3 { font-size: 15px; }
.kw-input { display: flex; flex-wrap: wrap; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; min-height: 36px; background: var(--surface); }
.kw-input input { border: 0; outline: none; flex: 1; min-width: 120px; font: inherit; background: transparent; color: var(--text); }
.insight { line-height: 1.6; } .insight ul { margin: 4px 0 10px; padding-left: 18px; }

/* ---------- feeds ---------- */
.feeds-layout { display: grid; grid-template-columns: 250px 1fr; height: 100%; min-height: 0; }
.feeds-side { border-right: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 8px; }
.feeds-side .fs-h { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 12px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.feeds-side button.fs-i { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 12.5px; color: var(--text); }
.feeds-side button.fs-i:hover { background: var(--surface-2); } .feeds-side button.fs-i.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.feeds-side .cnt { margin-left: auto; font-size: 11px; color: var(--text-3); } .feeds-side .err { color: var(--danger); }
.feeds-main { overflow: auto; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; padding: 16px; }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.article-img { aspect-ratio: 16/9; background: var(--surface-3); object-fit: cover; width: 100%; display: block; }
.article-noimg { aspect-ratio: 16/9; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px; padding: 16px; text-align: center; }
.article-b { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.article-b h4 { font-size: 14px; line-height: 1.4; font-weight: 650; }
.article-b h4 a { color: var(--text); } .article-f { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line-2); align-items: center; }
.article-list .article { flex-direction: row; } .article-list .article-img, .article-list .article-noimg { width: 180px; aspect-ratio: auto; flex: none; }
.lang-ta { font-family: 'Noto Sans Tamil', var(--font); }

/* ---------- settings ---------- */
.settings-sec { margin-bottom: 18px; }
.prof-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); } .prof-row:last-child { border: 0; }
.net-connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.net-connect button { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; text-align: left; }
.net-connect button:hover { border-color: var(--primary); }
.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.callout { padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--text); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.callout.warn { background: var(--warn-soft); } .callout.ok { background: var(--ok-soft); }

/* cases */
.split-view { display: grid; grid-template-columns: 340px 1fr; height: 100%; min-height: 0; }
.split-list { border-right: 1px solid var(--line); overflow: auto; background: var(--surface); }
.case-i { padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; } .case-i:hover { background: var(--surface-2); } .case-i.on { background: var(--primary-soft); }
.prio-urgent { color: #b91c1c; } .prio-high { color: #c2410c; } .prio-normal { color: var(--text-2); } .prio-low { color: var(--text-3); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; } .person:hover { border-color: var(--primary); }
.person-top { height: 6px; } .person-b { padding: 12px; }
.stars { color: #f5a524; letter-spacing: 1px; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); } .notif.unread { background: var(--primary-soft); }

@media (max-width: 900px) {
  .subnav { position: fixed; left: 52px; top: 0; bottom: 0; z-index: 30; }
  .subnav:not(.collapsed) { box-shadow: var(--shadow-lg); }
  .composer-body { grid-template-columns: 1fr; } .composer-r { display: none; }
  .thread { grid-template-columns: 1fr; } .thread-l, .thread-r { display: none; }
  .feeds-layout, .split-view { grid-template-columns: 1fr; } .feeds-side { display: none; }
  .composer { inset: 0 0 0 52px; border-radius: 0; }
}

/* ---------- YouTube Research ---------- */
.yt-tasks { max-height: 46vh; overflow: auto; padding: 0 8px; }
.yt-task { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.yt-task:hover { background: var(--surface-2); } .yt-task.active { background: var(--accent-soft); }
.yt-task-ic { color: var(--text-3); padding-top: 2px; } .yt-task-meta { display: block; font-size: 11px; color: var(--text-3); }
.yt-wrap { display: flex; flex-direction: column; height: calc(100vh - 118px); max-width: 1180px; margin: 0 auto; width: 100%; }
.yt-convo { flex: 1; overflow: auto; padding: 8px 4px 16px; }
.yt-msg { display: flex; margin: 10px 0; flex-direction: column; } .yt-msg.user { align-items: flex-end; }
.yt-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.yt-bubble.ai { background: var(--surface); border: 1px solid var(--line); }
.yt-card { width: 100%; margin-top: 6px; } .yt-note { padding: 6px 2px; }
.yt-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.yt-composer textarea { flex: 1; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--text); font: inherit; min-height: 44px; max-height: 200px; }
.yt-empty { text-align: center; padding: 40px 12px; } .yt-empty h2 { margin: 0 0 6px; }
.yt-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 18px; text-align: left; }
.yt-ex { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.yt-ex:hover { border-color: var(--accent); }
.yt-kw { display: flex; flex-wrap: wrap; gap: 6px; } .yt-kw-i { cursor: pointer; } .yt-kw-i input { margin: 0; }
.yt-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.yt-metrics > div { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; } .yt-metrics b { font-size: 20px; }
.yt-metrics small { display: block; margin-top: 2px; color: var(--text-3); font-size: 10.5px; line-height: 1.35; }
.yt-issues { margin-top: 10px; border: 1px solid var(--warn-soft); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; max-height: 240px; overflow: auto; }
.yt-issues summary { cursor: pointer; font-weight: 600; color: var(--warn); }
.yt-table { max-height: 360px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.yt-jobhead { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.yt-news-list { max-height: 55vh; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.yt-news { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.yt-news.oi { border-left: 3px solid var(--accent); } .yt-news:hover { background: var(--surface-2); }
.yt-sent { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.yt-sent-positive { background: var(--ok-soft); color: var(--ok); } .yt-sent-negative { background: var(--danger-soft); color: var(--danger); }
.yt-sent-mixed { background: var(--warn-soft); color: var(--warn); } .yt-sent-unscored, .yt-sent-failed { background: var(--surface-2); color: var(--text-3); border: 1px dashed var(--line); }
.yt-dl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.yt-dl.failed .bold { color: var(--danger); }
.yt-tr { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.yt-tr-lines { max-height: 260px; overflow: auto; margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; line-height: 1.6; }
.yt-ts { display: inline-block; min-width: 52px; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 12px; }
@media (max-width: 720px) { .yt-bubble { max-width: 100%; } .yt-wrap { height: auto; } }

/* ---------- shared module layout (Scraper / WhatsApp) ---------- */
.mod-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.mod-tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--text-2); font: inherit; border-bottom: 2px solid transparent; }
.mod-tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.mod-split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; min-height: 0; }
.mod-split > * { min-width: 0; }
@media (max-width: 900px) { .mod-split { grid-template-columns: 1fr; } }
.wa-chats { max-height: calc(100vh - 230px); overflow: auto; }
.wa-chat { display: flex; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.wa-chat:hover { background: var(--surface-2); } .wa-chat.active { background: var(--accent-soft); }
.wa-thread { display: flex; flex-direction: column; height: calc(100vh - 230px); }
.wa-msgs { flex: 1; overflow: auto; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.wa-m { max-width: 72%; margin: 4px 0; padding: 7px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-m.me { margin-left: auto; background: var(--ok-soft); }
.wa-m .meta { font-size: 11px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.wa-qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 10px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }

/* ---------- groups (clients / parties / leaders) ---------- */
.grp-switch { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.grp-switch:hover { border-color: var(--primary); }
.grp-caret { margin-left: auto; display: inline-flex; color: var(--text-3); }
.grp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.grp-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.grp-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.grp-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.person-eng { margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 6px; display: grid; gap: 3px; }
.person-eng div { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.person-eng b { font-weight: 600; }
.person-eng .muted { margin-left: auto; }

/* ---------- creative studio ---------- */
.creative-modal .cr-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.1fr); gap: 20px; align-items: start; }
.cr-form { max-height: 72vh; overflow: auto; padding-right: 6px; }
.cr-brand { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; }
.cr-preview { position: sticky; top: 0; }
.cr-canvas { position: relative; background: var(--surface-3); border-radius: 10px; min-height: 320px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cr-canvas img { max-width: 100%; max-height: 66vh; display: block; }
.cr-busy { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.35); }
@media (max-width: 820px) { .creative-modal .cr-grid { grid-template-columns: 1fr; } .cr-preview { position: static; } }
.ai-brief { white-space: pre-wrap; font-size: 13.5px; line-height: 1.65; max-height: 60vh; overflow: auto; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }
.nowrap { white-space: nowrap; }
.cf-edit { width: 24px; height: 24px; vertical-align: middle; opacity: .55; } tr:hover .cf-edit, .cf-edit.on { opacity: 1; } .cf-edit.on { color: var(--primary); background: var(--primary-soft); }

/* =====================================================================================
   Design system v2 — one layer over everything above: calmer surfaces, clear focus states,
   motion that explains (never decorates), and a shell that works in light and dark.
   ===================================================================================== */
:root { --r: 10px; --r-sm: 7px; --ease: cubic-bezier(.2,.8,.2,1); --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent); }
:root[data-theme="dark"] {
  --rail: #121a1b; --rail-2: #0f1617; --rail-ic: #8b9a9b; --rail-active: #1d2c44;
  --nav: #151d1e; --nav-text: #c9d4d4; --nav-muted: #7c8a8a; --nav-hover: #202a2b; --nav-active: #1d2c44;
}
body { font-size: 13.5px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-3) 70%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
button:focus-visible, a:focus-visible { box-shadow: var(--ring); }

/* shell */
.rail { border-right: 1px solid var(--line); gap: 2px; }
.rail-btn { transition: background .15s, color .15s, transform .15s var(--ease); }
.rail-btn:hover { background: var(--nav-hover); color: var(--text); }
.rail-btn:active { transform: scale(.94); }
.rail-btn.active { background: var(--rail-active); color: var(--primary); }
.rail-btn.active::before { content: ''; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.rail-btn.compose:hover { background: var(--primary-h); color: #fff; }
.rail-sep { height: 1px; width: 22px; background: var(--line); margin: 6px 0; flex: none; }
.rail-dot { border-color: var(--rail); }
.tip[data-tip]:hover::after { animation: tip-in .12s ease both; background: #0f172a; font-weight: 500; }
@keyframes tip-in { from { opacity: 0; transform: translate(-4px, -50%); } }
.subnav { transition: width .2s var(--ease); }
.subnav-h h2 { color: var(--text); font-size: 15px; font-weight: 700; }
.subnav .nav-count { background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.subnav a.active .nav-count { background: var(--primary); color: #fff; }
.subnav a, .subnav .nav-i { transition: background .12s, color .12s; }
.subnav-card { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.main { background: var(--bg); }
.page-h { min-height: 62px; }
.page-h h1 { font-size: 18px; font-weight: 700; }
.page-h .sub { font-size: 12px; }

/* page entrance: content fades up a few pixels when a page opens */
.route-in > * { animation: route-in .28s var(--ease) both; }
@keyframes route-in { from { opacity: 0; transform: translateY(6px); } }

/* controls */
.btn { transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; border-radius: var(--r-sm); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text-3) 45%, var(--line)); }
.btn-primary:hover:not(:disabled) { border-color: var(--primary-h); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-group .btn.on, .toggle input:checked + span { background: var(--primary); border-color: var(--primary); }
.input { transition: border-color .15s, box-shadow .15s; border-radius: var(--r-sm); }
.input:hover:not(:focus) { border-color: color-mix(in srgb, var(--text-3) 40%, var(--line)); }
.input:focus { box-shadow: var(--ring); }
.icon-btn { transition: background .12s, color .12s; }
.seg button { transition: background .15s, color .15s; }
.card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.table tbody tr { transition: background .1s; }
.badge { border-radius: 99px; }
.callout { border-radius: 10px; }
.chip { transition: border-color .15s; }

/* overlays */
.modal-wrap { backdrop-filter: blur(2px); animation: fade .16s ease; }
.modal { border-radius: 14px; animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.popover { border-radius: 10px; animation: pop .14s var(--ease); }
.menu-i { border-radius: 7px; transition: background .1s; }
.drawer { animation: slide .2s var(--ease); border-right: 1px solid var(--line); }
.toast { border-radius: 10px; animation: toast-in .22s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* loading: a calm shimmer instead of a lone spinner where content is coming */
.loading { padding: 40px; }
.skel-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* command palette */
.cmdk-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(10,18,20,.38); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade .12s; }
.cmdk { width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(16,24,40,.28); overflow: hidden; animation: pop .18s var(--ease); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.cmdk-in input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--text); }
.cmdk-in kbd, .cmdk-foot kbd { font: 600 11px var(--font); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); }
.cmdk-list { max-height: 52vh; overflow: auto; padding: 6px; }
.cmdk-g { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px 4px; }
.cmdk-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.cmdk-i .ic { color: var(--text-3); }
.cmdk-i small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.cmdk-i.on { background: var(--primary-soft); color: var(--primary); } .cmdk-i.on .ic { color: var(--primary); }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.rail-btn { width: 34px; height: 34px; }
@media (max-height: 860px) { .rail-btn { width: 32px; height: 30px; } .rail-sep { margin: 3px 0; } .rail-logo { margin-bottom: 4px; } .rail-btn.compose { margin-bottom: 6px; } }
@media (max-height: 720px) { .rail-sep { display: none; } .rail-btn { height: 28px; } }

/* ---------- home: today strip, public mood, setup ---------- */
.today { padding: 18px 16px 4px; }
.today-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.today-tile { display: flex; gap: 11px; align-items: center; padding: 13px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.today-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.08); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); }
.today-tile .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); }
.today-tile b { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; }
.today-tile span:not(.ti) { font-size: 12px; color: var(--text-3); }
.today-tile.zero { opacity: .7; } .today-tile.zero .ti { color: var(--text-3); background: var(--surface-3); }
.today-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.today-row > .card:only-child { grid-column: 1 / -1; }
.mood-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mood-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); text-decoration: none; transition: background .15s, border-color .15s; }
.mood-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--surface); }
.mood-card img, .mood-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.mood-card b { display: block; font-size: 13.5px; } .mood-card small { color: var(--text-3); font-size: 11.5px; }
.mood-bar { height: 6px; border-radius: 99px; background: #e5484d; overflow: hidden; margin-top: 6px; }
.mood-bar span { display: block; height: 100%; background: #0f9f6e; border-radius: 99px 0 0 99px; transition: width .8s var(--ease); }
.mood-v { text-align: right; } .mood-v b { font-size: 20px; font-weight: 800; }
.setup-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.setup-bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.setup-step { display: flex; align-items: center; gap: 9px; padding: 7px 4px; color: var(--text); text-decoration: none; border-radius: 7px; font-size: 13px; }
.setup-step:hover { background: var(--surface-2); text-decoration: none; }
.setup-step .ck { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.setup-step.ok { color: var(--text-3); text-decoration: line-through; } .setup-step.ok .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-step .go { margin-left: auto; color: var(--text-3); }
@media (max-width: 1200px) { .today-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .today-row, .mood-list { grid-template-columns: 1fr; } .today-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- WhatsBusiness: business tools ---------- */
.wb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.wb-preview { position: sticky; top: 0; }
.wb-day { display: grid; grid-template-columns: 160px 130px 20px 130px; justify-content: start; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.wb-day .input:disabled { opacity: .4; }
.wb-profile { text-align: center; }
.wb-profile h3 { font-size: 18px; margin-top: 10px; }
.wb-profile p { margin: 12px 0 0; color: var(--text-2); white-space: pre-wrap; }
.wb-avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: #dcf8c6; color: #128c7e; }
.wb-rows { text-align: left; margin-top: 14px; border-top: 1px solid var(--line-2); }
.wb-rows div { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.wb-rows .ic { color: #128c7e; margin-top: 2px; }
.wb-phone { margin-top: 12px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.wb-phone-h { background: #075e54; color: #fff; padding: 8px 12px; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.wb-phone-b { background: #efeae2; padding: 14px 12px; min-height: 70px; }
:root[data-theme="dark"] .wb-phone-b { background: #0b141a; }
.wb-bubble { max-width: 85%; margin-left: auto; background: #d9fdd3; color: #111b21; border-radius: 10px 0 10px 10px; padding: 7px 10px 18px; font-size: 13.5px; line-height: 1.45; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.12); word-wrap: break-word; }
:root[data-theme="dark"] .wb-bubble { background: #005c4b; color: #e9edef; }
.wb-bubble span { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #667781; }
.wb-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.wb-label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.wb-label b { display: block; } .wb-label small { color: var(--text-3); }
.wb-tagic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.wb-swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.wb-swatch.on { box-shadow: 0 0 0 2px var(--text); }
.wb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 0; cursor: default;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); }
button.wb-chip { cursor: pointer; font: inherit; font-size: 11.5px; padding: 3px 10px; }
button.wb-chip.on { background: var(--c); color: #fff; }
.wb-chip small { opacity: .7; }
.wb-lfilter { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.wb-lfilter:empty { display: none; }
.wb-lrow { padding: 6px 4px; border-radius: 8px; } .wb-lrow:hover { background: var(--surface-2); }
.wb-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.wb-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wb-prod { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.wb-prod:hover { box-shadow: 0 8px 22px rgba(16,24,40,.08); transform: translateY(-2px); }
.wb-prod.off { opacity: .55; }
.wb-prod-img { aspect-ratio: 1; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); position: relative; overflow: hidden; }
.wb-prod-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.wb-oos { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.wb-prod-b { padding: 10px 12px; flex: 1; }
.wb-price { font-weight: 800; color: #128c7e; margin: 3px 0; } .wb-price s { color: var(--text-3); font-weight: 500; font-size: 12px; }
.wb-prod-f { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line-2); }
.wb-link { font-family: ui-monospace, Consolas, monospace; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); word-break: break-all; }
.wb-qr-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; z-index: 20; max-height: 260px; overflow: auto; animation: pop .14s var(--ease); }
.wb-qr-pop button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 9px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.wb-qr-pop button.on, .wb-qr-pop button:hover { background: var(--primary-soft); }
.wb-pick { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.wb-pick-i { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.wb-pick-i:hover { border-color: #25d366; background: var(--surface-2); }
.wb-pick-i img, .wb-pick-ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.wb-pick-i b { display: block; } .wb-pick-i small { color: var(--text-3); }
@media (max-width: 1000px) { .wb-grid { grid-template-columns: 1fr; } .wb-preview { position: static; } .wb-day { grid-template-columns: 110px 1fr 20px 1fr; } }
[hidden] { display: none !important; }
.fbar-r .link-btn, .fbar-r a { white-space: nowrap; }
.subnav .nav-count.danger { background: var(--danger); color: #fff; }
.page-h .actions select.input, .page-h .actions .input-sm:not(.grow) { width: auto; }
input[type=file].input { height: auto; padding: 5px 6px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12px; margin-right: 10px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; transition: background .15s; }
input[type=file]::file-selector-button:hover { background: var(--surface-3); }

.help-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.help-i { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.help-i:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.help-i .ic { color: var(--primary); margin-top: 2px; }
.help-i b { display: block; font-size: 13px; } .help-i small { color: var(--text-3); font-size: 12px; line-height: 1.4; }
@media (max-width: 600px) { .help-guide { grid-template-columns: 1fr; } }

/* Apify panel */
.ap-spend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-spend > div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.ap-spend b { font-size: 22px; font-weight: 800; } .ap-spend small { color: var(--text-3); font-size: 12px; }
.ap-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.ap-bar span { display: block; height: 100%; border-radius: 99px; transition: width .6s var(--ease); }
.ap-plan { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); }
.ap-plan > div { display: flex; flex-direction: column; padding: 0 12px; border-left: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); }
.ap-plan b { font-size: 18px; font-weight: 800; } .ap-plan small { color: var(--text-2); font-size: 12px; }

.sp-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sp-opt { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s; }
.sp-opt:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.sp-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.sp-opt b { font-size: 14px; } .sp-opt span { font-size: 12.5px; color: var(--text-2); } .sp-opt small { font-size: 12px; color: var(--text-3); }
.sp-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.ap-optional > summary { cursor: pointer; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; list-style: none; }
.ap-optional[open] > summary { border-style: solid; }
@media (max-width: 900px) { .sp-opts { grid-template-columns: 1fr; } }

.bk-res { max-height: 200px; overflow: auto; margin-top: 6px; font-size: 12px; line-height: 1.7; }

.sq-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sq-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); }
.sq-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.sq-row.open .sq-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.sq-row.done .sq-dot { background: var(--ok); } .sq-row.error .sq-dot { background: var(--danger); } .sq-row.skipped { opacity: .6; }

/* agency */
.ag-opt { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ag-opt p { margin: 4px 0 10px; }
.ag-client { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ag-client:last-of-type { border-bottom: 0; }
.ag-page { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; background: var(--surface-2); }
.ag-page.off { opacity: .7; }
.ag-page img, .ag-ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.ag-page b { display: block; } .ag-page small { display: block; color: var(--text-3); }

/* WhatsBusiness statistics: busiest-hours heatmap */
.wb-heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; font-size: 10px; }
.wb-heat > span { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, #25d366 calc(var(--a, 0) * 100%), var(--line-2)); }
.wb-heat > .wb-heat-d, .wb-heat > .wb-heat-h, .wb-heat > span:empty:not([title]) { background: none; aspect-ratio: auto; color: var(--muted); align-self: center; }
.wb-wait { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--line-2); white-space: nowrap; }
.wb-wait.late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.wb-reason { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); }
.wb-reason.urgent, .wb-reason.negative { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.wb-reason.negative_estimate { background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); font-style: italic; }
.kpi-link { cursor: pointer; text-decoration: none; color: inherit; transition: background .15s; border-radius: 8px; }
.kpi-link:hover { background: var(--line-2); }

/* ---------- Instagram → Comments & DMs (official API) ---------- */
.seg a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; color: var(--text); }
.igb-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .igb-split { grid-template-columns: 1fr; } }
.igb-posts { overflow: hidden; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.igb-posts > div:last-child { overflow: auto; }
.igb-post { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.igb-post:hover { background: var(--surface-2); } .igb-post.on { background: var(--primary-soft); }
.igb-post small { display: block; color: var(--text-3); font-size: 11px; }
.igb-thumb { width: 42px; height: 42px; border-radius: 8px; background: var(--surface-3); flex: none; overflow: hidden; display: grid; place-items: center; color: var(--text-3); position: relative; }
.igb-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.igb-thumb.sm { width: 28px; height: 28px; border-radius: 6px; }
.igb-un { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; flex: none; }
.igb-thread { margin-bottom: 10px; }
.igb-children { margin: 6px 0 0 40px; display: flex; flex-direction: column; gap: 6px; }
.igb-c { position: relative; }
.igb-c.igb-ctx { opacity: .7; }
.igb-sel { margin: 10px 2px 0 0; flex: none; }
.igb-c .igc-bar { margin-left: 64px; }
.igb-c .igc-bar button:disabled { opacity: .45; cursor: not-allowed; }
.igb-ours { margin: 8px 0 0 64px; padding: 6px 10px; border-left: 2px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.igb-tag { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); display: inline-flex; gap: 3px; align-items: center; }
.igb-tag.ok { background: var(--for-soft, #e6f6ee); color: var(--ok); } .igb-tag.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.igb-bulk { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 10px; }
.igb-dm { max-height: 52vh; }
.igb-auto { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.igb-funnel { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.igb-funnel span b { display: block; font-size: 15px; color: var(--text); }
.igb-paused { border-color: var(--warn); }
.igb-st { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); white-space: nowrap; }
.igb-st.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); } .igb-st.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.igb-st.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); } .igb-st.info { background: var(--primary-soft); color: var(--primary); } .igb-st.muted { color: var(--text-3); }
.igb-ed { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
@media (max-width: 860px) { .igb-ed { grid-template-columns: 1fr; } }
.igb-ed-form { max-height: 66vh; overflow: auto; padding-right: 6px; }
.igb-step { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.igb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 190px; overflow: auto; margin-bottom: 8px; }
.igb-pick-i { display: flex; flex-direction: column; gap: 3px; padding: 5px; border: 2px solid transparent; border-radius: 9px; cursor: pointer; background: var(--surface-2); }
.igb-pick-i.on { border-color: var(--primary); } .igb-pick-i input { position: absolute; opacity: 0; } .igb-pick-i .igb-thumb { width: 100%; height: 70px; }
.igb-phone { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-height: 260px; font-size: 13px; }
.igb-pc { background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.igb-pr { margin: 6px 0 0 14px; padding-left: 8px; border-left: 2px solid var(--line); }
.igb-bub { align-self: flex-start; max-width: 88%; background: var(--surface); border-radius: 16px; padding: 8px 12px; }
.igb-bub.me { align-self: flex-end; background: linear-gradient(135deg, #7b3fe4, #d62976); color: #fff; }
.igb-btn { margin-top: 6px; text-align: center; font-weight: 700; background: rgba(255,255,255,.2); border-radius: 9px; padding: 5px 8px; }
.igb-tap { align-self: center; font-size: 11px; color: var(--text-3); }
.igb-steps { margin: 6px 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.igb-diag { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.igb-diag b { width: 170px; flex: none; }
.igb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; transform: translateY(1px); }
.igb-dot.ok { background: var(--ok); } .igb-dot.bad { background: var(--danger); }

.igb-post b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.igb-post small.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.igb-c.unans { border-left-color: var(--warn); } .igb-c.ans { border-left-color: var(--ok); }
.igb-step-d { margin: 2px 0 6px 24px; }
.igb-step .grid, .igb-step > div[data-when] { margin-top: 6px; }
.igb-ed-side { max-height: 66vh; overflow: auto; }

/* Instagram → News accounts */
.nm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.nm-acc { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.nm-acc.off { opacity: .6; } .nm-acc b { display: block; font-size: 13px; } .nm-acc small { display: block; font-size: 11px; color: var(--text-3); }
.nm-acc a { color: inherit; } .nm-pm { display: flex; flex-wrap: wrap; gap: 6px; }

/* Instagram sidebar leaders: own picture in a party-flag ring, party tone on hover / when selected */
.subnav a.ig-lead { --lead-accent: var(--primary); --lead-ring: linear-gradient(180deg, var(--primary), var(--primary)); padding: 6px 10px 6px 14px; gap: 10px; position: relative; }
.subnav a.ig-lead:hover { background: color-mix(in srgb, var(--lead-accent) 8%, transparent); }
.subnav a.ig-lead.active { background: color-mix(in srgb, var(--lead-accent) 13%, transparent); color: var(--lead-accent); }
.subnav a.ig-lead.active::before { content: ''; position: absolute; left: 3px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--lead-ring); }
.ig-lead-face { width: 34px; height: 34px; flex: none; border-radius: 50%; padding: 2px; background: var(--lead-ring); display: grid; place-items: center; }
.ig-lead-face img, .ig-lead-face b { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--nav); object-fit: cover; display: grid; place-items: center; background: color-mix(in srgb, var(--lead-accent) 14%, var(--nav)); color: var(--lead-accent); font-size: 13px; font-weight: 800; }
.ig-lead-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ig-lead-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-lead-txt small { font-size: 11px; color: var(--nav-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subnav a.ig-lead.active small { color: color-mix(in srgb, var(--lead-accent) 70%, var(--nav-muted)); }
.ig-ldcard .card-h { gap: 12px; align-items: center; }
.ig-ldcard .ig-lead-face img, .ig-ldcard .ig-lead-face b, .modal .ig-lead-face img, .modal .ig-lead-face b { border-color: var(--surface); font-size: 16px; }
.ig-ldcard h3 { margin: 0; }
.err-line { color: var(--danger); display: inline-flex; gap: 5px; align-items: flex-start; line-height: 1.4; cursor: help; } .err-line .ic { flex: none; margin-top: 2px; }

/* =====================================================================================
   Design layer v2 — one calm, consistent system across every module (Sprout / Brandwatch grade):
   a clear type scale, 12px cards with hairline borders, one primary action per view, soft AI buttons,
   metric tiles that read at a glance, quiet tables, and no loud gradients.
   ===================================================================================== */
:root { --r: 10px; --r-sm: 8px; --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-lg: 0 16px 40px rgba(16,24,40,.16), 0 2px 8px rgba(16,24,40,.06);
  --line: #e3e9f1; --line-2: #eef2f7; --bg: #f5f7fa; --text: #14223b; --text-2: #55657d; --text-3: #8391a6; }
:root[data-theme="dark"] { --line: #2a3536; --line-2: #222c2d; }
body { font-size: 13.5px; }
h1, h2, h3, h4 { letter-spacing: -.01em; }
/* page header */
.page-h { padding: 14px 24px; min-height: 64px; }
.page-h h1 { font-size: 19px; font-weight: 650; line-height: 1.25; }
.page-h .sub { font-size: 12px; margin-top: 3px; }
.page-body { padding: 22px 24px; }
/* cards */
.card { border-radius: 12px; border-color: var(--line); box-shadow: var(--shadow); }
.card-h { padding: 16px 18px 10px; }
.card-h h3 { font-size: 14.5px; font-weight: 650; }
.card-h p { font-size: 12.5px; line-height: 1.45; margin-top: 3px; }
.card-b { padding: 0 18px 18px; }
.card-pad { padding: 18px; }
/* buttons: one primary per view; AI actions are soft, never a second primary */
.btn { height: 32px; border-radius: 8px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { box-shadow: 0 1px 2px rgba(79,70,229,.25); }
.btn-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); filter: none; }
.btn-sm { height: 30px; }
/* inputs */
.input, select.input, textarea.input { border-radius: 8px; }
.input-sm { height: 30px; }
/* badges and chips */
.badge { border-radius: 999px; padding: 2px 8px; font-weight: 600; }
/* metric tiles (KPI rows) */
.kpi-l { font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 0; }
.kpi-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.yt-metrics { gap: 12px; }
.yt-metrics > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yt-metrics > div > .muted.tiny, .yt-metrics > div > span:first-child { font-size: 12px; font-weight: 600; color: var(--text-2); }
.yt-metrics b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.yt-metrics small { font-size: 11.5px; }
/* tables */
.table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); background: var(--surface-2); padding: 9px 12px; }
.table td { padding: 10px 12px; }
/* callouts and banners: calm, never shouting */
.callout { border-radius: 10px; padding: 11px 14px; line-height: 1.5; }
.promo { background: var(--primary-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); border-radius: 12px; }
.promo .ic { color: var(--primary); }
.hero { background: var(--surface-2); }
/* empty states */
.empty { padding: 48px 20px; }
.empty .ic { color: var(--text-3); opacity: .8; }
/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
/* Profile analytics shell: one line of tabs, a way back, no second brand */
.fp-topbar { gap: 22px; }
.fp-brand { min-width: 0; font-size: 13px; font-weight: 650; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; padding: 5px 10px; border-radius: 8px; background: var(--surface-3); }
.fp-brand:hover { color: var(--primary); text-decoration: none; }
.fp-topbar nav { gap: 18px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.fp-topbar nav::-webkit-scrollbar { display: none; }
.fp-topbar nav a { white-space: nowrap; }
.fp-avatar { position: relative; overflow: hidden; }
.fp-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.fp-avatar i { font-style: normal; }
.yt-metrics > a { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.yt-metrics > a:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); box-shadow: 0 4px 12px rgba(16,24,40,.08); text-decoration: none; }
.yt-metrics > a > span:first-child, .yt-metrics > a > .muted { font-size: 12px; font-weight: 600; color: var(--text-2); }
/* Smart Inbox: list + reading pane (Sprout-style) on wide screens */
.inbox-split { display: flex; min-height: 0; overflow: hidden !important; }
.inbox-col { flex: 1; min-width: 0; overflow: auto; }
.inbox-pane { display: none; }
@media (min-width: 1100px) {
  .inbox-col { flex: 0 0 min(520px, 44%); border-right: 1px solid var(--line); background: var(--surface-2); }
  .inbox-col .inbox-list, .inbox-col .inbox-toolbar { max-width: none; }
  .inbox-pane { display: flex; flex-direction: column; flex: 1; min-width: 0; background: var(--surface); }
  .msg { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
  .msg:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
  .msg.open { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
  .msg-media video, .msg-media img { max-height: 180px; }
}
.pane-h { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pane-h b { display: block; font-size: 14px; }
.pane-scroll { flex: 1; overflow: auto; padding: 16px 18px; background: var(--surface-2); }
.pane-reply { border-top: 1px solid var(--line); padding: 12px 16px; }
.pane-reply textarea { height: auto; padding: 8px 10px; resize: vertical; }
.pane-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); text-align: center; padding: 40px; }
.pane-empty b { color: var(--text); font-size: 15px; }
.promo { position: relative; }
.promo-x { position: absolute; top: 8px; right: 8px; }
/* Athena OS brand: indigo primary, sky gradient, marigold highlight */
:root { --primary: #4F46E5; --primary-h: #4338CA; --primary-soft: #EEF2FF; --brand: #4F46E5; --brand-dark: #3730A3; --brand-sky: #0EA5E9; --brand-marigold: #F59E0B;
  --rail-active: #EEF2FF; --nav-active: #EEF2FF; --pos: #4F46E5; }
:root[data-theme="dark"] { --primary: #818CF8; --primary-h: #A5B4FC; --primary-soft: #1E1B4B; --brand: #818CF8; --rail-active: #1E1B4B; --nav-active: #1E1B4B; }
.rail-logo img { display: block; border-radius: 8px; }
/* Profile analytics inside the normal app layout: the module sidebar stays (it holds the same sections the
   old top bar repeated), colours follow the theme, and the profile rail is a little narrower. */
body.analytics-focus .subnav { display: flex; }
body.analytics-focus .subnav.collapsed { display: flex; }
body.analytics-focus .main { background: var(--bg); }
.fp-topbar { display: none; }
.fp-shell { background: var(--bg); color: var(--text); grid-template-columns: 200px minmax(0, 1fr); }
.fp-subbar, .fp-profile-rail, .fp-canvas .ig-analytics-toolbar, .fp-canvas .ig-truth-banner, .fp-report-toolbar, .fp-manage { background: var(--surface); border-color: var(--line); color: var(--text); }
.fp-canvas .yt-metrics > div { background: var(--surface); border-color: var(--line); }
.fp-toolbar-divider { background: var(--line); }
.fp-subbar { font-weight: 650; }
/* Sign-in */
body.signin-mode { background: radial-gradient(900px 500px at 15% 0%, #eef2ff, transparent 60%), radial-gradient(700px 500px at 100% 100%, #e0f2fe, transparent 60%), var(--bg); overflow: auto; }
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.signin-logo { height: 40px; display: block; margin-bottom: 22px; }
.signin-card h1 { font-size: 22px; margin: 0 0 6px; }
.signin-card p { line-height: 1.55; }
.signin-card form { margin-top: 18px; display: grid; gap: 4px; }
.signin-err { color: var(--danger); font-size: 12.5px; min-height: 18px; }
.signin-foot { margin: 20px 0 0; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.si-devs { display: grid; gap: 6px; margin-top: 8px; }
.si-dev { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
body.signin-mode #app { display: block; height: auto; min-height: 100vh; width: 100%; }
.signin { width: 100%; }
/* Keyword search preview */
.kw-prev { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.kw-row { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none !important; }
.kw-row:hover { border-color: var(--primary); }
.kw-row.off { opacity: .55; }
.kw-row img, .kw-noimg { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); }
/* Athena OS: modules as app icons in the rail (an OS dock), module identity in each section header */
.rail-btn.rail-mod { background: none !important; }
.rail-btn.rail-mod .athena-icon { display: block; border-radius: 8px; opacity: .78; filter: saturate(.85); transition: opacity .15s, transform .15s, filter .15s, box-shadow .15s; }
.rail-btn.rail-mod:hover .athena-icon { opacity: 1; filter: none; transform: translateY(-1px); }
.rail-btn.rail-mod.active .athena-icon { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--text) 25%, transparent); }
.rail-btn.rail-mod.active::before { background: var(--brand-gold, #F5A524); }
.rail-logo img { border-radius: 0; }
.subnav-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.subnav-brand .athena-icon { flex: none; border-radius: 8px; }
.subnav-brand h2 { font-size: 15px; line-height: 1.15; }
.subnav-brand small { display: block; font-size: 11.5px; color: var(--nav-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.help-hero { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; background: var(--surface-2); }
.help-hero b { display: block; font-size: 15px; } .help-hero small { color: var(--text-3); } .help-hero > div { flex: 1; }
.cmdk-owl { display: grid; place-items: center; }
:root { --brand-gold: #F5A524; --brand-marigold: #F5A524; }

/* Email sign-in (signin.js) */
.si-google { display: flex; justify-content: center; min-height: 44px; margin: 6px 0 4px; }
.si-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--text-3); font-size: 12px; }
.si-or::before, .si-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.si-code { font-size: 22px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.signin-note { font-size: 12.5px; color: var(--text-2); min-height: 0; margin: 2px 0 8px; }
.signin-note:empty { display: none; }
.si-pw { margin-top: 14px; font-size: 13px; }
.si-pw summary { cursor: pointer; color: var(--text-2); margin-bottom: 8px; }
.acc-list { display: grid; gap: 6px; }
.acc-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.acc-row b { overflow-wrap: anywhere; }
.acc-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft, #EEF0FF); color: var(--primary, #4F46E5); font-weight: 700; flex: none; }

/* Continue with Google (signin.js) */
.si-sub { margin-bottom: 18px; }
.si-google { display: flex; justify-content: center; min-height: 46px; margin: 4px 0 6px; transition: opacity .2s; }
.si-google.busy { opacity: .45; pointer-events: none; }
.si-more { margin-top: 18px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.si-more > summary { cursor: pointer; color: var(--text-2); text-align: center; list-style: none; }
.si-more > summary::-webkit-details-marker { display: none; }
.si-more[open] > summary { margin-bottom: 12px; }
.si-legal { font-size: 12px; color: var(--text-3); text-align: center; margin: 14px 0 0; }
.si-person { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 14px; text-align: left; }
.si-person img, .si-person .acc-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.acc-av { position: relative; overflow: hidden; }
.acc-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acc-req { display: grid; gap: 6px; padding: 10px; margin-bottom: 12px; border-radius: 12px; background: var(--warn-soft, #FFF7E6); }
.acc-setup { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.acc-setup h4 { margin: 0; display: flex; gap: 6px; align-items: center; }
.acc-setup > summary, .acc-setup details > summary { cursor: pointer; margin: 6px 0; }
.acc-steps { padding-left: 20px; display: grid; gap: 8px; margin: 8px 0 12px; line-height: 1.5; }
.acc-origins { display: grid; gap: 4px; margin-top: 6px; }
.acc-origins > div { display: flex; align-items: center; gap: 6px; }
.acc-copy { padding: 2px 6px; min-height: 0; }
.rail-me img.me-pic { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
