/* A2Z Sales: clean, modern, minimal. Light + dark. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7e9ee;
  --soft: #f1f3f7;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-ink: #ffffff;
  --good: #059669;
  --good-soft: #e7f7f0;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --chip: #f1f3f7;
  --side: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f14;
    --card: #151821;
    --ink: #e6e9ef;
    --muted: #8b95a7;
    --line: #242936;
    --soft: #1b1f2a;
    --accent: #818cf8;
    --accent-soft: #1f2240;
    --accent-ink: #0d0f14;
    --good: #34d399;
    --good-soft: #10261f;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --bad: #f87171;
    --bad-soft: #2b1414;
    --chip: #1d2230;
    --side: #11141b;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 0 0 6px; }
p { margin: 6px 0; }

/* ---------- Shell: sidebar + content ---------- */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: 228px; flex: 0 0 228px; background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.brand { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand span:not(.logo) { font-weight: 400; color: var(--muted); }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #6366f1, #0ea5e9); color: #fff; font-weight: 800; }
.side nav { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; flex: 1; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 10px 4px; font-weight: 600; }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink); opacity: .82; }
.nav-group a:hover { background: var(--soft); text-decoration: none; opacity: 1; }
.nav-group a.on { background: var(--accent-soft); color: var(--accent); opacity: 1; font-weight: 600; }
.nav-group .ico { width: 18px; text-align: center; font-size: .95rem; }
.nav-group .lbl { flex: 1; }
.side form { margin-top: 8px; }
button.link { background: none; border: 0; color: var(--muted); padding: 6px 10px; }
main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1280px; }
main.bare { margin: 0 auto; }
.navtoggle, .mobile-top, .scrim { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .mobile-top { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--side); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .burger { font-size: 1.3rem; cursor: pointer; padding: 2px 6px; margin: 0; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .navtoggle:checked ~ .side { box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  .navtoggle:checked ~ .side { transform: none; }
  .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); margin: 0; }
  main { padding: 16px 16px 60px; }
}

/* ---------- Building blocks ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.flash { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
a.card { color: var(--ink); display: block; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: .78rem; margin: 0 4px 4px 0; font-weight: 500; white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.on, .chip.accent { background: var(--accent-soft); color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; font-weight: 600; }
.paused-pill { background: var(--bad); color: #fff; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: .78rem; text-align: center; }

button, .btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.danger, .btn.danger { color: var(--bad); }
button.big, .btn.big { padding: 12px 18px; font-size: 1rem; flex: 1; justify-content: center; min-width: 140px; }
.btn.sm, button.sm { padding: 5px 10px; font-size: .82rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { width: 100%; min-height: 120px; }
label { display: block; margin: 6px 0; }
form { margin: 0; }
pre.msg { white-space: pre-wrap; word-wrap: break-word; background: var(--soft); border-radius: 10px; padding: 10px 12px; font: inherit; margin: 8px 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.card.flush { padding: 4px 6px; }
@media (max-width: 700px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 4px; }
  table.stack td { display: block; border: 0; padding: 2px 0; }
}

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats .card { margin: 0; }
.stat { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .badge { margin-left: 4px; background: var(--muted); }

/* Avatars */
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em; }
.avatar.big { width: 56px; height: 56px; font-size: 1.15rem; }
.av0 { background: #6366f1; } .av1 { background: #0ea5e9; } .av2 { background: #10b981; } .av3 { background: #f59e0b; }
.av4 { background: #ef4444; } .av5 { background: #8b5cf6; } .av6 { background: #14b8a6; } .av7 { background: #ec4899; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .name { font-weight: 600; color: var(--ink); }
.who-cell .sub { font-size: .8rem; color: var(--muted); }

/* Lists (inbox, mail, history) */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--soft); text-decoration: none; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .top { display: flex; justify-content: space-between; gap: 8px; }
.list-row .preview { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row.unread .name { font-weight: 700; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Two-pane layouts: folders | list */
.split { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .split { grid-template-columns: 210px 1fr; } }
.folders { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 899px) { .folders { flex-direction: row; overflow-x: auto; } }
.folders a { padding: 8px 12px; border-radius: 9px; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.folders a:hover { background: var(--soft); text-decoration: none; }
.folders a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Lead profile */
.profile-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .info { flex: 1; min-width: 220px; }
.profile-head h1 { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.fact .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.fact .v { word-break: break-word; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .85rem; }
dl.kv dd { margin: 0; word-break: break-word; }

/* Pipeline board */
.board { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .board { grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); grid-template-columns: none; overflow-x: auto; align-items: start; } }
.col { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.col summary { cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; list-style: none; }
.col summary::-webkit-details-marker { display: none; }
.lead-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; color: var(--ink); }
.lead-card:hover { border-color: var(--accent); text-decoration: none; }

/* Feed + timeline */
.feed li { list-style: none; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed { padding: 0; margin: 0; }
.feed .who { font-weight: 600; }
.timeline .item { position: relative; border-left: 2px solid var(--line); padding: 4px 0 14px 18px; margin-left: 6px; }
.timeline .item::before { content: ''; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline .item.touch::before { background: var(--accent); }
.timeline .item.reply::before { background: var(--good); }
.timeline .item.call::before { background: var(--warn); }

/* Chat (Heads + message threads) */
.chat { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.history { display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; }
.msg-row.owner, .msg-row.out { justify-content: flex-end; }
.bubble { max-width: 78%; border-radius: 16px; padding: 9px 13px; background: var(--soft); border: 1px solid var(--line); }
.bubble.owner, .bubble.out { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-bottom-right-radius: 4px; }
.bubble.in, .bubble.head { border-bottom-left-radius: 4px; }
.bubble.pending { background: var(--warn-soft); color: var(--ink); border: 1px dashed var(--warn); }
.bubble.owner .muted, .bubble.out .muted { color: inherit; opacity: .8; }
.bubble.standup { border-left: 4px solid var(--good); }
.bubble .text { white-space: pre-wrap; word-wrap: break-word; }
.bubble .acts { margin: 6px 0 0; padding-left: 0; list-style: none; }
.bubble .acts li { color: var(--good); }
.bubble .acts li.bad { color: var(--bad); }
.sys-row { align-self: center; font-size: .8rem; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 4px 12px; }
@media (max-width: 700px) { .bubble { max-width: 92%; } }
.say textarea { min-height: 70px; }
#mic.live { background: var(--bad); border-color: var(--bad); color: #fff; }

.login { max-width: 380px; margin: 14vh auto; }
.login input { width: 100%; }
.copied { background: var(--good) !important; border-color: var(--good) !important; color: #fff !important; }

/* Call Cockpit */
.call-card .shots { display: flex; gap: 8px; margin: 8px 0; align-items: flex-start; }
.call-card .shots img { height: 150px; border: 1px solid var(--line); border-radius: 8px; }
.call-card pre.script { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--soft); padding: 10px; border-radius: 10px; margin: 4px 0; }
.call-card textarea.copy { width: 100%; font: inherit; font-size: .85rem; min-height: 0; }
.call-card .outcome-btns button { padding: 6px 10px; }
.call-card details summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-top: 6px; }
@media (max-width: 700px) { .call-card .shots img { height: 110px; } }
.outcome { font-weight: 600; }

/* Utilities (CSP forbids inline styles) */
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 12px; } .my-s { margin: 6px 0; }
.between { justify-content: space-between; } .py { padding: 6px 0; }
.row.between.py { flex-wrap: nowrap; } .row.between.py > .small { text-align: right; }

/* ================= v3: departments + a more polished look ================= */
:root { --bg: #f4f6fb; --radius: 16px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05); --side-bg: #0c1124; --side-ink: #cbd2e6; --side-muted: #7b84a3; --side-hover: #161d38; }
@media (prefers-color-scheme: dark) { :root { --bg: #0b0e16; --side-bg: #080b14; --side-hover: #121829; } }
h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
h2 { font-weight: 700; }

/* Department colours (CSP: classes, no inline styles) */
.c-blue { --dc: #2563eb; --dc2: #0ea5e9; } .c-green { --dc: #059669; --dc2: #22c55e; } .c-violet { --dc: #7c3aed; --dc2: #a855f7; }
.c-pink { --dc: #db2777; --dc2: #f472b6; } .c-amber { --dc: #d97706; --dc2: #f59e0b; } .c-teal { --dc: #0d9488; --dc2: #2dd4bf; }
.c-slate { --dc: #64748b; --dc2: #94a3b8; } .c-indigo { --dc: #4f46e5; --dc2: #818cf8; }

/* Sidebar: dark, calm, grouped by department */
.side { background: var(--side-bg); border-right: 0; color: var(--side-ink); width: 240px; flex-basis: 240px; padding: 18px 12px; }
.side .brand { color: #fff; } .side .brand span:not(.logo) { color: var(--side-muted); }
.logo { background: linear-gradient(135deg, #6366f1, #a855f7 55%, #ec4899); box-shadow: 0 4px 14px rgba(124,58,237,.45); }
.side nav { gap: 2px; margin-top: 14px; }
.side .dot { width: 9px; height: 9px; border-radius: 3px; background: linear-gradient(135deg, var(--dc), var(--dc2)); flex: 0 0 auto; }
.home-link, .nav-group summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--side-ink); cursor: pointer; font-weight: 600; font-size: .9rem; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "\203A"; margin-left: 6px; color: var(--side-muted); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.home-link:hover, .nav-group summary:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.home-link.on { background: var(--side-hover); color: #fff; }
.nav-group a { color: var(--side-ink); opacity: .85; padding: 6px 10px 6px 29px; border-radius: 9px; font-size: .88rem; display: flex; gap: 8px; }
.nav-group a:hover { background: var(--side-hover); opacity: 1; color: #fff; }
.nav-group a.on { background: rgba(129,140,248,.16); color: #fff; opacity: 1; font-weight: 600; }
.nav-group .lbl { flex: 1; }
.side button.link { color: var(--side-muted); }
@media (max-width: 860px) { .mobile-top { background: var(--side-bg); color: #fff; border: 0; } .mobile-top .brand { color: #fff; } .burger { color: #fff; } }

/* Hero */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; padding: 26px 28px; border-radius: 22px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(900px 300px at 100% 0%, rgba(236,72,153,.35), transparent 60%), radial-gradient(700px 300px at 0% 100%, rgba(14,165,233,.35), transparent 60%), linear-gradient(135deg, #312e81, #4f46e5 50%, #7c3aed); box-shadow: 0 18px 40px rgba(79,70,229,.25); }
.hero h1 { color: #fff; font-size: 1.9rem; margin: 2px 0 6px; }
.hero-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; opacity: .75; margin: 0; }
.hero-sub { opacity: .9; margin: 0; max-width: 620px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats a { display: flex; flex-direction: column; min-width: 120px; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.hero-stats a:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.hero-stats b { font-size: 1.45rem; letter-spacing: -.02em; } .hero-stats span { font-size: .78rem; opacity: .85; }

.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; } .section-head h2 { margin: 0; }

/* Department cards */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.dept-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; }
.dept-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--dc), var(--dc2)); }
.dept-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,23,42,.10); border-color: color-mix(in srgb, var(--dc) 35%, var(--line)); }
.dept-card.soon { border-style: dashed; box-shadow: none; opacity: .8; } .dept-card.soon::before { opacity: .35; }
.dept-top { display: flex; align-items: center; gap: 12px; color: var(--ink); } .dept-top:hover { text-decoration: none; }
.dept-name { font-weight: 750; font-size: 1.08rem; letter-spacing: -.01em; }
.dept-blurb { color: var(--muted); font-size: .88rem; margin: 0; min-height: 2.6em; }
.dico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--dc), var(--dc2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--dc) 35%, transparent); flex: 0 0 auto; }
.dico.big { width: 60px; height: 60px; border-radius: 18px; } .dico.big svg { width: 28px; height: 28px; }
.pulse { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pulse.on { color: var(--good); background: var(--good-soft); } .pulse.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 5px; animation: blink 1.6s infinite; }
.pulse.off { background: transparent; border: 1px dashed var(--line); }
@keyframes blink { 50% { opacity: .3; } }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metrics .m { display: flex; flex-direction: column; background: var(--soft); border-radius: 12px; padding: 9px 10px; color: var(--ink); min-width: 0; }
.metrics a.m:hover { text-decoration: none; background: color-mix(in srgb, var(--dc, var(--accent)) 10%, var(--soft)); }
.metrics .m b { font-size: 1.2rem; letter-spacing: -.02em; } .metrics .m span { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metrics.big { margin-bottom: 16px; } .metrics.big .m { background: var(--card); border: 1px solid var(--line); padding: 14px 16px; box-shadow: var(--shadow); } .metrics.big .m b { font-size: 1.6rem; }
.dept-actions { display: flex; gap: 8px; margin-top: auto; }
.btn.ghost { background: transparent; }
.dept-card .dept-actions .btn.sm:first-child { background: linear-gradient(135deg, var(--dc), var(--dc2)); color: #fff; border: 0; font-weight: 600; }

/* Department page */
.dept-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px 24px; border-radius: 22px; margin-bottom: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--dc) 13%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--dc) 22%, var(--line)); }
.dept-hero h1 { margin: 0 0 4px; } .dept-hero .hero-kicker { color: var(--dc); opacity: 1; } .dept-hero .hero-sub { color: var(--muted); }
.dept-hero.slim { padding: 16px 20px; } .dept-hero.slim h1 { font-size: 1.3rem; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shortcut { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.shortcut:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); } .shortcut span { font-size: .8rem; color: var(--muted); }
.agent-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); } .agent-row:last-child { border-bottom: 0; }
.agent-row .name { font-weight: 650; color: var(--ink); } .agent-row .last { margin: 4px 0; }
.mini-msg { padding: 8px 12px; border-radius: 12px; background: var(--soft); margin: 8px 0; } .mini-msg.me { background: var(--accent-soft); }
.feed-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); } .feed-item:last-child { border-bottom: 0; }
.feed-item.link:hover { text-decoration: none; background: var(--soft); border-radius: 10px; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--soft); font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.step.hot { background: linear-gradient(135deg, #4f46e5, #a855f7); color: #fff; }
.card-head { padding: 12px 12px 4px; } .card-head h3 { margin: 0; }
.card.flush .list { border: 0; box-shadow: none; }

/* Content queue + profiles */
.post-card pre.msg { font-size: .95rem; line-height: 1.55; }
blockquote.target { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; }
blockquote.target div { margin: 2px 0; }
.profile-card.dim { opacity: .6; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 4px 14px; } .form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: span 2; } }
.form-grid textarea { min-height: 60px; }
details summary { cursor: pointer; }
a.card:hover { transform: translateY(-2px); }
@media (max-width: 700px) { .hero { padding: 20px; border-radius: 18px; } .hero h1 { font-size: 1.5rem; } .hero-stats a { min-width: 0; flex: 1; } .metrics .m b { font-size: 1.05rem; } }

/* Staff: lessons + deliverables */
.lesson { border-bottom: 1px solid var(--line); padding: 8px 0; } .lesson:last-child { border-bottom: 0; }
.lesson summary { list-style: none; } .lesson summary::-webkit-details-marker { display: none; }
p.pre { white-space: pre-wrap; }
pre.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; max-height: 420px; overflow: auto; }
.card.flag { border-left: 4px solid var(--warn); background: var(--warn-soft); }

/* Munshi: the owner's PA */
.m-avatar { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, #0d9488, #4f46e5); flex: 0 0 auto; box-shadow: 0 6px 18px rgba(79,70,229,.25); }
.munshi-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.munshi-hero h1 { margin: 0 0 2px; }
.munshi-hero .grow { flex: 1; min-width: 240px; }
.munshi-box { border: 1px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--card) 70%); }
.munshi-box h3 { margin: 0; }
.munshi-box .m-avatar { width: 40px; height: 40px; font-size: 1.1rem; }
.munshi-box form { display: flex; gap: 8px; margin-top: 12px; }
.munshi-box form input[name="content"] { flex: 1; min-width: 0; }
.munshi-box .last { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); white-space: pre-wrap; }
.munshi-box .last:hover { border-color: var(--accent); text-decoration: none; }
.bubble.report { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.record .pre { margin: 8px 0; }
.record h4 { margin: 14px 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rec-reply { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin: 8px 0; }
.rec-reply .pre { margin: 4px 0; }
.rec-task { padding: 7px 0; border-bottom: 1px solid var(--line); }
.rec-task:last-child { border-bottom: 0; }
.timeline { color: var(--muted); margin-top: 3px; line-height: 1.7; }
.timeline span { white-space: nowrap; }
.record .acts, .rec-reply .acts { margin: 6px 0 0; padding-left: 0; list-style: none; }
.record .acts li { color: var(--good); }
.record .acts li.bad { color: var(--bad); }
.note-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.note-row:last-child { border-bottom: 0; }
.note-row .grow { flex: 1; }
.note-row form { display: flex; gap: 6px; flex: 0 0 auto; }
@media (max-width: 700px) { .note-row { flex-direction: column; } .note-row form { width: 100%; } .note-row form input { flex: 1; } .munshi-box form { flex-direction: column; } }

/* Dev team: command center, developer pages, approvals, Claude account usage */
.dev-row .main .row { gap: 6px; flex-wrap: wrap; }
.dev-row .preview { white-space: normal; }
.acct { padding: 10px 0; border-bottom: 1px solid var(--line); }
.acct:last-of-type { border-bottom: 0; }
.acct .row { gap: 8px; flex-wrap: wrap; }
.usage { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; margin-top: 6px; }
.usage progress { width: 100%; height: 8px; accent-color: var(--accent); }
.approval { border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: var(--card); }
.approval .row { margin-top: 8px; gap: 8px; }
.card.attention { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.msg-row.sys { justify-content: center; }
.center { text-align: center; }
.pad { padding: 12px 16px; }
.msg-tools { margin-top: 6px; }
.replying { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; }
.big-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .08em; font-family: ui-monospace, Consolas, monospace; margin: 6px 0; }
@media (max-width: 700px) { .usage { grid-template-columns: 52px 1fr; } .usage span:last-child { grid-column: 1 / -1; } }
/* Long paths and commands wrap instead of pushing cards off the screen */
.grid2 > *, .stats > *, .dept-hero .grow, .list-row .main, .feed-item .grow { min-width: 0; }
.bubble .text, .approval .pre, .feed li, .dev-row .preview, .hero-sub, .card p, .card code, .msg-tools { overflow-wrap: anywhere; }
.dept-hero .grow { flex: 1 1 320px; }
.dev-row .main div { overflow-wrap: anywhere; }

/* ---------- Munshi: chat + history box, files, voice notes ---------- */
[hidden] { display: none !important; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; }
ul.plain li { padding: 3px 0; }
form.inline { display: inline; }
.munshi-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.munshi-grid > * { min-width: 0; }
@media (min-width: 1100px) { .munshi-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
.chat-bar { margin-bottom: 6px; }
.focus-panel { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 40px); padding: 12px; }
.focus-head { display: flex; align-items: center; gap: 8px; }
.focus-head select { flex: 1; min-width: 0; }
.focus-title { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.focus-title .row { gap: 8px; }
.focus-items { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 120px; flex: 1; }
.fi { border-radius: 12px; padding: 7px 10px; background: var(--soft); border: 1px solid var(--line); }
.fi .text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.fi-owner { background: var(--accent-soft); border-color: var(--accent); margin-left: 18px; }
.fi-report, .fi-developer { border-left: 3px solid var(--good); }
.fi-system { opacity: .8; font-size: .85rem; }
.focus-tasks { border-top: 1px solid var(--line); padding-top: 6px; }
#focus-close { display: none; }
button.about { padding: 0 2px; color: inherit; text-decoration: underline dotted; }
@media (max-width: 1099px) {
  .focus-panel { display: none; }
  .focus-panel.open { display: flex; position: fixed; inset: 0; z-index: 60; max-height: none; border-radius: 0; margin: 0; }
  .focus-panel.open #focus-close { display: inline-flex; }
}
@media (min-width: 1100px) { #focus-toggle { display: none; } }
.files { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.pics { display: flex; flex-wrap: wrap; gap: 6px; }
.pic { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.pic img { display: block; height: 120px; max-width: 220px; object-fit: cover; }
.flabel { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(15, 23, 42, .72); color: #fff; }
.pic .flabel { position: absolute; left: 6px; top: 6px; }
.vid video { display: block; width: 100%; max-width: 360px; max-height: 260px; border-radius: 10px; background: #000; margin-top: 3px; }
.aud audio { display: block; width: 100%; max-width: 320px; margin-top: 3px; }
.doc { display: inline-flex; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble.owner .doc { color: var(--ink); }
.tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tchip { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); max-width: 260px; }
.tchip img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; }
.tchip .ticon { font-size: 1.4rem; width: 44px; text-align: center; }
.tchip .tname { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.tchip .flabel { position: absolute; left: -6px; top: -8px; }
.tchip.busy { opacity: .6; }
.tchip.bad { border-color: var(--bad); }
.tchip.bad .tname { white-space: normal; color: var(--bad); }
.say.drop { outline: 2px dashed var(--accent); }
.composer { flex-wrap: wrap; gap: 8px; }
.composer #attach { flex: 0 0 auto; min-width: 0; }
.recbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); border: 1px solid var(--bad); margin-bottom: 6px; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: recpulse 1s infinite; }
.rectime { font-variant-numeric: tabular-nums; font-weight: 700; }
@keyframes recpulse { 50% { opacity: .25; } }
@media (max-width: 700px) { .recbar .muted { display: none; } .pic img { height: 96px; max-width: 160px; } }

/* ---------- Resources ---------- */
.res-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 8px; }
@media (min-width: 760px) { .res-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .res-grid { grid-template-columns: 1fr 1fr 1fr; } }
.res { display: flex; flex-direction: column; gap: 6px; }
.res-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: 0 0 auto; }
.res-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.res details.add > summary { list-style: none; display: inline-flex; }
.res details.add > summary::-webkit-details-marker { display: none; }
.res details.add[open] > summary { margin-bottom: 8px; }
.res .steps { padding-left: 18px; margin: 4px 0 8px; }
.res-home { display: block; color: inherit; }
.res-home:hover { text-decoration: none; border-color: var(--accent); }
.focus-title, .focus-title .small, .focus-title b { overflow-wrap: anywhere; min-width: 0; }
.focus-panel { overflow: hidden; }
/* Phone: the chat comes first; the numbers shrink to one row */
@media (max-width: 700px) {
  .munshi-hero p { display: none; }
  .munshi-hero { margin-bottom: 8px; }
  .munshi-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .munshi-stats .card { padding: 8px 6px; text-align: center; }
  .munshi-stats .stat { font-size: 1.15rem; }
  .munshi-stats .muted { font-size: .68rem; line-height: 1.2; }
}

/* Existing projects: the "where you left off" note and the owner's earlier chats */
.recap-card { border-left: 4px solid var(--accent); }
.recap-card .text, .recap .text, .fi-recap .text { white-space: pre-wrap; }
.recap { max-width: 680px; margin: 6px auto; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.fi-recap { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.fi.earlier, .msg-row.earlier .bubble { opacity: .82; }
.recap-card > .row { flex-wrap: wrap; gap: 2px 10px; }
@media (max-width: 640px) { .recap-card > .row h3 { flex-basis: 100%; } }

/* Sidebar (2026-11-25): Home, Munshi, departments; Settings and Sign out at the bottom. */
.side-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }
.home-link .badge { margin-left: auto; }
/* A project's two-line note under its name; older long notes stay folded. */
.hero-sub.note { white-space: pre-line; font-weight: 600; margin-top: 6px; }
.dept-hero .hero-kicker a { color: inherit; }
details.recap > summary, details.fi-recap > summary { cursor: pointer; }
