/* CS Tuition brand: Royal Navy, Academic Navy, Heritage Gold, Champion Gold, Warm Ivory.
   Navy for authority, gold only for highlights and key actions. */
:root {
  --navy: #071C3D;
  --navy-2: #0E326B;
  --gold: #B88A2B;
  --gold-2: #D6AE4B;
  --ivory: #F8F5ED;
  --mist: #EAF0F8;

  --bg: var(--ivory);
  --panel: #FFFFFF;
  --panel-2: #F4F1E8;
  --text: var(--navy);
  --muted: #47617E;
  --line: #E7E1D2;
  --accent: var(--navy-2);
  --on-accent: #FFFFFF;
  --ok: #1F8A5B;
  --bad: #B83A33;
  --warn-soft: #FBF1DA;
  --warn: #8A6516;
  --bubble-customer: #FFFFFF;
  --bubble-bot: #FBF4E2;
  --bubble-staff: #E4ECF8;
  --chat-bg: #F1EEE4;
  --rail: var(--navy);
  --shadow: 0 1px 2px rgba(7, 28, 61, .04), 0 8px 24px rgba(7, 28, 61, .06);
  --shadow-lift: 0 2px 4px rgba(7, 28, 61, .06), 0 14px 34px rgba(7, 28, 61, .10);
  --radius: 22px;
  --radius-sm: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #061530;
    --panel: #0C2247;
    --panel-2: #10295A;
    --text: #F8F5ED;
    --muted: #A7B6CB;
    --line: #1B3767;
    --accent: #D6AE4B;
    --on-accent: #071C3D;
    --ok: #5BC995;
    --bad: #F08A80;
    --warn-soft: #3A2E12;
    --warn: #E9C46A;
    --bubble-customer: #12305F;
    --bubble-bot: #33290F;
    --bubble-staff: #173A73;
    --chat-bg: #081B3A;
    --rail: #040F24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #061530; --panel: #0C2247; --panel-2: #10295A; --text: #F8F5ED; --muted: #A7B6CB; --line: #1B3767;
  --accent: #D6AE4B; --on-accent: #071C3D; --ok: #5BC995; --bad: #F08A80; --warn-soft: #3A2E12; --warn: #E9C46A;
  --bubble-customer: #12305F; --bubble-bot: #33290F; --bubble-staff: #173A73; --chat-bg: #081B3A; --rail: #040F24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 34px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 4px 0 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--bad); min-height: 1em; }
.lead { max-width: 760px; }
.grow { flex: 1; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico { width: 18px; height: 18px; }

/* ---------- Form controls ---------- */
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  margin-top: 5px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 174, 75, .25); }
label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; accent-color: var(--gold); }

.btn {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 9px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: var(--navy); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; margin: 0; box-shadow: var(--shadow); font-size: 14px;
}
.pill.soft { box-shadow: none; background: var(--panel-2); }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); }

/* Language + light/dark buttons (top-right) */
.pill-btn {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; height: 38px; padding: 0 14px; box-shadow: var(--shadow);
}
.pill-btn:hover, .icon-btn:hover { border-color: var(--gold); }
.topbar .icon-btn, .corner-toggles .icon-btn { box-shadow: var(--shadow); }
.corner-toggles { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 30; }

/* ---------- Cards & layout helpers ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 12px; }
.row.gap { gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; align-items: start; }
.pair { display: flex; gap: 8px; align-items: center; }
.narrow { max-width: 620px; }
.section-title { font-size: 18px; margin-top: 4px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin: 6px 0 20px; }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-shell {
  width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--panel); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lift); border: 1px solid var(--line);
}
.auth-hero {
  position: relative; padding: 36px 36px 0; color: var(--navy);
  background: radial-gradient(circle at 85% 0%, rgba(214, 174, 75, .16), transparent 45%), #FFFFFF;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.auth-hero h1 { font-size: 34px; color: var(--navy); margin-top: 18px; }
.auth-hero p { color: var(--muted); max-width: 360px; }
.hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.hero-brand img { width: 46px; height: 46px; background: #fff; border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.hero-mascot { width: 62%; max-width: 280px; align-self: center; margin-top: 8px; border-radius: 24px 24px 0 0; display: block; }
.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center;
  background: var(--ivory); border-top: 1px solid var(--line); color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
}
/* Dark mode: the login box stays navy */
:root[data-theme="dark"] .auth-hero { color: #F8F5ED; border-right: 0; background: radial-gradient(circle at 85% 0%, rgba(214, 174, 75, .14), transparent 45%), linear-gradient(160deg, var(--navy) 10%, var(--navy-2) 100%); }
:root[data-theme="dark"] .auth-hero h1 { color: #fff; }
:root[data-theme="dark"] .auth-hero p { color: #C9D4E5; }
:root[data-theme="dark"] .hero-foot { background: rgba(7, 28, 61, .85); border-top: 0; color: var(--gold-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-hero { color: #F8F5ED; border-right: 0; background: radial-gradient(circle at 85% 0%, rgba(214, 174, 75, .14), transparent 45%), linear-gradient(160deg, var(--navy) 10%, var(--navy-2) 100%); }
  :root:not([data-theme="light"]) .auth-hero h1 { color: #fff; }
  :root:not([data-theme="light"]) .auth-hero p { color: #C9D4E5; }
  :root:not([data-theme="light"]) .hero-foot { background: rgba(7, 28, 61, .85); border-top: 0; color: var(--gold-2); }
}
.auth-card { padding: 44px 40px; align-self: center; }
.auth-card h2 { font-size: 28px; }

/* ---------- App shell: navy icon rail + top bar ---------- */
.app { display: flex; min-height: 100vh; }
.rail {
  width: 92px; flex-shrink: 0; background: var(--rail); color: #C9D4E5;
  display: flex; flex-direction: column; align-items: center; padding: 18px 0;
  position: sticky; top: 0; height: 100vh;
}
.rail-logo { width: 54px; height: 54px; background: #fff; border-radius: 16px; padding: 5px; margin-bottom: 22px; }
#nav { display: flex; flex-direction: column; gap: 6px; flex: 1; width: 100%; align-items: center; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
/* Sections of the open page, listed under its menu button (Team, Settings…) */
#nav .subnav { display: flex; flex-direction: column; gap: 2px; width: 84px; margin: -2px 0 4px; padding: 4px 0 6px; border-left: 2px solid rgba(255,255,255,.18); margin-left: 8px; }
#nav .subnav-arrow { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; line-height: 16px; border-radius: 50%; font-size: 14px; font-weight: 800; text-align: center; background: rgba(0,0,0,.18); color: inherit; cursor: pointer; }
#nav .subnav-arrow:hover { background: rgba(0,0,0,.32); }
#nav .subnav button { width: 100%; padding: 4px 6px; border-radius: 8px; font-size: 10px; font-weight: 500; line-height: 1.2; text-align: left; align-items: flex-start; color: #C9D4E5; opacity: .85; }
#nav .subnav button:hover, #nav .subnav button.here { background: rgba(255,255,255,.1); color: #fff; opacity: 1; }
.card.flash { box-shadow: 0 0 0 3px var(--gold); transition: box-shadow .3s; }
#nav button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 70px; padding: 10px 0 8px; border: 0; border-radius: 18px; cursor: pointer;
  background: transparent; color: inherit; font: inherit; font-size: 11px; font-weight: 600;
  transition: background .15s, color .15s;
}
#nav button svg { width: 22px; height: 22px; }
#nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav button.active { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); box-shadow: 0 6px 18px rgba(184, 138, 43, .35); }
#nav button:disabled { opacity: .35; cursor: default; }
#nav .nav-bottom { margin-top: auto; }
.badge {
  position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px;
  background: #E2483D; color: #fff; border-radius: 99px; font-size: 11px; line-height: 18px; font-weight: 700;
}

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 28px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.number-pill { padding: 4px 6px 4px 14px; font-weight: 600; }
.number-pill select {
  width: auto; min-width: 180px; border: 0; background: transparent; margin: 0; padding: 6px 8px; font-weight: 600; box-shadow: none; cursor: pointer;
}
.number-pill select:focus { box-shadow: none; }
.number-pill.connected .ico { color: var(--ok); }
.number-pill.off .ico { color: var(--muted); }
.faces { display: flex; align-items: center; }
.faces .avatar { margin-left: -10px; border: 2px solid var(--bg); }
.faces .avatar:first-child { margin-left: 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; font-weight: 700; font-size: 13px;
}
.avatar.more { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.me-pill {
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.me-pill .avatar { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); }
.me-name { font-size: 13px; line-height: 1.25; padding-right: 4px; }
.me-name b { display: block; font-size: 14px; }
main { padding: 4px 28px 40px; max-width: 1360px; width: 100%; }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .big { font-size: 30px; font-weight: 800; line-height: 1.1; }
#waStatus { font-size: 22px; white-space: nowrap; padding-top: 6px; }
.stat-gold { background: linear-gradient(135deg, #F3D98E, var(--gold-2)); border-color: var(--gold-2); color: var(--navy); }
.stat-gold .stat-label { color: rgba(7, 28, 61, .7); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

.buddy {
  position: sticky; top: 92px;
  border-radius: 28px; overflow: hidden; color: var(--navy); box-shadow: var(--shadow-lift);
  background: radial-gradient(circle at 50% 0%, rgba(214, 174, 75, .14), transparent 55%), #FFFFFF;
  border: 1px solid var(--line);
}
.buddy-mascot {
  display: block; width: calc(100% - 28px); margin: 14px 14px 0; border-radius: 22px;
  aspect-ratio: 1 / 1; object-fit: cover; object-position: center 30%;
}
.buddy-body { padding: 4px 22px 22px; text-align: center; }
.buddy-body h2 { color: var(--navy); font-size: 24px; margin-top: 10px; }
.buddy-body p { color: var(--muted); }
.buddy-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--navy);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { background: #FBF1DA; border-color: var(--gold-2); }
.buddy-tips { text-align: left; background: var(--ivory); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: 13px; }
.tips-title { display: flex; gap: 8px; align-items: center; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.tips-title svg { width: 18px; height: 18px; }
.buddy-tips ul { margin: 0; padding-left: 18px; color: var(--muted); }
.buddy-tips li { margin: 3px 0; }

/* Dark mode: the mascot panel stays navy */
:root[data-theme="dark"] .buddy { color: #F8F5ED; border-color: transparent; background: linear-gradient(180deg, #0B2550 0%, var(--navy) 70%); }
:root[data-theme="dark"] .buddy-mascot { width: 100%; margin: 0; border-radius: 0; }
:root[data-theme="dark"] .buddy-body h2 { color: #fff; }
:root[data-theme="dark"] .buddy-body p, :root[data-theme="dark"] .buddy-tips ul { color: #C9D4E5; }
:root[data-theme="dark"] .chip { color: #F8F5ED; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
:root[data-theme="dark"] .chip:hover { background: rgba(214, 174, 75, .22); border-color: var(--gold-2); }
:root[data-theme="dark"] .buddy-tips { background: rgba(255, 255, 255, .06); border-color: transparent; }
:root[data-theme="dark"] .tips-title { color: var(--gold-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .buddy { color: #F8F5ED; border-color: transparent; background: linear-gradient(180deg, #0B2550 0%, var(--navy) 70%); }
  :root:not([data-theme="light"]) .buddy-mascot { width: 100%; margin: 0; border-radius: 0; }
  :root:not([data-theme="light"]) .buddy-body h2 { color: #fff; }
  :root:not([data-theme="light"]) .buddy-body p, :root:not([data-theme="light"]) .buddy-tips ul { color: #C9D4E5; }
  :root:not([data-theme="light"]) .chip { color: #F8F5ED; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
  :root:not([data-theme="light"]) .chip:hover { background: rgba(214, 174, 75, .22); border-color: var(--gold-2); }
  :root:not([data-theme="light"]) .buddy-tips { background: rgba(255, 255, 255, .06); border-color: transparent; }
  :root:not([data-theme="light"]) .tips-title { color: var(--gold-2); }
}

/* Switch */
.switch { position: relative; width: 54px; height: 31px; margin: 0; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before {
  content: ""; position: absolute; width: 25px; height: 25px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.switch input:checked + span { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.switch input:checked + span::before { transform: translateX(23px); }
.switch input:disabled + span { opacity: .5; cursor: default; }

/* Linking */
.link-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.option { border: 1px solid var(--line); background: var(--panel-2); border-radius: 18px; padding: 16px; }
.option p { margin: 2px 0 12px; font-size: 14px; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 9px 14px; border-radius: 12px; }
.qr-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.qr-wrap img { width: 230px; height: 230px; background: #fff; padding: 10px; border-radius: 18px; border: 1px solid var(--line); }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.pair-code {
  font: 800 38px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px;
  background: var(--navy); color: var(--gold-2); border-radius: 18px;
  padding: 16px; text-align: center; margin-bottom: 14px; word-break: break-all;
}

/* Lists (scheduled, activity, numbers) */
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; font-size: 14px; }
.log li:last-child { border-bottom: 0; }
.log .when { color: var(--muted); width: 120px; flex-shrink: 0; font-size: 13px; }

/* ---------- Chats ---------- */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: var(--navy-2); color: #fff; }
#chatFilter .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 99px; background: #E2483D; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; vertical-align: 1px; }
#chatFilter .cnt.hidden { display: none; }
.chats { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; }
.chat-list { padding: 8px; height: calc(100vh - 150px); min-height: 560px; overflow-y: auto; margin: 0; }
.chat-item { padding: 12px 14px; border-radius: 16px; cursor: pointer; display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--mist); }
:root[data-theme="dark"] .chat-item.active { background: var(--panel-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-item.active { background: var(--panel-2); } }
.chat-item .top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.chat-item .last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin: 3px 4px 0 0; }
.tag.need { background: var(--warn-soft); color: var(--warn); }
.tag.paused { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.chat-view { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 560px; margin: 0; padding: 0; overflow: hidden; }
.chat-view > .muted.center { margin: auto; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 18px; background: var(--chat-bg); display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 2px rgba(7, 28, 61, .06); }
.msg.customer { background: var(--bubble-customer); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.bot, .msg.staff { align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.bot { background: var(--bubble-bot); border: 1px solid rgba(214, 174, 75, .4); }
.msg.staff { background: var(--bubble-staff); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg .sender { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 2px; }
.msg img.photo, .msg video.photo { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; margin-bottom: 4px; }
.msg img.sticker { display: block; width: 120px; height: 120px; object-fit: contain; }
.msg audio { display: block; width: 260px; max-width: 100%; margin-bottom: 4px; }
.media-note { font-size: 13px; color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { margin: 0; resize: none; border-radius: 18px; }

/* ---------- Auto replies ---------- */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 18px; }
.rule .rule-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.rule .rule-head input[name=name] { font-weight: 700; flex: 1; margin: 0; }
.rule .reply-row { display: flex; gap: 8px; align-items: flex-start; }
.rule .reply-row textarea { flex: 1; resize: vertical; overflow-y: auto; }
.rule .reply-row .btn { margin-top: 6px; box-shadow: none; }
.rule.off { opacity: .55; }
.test-box { background: var(--mist); border-color: transparent; }
:root[data-theme="dark"] .test-box { background: var(--panel-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .test-box { background: var(--panel-2); } }
.test-box #testResult { margin: 0; white-space: pre-wrap; }

/* English version of a reply + staff note */
.en-replies { margin: 6px 0 12px; border: 1px dashed var(--line); border-radius: 14px; padding: 8px 12px; }
.en-replies summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.en-replies[open] summary { margin-bottom: 8px; }
.rule-note { font-size: 13px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 8px 12px; white-space: pre-wrap; }

.site-card .card-head .pill { font-size: 12px; }

/* Hours */
.hours { display: grid; grid-template-columns: minmax(90px, 130px) minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; align-items: center; margin-bottom: 16px; }
.hours input { margin: 0; width: 100%; min-width: 0; box-sizing: border-box; }

/* ---------- Team ---------- */
.add-row { margin-top: 14px; }
.add-row input { flex: 1; min-width: 180px; margin: 0; }
.user-row { padding: 16px 18px; margin-bottom: 12px; }
.user-row.off { opacity: .55; }
.role-pick { width: auto; margin: 0; padding: 5px 10px; border-radius: 999px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.checks .check { margin: 0; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 999px; z-index: 20;
  box-shadow: var(--shadow-lift); border: 1px solid var(--gold);
}

/* ---------- Insights ---------- */
.pill-select { width: auto; margin: 0; border-radius: 999px; padding: 8px 14px; background: var(--panel); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.kpi-navy { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #F8F5ED; border-color: var(--navy-2); }
.kpi-navy .stat-label { color: var(--gold-2); }
.ins-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.ins-grid .card { min-width: 0; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.lg-a, .tb-a { background: var(--navy-2); }
.lg-b, .tb-b { background: var(--gold-2); }
:root[data-theme="dark"] .lg-a, :root[data-theme="dark"] .tb-a { background: #5E86C9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lg-a, :root:not([data-theme="light"]) .tb-a { background: #5E86C9; } }
.trend { display: flex; align-items: stretch; gap: 4px; height: 190px; margin-top: 12px; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trend-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.tb { width: 42%; max-width: 16px; border-radius: 5px 5px 0 0; min-height: 0; }
.trend-x { font-size: 10px; color: var(--muted); text-align: center; height: 16px; margin-top: 4px; white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--navy-2); }
.bar-val { font-size: 13px; white-space: nowrap; }
.f-new { background: #8FA6C4; }
.f-trial { background: var(--gold-2); }
.f-reg { background: var(--navy-2); }
.f-lost { background: #C9B8A8; }
:root[data-theme="dark"] .f-reg { background: #5E86C9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .f-reg { background: #5E86C9; } }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; margin-top: 10px; }
.heat-h { font-size: 10px; color: var(--muted); text-align: center; }
.heat-d { font-size: 11px; color: var(--muted); align-self: center; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; background-color: var(--panel-2); background-image: linear-gradient(rgba(var(--heat-rgb), var(--a)), rgba(var(--heat-rgb), var(--a))); }
:root { --heat-rgb: 184, 138, 43; }
:root[data-theme="dark"] { --heat-rgb: 127, 166, 230; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --heat-rgb: 127, 166, 230; } }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.stage-pick { padding: 6px 12px; font-size: 13px; }
.tag.stage-trial, .stage-pick.stage-trial,
.tag.stage-fu1, .stage-pick.stage-fu1, .tag.stage-fu2, .stage-pick.stage-fu2, .tag.stage-fu3, .stage-pick.stage-fu3 { background: #FBF1DA; color: #8A6516; }
.tag.stage-registered, .stage-pick.stage-registered { background: var(--navy-2); color: #fff; }
.tag.stage-lost, .stage-pick.stage-lost { background: var(--panel-2); color: var(--muted); }


/* ---------- CRM ---------- */
.chat-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-box { width: auto; flex: 1; min-width: 200px; margin: 0; border-radius: 999px; padding: 9px 16px; background: var(--panel); box-shadow: var(--shadow); }
.chat-item.unread .name { font-weight: 800; }
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 5px; }
.item-tags .tag { margin: 0; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.chip-tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 13px; line-height: 1; }
.unread-badge { background: #1F8A5B; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.owner-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); margin-left: auto; }

.chat-view { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; } /* header · search · who else is here · messages · reply box */
.chat-head { padding: 8px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.head-controls { row-gap: 4px; }
.head-controls label.mini { font-size: 12px; gap: 4px; }
.head-controls select, .head-controls input.amount-input, .head-controls .btn.small { padding: 4px 10px; font-size: 13px; min-height: 0; }
.head-controls input.amount-input { width: 90px; }
.head-controls { gap: 8px; }
.head-controls .pill-select { padding: 5px 10px; font-size: 13px; box-shadow: none; }
label.mini { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.status-closed { opacity: .75; }
.collision { background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; padding: 7px 16px; border-bottom: 1px solid var(--line); }
.chat-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.chat-view.no-panel .chat-body { grid-template-columns: minmax(0, 1fr); }
.chat-view.no-panel .panel-slot { display: none; }
.chat-body .msgs { min-height: 0; }
.panel-slot { border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.panel-toggle { display: none; }
.back-btn, .controls-toggle { display: none; }
.head-name { align-items: center; }
.profile-panel { padding: 14px 16px 24px; }
.profile-panel h4 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.profile-panel h4:first-child { margin-top: 0; }
.profile-panel label { font-size: 13px; margin-bottom: 10px; }
.profile-panel input, .profile-panel select, .profile-panel textarea { padding: 7px 10px; font-size: 14px; }
.student-box { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 2px; margin-bottom: 8px; background: var(--panel-2); }
.auto-chip { margin-left: 6px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: var(--mist); color: var(--navy-2); text-transform: uppercase; letter-spacing: .04em; }
:root[data-theme="dark"] .auto-chip { background: var(--panel-2); color: var(--gold-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auto-chip { background: var(--panel-2); color: var(--gold-2); } }
.add-tag { width: auto; margin: 0; padding: 2px 8px; font-size: 12px; border-radius: 99px; }
.fu-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.fu-row input { width: auto; margin: 3px 0 0; accent-color: var(--gold); }
.fu-row.due b { color: var(--bad); }
.fu-add { display: grid; gap: 6px; margin-top: 8px; }
.fu-add input, .fu-add select { margin: 0; }

.msg.note { align-self: stretch; max-width: 100%; background: var(--warn-soft); border: 1px dashed var(--gold); box-shadow: none; }
.note-head { font-size: 12px; font-weight: 700; color: var(--warn); margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.note-tick { margin-left: auto; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--gold); background: var(--panel); color: var(--warn); cursor: pointer; white-space: nowrap; }
.note-tick:hover { background: var(--gold); color: var(--navy); }
.note-tick.on { border-color: #1f9d55; color: #1f9d55; }
.msg.note.done { opacity: .7; border-style: solid; border-color: #1f9d55; }
.note-done { font-size: 12px; font-weight: 600; color: #1f9d55; margin-top: 2px; }
.composer-wrap { border-top: 1px solid var(--line); }
.composer-wrap .composer { border-top: 0; position: relative; }
.compose-mode { margin: 10px 14px 0; box-shadow: none; }
.compose-mode button { padding: 4px 12px; font-size: 13px; }
.composer-wrap.note-mode textarea { background: var(--warn-soft); border-color: var(--gold); }
.qr-popup {
  position: absolute; left: 14px; right: 90px; bottom: calc(100% - 4px); max-height: 260px; overflow-y: auto; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 6px;
}
.qr-popup button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.qr-popup button:hover, .qr-popup button:first-child { background: var(--panel-2); }

.bell-wrap { position: relative; }
.bell-wrap .badge { top: -4px; right: -4px; }
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 90vw); max-height: 60vh; overflow-y: auto; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); padding: 12px 14px;
}
.clickable { cursor: pointer; }
.clickable:hover { background: var(--panel-2); }
.log li.unread-note { font-weight: 600; }
.log li.overdue .when { color: var(--bad); font-weight: 700; }

.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board .col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 10px; min-height: 300px; display: flex; flex-direction: column; gap: 8px; }
.board .col.over { outline: 2px dashed var(--gold); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; }
.stage-col-trial .col-head b, .stage-col-fu1 .col-head b, .stage-col-fu2 .col-head b, .stage-col-fu3 .col-head b { color: #8A6516; }
.stage-col-registered .col-head b, .stage-col-newstudent .col-head b { color: var(--ok); }
.stage-col-lost .col-head b { color: var(--muted); }
.board-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.board-card:active { cursor: grabbing; }
.card-stage { width: auto; margin: 4px 0 0; padding: 3px 8px; font-size: 12px; border-radius: 99px; display: none; }

.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.feature-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--panel-2); }
.tag-edit, .quick-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tag-edit input[type=color] { width: 42px; height: 36px; padding: 2px; margin: 0; flex-shrink: 0; }
.tag-edit input, .quick-edit input, .quick-edit textarea { margin: 0; }
.quick-edit input { max-width: 160px; }

@media (max-width: 1180px) {
  .chat-body { grid-template-columns: minmax(0, 1fr); }
  .panel-slot { display: none; border-left: 0; }
  .chat-view.show-panel .panel-slot { display: block; }
  .chat-view.show-panel .msgs { display: none; }
  .panel-toggle { display: inline-flex; }
}
@media (max-width: 800px) {
  .board { grid-template-columns: repeat(6, 82vw); }
  .card-stage { display: inline-block; }
  .search-box { min-width: 100%; }
}

.safety-card { border-left: 4px solid var(--gold); }
.safety-list { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.safety-list li { margin: 0 0 8px; break-inside: avoid; font-size: 14px; }
@media (max-width: 900px) { .safety-list { columns: 1; } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: 1fr; }
  .buddy { position: static; display: grid; grid-template-columns: 220px 1fr; align-items: center; }
  .buddy-mascot { height: 100%; aspect-ratio: auto; }
  .buddy-body { text-align: left; padding: 18px 22px; }
  .buddy-actions { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ins-grid { grid-template-columns: 1fr 1fr; }
  .span3 { grid-column: span 2; }
}
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; width: 100%; z-index: 10;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .rail-logo { display: none; }
  #nav { flex-direction: row; justify-content: space-between; gap: 2px; overflow-x: auto; }
  #nav button { width: auto; min-width: 54px; flex: 1; padding: 7px 4px 6px; border-radius: 14px; font-size: 10px; }
  #nav .nav-bottom { margin-top: 0; }
  #nav .subnav { display: none; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .number-pill select { min-width: 0; max-width: 46vw; }
  .me-name, .faces { display: none; }
  main { padding: 0 16px 96px; }
  h1 { font-size: 26px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 24px 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-mascot { width: 46%; }
  .auth-card { padding: 28px 24px; }
  .auth { padding-top: 68px; }
  .buddy { grid-template-columns: 1fr; }
  .buddy-mascot { aspect-ratio: 4 / 3; height: auto; object-position: center 12%; }
  .chats { grid-template-columns: 1fr; gap: 0; }
  /* Phone: the list OR the open chat fills the screen (← Back goes to the list) */
  .chat-list { height: calc(100dvh - 215px); min-height: 0; }
  .chat-view { height: calc(100dvh - 128px); min-height: 0; }
  body.chat-open section[data-page="chats"] .page-head, body.chat-open .chat-filters, body.chat-open .top-toggle, body.chat-open .chat-list { display: none; }
  body:not(.chat-open) .chat-view { display: none; }
  .back-btn { display: inline-flex; padding: 4px 10px; font-size: 16px; }
  /* Phone: owner / status / stage fold away behind ⚙; "mark as unread" is the swipe / long-press menu */
  .controls-toggle { display: inline-flex; padding: 4px 10px; }
  .mark-unread-btn { display: none; }
  .chat-head .head-controls { display: none; }
  .chat-view.show-controls .chat-head .head-controls { display: flex; }
  .chat-head { padding: 6px 10px; gap: 4px; }
  .chat-head .head-controls label.mini { font-size: 11px; }
  .chat-head .head-controls select, .chat-head .head-controls input.amount-input { padding: 3px 8px; font-size: 12px; }
  .msgs { padding: 10px; }
  .composer textarea { min-height: 42px; }
  .rules-grid { grid-template-columns: 1fr; }
  .ins-grid { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .kpi b { font-size: 26px; }
  .heat { gap: 2px; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); }
  .msg { max-width: 88%; }
  .log .when { width: 84px; }
  .page-head { margin-bottom: 14px; }
}

/* AI test answer on the Team page */
.ai-test { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ai-test .msg { align-self: flex-start; max-width: 100%; }

/* Per-number access for staff: can't see / see only / see and reply */
.access-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 400; }
.access-pick { width: auto; min-width: 150px; padding: 6px 10px; }
.access-pick:not(.on) { color: var(--muted); }

/* Leads by ad */
.leads-kpis { margin: 8px 0 12px; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tr.total-row td { border-top: 2px solid var(--line); }
#leadsTables h4 { margin: 14px 0 4px; }
.ad-edit { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 640px) { .ad-edit { grid-template-columns: 1fr auto; } .ad-edit input:nth-child(2) { grid-column: 1; } }

/* Insights month picker: highlighted when a month is chosen */
#insMonth.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Eye button inside password boxes */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; box-shadow: none; padding: 6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--text); background: var(--panel-2); }
.pw-eye svg { width: 18px; height: 18px; }
.add-row .pw-wrap { flex: 1; }
.pw-dialog { border: 1px solid var(--line); border-radius: 18px; padding: 20px; min-width: min(380px, 90vw); background: var(--panel); color: var(--text); }
.pw-dialog::backdrop { background: rgba(7, 28, 61, .35); }

/* AI suggestion button + AI Learning page */
.compose-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-btn { background: linear-gradient(135deg, #FBF1DA, #F3DFA3); color: #6B4E0E; border: 0; }
.ai-btn:disabled { opacity: .7; }
.learn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.learn-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.learn-stat b { font-size: 24px; }
.learn-staff { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; overflow-x: auto; }
.learn-staff table { border-collapse: collapse; width: 100%; font-size: 14px; }
.learn-staff th, .learn-staff td { text-align: left; padding: 4px 10px 4px 0; }
.learn-staff th { color: var(--muted); font-weight: 600; font-size: 12px; }
#learnSearch { margin-bottom: 12px; }
.learn-list { display: flex; flex-direction: column; gap: 12px; }
.learn-block { margin-top: 10px; }
.learn-text { white-space: pre-wrap; background: var(--panel-2); border-radius: 12px; padding: 8px 12px; margin-top: 2px; }
.learn-block.dim .learn-text { color: var(--muted); }
.d-del { background: rgba(184, 58, 51, .15); color: var(--bad); text-decoration: line-through; }
.d-ins { background: rgba(31, 138, 91, .2); }
.learn-similar { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--panel-2); border-radius: 0 12px 12px 0; }
.learn-actions { margin-top: 12px; }
.learn-edit { margin-top: 10px; }
.learn-edit textarea { width: 100%; margin-bottom: 8px; }
.tag.ok { background: rgba(31, 138, 91, .15); color: var(--ok); }
.row.wrap { flex-wrap: wrap; }

/* Attach menu, files waiting to be sent, voice recording, quoted replies */
.compose-tools .right { display: flex; gap: 8px; align-items: center; }
.attach-wrap { position: relative; }
.attach-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 6; min-width: 190px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 6px; }
.attach-menu button { border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.attach-menu button:hover { background: var(--panel-2); }
.attach-bar, .quote-bar, .rec-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 14px 0; padding: 8px 12px; background: var(--panel-2); border-radius: 12px; font-size: 13px; }
.quote-bar { border-left: 3px solid var(--gold); }
.attach-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.attach-chip .x, .quote-bar .x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font: inherit; box-shadow: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.msg { position: relative; }
.msg .quote { border-left: 3px solid var(--gold); background: rgba(127, 127, 127, .12); padding: 4px 8px; border-radius: 8px; margin-bottom: 4px; font-size: 13px; }
.msg .reacts { display: flex; gap: 4px; margin-top: 4px; }
.msg .reacts span { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; font-size: 13px; }
.msg-actions { position: absolute; top: -12px; right: 8px; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow); }
.msg.customer .msg-actions { right: auto; left: 8px; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions button, .emoji-row button { border: 0; background: none; cursor: pointer; padding: 2px 5px; border-radius: 999px; box-shadow: none; font: inherit; }
.msg-actions button:hover, .emoji-row button:hover { background: var(--panel-2); }
.emoji-row { position: absolute; top: 16px; right: 8px; z-index: 5; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px; box-shadow: var(--shadow-lift); }
.emoji-row button { font-size: 18px; }
.msg.customer .emoji-row { right: auto; left: 8px; }
.msg.deleted { opacity: .75; font-style: italic; }
.msgs .msg + .msg { margin-top: 12px; }

/* Emoji picker in the reply box */
.emoji-wrap { position: relative; align-self: flex-end; }
.emoji-btn { border: 0; background: var(--panel-2); font-size: 20px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; box-shadow: none; padding: 0; line-height: 1; }
.emoji-btn:hover { background: var(--line); }
.emoji-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 7; width: min(340px, 80vw); max-height: 300px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 8px 10px; }
.emoji-group { margin-bottom: 6px; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-grid button { border: 0; background: none; font-size: 22px; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; padding: 0; box-shadow: none; line-height: 1; }
.emoji-grid button:hover { background: var(--panel-2); }

.msg .meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.msg .edited-tag { margin-left: auto; font-style: italic; color: var(--muted); }
.msg-actions { opacity: .45; }
.msg-actions button.dim { opacity: .4; }

.type-pick { width: auto; display: inline-block; padding: 3px 8px; font-size: 12px; margin: 0; }

/* AI Library */
.lib-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.lib-topics { display: flex; flex-direction: column; gap: 6px; }
.lib-topic { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--text); box-shadow: none; }
.lib-topic.active { border-color: var(--gold); background: var(--panel-2); }
.lib-detail { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.lib-playbook { white-space: pre-wrap; line-height: 1.6; background: var(--panel-2); border-radius: 14px; padding: 14px 16px; margin: 10px 0; }
.lib-detail textarea { width: 100%; margin-bottom: 8px; font: inherit; }
@media (max-width: 800px) { .lib-layout { grid-template-columns: 1fr; } }

/* Pipeline filters and amounts */
.pipe-filters input[type=date] { width: auto; padding: 6px 10px; }
.pipe-filters label.mini { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.board-card .amount { font-weight: 700; color: var(--ok); margin-top: 4px; }
.amount-input { width: 110px; padding: 6px 10px; margin: 0; }

/* Scheduled messages inside a chat */
.sched-bar { display: flex; flex-direction: column; gap: 6px; margin: 8px 14px 0; padding: 8px 12px; background: var(--warn-soft); border-left: 3px solid var(--gold); border-radius: 12px; font-size: 13px; }
.sched-row { display: flex; align-items: center; gap: 8px; }
.sched-row .x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font: inherit; box-shadow: none; }
.sched-btn { border: 0; background: var(--panel-2); font-size: 20px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; box-shadow: none; padding: 0; line-height: 1; align-self: flex-end; }
.sched-btn:hover { background: var(--line); }

/* Automation builder */
.auto-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.auto-table th, .auto-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.auto-table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.auto-name { font-size: 18px; font-weight: 700; width: min(420px, 60vw); margin: 0; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step.card { margin: 0; background: var(--panel-2); }
.step textarea { width: 100%; margin: 0; }
.add-step { width: auto; align-self: flex-start; }
.branch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.branch-side { border: 1px dashed var(--line); border-radius: 12px; padding: 8px; }
input.num { width: 90px; margin: 0; }
label.mini.grow { flex: 1; }
@media (max-width: 800px) { .branch { grid-template-columns: 1fr; } }

/* AI-drafted message waiting for staff */
.approval-bar { margin: 8px 14px 0; padding: 10px 12px; background: var(--warn-soft); border: 1px dashed var(--gold); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.approval-text { align-self: flex-start; max-width: 100%; }

.dialog-note { white-space: pre-wrap; background: var(--panel-2); border-radius: 12px; padding: 10px 12px; max-height: 55vh; overflow: auto; font-size: 14px; line-height: 1.5; margin-bottom: 6px; }

/* Pipeline advanced filters */
.pipe-chips { margin: 6px 0 10px; }
.adv-chip { font-size: 13px; }
.adv-dialog { width: min(640px, 94vw); }
.adv-list { display: flex; flex-direction: column; gap: 8px; }
.adv-row { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--panel-2); }
.adv-value { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adv-value input[type=date] { width: auto; margin: 0; }
.adv-and { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }

/* New stage colours */
.tag.stage-pending, .stage-pick.stage-pending { background: #FBF1DA; color: #8A6516; }
.tag.stage-existing, .stage-pick.stage-existing, .tag.stage-student, .stage-pick.stage-student, .tag.stage-returning, .stage-pick.stage-returning, .tag.stage-referred, .stage-pick.stage-referred { background: #DDEFEF; color: #1F6F6F; }
.tag.stage-added, .stage-pick.stage-added { background: #E5F4E4; color: #1F8A5B; }
.tag.stage-dropped, .stage-pick.stage-dropped { background: #F9ECE7; color: #B5531D; }
.tag.stage-stopped, .stage-pick.stage-stopped { background: var(--panel-2); color: var(--muted); }

/* Instagram / Facebook connection card */
.meta-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.meta-form label.mini { display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: 560px; text-align: left; }
.meta-form input { margin: 0; width: 100%; box-sizing: border-box; }
.meta-webhook { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft, rgba(0,0,0,.04)); }
.meta-webhook code { user-select: all; word-break: break-all; }
.chan-badge { font-size: 12px; opacity: .8; }

/* Pipeline: category pills + total */
.pipe-cats { align-items: center; margin-bottom: 10px; }
.pipe-cats .seg button { padding: 6px 12px; }
.pipe-cats .seg button .cnt { opacity: .7; font-weight: 500; margin-left: 4px; }
.pipe-total { font-weight: 700; padding: 8px 14px; }
.meta-warnings { margin: 6px 0 0; padding-left: 18px; color: var(--warn, #b7791f); }

/* Pop-up at the top for a new notification */
.note-pop {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px));
  background: var(--navy); color: #fff; padding: 12px 16px 12px 18px; border-radius: 16px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--gold); cursor: pointer;
}
.note-pop .note-pop-text { flex: 1; font-weight: 600; line-height: 1.35; }
.note-pop .note-pop-sub { font-weight: 400; opacity: .75; font-size: 12px; margin-top: 2px; }
.note-pop .note-pop-x { background: transparent; border: 0; color: #fff; font-size: 18px; cursor: pointer; opacity: .7; padding: 2px 6px; }
.note-pop .note-pop-x:hover { opacity: 1; }

/* Chats page: tuck the title + filters away so the conversation gets more room */
.top-toggle { display: block; margin: 0 auto 8px; padding: 2px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.top-toggle:hover { color: var(--ink); }
.top-toggle .when-closed, section.compact .top-toggle .when-open { display: none; }
section.compact .top-toggle .when-closed { display: inline; }
section.compact .page-head, section.compact .chat-filters { display: none; }
section.compact .chat-list, section.compact .chat-view { height: calc(100vh - 118px); }
.msg .ad-tag { font-size: 11px; font-weight: 700; color: #8A6516; background: rgba(184,138,43,.12); border-radius: 8px; padding: 3px 8px; margin-bottom: 6px; display: inline-block; }
.msg .ad-tag a { color: inherit; text-decoration: underline; }
.tbl td.kw { max-width: 260px; white-space: normal; font-size: 12px; color: var(--muted); }
.leads-filter { margin: 4px 0 12px; align-items: center; }
.leads-filter input[type=date] { padding: 6px 10px; }
.rule .rule-checked { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.rule.checked { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.rule.checked .rule-checked { color: var(--ok); font-weight: 600; }
.btn.pulse { box-shadow: 0 0 0 3px rgba(184,138,43,.35); animation: pulseBtn 1.2s ease-in-out infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 6px rgba(184,138,43,.15); } }

/* Replies page: filter row + pager */
.rules-filter { margin: 0 0 14px; align-items: center; }
.rules-filter .pager { margin: 0 0 0 auto; }
.rules-filter .search-box { flex: 1; min-width: 240px; }
.pager { display: flex; justify-content: flex-end; align-items: stretch; margin: 6px 0 20px; }
.pager button, .pager .page-of { font: inherit; font-size: 14px; padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); margin-left: -1px; cursor: pointer; }
.pager button:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.pager > :last-child { border-radius: 0 10px 10px 0; }
.pager button:disabled { color: var(--muted); cursor: default; opacity: .6; }
.pager .page-of { background: var(--panel-2); font-weight: 600; cursor: default; }
.pager input { width: 48px; font: inherit; font-size: 14px; text-align: center; border: 1px solid var(--line); margin: 0 0 0 -1px; padding: 8px 4px; background: var(--panel); color: var(--ink); }

.list-filter { margin: 0 0 14px; align-items: center; }
.list-filter .search-box { flex: 1; min-width: 220px; margin: 0; }
.list-filter .pager { margin: 0 0 0 auto; }
.lib-side { display: flex; flex-direction: column; gap: 8px; }
.lib-side .search-box { margin: 0; }
.pager.compact { justify-content: center; margin: 0; }
.pager.compact button, .pager.compact .page-of { padding: 5px 9px; font-size: 12px; }
.pager.compact input { width: 38px; padding: 5px 2px; font-size: 12px; }

/* Team / Settings: one tab per group, only that group's cards show */
.page-tabs { margin: -8px 0 18px; flex-wrap: wrap; }
.page-tabs button { padding: 7px 14px; }
.page-tabs:empty { display: none; }
.tab-off { display: none !important; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 0 22px; align-items: start; }

/* Tags: two columns when there is room */
#tagsEditor { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 22px; }
#tagsEditor .tag-edit input:not([type=color]) { min-width: 0; flex: 1; }

.quick-from-replies-head { margin: 18px 0 2px; font-size: 15px; }
.quick-from-replies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 18px; }
.quick-from-replies .qfr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--panel-2); cursor: pointer; }
.quick-from-replies .qfr:hover { border-color: var(--gold); }
.quick-from-replies .qfr b { display: block; }
.quick-from-replies .qfr .kw { font-size: 12px; color: #8A6516; }
.quick-from-replies .qfr .txt { font-size: 13px; color: var(--muted); white-space: pre-wrap; max-height: 60px; overflow: hidden; }
.qr-popup .chk { color: var(--ok); margin-right: 4px; }
.narrow-col { max-width: 720px; }

/* Company stickers */
.sticker-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 7; width: min(420px, 90vw); max-height: 320px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 8px 10px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.sticker-grid button { border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 4px; cursor: pointer; }
.sticker-grid button:hover { border-color: var(--gold); background: var(--panel-2); }
.sticker-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.reply-row .emoji-wrap { position: relative; }
.reply-row .sticker-panel { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); }
.access-row .num-detail { white-space: nowrap; }
.assign-list { display: grid; gap: 14px; }
.assign-num { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.assign-tbl td, .assign-tbl th { padding: 6px 8px; }
.assign-tbl tr.muted td { opacity: .55; }
.assign-weight { width: 72px; }
.assign-pct { font-weight: 600; min-width: 48px; }
.ok-text { color: var(--ok, #2a7a3b); }
.warn-text { color: var(--warn, #8A6516); }

/* Chats page: use the whole width of the screen, and let bubbles stretch further */
body.page-chats main { max-width: none; }
.msg { max-width: 82%; }
.chat-view .panel-slot { width: 320px; }
@media (min-width: 1500px) { .chats { grid-template-columns: 360px minmax(0, 1fr); } .chat-body { grid-template-columns: minmax(0, 1fr) 340px; } }

/* Right-click menu on a chat */
.ctx-menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; display: flex; flex-direction: column; min-width: 180px; }
.ctx-menu button { font: inherit; font-size: 14px; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--ink); }
.ctx-menu button:hover { background: var(--panel-2); }
.chat-item { transition: transform .15s; touch-action: pan-y; }

/* ---------- Phone: WhatsApp-style chats ---------- */
.avatar-circle { display: none; }
@media (max-width: 800px) {
  /* list rows: avatar, name + time, last message, green unread badge, thin dividers */
  .chat-list { padding: 0; border-radius: 14px; }
  .chat-item { display: grid; grid-template-columns: 50px minmax(0, 1fr); grid-template-areas: "av top" "av last" "av tags"; column-gap: 12px; row-gap: 2px; padding: 10px 14px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .chat-item:last-child { border-bottom: 0; }
  .avatar-circle { display: inline-flex; grid-area: av; align-self: center; width: 48px; height: 48px; border-radius: 50%; background: #CFD8E3; color: #1D2433; font-weight: 700; font-size: 16px; align-items: center; justify-content: center; flex-shrink: 0; }
  .chat-item .top { grid-area: top; align-items: baseline; }
  .chat-item .name { font-size: 16px; }
  .chat-item .last { grid-area: last; font-size: 14px; }
  .chat-item .item-tags { grid-area: tags; margin-top: 2px; }
  .chat-item.unread .name { font-weight: 800; }
  .chat-item.unread .last { color: var(--ink); font-weight: 500; }
  .chat-item.unread .time { color: #1DAA61; font-weight: 700; }
  .chat-item .item-tags .tag { display: none; }
  .chat-item .item-tags .tag.need { display: inline-flex; }
  .chat-item .unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #25D366; color: #fff; font-size: 12px; font-weight: 700; }
  /* chat header: green bar with avatar, name and phone */
  .chat-view { border-radius: 14px; }
  .chat-head { background: #008069; color: #fff; padding: 8px 10px; }
  .chat-head b, .chat-head .muted, .chat-head .muted.small { color: #fff; }
  .chat-head .muted, .chat-head .muted.small { opacity: .85; font-size: 12px; }
  .chat-head .btn, .chat-head .btn.small { background: rgba(255, 255, 255, .16); color: #fff; border-color: transparent; box-shadow: none; }
  .head-avatar { width: 38px; height: 38px; font-size: 14px; }
  .chat-head .head-controls { background: rgba(0, 0, 0, .12); border-radius: 10px; padding: 6px 8px; margin-top: 4px; }
  .chat-head .head-controls label.mini { color: #fff; }
  /* messages: WhatsApp colours, tails, small time inside the bubble */
  .msgs { padding: 10px 8px; gap: 4px; background-color: #EFEAE2; background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px); background-size: 18px 18px; }
  .msg { max-width: 86%; padding: 6px 9px 4px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); font-size: 15px; }
  .msg.customer { background: #FFFFFF; color: #111B21; border-bottom-left-radius: 2px; }
  .msg.staff, .msg.bot { background: #D9FDD3; color: #111B21; border: 0; border-bottom-right-radius: 2px; }
  .msg.note { background: #FFF5C4; color: #111B21; }
  .msg .meta { font-size: 10px; color: #667781; text-align: right; margin-top: 1px; }
  .msgs .msg + .msg { margin-top: 2px; }
  .msg .ad-tag { font-size: 10px; }
  /* composer: one row — emoji, text box, stickers, round send button; tools above as small icons */
  .composer-wrap { background: var(--panel); }
  .compose-tools { padding: 4px 8px 0; }
  .compose-tools .seg button { padding: 5px 10px; font-size: 12px; }
  .compose-tools .btn.small.attach-btn, .compose-tools .btn.small.ai-btn { font-size: 0 !important; line-height: 0; width: 36px; height: 36px; min-width: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  /* message actions show only after a tap on the bubble (like a long-press in WhatsApp) */
  .msg .msg-actions { display: none; }
  .msg.sel .msg-actions { display: flex; opacity: 1; }
  .attach-btn::before { content: '📎'; font-size: 18px; }
  .ai-btn::before { content: '✨'; font-size: 18px; }
  .composer { padding: 6px 8px 8px; gap: 6px; align-items: center; }
  .composer textarea { min-height: 42px; max-height: 120px; border-radius: 22px; padding: 10px 14px; font-size: 15px; }
  .emoji-btn { width: 36px; height: 36px; font-size: 20px; }
  .sched-btn { width: 36px; height: 36px; font-size: 18px; }
  .composer .btn.primary { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; font-size: 0; background: #00A884; box-shadow: none; }
  .composer .btn.primary::before { content: '➤'; font-size: 18px; color: #fff; }
  .qr-popup { left: 8px; right: 8px; }
}
/* dark mode on phones: WhatsApp's dark colours */
@media (max-width: 800px) {
  :root[data-theme="dark"] .avatar-circle { background: #3B4A54; color: #E9EDEF; }
  :root[data-theme="dark"] .chat-head { background: #202C33; }
  :root[data-theme="dark"] .msgs { background-color: #0B141A; background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px); }
  :root[data-theme="dark"] .msg.customer { background: #202C33; color: #E9EDEF; }
  :root[data-theme="dark"] .msg.staff, :root[data-theme="dark"] .msg.bot { background: #005C4B; color: #E9EDEF; }
  :root[data-theme="dark"] .msg.note { background: #4A3F12; color: #E9EDEF; }
  :root[data-theme="dark"] .msg .meta { color: #8696A0; }
}
@media (max-width: 800px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar-circle { background: #3B4A54; color: #E9EDEF; }
  :root:not([data-theme="light"]) .chat-head { background: #202C33; }
  :root:not([data-theme="light"]) .msgs { background-color: #0B141A; background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px); }
  :root:not([data-theme="light"]) .msg.customer { background: #202C33; color: #E9EDEF; }
  :root:not([data-theme="light"]) .msg.staff, :root:not([data-theme="light"]) .msg.bot { background: #005C4B; color: #E9EDEF; }
  :root:not([data-theme="light"]) .msg.note { background: #4A3F12; color: #E9EDEF; }
  :root:not([data-theme="light"]) .msg .meta { color: #8696A0; }
}
.pw-copy { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.pw-copy input { margin: 0; max-width: 260px; }

.test-mode { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line, #e3dfd3); }
.test-mode label { display: block; margin-bottom: 6px; }
.test-mode-row { gap: 8px; flex-wrap: wrap; }
.test-mode-row input { flex: 1; min-width: 220px; }

/* ---------- Fee reminders ---------- */
.rem-bubble { background: #D9FDD3; color: #111; border-radius: 12px; padding: 10px 14px; white-space: pre-wrap; margin: 0 0 14px; max-width: 560px; font-size: 14px; }
:root[data-theme="dark"] .rem-bubble { background: #005C4B; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rem-bubble { background: #005C4B; color: #fff; } }
.rem-skip td { color: var(--muted); }
.rem-batch { padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rem-batch:last-child { border-bottom: 0; }
.rem-batch.open { background: var(--panel-2); border-radius: 10px; padding: 12px; }
.rem-bar { height: 8px; background: var(--panel-2); border-radius: 99px; margin: 8px 0 6px; overflow: hidden; border: 1px solid var(--line); }
.rem-bar i { display: block; height: 100%; background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-radius: 99px; }
.pill.rem-running { color: #0a7a3f; } .pill.rem-paused { color: var(--warn); } .pill.rem-stopped { color: var(--bad); }
.rem-tpl { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rem-tpl:last-child { border-bottom: 0; }
.rem-pre { white-space: pre-wrap; font: inherit; font-size: 14px; margin: 8px 0; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
#remPreviewTable td:nth-child(5) { white-space: normal; min-width: 200px; }
#remDetailCard .tbl td:nth-child(4) { white-space: normal; min-width: 180px; }
#remList, #remText, #remTplText { font-family: inherit; }

.manual-note { margin-top: 6px; max-width: 640px; }

.pipe-search { min-width: 180px; max-width: 260px; flex: 0 1 auto; padding: 7px 14px; font-size: 14px; }


/* Pinned chats, WhatsApp-style formatting buttons */
.chat-item.pinned { background: var(--panel-2); }
.mic-btn { font: inherit; font-size: 18px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); cursor: pointer; flex: none; }
.mic-btn:hover { background: var(--panel-2); }
.fmt-btns { display: inline-flex; gap: 2px; margin-right: 4px; }
.fmt-btns button { font: inherit; font-size: 12px; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); cursor: pointer; }
.fmt-btns button:hover { background: var(--panel-2); }
.fmt-btns .fmt-b { font-weight: 800; } .fmt-btns .fmt-i { font-style: italic; } .fmt-btns .fmt-s { text-decoration: line-through; }
.msg code { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 4px; }

/* ---- Forms (QR code sign-up) ---- */
/* ---- Form editor (Google-Forms style): a header card, one open question card, the rest show a preview ---- */
.fm-editbar { margin-bottom: 12px; }
.fm-canvas { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 14px; align-items: start; }
.fm-main { min-width: 0; }
#fmQuestions { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.fm-hint { margin: 14px 4px 0; }
.fm-head { position: relative; padding: 22px 24px 18px; border-top: 10px solid var(--gold); }
.fm-head .fm-descimgs { margin-top: 14px; }
.fm-banner { margin: -22px -24px 18px; }
.fm-banner img { display: block; width: 100%; aspect-ratio: 4 / 1; object-fit: cover; }
.fm-banner-tools { padding: 10px 24px 0; }
.fm-banner-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--panel-2); border-bottom: 1px dashed var(--line); }
.fm-title { font-size: 28px; font-weight: 700; margin: 0; padding: 4px 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; width: 100%; }
.fm-desc { font-size: 14px; margin-top: 6px; padding: 4px 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; resize: none; min-height: 30px; width: 100%; }
.fm-title:hover, .fm-desc:hover, .fm-qdesc:hover, .fm-oinput:hover { border-bottom-color: var(--line); }
.fm-title:focus, .fm-desc:focus, .fm-qdesc:focus, .fm-oinput:focus { border-bottom: 2px solid var(--navy-2); box-shadow: none; outline: none; }
.fm-tools { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.fm-tool { width: 42px; height: 42px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fm-tool:hover { background: var(--panel-2); color: var(--text); }
.fm-tool svg { width: 24px; height: 24px; }
.fm-q { position: relative; padding: 22px 24px 16px; border-left: 6px solid transparent; cursor: pointer; transition: box-shadow .15s; }
.fm-q:hover { box-shadow: var(--shadow-lift); }
.fm-q.fm-active { border-left-color: var(--navy-2); box-shadow: var(--shadow-lift); cursor: default; }
.fm-q.fm-section { border-top: 8px solid var(--gold); }
.fm-pagehead { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy-2); padding: 3px 10px; border-radius: 6px; margin-bottom: 10px; }
.fm-handle { position: absolute; top: 0; left: 0; right: 0; height: 22px; display: flex; justify-content: center; align-items: center; color: var(--muted); cursor: grab; touch-action: none; user-select: none; opacity: .5; border-top-left-radius: inherit; border-top-right-radius: inherit; }
.fm-handle svg { width: 22px; height: 18px; transform: rotate(90deg); pointer-events: none; }
.fm-q:hover .fm-handle, .fm-q.fm-active .fm-handle { opacity: 1; }
.fm-handle:hover { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.fm-handle:active { cursor: grabbing; }
.fm-q.dragging { position: relative; z-index: 30; box-shadow: 0 18px 40px rgba(0,0,0,.22); transition: none; }
.fm-q.drop-before { box-shadow: 0 -4px 0 0 var(--gold); }
.fm-q.drop-after { box-shadow: 0 4px 0 0 var(--gold); }
.fm-qhead { display: flex; gap: 14px; align-items: flex-start; }
.fm-qtitle { flex: 1; min-width: 0; margin: 0; background: var(--panel-2); border: 0; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; padding: 13px 14px; font-size: 16px; font-weight: 500; }
.fm-qtitle:focus { border-bottom: 2px solid var(--navy-2); box-shadow: none; outline: none; }
.fm-qtype { width: 230px; flex-shrink: 0; margin: 0; padding: 12px 12px; border-radius: 8px; }
.fm-fixedtag { align-self: center; }
.fm-qdesc { margin-top: 10px; font-size: 13px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 6px 2px; width: 100%; }
.fm-qbody { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.fm-qbody input, .fm-qbody select, .fm-qbody textarea { margin-top: 0; }
.fm-opts { display: flex; flex-direction: column; gap: 2px; }
.fm-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.fm-oico { width: 24px; display: inline-flex; justify-content: center; color: var(--muted); flex-shrink: 0; }
.fm-oico svg { width: 20px; height: 20px; }
.fm-onum { font-size: 14px; }
.fm-oinput { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; padding: 7px 2px; margin: 0; font-size: 14px; }
.fm-oother { color: var(--muted); font-size: 14px; flex: 1; padding: 7px 2px; border-bottom: 1px dotted var(--line); }
.fm-x { opacity: 0; font-size: 14px; }
.fm-opt:hover .fm-x, .fm-opt:focus-within .fm-x { opacity: 1; }
.fm-addopt { gap: 6px; }
.fm-addopt .fm-oico { margin-right: 4px; }
.fm-link { border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; padding: 6px 2px; }
.fm-link:hover { color: var(--text); text-decoration: underline; }
.fm-link-blue { color: var(--accent); font-weight: 600; }
.fm-goto { display: flex; flex-direction: column; gap: 6px; }
.fm-goto:empty { display: none; }
.fm-goto-row select { width: auto; flex: 1; }
.fm-slots { display: flex; flex-direction: column; gap: 10px; }
.fm-slots label.mini { flex-direction: column; align-items: flex-start; gap: 4px; }
.fm-preview img { max-height: 180px; border-radius: 12px; margin-top: 6px; }
.fm-qfoot { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.fm-ib { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; }
.fm-ib svg { width: 22px; height: 22px; }
.fm-vsep { width: 1px; height: 28px; background: var(--line); margin: 0 10px; }
.fm-reqlbl { gap: 10px; margin: 0 6px 0 0; }
.fm-menu { position: absolute; right: 16px; bottom: 58px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; min-width: 260px; cursor: default; }
.fm-menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.fm-menu button:hover { background: var(--panel-2); }
.fm-menu button:disabled { opacity: .4; cursor: default; }
.fm-menu .tick { width: 18px; color: var(--ok); font-weight: 700; }
.fm-menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
/* closed cards: a grey preview of the question */
.fm-pvtitle { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-pvtag { font-size: 11px; }
.fm-pvdesc { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.fm-pvline { margin-top: 12px; border-bottom: 1px dotted var(--line); color: var(--muted); font-size: 13px; padding-bottom: 6px; width: 50%; }
.fm-pvline.wide { width: 100%; }
.fm-pvopt { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; margin-top: 2px; }
.fm-pv .fm-pvopt:first-of-type { margin-top: 10px; }
.fm-req { color: var(--bad); }
.fm-pvscale { display: flex; gap: 16px; align-items: flex-end; margin-top: 12px; font-size: 13px; flex-wrap: wrap; }
.fm-pvscale .n { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.fm-pvscale svg { width: 20px; height: 20px; }
.fm-pvgrid { margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.fm-pvgrid td, .fm-pvgrid th { padding: 6px 10px; text-align: center; font-weight: 500; }
.fm-pvgrid td.left { text-align: left; }
@media (max-width: 800px) {
  .fm-canvas { grid-template-columns: 1fr; }
  .fm-tools { position: fixed; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); flex-direction: row; z-index: 20; }
  .fm-q { padding: 20px 14px 12px 16px; }
  .fm-qhead { flex-direction: column; gap: 8px; }
  .fm-qtype { width: 100%; }
  .fm-title { font-size: 22px; }
  .fm-pvline { width: 100%; }
  .fm-x { opacity: 1; }
}
.fm-share { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.fm-share input { margin: 0; }
.fm-qr { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
@media (max-width: 720px) { .fm-share { grid-template-columns: 1fr; } .fm-qr { width: 160px; height: 160px; } }
.fm-notice { background: var(--panel-2); margin-top: 12px; }
.fm-notice input, .fm-notice select, .fm-notice textarea { margin-top: 4px; }
.fm-notice .chip { font-size: 12px; padding: 3px 9px; }
.fm-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.fm-stat { margin: 0; }
.fm-stat h4 { margin: 0; }
.fm-samples { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.fm-samples li { margin-bottom: 4px; }
.fm-resp .fm-row { cursor: pointer; }
.fm-resp .fm-row:hover td { background: var(--panel-2); }
.fm-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.fm-dialog { width: min(640px, 94vw); }
.fm-dialog-body { max-height: 65vh; overflow: auto; margin-top: 10px; }
.fm-crop-dialog { width: auto; max-width: 94vw; }
.fm-crop-dialog .fm-dialog-body { max-height: none; overflow: visible; }
.fm-crop-stage { position: relative; margin: 0 auto; overflow: hidden; background: #f3d6e4; border-radius: 6px; user-select: none; touch-action: none; }
.fm-crop-img { display: block; width: 100%; height: 100%; }
.fm-crop-box { position: absolute; cursor: move; outline: 1px solid rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 0 9999px rgba(255,255,255,.55); touch-action: none; }
.fm-crop-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 1px solid #333; }
.fm-crop-h.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.fm-crop-h.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.fm-crop-h.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.fm-crop-h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.fm-crop-tools { justify-content: center; margin-top: 14px; }
.fm-crop-tool { font-size: 20px; width: 40px; height: 40px; }
.fm-ans { padding: 8px 0; border-bottom: 1px solid var(--line); }
.fm-ans-text { white-space: pre-wrap; word-break: break-word; }
.fm-panel { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fm-panel .btn { justify-content: flex-start; text-align: left; }

.fm-descimgs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.fm-descimg { position: relative; display: inline-block; }
.fm-descimg img { height: 90px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.fm-descimg .icon-btn { position: absolute; top: -8px; right: -8px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; width: 24px; height: 24px; }

/* ---- Search inside a chat ---- */
.chat-search { display: none; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-view.show-search .chat-search { display: flex; }
.chat-search input { flex: 1; margin: 0; padding: 7px 12px; border-radius: 999px; }
.chat-search .count { min-width: 44px; text-align: center; white-space: nowrap; }
.msg.search-hit { outline: 2px solid var(--gold-2); }
.msg.search-cur { outline-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 174, 75, .35); }

/* ---- Settings → Stickers ---- */
.sticker-grid.admin { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.sticker-cell { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel-2); text-align: center; }
.sticker-cell img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.sticker-cell .sticker-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.sticker-cell .row { justify-content: center; margin-top: 6px; }

/* Team → Google Drive steps */
.drive-steps { margin: 6px 0 16px; padding-left: 22px; display: grid; gap: 14px; }
.drive-steps li > p { margin: 2px 0 8px; }
.drive-steps form input { flex: 1; min-width: 220px; margin: 0; }

/* Forms → Responses → Edit answer */
.fm-edit-row { display: grid; gap: 6px; }
.fm-edit-row select, .fm-edit-row input:not([type=checkbox]), .fm-edit-row textarea { margin: 0; }
.fm-edit-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fm-edit-grid { display: grid; gap: 8px; }
.fm-edit-bad { border-left: 3px solid var(--bad, #B83A33); padding-left: 10px; }
.fm-edit-err { color: var(--bad, #B83A33); margin: 0; }

/* ---- 数据: own start / end dates ---- */
.ins-range { align-items: center; gap: 6px; flex-wrap: nowrap; }
.ins-range input[type=date] { width: auto; margin: 0; border-radius: 999px; padding: 7px 12px; background: var(--panel); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }
.lc-staff-title { margin: 18px 0 2px; }
.ins-tabs { margin: 10px 0 0; }
.lc-remark { margin-top: 10px; font-weight: 600; }

/* ---- "A new version is ready" bar ---- */
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px; background: var(--navy, #0B3D91); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }

/* ---- Team → Google Drive: monthly report ---- */
.monthly-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.monthly-box h4 { margin: 0 0 4px; }
.monthly-list { margin: 8px 0; padding-left: 18px; }
.monthly-list li { margin: 4px 0; }
.warn-text { color: var(--warn); font-weight: 600; }

/* ---- 数据: coloured tables (paintTable in app.js) ---- */
.tbl.tbl-color { border-collapse: separate; border-spacing: 4px 4px; font-size: 14px; }
.tbl.tbl-color th { color: #fff; font-size: 13px; font-weight: 700; text-align: center; padding: 10px 12px; border: 0; border-radius: 8px 8px 0 0; background: #5B7290; border-top: 4px solid rgba(255,255,255,.35); white-space: nowrap; }
.tbl.tbl-color th.c-first { background: #12305E; text-align: left; border-top-color: rgba(255,255,255,.15); }
.tbl.tbl-color td { border: 0; text-align: center; padding: 10px 12px; background: color-mix(in srgb, var(--text) 5%, transparent); font-variant-numeric: tabular-nums; }
.tbl.tbl-color tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--text) 9%, transparent); }
.tbl.tbl-color td:first-child { text-align: left; font-weight: 700; background: color-mix(in srgb, var(--text) 13%, transparent); }
.tbl.tbl-color td.kw { text-align: left; }
.tbl.tbl-color td.zero { color: color-mix(in srgb, var(--text) 32%, transparent); }
.tbl.tbl-color tbody tr:hover td { background: color-mix(in srgb, var(--gold-2) 22%, transparent); }
.tbl.tbl-color tr.total-row td { border-top: 0; font-weight: 800; background: color-mix(in srgb, var(--gold-2) 30%, transparent); }
.tbl.tbl-color td[colspan] { text-align: center; font-weight: 500; }
.tbl.tbl-color .c-red { background: #D94F5C; }
.tbl.tbl-color .c-purple { background: #7A4FB5; }
.tbl.tbl-color .c-green { background: #2E9E62; }
.tbl.tbl-color .c-amber { background: #E5A126; }
.tbl.tbl-color .c-blue { background: #2F86D6; }
.tbl.tbl-color .c-pink { background: #D2558C; }
.tbl.tbl-color .c-teal { background: #1A9E98; }
.tbl.tbl-color .c-indigo { background: #4D5BD1; }
.tbl.tbl-color .c-orange { background: #E57A2E; }
.tbl.tbl-color .c-gold { background: #C99A1E; }
.tbl.tbl-color .c-gold2 { background: #9A6B07; }
.tbl.tbl-color .c-slate { background: #5B7290; }
:root[data-theme="dark"] .tbl.tbl-color th.c-first { background: #2D558F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tbl.tbl-color th.c-first { background: #2D558F; } }
.media-note.media-blocked { color: #B3261E; font-weight: 600; background: rgba(179, 38, 30, .08); border: 1px dashed #B3261E; border-radius: 10px; padding: 8px 10px; white-space: normal; }

/* HR copy: inside the HR website, the website's left menu lists our pages (body.embedded-menu), so our rail is hidden */
body.embedded-menu .rail { display: none; }
@media (max-width: 800px) { body.embedded-menu main { padding-bottom: 32px; } }
/* HR copy: Home, Insights and Forms are not used (owner's decision 2026-11-03) */
#nav > button[data-tab="home"], #nav > button[data-tab="insights"], #nav > button[data-tab="forms"] { display: none !important; }
