/* =========================================================
   Skin: calm teal palette, editorial layout, dark teal rail
   (loaded after style.css and overrides it)
   ========================================================= */
:root {
  --brand: #3f6e79; --brand-2: #6b7d5c; --brand-soft: #e2eef0;
  --ig: #3f6e79; --chart: #3f6e79;
  --bg: #faf8f4; --surface: #ffffff; --surface-2: #f2eee8; --surface-3: #e8e2d9;
  --border: #e6e0d6; --border-strong: #d4ccbf; --line: #e3ddd2;
  --text: #1f2d31; --text-2: #4b5a5e; --muted: #85908e;
  --ok: #5e7350; --ok-soft: #e4ebdf; --warn: #9a6b1c; --warn-soft: #f6eedd;
  --info: #3f6e79; --info-soft: #e2eef0; --err: #c2524f; --err-soft: #f8e6e4;
  --sage: #c3d0bf; --sky: #c9dee0; --sand: #e0d6c6;
  --rail: #1f3d44; --rail-text: #a9c3c4; --rail-hover: rgba(255,255,255,.07);
  --on-brand: #ffffff; --ink-btn: #1f2d31; --ink-btn-text: #faf8f4;
  --radius: 20px; --radius-sm: 12px;
}
[data-theme="dark"] {
  --brand: #8fbcc5; --brand-soft: #1c3035; --ig: #4a7884; --chart: #8fbcc5;
  --bg: #0f1516; --surface: #151d1f; --surface-2: #1b2527; --surface-3: #243134;
  --border: #243134; --border-strong: #33423f; --line: #2a3739;
  --text: #e8eeee; --text-2: #b5c2c2; --muted: #7d8c8c;
  --ok: #9cb58c; --ok-soft: #1d2a1d; --warn: #d9a54d; --warn-soft: #2b2416;
  --info: #8fbcc5; --info-soft: #1c3035; --err: #e07a76; --err-soft: #2e1a19;
  --sage: #5d7356; --sky: #4a7884; --sand: #6d6252;
  --rail: #0b1214; --on-brand: #0f1516; --ink-btn: #e8eeee; --ink-btn-text: #0f1516;
}

/* ---- base ---- */
body { background: var(--bg); }
::selection { background: var(--sky); }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: none; border-radius: var(--radius); }
.btn { border-radius: 99px; }
.btn.primary, .btn.brand { background: var(--ink-btn); color: var(--ink-btn-text); border: none; box-shadow: none; }
.btn.ig { background: var(--brand); color: var(--on-brand); border: none; box-shadow: none; }
.btn.brand kbd { color: inherit; opacity: .7; border-color: currentColor; }
.logo { background: var(--brand); box-shadow: none; }
.switch input:checked + span { background: var(--brand); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel],
input[type=time], input[type=number], textarea, select, .chips-input { background: var(--surface-2); border-color: transparent; }
input:focus, textarea:focus, select:focus { background: var(--surface); }
.chip { background: var(--surface-2); border-color: transparent; }
.seg { background: var(--surface-2); border-color: transparent; border-radius: 99px; }
.seg button { border-radius: 99px; }
.page-head h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; }
.progress span { background: var(--brand); }

/* ---- hero: outlined, icon in a teal circle ---- */
.hero { background: transparent; border: 1px solid var(--line); padding: 1.8rem; }
.hero::before { display: none; }
.hero .txt h2 { font-size: 1.5rem; }
.hero .state { background: var(--brand); color: var(--on-brand); border-radius: 50%; width: 60px; height: 60px; }
.hero.off .state { background: var(--surface-3); color: var(--muted); }
.hero .btn { background: var(--brand); color: var(--on-brand); border: none; }

/* ---- KPIs: big numbers beside a coloured line ---- */
.grid.kpis > .card { border: none; border-radius: 0; background: transparent; border-inline-start: 3px solid var(--sage); padding: .2rem 1.2rem; }
.grid.kpis > .card:nth-child(1) { border-color: var(--brand); }
.grid.kpis > .card:nth-child(3) { border-color: var(--sky); }
.grid.kpis > .card:nth-child(4) { border-color: var(--sand); }
.kpi .ic { display: none; }
.kpi b { font-size: 3rem; font-weight: 600; letter-spacing: -.04em; }

/* ---- lollipop chart ---- */
.chart .bar { background: var(--chart); width: 3px; border-radius: 99px; position: relative; overflow: visible; }
.chart .bar::after { content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--chart); }

/* ---- automations & misc ---- */
.node { background: transparent; border: 1px dashed var(--border-strong); }
.auto-head .ic, .kpi .ic, .opt .ic { border-radius: 50%; }
.auto:hover { box-shadow: 0 10px 30px -18px rgba(31,61,68,.35); }
.thumb.all, .post-opt .img.all, .empty .art, .ig-badge, .acc-av { background: var(--brand); }
.connect::before { display: none; }
.bubble.me { background: var(--brand); color: var(--on-brand); }
.screen .av, .screen .av.me i { background: var(--brand); }
.screen .post-img { background: linear-gradient(135deg, var(--sky), var(--sage)); }
.nav-item .count.hot, .conv .unr { background: var(--brand); color: var(--on-brand); }
.conv.on { background: var(--brand-soft); }
.mesh { background: radial-gradient(40% 40% at 20% 30%, var(--sage) 0, transparent 70%),
  radial-gradient(40% 40% at 80% 70%, var(--sky) 0, transparent 70%); opacity: .8; }
.auth-side { background: var(--rail); }
.toast { border-radius: 99px; }

/* ---- dark teal rail (desktop) ---- */
.sidebar { background: var(--rail); color: #e8f0f0; border-inline-end: none; }
.side-brand b { color: #fff; }
.side-brand small { display: none; }
.sidebar .logo { background: var(--sage); }
.sidebar .logo span { border-color: var(--rail); } .sidebar .logo span::after { background: var(--rail); }
.nav-item { color: var(--rail-text); padding: .6rem .8rem; border-radius: 12px; }
.nav-item:hover { background: var(--rail-hover); color: #fff; }
.nav-item.on { background: var(--sage); color: #1f3d44; font-weight: 600; }
[data-theme="dark"] .nav-item.on { color: #fff; }
.nav-item.on::before { display: none; }
.nav-item .count { background: transparent; color: var(--rail-text); }
.sidebar .acc-btn, .sidebar .bot-pill { background: rgba(255,255,255,.07); border-color: transparent; color: #e8f0f0; }
.sidebar .acc-btn:hover { background: rgba(255,255,255,.12); }
.sidebar .acc-btn small, .sidebar .bot-pill small, .sidebar .user-row small { color: #8fb0b2; }
.sidebar .acc-btn > svg.i { color: #8fb0b2; }
.sidebar .acc-av i { background: var(--rail); border-color: var(--rail); color: #fff; }
.sidebar .acc-av img { border-color: var(--rail); }
.sidebar .user-row { border-color: rgba(255,255,255,.1); color: #e8f0f0; }
.sidebar .user-row .btn { color: #c5d6d6; }
.sidebar .user-row .btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .switch span { background: rgba(255,255,255,.15); border-color: transparent; }
.sidebar .switch input:checked + span { background: var(--sage); }

/* ---- "more" sheet (phone) ---- */
.nav-item.more-btn { display: none; }
.sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; background: var(--surface); border-radius: 26px 26px 0 0;
  padding: .6rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px -10px rgba(0,0,0,.25);
  animation: sheetin .3s var(--ease); max-height: 85dvh; overflow-y: auto; }
@keyframes sheetin { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 9px; background: var(--border-strong); margin: 0 auto .9rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: .8rem 0; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .3rem; border-radius: 18px;
  background: var(--surface-2); text-decoration: none; color: var(--text); font-size: .82rem; font-weight: 500; text-align: center; }
.sheet-grid a .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--brand); }
.sheet-grid a.on { background: var(--brand-soft); color: var(--brand); }
.sheet .bot-pill { background: var(--surface-2); border-color: transparent; }
.sheet .user-row { border-top: none; margin-top: .4rem; }

/* ---- phone ---- */
@media (max-width: 860px) {
  .sidebar { background: var(--rail); left: 12px !important; right: 12px !important; bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    border-radius: 99px; padding: .4rem .5rem; border-top: none; box-shadow: 0 14px 30px -10px rgba(31,61,68,.6);
    backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-item, .nav-item.more-btn { color: var(--rail-text); font-size: .68rem; border-radius: 99px; }
  .nav-item.more-btn { display: flex; border: none; background: none; font-family: inherit; cursor: pointer; }
  .nav-item.on { color: #fff; background: none; }
  .nav-item.on svg.i { background: var(--sage); color: #1f3d44; border-radius: 99px; width: 46px; height: 26px; padding: 4px 0; }
  .topbar { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: none; }
  .view { padding: 1.1rem .9rem calc(9.5rem + env(safe-area-inset-bottom)); }
  .card { padding: 1rem; }
  .page-head { margin-bottom: 1.1rem; }
  .page-head h1 { font-size: 1.9rem; }
  .page-head .btn.brand { position: fixed; bottom: calc(5.6rem + env(safe-area-inset-bottom)); inset-inline-start: 1rem; z-index: 29;
    height: 50px; border-radius: 99px; padding: 0 1.2rem; background: var(--brand); color: var(--on-brand); box-shadow: 0 10px 24px -8px rgba(31,61,68,.55); }
  .grid.kpis { gap: .9rem .6rem; }
  .grid.kpis > .card { padding: .1rem .9rem; }
  .kpi b { font-size: 2.2rem; }
  .hero { padding: 1.2rem; }
  .toasts { bottom: calc(6rem + env(safe-area-inset-bottom)); }
  .inbox, .sim-chat { height: calc(100dvh - 230px - env(safe-area-inset-bottom)); }
}
.more-links { display: none !important; }
