/* LeadGen.agi: black, gold and dark brown. Light = warm ivory with deep gold; dark = near-black with gold. */
:root {
  --bg: #f5f0e7; --panel: #fffdf8; --ink: #1d150d; --muted: #5d5042; --line: #e4d8c5; --soft: #efe6d8; --hover: #f3ead9;
  --brand: #94681c; --brand-2: #6b4423; --on-brand: #ffffff; --danger: #b2412f; --ok: #3f7f33; --sel: #f0dfb6;
  --side: #ebdfca; --side-line: #d9c8ab; --side-hover: #e2d3b9; --side-sel: #d8c193;  /* the sidebar: a soft tan, for contrast */
  --shadow: 0 4px 16px rgba(60, 40, 15, .10); --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1d1914; --panel: #26211b; --ink: #f8f1e4; --muted: #cbbca8; --line: #40372c;
    --soft: #2e2820; --hover: #352e25; --sel: #4a3a20; --brand: #d4a64a; --brand-2: #a0703c; --on-brand: #1a130b;
    --danger: #d9705c; --ok: #7fbf6e; --shadow: 0 8px 28px rgba(0,0,0,.5);
    --side: #221d17; --side-line: #40372c; --side-hover: #2f281f; --side-sel: #4a3a20; }
}
:root[data-theme="dark"] { --bg: #1d1914; --panel: #26211b; --ink: #f8f1e4; --muted: #cbbca8; --line: #40372c;
    --soft: #2e2820; --hover: #352e25; --sel: #4a3a20; --brand: #d4a64a; --brand-2: #a0703c; --on-brand: #1a130b;
    --danger: #d9705c; --ok: #7fbf6e; --shadow: 0 8px 28px rgba(0,0,0,.5);
    --side: #221d17; --side-line: #40372c; --side-hover: #2f281f; --side-sel: #4a3a20; }
.theme-switch { display: inline-flex; background: var(--soft); border-radius: 8px; padding: 2px; }
.theme-switch button { border: 0; background: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.theme-switch button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input, select, textarea, td, th, li, p, span, a, label { font-weight: inherit; }  /* a touch bolder everywhere (500) */
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.logo { width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 5px rgba(212, 166, 74, .35)); }
.logo.big { width: 92px; height: 92px; margin: 0 auto 10px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; padding: 11px; margin-top: 18px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.small { padding: 3px 8px; font-size: 13px; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 5px; }
.error { color: var(--danger); margin: 12px 0 0; }

/* ---------- login ---------- */
.login-page { display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand) 18%, var(--bg)), var(--bg) 60%); }
.login-card { width: min(380px, 100%); background: var(--panel); border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-logo { display: block; width: min(230px, 70%); margin: -6px auto 6px; border-radius: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-card label, .login-card input { text-align: left; width: 100%; }

/* ---------- app layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.mainwrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 6px 16px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .who { text-align: right; line-height: 1.15; margin-left: 6px; } .topbar .who b { font-size: 13.5px; }
.topbar .btn.ghost { padding: 5px 8px; } .topbar .theme-switch { margin-right: 4px; }
.side { background: var(--side, var(--panel)); border-right: 1px solid var(--side-line, var(--line)); display: flex; flex-direction: column; min-height: 0; }
.side-top { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--side-line, var(--line)); }
.side-top b { font: 600 19px/1.1 "Bodoni MT", "Didot", Georgia, serif; letter-spacing: .01em; color: var(--brand); }
.side-top .logo { width: 42px; height: 42px; }
.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 10px 6px;
  display: flex; justify-content: space-between; align-items: center; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; color: inherit; text-decoration: none; cursor: pointer; }
.nav a:hover { background: var(--side-hover, var(--hover)); }
.nav a.on { background: var(--side-sel, var(--sel)); font-weight: 600; }
.nav .ic { width: 16px; text-align: center; color: var(--muted); flex: none; }
.add { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center;
  font-weight: 700; font-size: 12.5px; flex: none; }
.main { flex: 1; overflow: auto; min-width: 0; background: var(--bg); }
/* dark mode: the frame (sidebar, top bar) stays deep; the main window is a little lighter and less brown */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) .main, :root:not([data-theme="light"]) .drawer-in { --bg: #2a2621; --panel: #332e28; --soft: #3b352e; --hover: #403930; --line: #4d453b; --sel: #4f4128; }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] .main, :root[data-theme="dark"] .drawer-in { --bg: #2a2621; --panel: #332e28; --soft: #3b352e; --hover: #403930; --line: #4d453b; --sel: #4f4128; }
.page { padding: 22px 28px 60px; }

/* ---------- board header ---------- */
.board-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.board-h h1 { margin: 0; font-size: 26px; font-weight: 600; }
.board-h .desc { color: var(--muted); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 9px; border-radius: 999px;
  background: var(--soft); color: var(--muted); margin-left: 8px; vertical-align: middle; font-weight: 500; }
.pill.view { background: #fff3d6; color: #8a6100; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 14px; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { width: 220px; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- board table ---------- */
.group { margin-bottom: 26px; }
.group-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; cursor: pointer; user-select: none; }
.group-h h2 { margin: 0; font-size: 17px; font-weight: 600; }
.group-h .n { color: var(--muted); font-size: 13px; }
.group-h .chev { transition: transform .15s; }
.group.closed .chev { transform: rotate(-90deg); } .group.closed .tbl-wrap { display: none; }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
table.board { border-collapse: separate; border-spacing: 0; min-width: 100%; background: var(--panel); }
table.board th, table.board td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 33px; padding: 0; }
table.board th { font-weight: 500; color: var(--muted); font-size: 13.5px; padding: 0 10px; background: var(--panel); text-align: center; white-space: nowrap; }
table.board th:first-child, table.board td:first-child { position: sticky; left: 0; z-index: 2; background: var(--panel);
  border-left: 6px solid var(--gc, var(--brand)); }
table.board th:first-child { text-align: left; z-index: 3; }
table.board tr:hover td { background: var(--hover); }
td .cell { display: flex; align-items: center; height: 38px; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
td.center .cell { justify-content: center; }
td.lead .cell { gap: 8px; justify-content: space-between; }
td.lead .name { overflow: hidden; text-overflow: ellipsis; }
td.lead .open { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15.5px; opacity: .6; }
td.lead .open:hover { opacity: 1; color: var(--brand); }
td.editable { cursor: text; }
table.board td.label { cursor: pointer; padding: 3px 4px; }
td.label .cell { justify-content: center; color: #fff; font-weight: 600; height: 31px; border-radius: 6px;  /* a slightly raised button */
  background-image: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.05) 50%, rgba(0,0,0,.10));
  box-shadow: 0 1px 2px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.32), inset 0 -2px 0 rgba(0,0,0,.16);
  text-shadow: 0 1px 1px rgba(0,0,0,.28); transition: filter .12s; }
td.label:hover .cell { filter: brightness(1.07); }
td.label.empty .cell { color: transparent; background-image: none; box-shadow: none; }
td input.inline { width: 100%; height: 37px; border: 2px solid var(--brand); border-radius: 0; padding: 0 8px; }
td.phone a { color: var(--brand); text-decoration: none; }
tr.add-row td { color: var(--muted); }
tr.add-row td .cell { cursor: pointer; } tr.add-row td .cell:hover { color: var(--brand); }
.empty-board { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- popovers, dialogs, drawer ---------- */
.pop { position: fixed; z-index: 50; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 8px; display: grid; gap: 5px; min-width: 170px; }
.pop button { border: 0; border-radius: 6px; padding: 7px 10px; color: #fff; cursor: pointer; font-weight: 600; text-align: center;
  background-image: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.05) 50%, rgba(0,0,0,.10));
  box-shadow: 0 1px 2px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.32), inset 0 -2px 0 rgba(0,0,0,.16);
  text-shadow: 0 1px 1px rgba(0,0,0,.28); }
.pop button:hover { filter: brightness(1.07); }
.pop button.clear { background: var(--soft); color: var(--muted); box-shadow: none; text-shadow: none; }
.veil { position: fixed; inset: 0; background: rgba(15, 18, 40, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--panel); border-radius: 14px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 24px; box-shadow: var(--shadow); }
.dialog h2 { margin: 0 0 4px; font-size: 19px; }
.dialog input, .dialog select, .dialog textarea { width: 100%; }
.dialog input[type=checkbox], .dialog input[type=radio] { width: auto; }
.dialog .li input.grow { width: auto; }
.dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; cursor: pointer; font-weight: 400; }
.choice input { width: auto; margin-top: 3px; }
.list { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.list .li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list select { width: auto; padding: 5px 8px; }
.copy { display: flex; gap: 6px; } .copy input { flex: 1; }
.drawer { position: fixed; inset: 0; background: rgba(15, 18, 40, .35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer-in { width: min(600px, 100%); height: 100%; overflow-y: auto; background: var(--panel); padding: 24px 26px; }
.drawer-in h2 { margin: 0; font-size: 21px; }
.fields { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 18px 0; align-items: center; }
.fields .k { color: var(--muted); font-size: 13.5px; }
.fields input, .fields select, .fields textarea { width: 100%; }
.fields textarea { min-height: 90px; resize: vertical; }
.log { border-left: 2px solid var(--line); margin: 10px 0 0 6px; padding-left: 14px; }
.log p { margin: 0 0 10px; font-size: 13.5px; } .log time { color: var(--muted); font-size: 12.5px; display: block; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; background: var(--soft); color: var(--muted); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel);
  padding: 9px 16px; border-radius: 8px; z-index: 60; box-shadow: var(--shadow); }
.people td, .people th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.people { border-collapse: collapse; width: 100%; background: var(--panel); border-radius: var(--radius); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .side { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-block; }
  .page { padding: 16px; }
  .topbar { padding: 5px 8px; gap: 2px; } .topbar .who { display: none; } .topbar .theme-switch button { padding: 3px 6px; }
  .toolbar input[type=search] { width: 100%; }
  .fields { grid-template-columns: 1fr; }
}

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-head h2 { margin: 0 6px; font-size: 18px; min-width: 150px; text-align: center; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--line); gap: 1px; min-width: 770px; }
.cal-w { background: var(--soft); color: var(--muted); font-size: 12.5px; text-align: center; padding: 6px 0; font-weight: 600; }
.cal-day { background: var(--panel); min-height: 104px; padding: 4px 5px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.other { background: var(--bg); } .cal-day.other .cal-n { opacity: .45; }
.cal-n { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal-day.today .cal-n { background: var(--brand); color: var(--on-brand); border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; }
.cal-ev { border: 0; border-left: 3px solid var(--ec); background: color-mix(in srgb, var(--ec) 14%, var(--panel)); color: var(--ink);
  border-radius: 4px; padding: 2px 5px; font-size: 12.5px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { filter: brightness(1.05); outline: 1px solid var(--ec); }

/* ---------- kanban ---------- */
.kan-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.lane { flex: 0 0 250px; background: var(--soft); border-radius: 10px; border-top: 4px solid var(--lc); }
.lane.over { outline: 2px dashed var(--lc); }
.lane h3 { display: flex; justify-content: space-between; margin: 0; padding: 10px 12px; font-size: 14.5px; }
.lane h3 .n { color: var(--muted); font-weight: 500; }
.lane-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; min-height: 40px; }
.card { background: var(--panel); border-radius: 8px; padding: 9px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); cursor: pointer; border: 1px solid var(--line); }
.card[draggable=true] { cursor: grab; } .card.dragging { opacity: .45; }
.card b { display: block; margin-bottom: 2px; }

/* ---------- chart ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile span { color: var(--muted); font-size: 13px; display: block; } .tile b { font-size: 26px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.chart-card h3 { margin: 0 0 10px; font-size: 14.5px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.bar-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar { background: var(--soft); border-radius: 4px; height: 14px; overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 4px; }
.bar-n { text-align: right; font-weight: 600; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 275px); min-height: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-page .chat { height: calc(100vh - 195px); margin-top: 14px; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.chat-empty { text-align: center; margin: auto; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--soft); border-radius: 14px 14px 14px 4px; padding: 8px 11px; min-width: 0; }
.msg.mine .bubble { background: color-mix(in srgb, var(--brand) 22%, var(--panel)); border-radius: 14px 14px 4px 14px; }
.bubble .who { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-bottom: 2px; }
.bubble .txt { white-space: pre-wrap; word-break: break-word; }
.bubble img, .bubble video { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 10px; margin: 2px 0 4px; }
.msg.mine .bubble img, .msg.mine .bubble video, .msg.mine .bubble audio { margin-left: auto; }  /* my photos / videos sit on the right, like my messages */
.bubble audio { max-width: 260px; margin: 2px 0 4px; }
.bubble .file { display: inline-block; padding: 6px 10px; background: var(--panel); border-radius: 8px; color: var(--brand); text-decoration: none; margin-bottom: 4px; }
.bubble .meta { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11.5px; padding: 0; text-decoration: underline; }
/* message buttons: small, rounded, easy to tap; the date and time easy to read */
.bubble .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bubble .meta time { font-size: 13px; font-weight: 600; color: var(--muted); }
.mbtns { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.mbtn { border: 1px solid var(--line); background: var(--soft); color: var(--muted); border-radius: 999px; padding: 2px 9px;
  font-size: 12.5px; line-height: 1.5; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.mbtn:hover { background: var(--hover); color: var(--ink); border-color: var(--brand); }
.mbtn.danger:hover { color: var(--danger); border-color: var(--danger); }
.unread-line { display: flex; align-items: center; gap: 10px; color: var(--brand); font-size: 12.5px; font-weight: 700; margin: 4px 0; }
.unread-line::before, .unread-line::after { content: ""; flex: 1; border-top: 1px solid var(--brand); opacity: .6; }
.chat-pick { padding: 6px 14px; border-top: 1px solid var(--line); }
.chat-send { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-send textarea { flex: 1; resize: none; max-height: 140px; }
.chat-send .attach { font-size: 18px; padding: 6px 8px; cursor: pointer; }
@media (max-width: 860px) {
  .chat, .chat-page .chat { height: calc(100vh - 215px); }
  .msg { max-width: 92%; }
  .lane { flex-basis: 78vw; }
  .tabs { overflow-x: auto; } .tabs button { white-space: nowrap; }
}

/* ---------- AI performance dashboard inside the CRM ---------- */
.perf-wrap { position: relative; height: 100%; }
.perf-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.perf-menu { position: absolute; top: 8px; left: 8px; z-index: 5; background: var(--panel); }

/* ---------- @tags + voice notes in chat ---------- */
.mention { color: var(--brand); font-weight: 600; background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 4px; padding: 0 2px; }
.mention.me { color: #b06a00; background: #fdab3d33; }
.chat-send { position: relative; }
.mention-pop { position: absolute; left: 10px; bottom: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: grid; min-width: 240px; z-index: 20; }
.mention-pop button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.mention-pop button:hover { background: var(--hover); }
.attach.recording { color: #fff; background: #e2445c; font-size: 13.5px; }
/* ---------- selecting leads (dots), bulk bar, right-click & column menus ---------- */
table.board th.sel, table.board td.sel { width: 34px; min-width: 34px; max-width: 34px; text-align: center; padding: 0; }
table.board th.lead-h, table.board td.lead { position: sticky; left: 40px; z-index: 2; background: var(--panel); }
table.board th.lead-h { z-index: 3; text-align: left; }
input.selbox { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 2px solid var(--muted);
  border-radius: 50%; cursor: pointer; vertical-align: middle; opacity: .45; background: var(--panel); }
tr:hover input.selbox, input.selbox:checked, input.selbox.some, th input.selbox { opacity: 1; }
input.selbox:checked { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 3px var(--panel); }
input.selbox.some { border-color: var(--brand); background: linear-gradient(var(--brand), var(--brand)) center / 8px 2px no-repeat var(--panel); }
table.board tr.selected td.sel, table.board tr.selected td.lead, table.board tr.selected td:not(.label) { background: var(--sel); }
.bulkbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; gap: 8px;
  align-items: center; flex-wrap: wrap; justify-content: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; max-width: calc(100vw - 32px); }
.bulkbar .btn.danger { color: var(--danger); }
.pop.ctx { padding: 5px; min-width: 200px; display: block; }
.pop.ctx button { display: block; width: 100%; background: none; color: var(--ink); text-align: left; font-weight: 400; padding: 8px 10px; }
.pop.ctx button:hover { background: var(--hover); }
.pop.ctx button.danger { color: var(--danger); }
th .colmenu { border: 0; background: none; color: var(--muted); cursor: pointer; margin-left: 6px; opacity: 0; padding: 0 3px; font-size: 14.5px; }
th:hover .colmenu { opacity: 1; }

/* a little bigger text in the main area (the sidebar stays as it is) */
#main { font-size: 15.5px; }
#main table.board th { font-size: 14.5px; }
#main .toolbar input, #main .toolbar select, #main .toolbar .btn { font-size: 15px; }
#main .small, #main .toolbar .count { font-size: 14px; }
#main .bubble .txt { font-size: 15.5px; }

/* ---------- chat: replies, profiles, private messages, update note ---------- */
.quote { border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent);
  border-radius: 6px; padding: 4px 8px; margin: 2px 0 6px; font-size: 13.5px; cursor: pointer; max-width: 100%; overflow: hidden; }
.quote b { display: block; color: var(--brand); font-size: 12.5px; }
.quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.msg.flash .bubble { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); transition: box-shadow .3s; }
.reply-bar { margin: 0 12px 6px; padding: 6px 10px; border-left: 3px solid var(--brand); background: var(--soft);
  border-radius: 6px; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .avatar[data-profile], .bubble .who[data-profile], .click[data-profile] { cursor: pointer; }
.avatar.pic { object-fit: cover; padding: 0; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11.5px; }
.profile-top { display: flex; gap: 16px; align-items: center; }
.profile-top h2 { margin: 0 0 2px; }
.pstatus { margin-top: 6px; font-size: 14.5px; }
.pabout { margin: 12px 0 4px; white-space: pre-wrap; }
.profile textarea { width: 100%; }
.dm-h { font-size: 15.5px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.dm-list { display: grid; gap: 6px; max-width: 760px; }
.dm-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; color: inherit; text-decoration: none; }
.dm-row:hover { background: var(--hover); }
.dm-main { min-width: 0; flex: 1; }
.dm-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-people { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); color: inherit; text-decoration: none; }
.dm-chip:hover { background: var(--hover); }
.dm-head { display: flex; gap: 12px; align-items: center; }
.update-note { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 45; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px; padding: 6px 8px 6px 16px;
  display: flex; gap: 8px; align-items: center; font-size: 14.5px; max-width: calc(100vw - 32px); }

/* ---------- sidebar numbers: 🔵 unread chats / messages, 🟢 new leads ---------- */
.nav a { position: relative; }
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #2a78d6;
  color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.nbadge.green { background: #00a35c; }
.nbadge.inline { margin-left: 6px; }
.nbadge[hidden] { display: none; }

/* ---------- 🏆 AI Lounge scoreboard (fixed, next to the chat) ---------- */
.lounge-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }  /* wider side: scoreboard + Rey */
.lounge-wrap #chatBox { min-width: 0; }
.scoreboard { position: sticky; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 12px 10px; font-size: 13.5px; box-shadow: var(--shadow); }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 2px; }
.sc-head b { font-size: 15.5px; }
.sc-nav { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sc-nav .btn { padding: 0 6px; min-height: 0; line-height: 20px; }
.sc-cal { width: 100%; border-collapse: collapse; margin: 8px 0 6px; table-layout: fixed; }
.sc-cal th { font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 2px 0; text-align: center; line-height: 1.15; }
.sc-cal th:first-child { width: 64px; }
.sc-cal th.today { color: var(--brand); }
.sc-cal td { text-align: center; padding: 2px 1px; position: relative; }
.sc-cal td.sc-name { text-align: left; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sc-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--soft);
  font-weight: 700; font-size: 12.5px; }
.sc-cal td.today .sc-n { outline: 2px solid var(--brand); outline-offset: 1px; }
.sc-cal td.future .sc-n { background: transparent; border: 1px dashed var(--line); }
.sc-hi { position: absolute; top: -3px; right: 0; font-style: normal; font-size: 10.5px; }
.sc-week b { font-size: 15.5px; }
.sc-stats { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.sc-stat { display: grid; gap: 1px; font-size: 12.5px; }
@media (max-width: 1000px) {
  .lounge-wrap { grid-template-columns: 1fr; }
  .scoreboard { position: static; order: -1; }
}
.lounge-wrap .scoreboard { margin-top: 14px; }

/* emoji reactions under a chat message + the picker */
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 1px; }
.reacts:empty { display: none; }
.rx { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 1px 8px; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.rx b { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rx.mine { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--panel)); }
.rx.mine b { color: var(--brand); }
.rx:hover { background: var(--hover); }
.react-pop { position: fixed; z-index: 80; display: flex; flex-wrap: wrap; gap: 2px; max-width: calc(100vw - 16px);
  padding: 5px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.react-pop button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 5px; border-radius: 50%; cursor: pointer;
  transition: transform .1s; }
.react-pop button:hover { background: var(--hover); transform: scale(1.18); }

/* ---------- Outreach (campaigns, contacts, Rey's reply desk, calls) ---------- */
.outreach .o-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 14px; border-bottom: 1px solid var(--line); }
.o-tabs a { padding: 8px 12px; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.o-tabs a.on { color: var(--ink); background: var(--soft); font-weight: 600; }
.o-test { background: color-mix(in srgb, #fdab3d 18%, var(--panel)); border: 1px solid #fdab3d; color: var(--ink); padding: 8px 12px; border-radius: 8px; margin: 8px 0 12px; font-weight: 600; font-size: 13.5px; }
.o-warn { background: color-mix(in srgb, var(--danger) 12%, var(--panel)); border: 1px solid var(--danger); padding: 8px 12px; border-radius: 8px; margin: 8px 0 12px; font-size: 13.5px; }
.o-warnline { color: var(--danger); font-size: 13.5px; }
.o-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.o-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.o-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.o-card h3 { margin: 0 0 10px; font-size: 15.5px; } .o-card h4 { margin: 12px 0 4px; font-size: 14px; }
.o-card label, .outreach .o-grid2 > div > label { display: block; margin: 8px 0; font-size: 13.5px; color: var(--muted); }
.o-card input, .o-card select, .o-card textarea, .o-toolbar input, .o-toolbar select, .o-map select { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; margin-top: 3px; }
.o-card textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.o-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; } .o-inline label { flex: 1 1 120px; }
.o-check label { display: inline-flex !important; gap: 6px; align-items: center; margin: 3px 10px 3px 0 !important; color: var(--ink) !important; }
.o-check input { width: auto !important; margin: 0 !important; }
.o-row { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.o-row:last-child { border-bottom: 0; }
.o-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.o-toolbar input, .o-toolbar select { width: auto; min-width: 160px; margin: 0; }
.o-table { width: 100%; border-collapse: collapse; font-size: 13.5px; } .o-table th, .o-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.o-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; } .o-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.o-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; } .o-head h2 { margin: 0; font-size: 19px; }
.o-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.o-card .o-actions { margin-left: 0; }
.o-map { display: flex !important; gap: 10px; align-items: center; } .o-map select { width: 60%; margin: 0; }
.o-bar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: 13.5px; margin: 5px 0; }
.o-bar div { background: var(--soft); border-radius: 6px; height: 14px; overflow: hidden; } .o-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; }
.o-bar b { text-align: right; font-variant-numeric: tabular-nums; } .o-bar small { color: var(--muted); font-weight: 400; }
.o-step { background: var(--soft); }
.o-pre { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; background: var(--soft); padding: 10px; border-radius: 8px; }
.o-mail { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 8px 0; }
.o-click { cursor: pointer; } .o-click:hover { outline: 2px solid var(--brand); }
.o-desk { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 14px; min-height: 60vh; }
.o-convs { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: auto; max-height: 78vh; padding: 8px; }
.o-conv { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.o-conv.on, .o-conv:hover { background: var(--hover); } .o-snip { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-thread { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 14px; overflow: auto; max-height: 78vh; }
.o-msgs { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 16px; }
.o-msg { max-width: 80%; padding: 9px 12px; border-radius: 12px; background: var(--soft); } .o-msg.out { align-self: flex-end; background: color-mix(in srgb, var(--brand) 16%, var(--panel)); }
.o-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; margin-top: 3px; }
.o-compose textarea { width: 100%; box-sizing: border-box; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.o-audit { max-height: 360px; overflow: auto; }
@media (max-width: 760px) { .o-desk { grid-template-columns: 1fr; } .o-bar { grid-template-columns: 90px 1fr 70px; } }

/* My phone lines (phone.js) */
.ph-lines { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-line { border-left: 5px solid var(--lc, var(--brand)); padding: 9px 14px; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.ph-ac { background: var(--soft); color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: 12.5px; }
.ph-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.ph-dot.on { background: var(--ok); }
.ph-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.ph-status { padding: 8px 12px; border-radius: 8px; margin: 8px 0 12px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel); }
.ph-status.ok { border-color: var(--ok); }
.ph-calls audio { height: 34px; max-width: 260px; }
.ph-calls textarea { width: 100%; min-width: 140px; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; resize: vertical; }
@media (max-width: 700px) { .ph-calls audio { max-width: 180px; } }
.o-card textarea.o-write { font-family: inherit; font-size: 15px; line-height: 1.55; padding: 10px 12px; }

/* Rey's page (rey.js) */
.rey-head { display: flex; align-items: center; gap: 14px; } .rey-head h1 { margin: 0; }
.rey-voice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rey-voice audio { height: 32px; max-width: 220px; }
.o-check-inline { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 500; }
.o-check-inline input { width: auto !important; margin: 0 !important; }
.rey-item { display: flex; align-items: center; gap: 8px; } .rey-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rey-text { max-height: 70vh; overflow: auto; }

/* AI Lounge side column: scoreboard + Rey's brief */
.lounge-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 12px; margin-top: 14px;
  max-height: calc(100vh - 150px); overflow-y: auto; }
.lounge-side .scoreboard { position: static; margin-top: 0; }
@media (max-width: 1000px) { .lounge-side { position: static; order: -1; max-height: none; overflow: visible; } }
.rey-brief .rb-body { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.rb-sec b { display: block; font-size: 13px; margin-bottom: 2px; } .rb-line { font-size: 13px; color: var(--ink); line-height: 1.4; }
.rb-sec + .rb-sec { border-top: 1px dashed var(--line); padding-top: 6px; }
.rb-chat { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.rb-msg { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 5px 8px; } .rb-msg span { font-weight: 700; }
.rb-msg.mine { background: var(--sel); align-self: flex-end; } .rb-msg audio { display: block; height: 30px; max-width: 100%; margin-top: 4px; }
.rb-ask { display: flex; gap: 6px; margin-top: 8px; } .rb-ask input { flex: 1; min-width: 0; padding: 6px 9px; }

/* Closer updates (#/closers) */
.cl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cl-row .cl-actions { margin-left: auto; display: flex; gap: 6px; }
.cl-add { display: flex; gap: 8px; margin-top: 12px; } .cl-add input { flex: 1; }
.closers-page .o-table audio { width: 220px; height: 34px; }
.closers-page .o-card b { display: inline; }
.closers-page a.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.closers-page .o-table td { vertical-align: middle; }

/* no automatic refresh: new chat messages wait behind this chip (tap to go down) */
.chat { position: relative; }
.new-chip { position: absolute; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 5; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2, #6b4423)); color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.rb-new { margin-left: auto; }

/* ---------- chat v2: hover emoji bar, emoji & sticker panels, camera, edit, big emojis, stickers ---------- */
.hover-react { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: pop .14s ease-out; }
.hover-react button { border: 0; background: none; font-size: 21px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  transition: transform .12s ease, background .12s; }
.hover-react button:hover { transform: translateY(-3px) scale(1.25); background: var(--soft, rgba(0,0,0,.05)); }
.hover-react .more { font-size: 18px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.92); } to { opacity: 1; transform: none; } }
.react-pop { max-width: min(360px, 92vw); flex-wrap: wrap; max-height: 260px; overflow-y: auto; }
.chat-panel { position: absolute; bottom: calc(100% + 8px); left: 8px; z-index: 30; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 8px; animation: pop .14s ease-out; max-width: min(420px, 94vw); }
.chat-send { position: relative; }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; overflow-x: hidden; }
.emoji-grid button { border: 0; background: none; font-size: 22px; padding: 4px; border-radius: 8px; cursor: pointer; transition: transform .1s; }
.emoji-grid button:hover { transform: scale(1.3); background: var(--soft, rgba(0,0,0,.05)); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 280px; overflow-y: auto; }
.sticker-grid button { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .12s, box-shadow .12s; }
.sticker-grid button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.sticker-grid span { font-size: 30px; } .sticker-grid small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.msg .txt.jumbo { font-size: 40px; line-height: 1.15; }
.sticker { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 14px 8px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--brand-2) 10%, transparent));
  animation: pop .25s ease-out; }
.sticker .st-e { font-size: 58px; line-height: 1.1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
.sticker .st-t { font-weight: 800; font-size: 14.5px; letter-spacing: .02em; }
.meta .edited { font-size: 11.5px; color: var(--muted); font-style: italic; margin-left: 6px; }
.edit-box textarea { width: 100%; min-width: 220px; border-radius: 10px; border: 1px solid var(--line); padding: 8px; font: inherit;
  background: var(--bg); color: var(--ink); }
.edit-box .row { display: flex; gap: 6px; justify-content: flex-end; margin: 6px 0; }
.cam-view, .dialog canvas { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }
.pfact { display: inline-block; margin: 0 8px 6px 0; padding: 4px 10px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.05)); font-size: 13.5px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .pgrid label { display: block; }
.pgrid input, .pgrid select { width: 100%; }
.rb-mic.recording, #rec.recording { background: #d4433a; color: #fff; animation: pulse 1.2s infinite; }
/* ---------- chat on phones: like a messaging app ---------- */
@media (max-width: 760px) {
  .chat-page { height: calc(100dvh - 56px); display: flex; flex-direction: column; }
  .chat-page #chatBox, .chat-page .chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .chat-page .chat-list { flex: 1; min-height: 0; padding: 8px 6px; }
  .msg .bubble { max-width: 86%; border-radius: 18px; }
  .msg .mbtns .mbtn { font-size: 0; padding: 4px 6px; } .msg .mbtns .mbtn::first-letter { font-size: 15.5px; }
  .chat-send { position: sticky; bottom: 0; padding: 6px; gap: 4px; background: var(--panel); border-top: 1px solid var(--line); }
  .chat-send textarea { border-radius: 22px; padding: 10px 14px; font-size: 16.5px; }
  .chat-send { flex-wrap: wrap; }
  .chat-send textarea { order: -1; flex: 1 1 100%; }  /* the message box gets the whole row, buttons under it */
  .chat-send #chatBtn { margin-left: auto; border-radius: 22px; }
  .chat-send .attach { padding: 6px; font-size: 19px; }
  .emoji-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ---------- agents: My appointments (mine.js) ---------- */
.mine-btns a.btn { color: var(--brand); text-decoration: none; font-weight: 600; }
.mine-page .actions { display: flex; gap: 8px; align-items: center; }
.mine-page #mineQ { min-width: 220px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.mine-h { margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.mine-h .pill { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.06)); }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.mine-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 6px; }
.mine-card.fu { border-left: 4px solid #e2445c; }
.mine-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mine-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mine-notes pre { white-space: pre-wrap; font: inherit; font-size: 13.5px; margin: 6px 0 0; }
@media (max-width: 760px) { .mine-page .actions { width: 100%; } .mine-page #mineQ { flex: 1; min-width: 0; } }

/* ---------- outreach: Gmail switch, Send one, SMS preview ---------- */
.gm-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.gm-bar .gm { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 150px; text-align: left; transition: transform .1s, box-shadow .1s; }
.gm-bar .gm:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.gm-bar .gm.on { border: 2px solid var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--panel)); }
.gm-bar .gm[disabled] { opacity: .5; cursor: not-allowed; }
.gm-bar .gm small { font-size: 12.5px; color: var(--muted); } .gm-bar .gm i { font-size: 11.5px; font-style: normal; color: var(--muted); }
.o-one textarea, .o-one input { width: 100%; } .o-one .o-grow { flex: 1; min-width: 200px; }
.sms-bubble { display: inline-block; max-width: 340px; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #e9e9eb; color: #111;
  white-space: pre-wrap; font-size: 15.5px; line-height: 1.35; }
.o-quick p b, .o-one p b { display: inline; }

/* ---------- 📊 Data (data.js): stats, filter bar, map + list, profile, uploads ---------- */
.dt-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.dt-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; min-width: 120px; }
.dt-stat span { display: block; font-size: 12.5px; color: var(--muted); } .dt-stat b { font-size: 20px; }
.dt-stat.dt-busy { border-color: var(--brand); }
.dt-bar, .dt-more { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.dt-bar input, .dt-bar select, .dt-more input, .dt-more select { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; }
.dt-bar #fq { flex: 1 1 260px; min-width: 200px; } .dt-bar #fcity, .dt-bar #fzip { width: 110px; }
.dt-recent { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; min-height: 4px; }
.dt-recent .chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.dt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.dt-tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
.dt-tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.dt-main { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 10px; height: calc(100vh - 330px); min-height: 460px; }
.dt-list { overflow-y: auto; padding-right: 4px; }
.dt-mapwrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); isolation: isolate; }  /* the map's layers stay under side panels */
.dt-map { position: absolute; inset: 0; background: #e5e3df; }

.dt-count { margin: 2px 0 8px; font-size: 14.5px; }
.dt-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .1s, transform .1s; }
.dt-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.dt-addr { font-weight: 700; } .dt-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13.5px; }
.data-page .pill, .dt-profile .pill { font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.06)); }
.data-page .pill.ok { background: #d6f5e6; color: #037f4c; }
.dt-pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 10px 0; }
.dt-profile h2 { margin: 0 34px 2px 0; } .dt-x { position: absolute; top: 10px; right: 10px; }
.dt-profile .drawer-in, .drawer-in.dt-profile, .drawer-in.dt-up { position: relative; }
.dt-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

.dt-line { margin-top: 4px; } .dt-line a { color: var(--ink); text-decoration: none; }
.dt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.dt-fields div { border-bottom: 1px dashed var(--line); padding: 3px 0; } .dt-fields span { display: block; font-size: 12px; color: var(--muted); }
.dt-up label { display: block; margin: 8px 0; font-size: 13.5px; color: var(--muted); } .dt-up input:not([type=file]) { width: 100%; }
.dt-progress { height: 12px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.08)); overflow: hidden; margin-top: 12px; }
.dt-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #fff)); transition: width .4s; }
.dt-map-cols select { min-width: 190px; }
.leaflet-container { font: inherit; }
@media (max-width: 860px) {
  .dt-main { grid-template-columns: 1fr; height: auto; }
  .dt-mapwrap { height: 55vh; order: -1; } .dt-list { max-height: none; overflow: visible; }
  .dt-fields { grid-template-columns: 1fr; }
  .dt-stat { flex: 1 1 calc(33% - 10px); min-width: 0; padding: 6px 10px; } .dt-stat b { font-size: 16.5px; }
  .dt-stat span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 🎚️ AI agents (agents.js): voice lab cards, sliders, learned ---------- */
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.ag-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ag-head h3 { margin: 0; }
.agents-page .pill { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.06)); }
.agents-page .pill.ok { background: #d6f5e6; color: #037f4c; }
.ag-voices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ag-slider { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 14px; }
.ag-slider small { grid-column: 2 / 4; margin-top: -6px; font-size: 11.5px; }
.ag-slider input[type=range] { width: 100%; accent-color: var(--brand); margin: 0; padding: 0; border: 0; }
.ag-slider b { text-align: right; font-variant-numeric: tabular-nums; }
.ag-samples { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 6px; }
.ag-type { display: flex; gap: 6px; } .ag-type input { flex: 1; }
.ag-audio { width: 100%; margin-top: 8px; height: 36px; }
.ag-report p { font-size: 15.5px; line-height: 1.5; }
.ag-learn ul { padding-left: 18px; margin: 6px 0 0; } .ag-learn li { margin: 4px 0; }
.ag-top { border: 2px solid var(--brand); }
@media (max-width: 760px) { .ag-voices { grid-template-columns: 1fr; } .ag-slider { grid-template-columns: 100px 1fr 46px; } }

.ag-who { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* the AI Lounge's 🎛️ Control panel button */
.panel-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  font: inherit; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, #e0b65a 0%, #b8862c 45%, #7a521a 100%);
  box-shadow: 0 4px 14px rgba(148,104,28,.35), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .12s, box-shadow .12s; }
.panel-btn span { font-size: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.panel-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(148,104,28,.45), inset 0 1px 0 rgba(255,255,255,.4); }
.panel-btn:active { transform: translateY(0); }

/* boards: the sideways scrollbar on top too (app.js topScrollbars) */
.hscroll { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.hscroll[hidden] { display: none !important; }
.hscroll > button { flex: none; width: 34px; height: 24px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--brand); font-size: 13.5px; cursor: pointer; } .hscroll > button:hover { background: var(--soft, rgba(0,0,0,.05)); }
.top-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; height: 20px; }
.top-scroll > div { height: 1px; }
.group.closed .hscroll { display: none !important; }
.top-scroll::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar { height: 16px; }
.top-scroll::-webkit-scrollbar-track, .tbl-wrap::-webkit-scrollbar-track { background: var(--soft, rgba(0,0,0,.05)); border-radius: 999px; }
.top-scroll::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #d6aa4f, #94681c);
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-width: 60px; }
.top-scroll::-webkit-scrollbar-thumb:hover, .tbl-wrap::-webkit-scrollbar-thumb:hover { background: #7a521a; background-clip: padding-box; }
body.grabbing, body.grabbing * { cursor: grabbing !important; user-select: none; }
table.board td.label { padding: 2px 4px; }

/* Team chat, AI Lounge and Data fit the window: only their inside parts scroll, never the whole page */
@media (min-width: 761px) {
  .main > .page.chat-page, .main > .page.data-page { height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
    overflow: hidden; padding-bottom: 14px; }
  .main { min-height: 0; }
  .chat-page > #chatBox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chat-page .chat, .chat-page .lounge-wrap .chat { height: auto; flex: 1; min-height: 0; }
  .chat-page .lounge-wrap { flex: 1; min-height: 0; align-items: stretch; }
  .chat-page .lounge-wrap #chatBox { display: flex; flex-direction: column; min-height: 0; }
  .chat-page .lounge-side { position: static; max-height: none; min-height: 0; overflow: hidden; }
  .chat-page .lounge-side .scoreboard { flex: none; }  /* stays put at the top */
  .chat-page .lounge-side .rey-brief { flex: 1; min-height: 0; overflow-y: auto; }  /* only Rey's updates scroll */
  .data-page #dBody { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
  .data-page .dt-main { flex: 1; height: auto; min-height: 320px; }
  .data-page .dt-list { min-height: 0; }
}

/* ---------- 📊 Data v2: actions, map buttons, the two pop-ups, history, uploads box ---------- */
.dt-tabs { align-items: center; flex-wrap: wrap; }
.dt-acts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.dt-mapbtns { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; gap: 6px; }
.dt-mapbtns .btn { box-shadow: 0 4px 12px rgba(0,0,0,.2); background: var(--panel); }
.leaflet-control-layers { border-radius: 10px !important; font: 13px "Segoe UI", system-ui, sans-serif; }
.dt-place { font-size: 15.5px; color: var(--muted); margin-top: 2px; }
.dt-btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.dt-h { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 15.5px; }
.dt-h .btn { margin-left: auto; }
.dt-people { display: flex; flex-direction: column; gap: 8px; }
button.dt-person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; transition: border-color .12s, transform .12s, box-shadow .12s; }
button.dt-person:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.dt-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none;
  background: linear-gradient(135deg, #e0b65a, #7a521a); text-transform: uppercase; }
.dt-pn { display: flex; flex-direction: column; flex: 1; min-width: 0; } .dt-pn small { color: var(--muted); }
.dt-go { color: var(--brand); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.drawer.dt-p2 { z-index: 41; background: rgba(0,0,0,.18); }
.veil { z-index: 1100; }  /* dialogs always on top of the pop-ups */
.drawer.dt-p2 .drawer-in { box-shadow: -12px 0 30px rgba(0,0,0,.25); }
.dt-line { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dt-line > b { font-size: 15.5px; }
.dt-lacts { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.dt-choose { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed var(--line); }
.dt-hist { display: flex; flex-direction: column; gap: 6px; }
.dt-hrow { border-left: 3px solid var(--brand); padding: 4px 10px; } .dt-hk { font-weight: 600; margin-right: 8px; }
.dt-hrow audio { width: 100%; height: 32px; margin-top: 4px; }
.dt-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; } .dt-3.two { grid-template-columns: 1fr 1fr; }
.dt-3 input { width: 100%; }
.dt-kv { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; max-height: 40vh; overflow-y: auto; }
.dt-kv input[readonly] { background: var(--soft, rgba(0,0,0,.04)); }
.dt-pick { max-height: 55vh; overflow: auto; }
.up-pill { position: fixed; right: 18px; bottom: 18px; z-index: 1200; background: var(--panel); border: 1px solid var(--brand); border-radius: 14px;
  padding: 10px 14px 14px; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); cursor: pointer; max-width: 320px; overflow: hidden; }
.up-pill i { position: absolute; left: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #e0b65a, #7a521a); transition: width .4s; }

.ag-say { margin-bottom: 12px; }
.ag-words { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ag-word { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; background: var(--panel); }
.ag-word i { color: var(--brand); font-style: normal; font-weight: 600; }
.ag-say .ag-type input { flex: 1; min-width: 140px; }

/* ---------- boards v3: brown headers, light-brown names, small dots, fixed widths, sections, drag, notes, ▶ ---------- */
table.board { table-layout: fixed; min-width: 0; }
table.board td .cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.board td.label .cell { white-space: nowrap; }
#main table.board th, table.board th { background: #d9c39b; color: #3d2a10; font-weight: 700; user-select: none;
  border-top: 4px solid transparent; overflow: hidden; text-overflow: ellipsis; }
table.board th:first-child, table.board th.lead-h { background: #d9c39b; }
table.board th:not(:first-child):not(.lead-h) { position: relative; }  /* (the first two stay sticky) */
table.board td.lead, table.board td.lead .cell { background: #f4ead8; }
table.board td:first-child { background: #f4ead8; }
table.board tr.selected td.lead, table.board tr.selected td:first-child { background: #ead9b8; }
table.board th.sec-survey { border-top-color: #579bfc; } table.board th.sec-setter { border-top-color: #9d50dd; }
table.board th.sec-closer { border-top-color: #c9a24e; }
table.board th.flash { animation: thflash 1.2s ease-out; }
@keyframes thflash { 0%, 40% { background: #f3d58a; } 100% { background: #d9c39b; } }
table.board th[draggable] { cursor: grab; } table.board th.dragging { opacity: .45; }
table.board th.drop-here { box-shadow: inset 4px 0 0 #7a521a; }
.col-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 4; }
.col-grip:hover, body.resizing .col-grip { background: rgba(122,82,26,.35); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
table.board th .colmenu { color: #3d2a10; }
table.board input.selbox, table.board th input.selbox { width: 13px !important; height: 13px !important; min-width: 13px; max-width: 13px;
  padding: 0 !important; box-sizing: border-box; border-width: 1.5px; border-radius: 50%; flex: none; }
table.board th.sel, table.board td.sel { width: 34px; }
.sec-btns { display: inline-flex; gap: 6px; margin-left: 14px; }
.sec-btn { border: 0; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .1s; }
.sec-btn:hover { transform: translateY(-1px); }
.sec-btn.sec-survey { background: #579bfc; } .sec-btn.sec-setter { background: #9d50dd; } .sec-btn.sec-closer { background: linear-gradient(135deg, #e0b65a, #94681c); }
td.note-cell { cursor: pointer; text-align: left; } td.note-cell .cell { justify-content: flex-start; padding-left: 8px; }
.note-pop { width: 400px; padding: 10px; } .note-pop textarea { width: 100%; min-height: 150px; font: inherit; border-radius: 8px; border: 1px solid var(--line); padding: 8px; }
.note-pop .row { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; } .note-read { white-space: pre-wrap; max-height: 300px; overflow: auto; }
.play-rec { border: 0; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #e0b65a, #94681c); color: #fff;
  cursor: pointer; margin-right: 6px; font-size: 11.5px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ch-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; } .ch-row input[type=color] { width: 42px; height: 32px; padding: 0; border: 0; }
.ch-row input:not([type]) , .ch-row input[data-ni] { flex: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.board th { background: #3a2b14; color: #f0dfbd; }
  :root:not([data-theme="light"]) table.board td.lead, :root:not([data-theme="light"]) table.board td.lead .cell, :root:not([data-theme="light"]) table.board td:first-child { background: #2a2116; }
  :root:not([data-theme="light"]) table.board th .colmenu { color: #f0dfbd; } }
:root[data-theme="dark"] table.board th { background: #3a2b14; color: #f0dfbd; }
:root[data-theme="dark"] table.board td.lead, :root[data-theme="dark"] table.board td.lead .cell, :root[data-theme="dark"] table.board td:first-child { background: #352a1c; }
:root[data-theme="dark"] table.board th .colmenu { color: #f0dfbd; }
table.board th.lead-h, table.board td.lead { left: 34px; }  /* right after the 34px dot column: no gap */

/* chat v3 look: a soft ivory-to-sand wash with a faint gold dot pattern and a gold top edge (not plain white) */
.chat { border-top: 3px solid var(--brand); box-shadow: 0 6px 22px rgba(60, 40, 10, .08); overflow: hidden; }
.chat-list {
  background-color: #fbf6ec;
  background-image:
    radial-gradient(rgba(148, 104, 28, .13) 1px, transparent 1.4px),
    radial-gradient(ellipse at top left, rgba(212, 166, 74, .16), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(107, 68, 35, .10), transparent 60%),
    linear-gradient(180deg, #fffdf8 0%, #f6eddc 100%);
  background-size: 18px 18px, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: local, scroll, scroll, scroll;
}
.chat-send, .chat-pick { background: var(--panel); }
.team-wrap .scoreboard { border-top: 3px solid var(--brand); }
.sc-none { margin: 10px 0 4px; line-height: 1.45; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chat-list {
    background-color: #1f1c18;
    background-image:
      radial-gradient(rgba(212, 166, 74, .10) 1px, transparent 1.4px),
      radial-gradient(ellipse at top left, rgba(212, 166, 74, .10), transparent 55%),
      linear-gradient(180deg, #24211d 0%, #1b1815 100%);
    background-size: 18px 18px, 100% 100%, 100% 100%;
  }
  :root:not([data-theme="light"]) .chat { box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
}
:root[data-theme="dark"] .chat-list {
  background-color: #1f1c18;
  background-image:
    radial-gradient(rgba(212, 166, 74, .10) 1px, transparent 1.4px),
    radial-gradient(ellipse at top left, rgba(212, 166, 74, .10), transparent 55%),
    linear-gradient(180deg, #24211d 0%, #1b1815 100%);
  background-size: 18px 18px, 100% 100%, 100% 100%;
}
:root[data-theme="dark"] .chat { box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }

/* each person's color (--uh = their hue): bold bigger name, matching avatar circle */
.bubble .who.uc { font-size: 14.5px; font-weight: 800; letter-spacing: .1px; color: hsl(var(--uh) 62% 34%); margin-bottom: 3px; }
.quote b.uc { color: hsl(var(--uh) 62% 34%); }
.avatar.uc:not(.pic) { background: hsl(var(--uh) 52% 42%); color: #fff; }
.avatar.uc.pic { box-shadow: 0 0 0 2px hsl(var(--uh) 52% 46%); }
.msg > .avatar.uc { width: 34px; height: 34px; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bubble .who.uc, :root:not([data-theme="light"]) .quote b.uc { color: hsl(var(--uh) 75% 70%); }
  :root:not([data-theme="light"]) .avatar.uc:not(.pic) { background: hsl(var(--uh) 45% 38%); }
}
:root[data-theme="dark"] .bubble .who.uc, :root[data-theme="dark"] .quote b.uc { color: hsl(var(--uh) 75% 70%); }
:root[data-theme="dark"] .avatar.uc:not(.pic) { background: hsl(var(--uh) 45% 38%); }

/* image pop-up */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 10, 5, .72); display: grid; place-items: center;
  backdrop-filter: blur(3px); animation: lbIn .15s ease-out; }
.lightbox img { max-width: min(88vw, 1100px); max-height: 80vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.lightbox .lb-x { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); font-size: 18px; cursor: pointer; }
.lightbox .lb-open { position: absolute; bottom: 22px; color: #f4ead8; font-size: 13.5px; text-decoration: underline; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

/* Messages: people in a vertical column, the conversation on the side */
.dmv { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; margin-top: 12px; height: calc(100vh - 190px); min-height: 420px; }
.dmv-list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-y: auto; padding: 8px; }
.dmv-search { width: 100%; margin-bottom: 6px; }
.dmv-row { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.dmv-row:hover { background: var(--hover); }
.dmv-row.on { background: var(--sel); }
.dmv-row .dm-main { min-width: 0; flex: 1; }
.dmv-row .dm-main b { font-size: 14.5px; }
.dmv-row .dm-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmv-sep { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 12px 8px 4px; }
.dmv-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dmv-head { display: flex; gap: 10px; align-items: center; padding: 0 4px 8px; }
.dmv-head b { font-size: 16.5px; }
.dmv-chat #chatBox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dmv-chat .chat { height: auto; flex: 1; min-height: 0; margin-top: 0; }
.dmv-empty { flex: 1; display: grid; place-content: center; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; }
@media (max-width: 760px) { .dmv { grid-template-columns: 1fr; height: auto; } .dmv-list { max-height: 260px; } .dmv-chat .chat { height: 70vh; } }

.mbtn.approve { font-weight: 800; color: #1f9d55; border-color: rgba(31,157,85,.35); }
.mbtn.approve.on { background: #1f9d55; color: #fff; border-color: #1f9d55; }

/* 🔔 notifications */
.bell-btn { position: relative; }
.bell-n { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font-size: 11.5px; font-weight: 800; line-height: 18px; text-align: center; }
.bell-pop { position: fixed; top: 58px; right: 16px; width: min(440px, calc(100vw - 32px)); max-height: 70vh; z-index: 900;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-list { overflow-y: auto; }
.bell-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.bell-item:hover { background: var(--hover); }
.bell-item.unread { border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--sel) 45%, transparent); }
.bell-t { display: flex; justify-content: space-between; gap: 8px; }
.bell-b { white-space: pre-wrap; font-size: 13.5px; color: var(--muted); margin-top: 4px; max-height: 2.8em; overflow: hidden; }
.bell-item.open .bell-b { max-height: none; color: var(--ink); }

/* ✏️ edit sidebar */
#nav .nav-edit { margin-top: 10px; opacity: .55; font-size: 12.5px; }
#nav .nav-edit:hover { opacity: 1; }
.sb-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin: 8px 0; }
.sb-row { display: flex; gap: 6px; align-items: center; padding: 4px; border-radius: 8px; }
.sb-row:hover { background: var(--hover); }
.sb-row.head { background: var(--soft); font-weight: 700; margin-top: 6px; }
.sb-row.off { opacity: .45; }
.sb-row .sb-name { flex: 1; min-width: 0; }
.sb-icon { width: 44px; text-align: center; }
.sb-move { display: flex; flex-direction: column; }
.sb-move button { border: 0; background: none; font-size: 10.5px; line-height: 1; padding: 1px 4px; cursor: pointer; color: var(--muted); }
.sb-move button:hover { color: var(--brand); }
.sb-eye, .sb-del { border: 0; background: none; cursor: pointer; font-size: 15.5px; }
.sb-add { margin: 6px 0 10px; }
.sb-addrow { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sb-addrow input:not(.sb-icon) { flex: 1; min-width: 140px; }

/* 🔑 RMD sign-ins + 🕐 clock (AI agents page) */
.rmd-card h3 { margin: 0 0 8px; }
.rmd-rows { display: flex; flex-direction: column; gap: 8px; }
.rmd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.rmd-name { width: 70px; font-size: 15.5px; }
.rmd-fields { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.rmd-fields label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); font-weight: 700; flex: 1; min-width: 160px; }
.rmd-clock { white-space: nowrap; }
.clk-rows { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.clk-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.clk-row b { width: 36px; }
.clk-row span { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.dialog .sb-row .sb-icon, .dialog .sb-addrow .sb-icon { width: 48px; flex: none; text-align: center; }
.dialog .sb-row .sb-name { width: auto; flex: 1; min-width: 0; }
.dialog .sb-addrow input:not(.sb-icon) { width: auto; }

/* 📹 live meeting dock: small squares stacked in the corner */
.meet-dock { position: fixed; right: 16px; bottom: 16px; z-index: 950; width: 236px; background: #1b140d; color: #f4ead8;
  border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.35); overflow: hidden; border: 1px solid #3a2b14; }
.meet-dock.big { width: min(760px, calc(100vw - 32px)); }
.meet-dock.pulse { outline: 3px solid #e5484d; }
.meet-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12.5px; }
.meet-bar b { color: #ff6b6b; }
.meet-bar button { border: 0; border-radius: 8px; background: #3a2b14; color: #f4ead8; cursor: pointer; padding: 3px 7px; font-size: 13.5px; }
.meet-bar button.off { background: #7a2222; }
.meet-bar button.leave { background: #c0392b; font-weight: 700; }
.meet-n { opacity: .75; }
.meet-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 4px 4px; max-height: 60vh; overflow-y: auto; }
.meet-dock.big .meet-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.meet-tile { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 8px; overflow: hidden; }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; }
.meet-tile span { position: absolute; left: 4px; bottom: 3px; font-size: 10.5px; background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 6px; }
.live-banner { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #fde8e8; border: 1px solid #f5b5b5; color: #8a1c1c;
  display: flex; gap: 8px; align-items: center; }
.live-btn { color: #c0392b; }
.meet-dock:not(.big) { width: 280px; }
.meet-bar { white-space: nowrap; }
.meet-bar .meet-n { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }

/* ⚙️ Settings */
.set-page .o-card { margin-bottom: 14px; }
.set-page h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.set-routes { display: flex; flex-direction: column; gap: 6px; }
.set-route { display: grid; grid-template-columns: 240px 300px 1fr; gap: 10px; align-items: center; }
.cred { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.cred-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cred-h { margin-left: auto; }
.cred-move { display: flex; flex-direction: column; } .cred-move button { border: 0; background: none; cursor: pointer; font-size: 10.5px; color: var(--muted); }
.cred-btns { display: flex; gap: 6px; margin-top: 6px; }
.cred-form label { display: block; margin-top: 6px; }
.cred-wl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 13.5px; }
.cred-wl label { display: flex; gap: 6px; align-items: center; margin: 0; }
.cred-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.set-table th, .set-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.set-ev { font-size: 11.5px; white-space: pre-wrap; max-height: 200px; overflow: auto; }
.danger-t { color: var(--danger); }
@media (max-width: 760px) { .set-route { grid-template-columns: 1fr; } }
.set-page .o-card p b, .set-page .o-card p span, .set-page .o-card .muted b { display: inline; }
.set-page .o-card .set-route { display: grid; grid-template-columns: 240px minmax(220px, 320px) 1fr; gap: 10px; align-items: center; margin: 0; }
.set-page .o-card .set-route select { width: 100%; margin: 0; }
.set-page .o-card .set-route > span:first-child { font-weight: 600; }
@media (max-width: 760px) { .set-page .o-card .set-route { grid-template-columns: 1fr; } }

/* 🎯 pitch guide (AI agents → Knowledge & studies) */
.pitch-card .pitch-box { width: 100%; min-height: 320px; font-family: inherit; font-size: 14.5px; line-height: 1.5; resize: vertical; }
.pitch-found { margin-top: 10px; }
.pitch-found summary { cursor: pointer; }
.pitch-line { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pitch-line div { margin-top: 2px; }

.bots-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.bot-row { position: relative; padding: 8px 36px 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.bot-row [data-botrm] { position: absolute; top: 6px; right: 6px; }

#rec.recording { color: #e5484d; font-weight: 700; }
#rec.recording.paused { color: var(--brand); }
.rec-cancel { color: #e5484d; font-weight: 800; }

/* ---------- chat buttons: bigger, clear, with a name under each ---------- */
.chat-send .attach { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 52px; height: 52px; padding: 4px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 8%, var(--panel)); cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.chat-send .attach i { font-style: normal; font-size: 23px; line-height: 1; }
.chat-send .attach em { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.1; }
.chat-send .attach:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.12); background: color-mix(in srgb, var(--brand) 16%, var(--panel)); }
.chat-send .attach.live-btn { background: color-mix(in srgb, #e2445c 12%, var(--panel)); border-color: color-mix(in srgb, #e2445c 40%, var(--line)); }
.chat-send .attach.live-btn em { color: #c2364b; }
.chat-send { gap: 6px; align-items: center; }
.hover-react button { width: 40px; height: 40px; font-size: 24px; }  /* the reaction bar: bigger emojis */
.mbtn[data-react] { font-size: 16px; }
.lounge-side .scoreboard { padding: 10px 12px 8px; }
.lounge-side .sc-stats { max-height: 120px; overflow-y: auto; }  /* compact: the scoreboard doesn't run down the column */
@media (max-width: 760px) {
  .chat-send .attach { min-width: 40px; height: 40px; border-radius: 12px; }
  .chat-send .attach em { display: none; }
  .chat-send .attach i { font-size: 20px; }
}
/* the message box gets its own full row; the buttons and Send sit under it (room for the bigger buttons) */
.chat-send { flex-wrap: wrap; }
.chat-send textarea { order: -1; flex: 1 1 100%; min-height: 44px; }
.chat-send #chatBtn { margin-left: auto; align-self: center; min-height: 44px; padding: 0 22px; }

/* ---------- live meeting: a pop-up in the middle; Minimize = the small corner dock ---------- */
.meet-veil { position: fixed; inset: 0; background: rgba(10, 6, 2, .5); z-index: 940; backdrop-filter: blur(2px); }
.meet-dock.pop { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); border-radius: 20px; }
.meet-dock.pop .meet-bar { padding: 10px 14px; font-size: 14px; }
.meet-dock.pop .meet-bar button { padding: 6px 12px; font-size: 14px; }
.meet-dock.pop .meet-tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; padding: 0 10px 10px; max-height: calc(100vh - 140px); }
.meet-dock.pop .meet-tile span { font-size: 13px; }
.meet-title { cursor: pointer; }
.meet-dock:not(.pop) .meet-title::after { content: " ⤢"; opacity: .8; }
/* the glowing red "● Meeting" dot */
.meet-dot { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 1px 8px 1px 6px; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  box-shadow: 0 0 0 0 rgba(229, 72, 77, .7); animation: meetGlow 1.6s infinite; }
.meet-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: meetBlink 1.6s infinite; }
.meet-dot[hidden] { display: none !important; }
.meet-dot.big { font-size: 12px; padding: 3px 11px 3px 9px; margin: 0 6px 0 0; }
@keyframes meetGlow { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .65); } 70% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
@keyframes meetBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-banner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meet-dock:not(.pop):not(.big) { width: 350px; }  /* minimized: room for Open + Leave */
.meet-dock:not(.pop) .meet-n { display: none; }

/* ---------- 🎡 raffle wheel (Team chat): live show, the card that stays in the chat, the admin's window ---------- */
.raffle-btn { color: #a87b0c; }
.rf-wheel { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; }
.rf-wheel svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .3)); }
.rf-rim { fill: #1b140d; stroke: #c9a227; stroke-width: 3; }
.rf-slice path { stroke: #fff4dc; stroke-width: .8; }
.rf-slice text { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; font-weight: 800; pointer-events: none; }
.rf-slice.win path { filter: brightness(1.2) saturate(1.15); stroke: #fff; stroke-width: 2.6; }
.rf-pegs circle { fill: #f0c64a; stroke: #6b4a12; stroke-width: .6; }
.rf-hub { fill: #1b140d; stroke: #c9a227; stroke-width: 3; }
.rf-gift { font-size: 20px; }
.rf-ptr { fill: #e5484d; stroke: #fff; stroke-width: 2; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.rf-ptr.bump { animation: rfBump .13s ease-out; }
@keyframes rfBump { 0% { transform: rotate(-16deg); } 100% { transform: rotate(0); } }

.rf-veil { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(70, 48, 12, .6), rgba(8, 5, 2, .86)); animation: rfIn .25s ease-out; }
.rf-show { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; text-align: center; color: #f7ecd6;
  background: linear-gradient(180deg, #2c1f10, #140f09); border: 1px solid rgba(201, 162, 39, .55); border-radius: 24px;
  padding: 18px 20px 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
.rf-head h2 { margin: 8px 0 2px; font-size: 24px; color: #f0c64a; }
.rf-tag { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px;
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase; animation: meetGlow 1.6s infinite; }
.rf-sub { font-size: 13px; opacity: .78; margin-bottom: 12px; }
.rf-show .rf-wheel { max-width: min(400px, 46vh); }
.rf-now { margin-top: 10px; min-height: 34px; font-size: 22px; font-weight: 800; color: #fbefd6; }
.rf-now[hidden] { display: none; }
.rf-win { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; padding: 10px 16px;
  border-radius: 16px; background: linear-gradient(90deg, #c9a227, #f6d465, #c9a227); color: #1b140d;
  box-shadow: 0 0 0 0 rgba(240, 198, 74, .6); animation: rfPop .55s cubic-bezier(.2, 1.6, .4, 1), rfShine 1.8s .55s infinite; }
.rf-win[hidden] { display: none; }
.rf-win > span { font-size: 30px; }
.rf-win small { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.rf-win b { display: block; font-size: 28px; line-height: 1.15; }
.rf-win em { display: block; font-style: normal; font-weight: 700; font-size: 14px; }
.rf-show .rf-close { margin-top: 14px; background: transparent; color: #f7ecd6; border: 1px solid rgba(247, 236, 214, .35); }
@keyframes rfIn { from { opacity: 0; } }
@keyframes rfPop { from { transform: scale(.6); opacity: 0; } }
@keyframes rfShine { 70% { box-shadow: 0 0 0 14px rgba(240, 198, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 198, 74, 0); } }
.rf-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1060; }
.rf-confetti i { position: absolute; top: -20px; border-radius: 2px; animation: rfFall 3s cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes rfFall { to { transform: translate(var(--sway), 108vh) rotate(760deg); } }

.rf-card { width: 250px; max-width: 100%; padding: 10px 12px 12px; margin-top: 2px; border-radius: 18px; text-align: center; color: #f7ecd6;
  background: linear-gradient(180deg, #2c1f10, #17110a); border: 1px solid rgba(201, 162, 39, .5); }
.msg.mine .bubble .rf-card { margin-left: auto; }
.rf-card-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.rf-card-h b { color: #f0c64a; font-size: 15px; }
.rf-card-h span { font-size: 13.5px; font-weight: 700; }
.rf-card .rf-wheel { max-width: 200px; }
.rf-card .rf-wheel svg { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
.rf-card-win { margin-top: 8px; font-size: 15.5px; min-height: 22px; }
.rf-card-win b { color: #f0c64a; }
.rf-replay { margin-top: 8px; border: 0; border-radius: 999px; padding: 6px 16px; font: inherit; font-weight: 800; font-size: 13.5px;
  cursor: pointer; background: #c9a227; color: #1b140d; }
.rf-replay:hover { filter: brightness(1.08); }
.rf-card.playing .rf-replay { opacity: .5; pointer-events: none; }

.dialog:has(.rf-form) { width: min(680px, 100%); }
.rf-form-grid { display: grid; grid-template-columns: 1fr 230px; gap: 18px; align-items: start; margin-top: 8px; }
.rf-form textarea { resize: vertical; }
.rf-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.rf-preview { padding-top: 22px; }
.rf-preview .rf-wheel { max-width: 230px; }
.rf-empty { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 13px; padding: 24px; }
@media (max-width: 640px) {
  .rf-form-grid { grid-template-columns: 1fr; }
  .rf-preview { max-width: 200px; margin: 0 auto; padding-top: 0; }
  .rf-win b { font-size: 23px; }
}
.chat-send .attach { min-width: 48px; padding: 4px; }  /* 8 buttons + Send on one row */
.chat-send { gap: 5px; }
.chat-send .attach.raffle-btn { background: color-mix(in srgb, #c9a227 16%, var(--panel)); border-color: color-mix(in srgb, #c9a227 45%, var(--line)); }
.chat-send .attach.raffle-btn em { color: #9a7209; }

/* ===================== 📱 PHONE APP (the boss, 2026-10-14): phones only; the desktop is untouched ===================== */
.top-menu, .side-close, .nav-veil, .ls-more { display: none; }
@media (max-width: 860px) {
  /* ☰ lives in the top bar (never scrolls away), centered between the screen's edge and the Light button */
  .top-menu { display: flex; flex: 1; justify-content: center; align-items: center; }
  .top-menu .btn { font-size: 22px; line-height: 1; padding: 5px 12px; }
  .main .menu-btn { display: none !important; }  /* (the old one inside each page) */
  .side-close { display: grid; place-items: center; margin-left: auto; width: 38px; height: 38px; flex: none; border-radius: 10px;
    border: 1px solid var(--side-line, var(--line)); background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
  .app.nav-open .nav-veil { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .45); }
}
@media (max-width: 760px) {
  @supports (height: 100dvh) { .app, .mainwrap { height: 100dvh; } }

  /* the lead boards: everything smaller, so more columns fit on one screen */
  #groups table.board { zoom: .72; }
  .group-h { margin-bottom: 4px; } .group-h h2 { font-size: 15.5px; }
  .sec-btns { gap: 4px; margin-left: 6px; }
  .sec-btn { padding: 3px 9px; font-size: 11.5px; white-space: nowrap; }
  .board-h h1 { font-size: 21px; }
  /* the board's top part (title, buttons, tabs, search, filters): compact, so the leads start higher up */
  .board-h { gap: 6px; } .board-h .desc { display: none; }
  .board-h .actions { gap: 5px; } .board-h .actions .btn { padding: 4px 9px; font-size: 13px; }
  .tabs { margin: 8px 0 8px; overflow-x: auto; } .tabs button { padding: 6px 9px; font-size: 13.5px; white-space: nowrap; }
  .toolbar { gap: 5px; margin-bottom: 8px; }
  .toolbar .btn { padding: 5px 10px; font-size: 13px; }
  .toolbar input[type=search] { width: auto; flex: 1 1 140px; min-width: 0; padding: 6px 10px; font-size: 14px; }
  .toolbar select { flex: 1 1 30%; min-width: 0; padding: 5px 6px; font-size: 13px; }
  .toolbar .count { font-size: 12px; }

  /* Team chat + AI Lounge = a messaging app: the conversation fills the screen (only the messages scroll),
     the scoreboard + Rey's brief sit small on top (▾ More opens them) */
  .main > .page.chat-page { height: 100%; box-sizing: border-box; padding: 6px 8px 0; display: flex; flex-direction: column; overflow: hidden; }
  .chat-page .board-h { flex: none; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .chat-page .board-h h1 { font-size: 19px; }
  .chat-page .board-h .desc { display: none; }
  .chat-page .panel-btn { padding: 5px 12px; font-size: 13px; white-space: nowrap; }
  .chat-page .panel-btn span { font-size: 14px; }
  .chat-page .lounge-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
  .chat-page .lounge-wrap > .live-banner { flex: none; order: 0; margin: 0; }
  .chat-page .lounge-side { order: 1; flex: none; position: static; margin-top: 4px; gap: 6px; max-height: 32vh; overflow-y: auto; }
  .chat-page .lounge-side.open { max-height: 60vh; }
  .chat-page .lounge-wrap > #chatBox { order: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chat-page .lounge-wrap .chat { flex: 1; height: auto; min-height: 0; margin-top: 0; }
  .chat-page .scoreboard { padding: 6px 8px; box-shadow: none; font-size: 12.5px; margin-top: 0; }
  .chat-page .scoreboard .sc-head b { font-size: 14px; }
  .chat-page .lounge-side:not(.open) .scoreboard > .muted.small, .chat-page .lounge-side:not(.open) .sc-stats { display: none; }
  .chat-page .sc-cal { margin: 3px 0 0; } .chat-page .sc-cal th { font-size: 10.5px; padding: 0; } .chat-page .sc-cal td { padding: 1px; }
  .chat-page .sc-n { width: 21px; height: 21px; font-size: 11.5px; }
  .chat-page .team-wrap .scoreboard:has(.sc-none) { display: none; }  /* no setters yet: no empty table */
  .chat-page .team-wrap .lounge-side:has(.sc-none) { display: none; }
  .chat-page .rey-brief .sc-head { flex-wrap: wrap; }
  .chat-page .rey-brief .rb-body { margin: 4px 0 0; gap: 4px; }
  .chat-page .lounge-side:not(.open) .rb-sec:not(:first-child),
  .chat-page .lounge-side:not(.open) .rb-sec .rb-line:not(:nth-child(2)),
  .chat-page .lounge-side:not(.open) .rb-chat, .chat-page .lounge-side:not(.open) .rb-ask { display: none; }
  /* the message box: buttons + Send on one row under it (more room for the messages) */
  .chat-page .chat-send { gap: 4px; padding: 5px 6px; }
  .chat-page .chat-send .attach { min-width: 0; flex: 1 1 0; height: 38px; padding: 2px; }
  .chat-page .chat-send #chatBtn { flex: none; min-height: 38px; padding: 0 16px; margin-left: 2px; }
  .chat-page .chat-send textarea { min-height: 40px; padding: 8px 12px; font-size: 16px; }
  .ls-more { display: block; width: 100%; border: 0; background: none; color: var(--brand); font: inherit; font-size: 12.5px;
    font-weight: 700; padding: 2px 0 0; cursor: pointer; text-align: center; }
}
