/* Rotbun Command Centre: brand navy #014085 and orange #F88034. */
:root {
  --navy: #014085; --navy-ink: #0a2f5c; --navy-deep: #071d3a; --orange: #F88034; --orange-ink: #c85f17;
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f7f9fc; --text: #142033; --muted: #5d6a80; --line: #e2e7ef;
  --accent: #014085; --accent-soft: rgba(1, 64, 133, .08);
  --ok: #18804a; --warn: #a96300; --bad: #c0392b; --info: #014085;
  --exec: #F88034; --bd: #014085; --ops: #2a7bbf;
  --radius: 14px; --shadow: 0 1px 2px rgba(10, 30, 60, .05), 0 4px 16px rgba(10, 30, 60, .06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #111b2e; --surface-2: #0e1729; --text: #e7edf6; --muted: #93a2ba; --line: #213049;
  --accent: #6aa6ff; --accent-soft: rgba(106, 166, 255, .12);
  --ok: #4cc27f; --warn: #f0a640; --bad: #ff6b5e; --info: #7fb0ff; --bd: #4f8fe6; --ops: #4fb3e6;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --surface: #111b2e; --surface-2: #0e1729; --text: #e7edf6; --muted: #93a2ba; --line: #213049;
    --accent: #6aa6ff; --accent-soft: rgba(106, 166, 255, .12);
    --ok: #4cc27f; --warn: #f0a640; --bad: #ff6b5e; --info: #7fb0ff; --bd: #4f8fe6; --ops: #4fb3e6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; } h2 { font-size: 1.05rem; font-weight: 650; } h3 { font-size: .95rem; font-weight: 650; }
a { color: var(--accent); cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .84rem; }
.error { color: var(--bad); min-height: 1.2em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: border-color .15s, background .15s, transform .05s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #02509f; }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #241104; }
.btn.accent:hover { background: #ff8f45; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg, .icon-btn svg, i[data-icon] svg { width: 18px; height: 18px; flex: none; }
i[data-icon] { display: inline-flex; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: .84rem; color: var(--muted); margin: 10px 0; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
kbd { font: 600 .72rem ui-monospace, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(120% 90% at 20% 10%, #0b4f9e 0%, var(--navy-ink) 45%, var(--navy-deep) 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px; text-align: center; }
.login-art h2 { font-size: 1.8rem; margin-top: 28px; }
.login-art p { color: #b9cbe6; margin: 0; }
.login-card { align-self: center; justify-self: center; width: min(400px, calc(100% - 32px)); padding: 24px 0; }
.login-logo { margin-bottom: 18px; width: auto; }
.on-dark { display: none; }
:root[data-theme="dark"] .on-dark { display: inline-block; } :root[data-theme="dark"] .on-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .on-dark { display: inline-block; } :root:not([data-theme="light"]) .on-light { display: none; } }
.art-logo { margin-top: 26px; width: auto; }
.login-art h2 { margin-top: 6px !important; font-weight: 500; color: #ffb27d; font-size: 1.2rem !important; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.nav { background: linear-gradient(180deg, var(--navy-ink) 0%, var(--navy-deep) 100%); color: #d6e2f3; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; z-index: 15; }
.nav-brand { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; color: #fff; padding: 4px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.nav-brand img { width: auto; max-width: 100%; }
.nav-brand small { display: block; color: #93acd0; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.nav nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f98bd; margin: 14px 10px 6px; }
.nav nav a { color: #d6e2f3; text-decoration: none; padding: 9px 10px; border-radius: 10px; display: flex; gap: 11px; align-items: center; font-weight: 500; transition: background .15s; }
.nav nav a span { flex: 1; }
.nav nav a i svg { width: 18px; height: 18px; opacity: .85; }
.nav nav a:hover { background: rgba(255,255,255,.06); }
.nav nav a.active { background: linear-gradient(90deg, rgba(248,128,52,.22), rgba(248,128,52,.04)); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.nav nav a.active i svg { opacity: 1; color: var(--orange); }
.nav-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.nav-foot .me { display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 600; font-size: .9rem; }
.nav-foot .me small { display: block; color: #93acd0; font-weight: 400; font-size: .75rem; }
.nav-foot .btn { color: #d6e2f3; border-color: rgba(255,255,255,.18); }
.badge { background: var(--orange); color: #241104; border-radius: 999px; padding: 0 8px; font-size: .72rem; font-weight: 700; line-height: 1.6; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.command { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; box-shadow: var(--shadow); max-width: 760px; }
.command:focus-within { border-color: var(--accent); }
.command i svg { color: var(--orange); }
.command input { border: 0; background: transparent; padding: 11px 0; outline: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.mic { background: var(--navy); border-color: var(--navy); color: #fff; }
.icon-btn.mic.live { background: var(--orange); border-color: var(--orange); color: #241104; animation: ring 1.4s infinite; }
.icon-btn.speaking { border-color: var(--orange); color: var(--orange); }
.wake-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface); white-space: nowrap; }
.wake-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: blink 1.6s infinite; }
.only-mobile { display: none; }

.main { padding: 24px; min-width: 0; max-width: 1480px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: 1fr 1fr; }
.dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.banner { border-left: 4px solid var(--orange); margin-bottom: 16px; }
.section { margin-top: 18px; }

/* ---------------------------------------------------------------- dashboard */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 0% 0%, #0b56a8 0%, var(--navy) 40%, var(--navy-ink) 100%); color: #fff; border: 0; display: flex; gap: 22px; align-items: center; padding: 22px 24px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(248,128,52,.35), transparent 65%); }
.hero h1 { font-size: 1.6rem; margin-bottom: 4px; }
.hero p { margin: 0; color: #c9d8ee; }
.hero .grow { flex: 1; position: relative; z-index: 1; }
.hero .actions { margin-top: 14px; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.hero .orb { flex: none; z-index: 1; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.kpi { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.kpi .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi .ic.o { background: rgba(248,128,52,.14); color: var(--orange-ink); }
:root[data-theme="dark"] .kpi .ic.o { color: var(--orange); }
.kpi .v { font-size: 1.45rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .v.na { font-size: .88rem; font-weight: 500; color: var(--muted); }
.kpi .l { color: var(--muted); font-size: .8rem; }
.agent-row { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.agent-row:last-child { border-bottom: 0; }
.agent-row:hover { background: var(--accent-soft); border-radius: 10px; }
.agent-row .info { flex: 1; min-width: 0; }
.agent-row .info .t { font-weight: 600; font-size: .92rem; }
.agent-row .info .s { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: .76rem; white-space: nowrap; min-width: 46px; }
.decision { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.decision:last-child { border-bottom: 0; }
.decision .grow { flex: 1; min-width: 0; }
.empty { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 6px 0; }

/* ---------------------------------------------------------------- avatars and status */
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: .82rem; color: #fff; flex: none; position: relative; letter-spacing: .02em; background: var(--bd); }
.avatar.executive { background: linear-gradient(135deg, #ff9a52, #e86a1c); color: #241104; }
.avatar.business_development { background: linear-gradient(135deg, #1a62b5, #013a78); }
.avatar.operations { background: linear-gradient(135deg, #3592d6, #1d5f99); }
.avatar.founder { background: var(--orange); color: #241104; border-radius: 50%; width: 34px; height: 34px; }
.avatar.lg { width: 52px; height: 52px; font-size: 1rem; border-radius: 15px; }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; border-radius: 9px; }
.avatar .st { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: #8c98aa; }
.st.working { background: var(--ok) !important; animation: blink 1.2s infinite; }
.st.queued { background: var(--info) !important; }
.st.idle { background: #8c98aa; }
.st.paused { background: var(--warn) !important; }
.st.deactivated { background: var(--bad) !important; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, currentColor 12%, transparent); }
.pill.ok, .pill.completed, .pill.verified, .pill.executed, .pill.approved, .pill.idle, .pill.active { color: var(--ok); }
.pill.working, .pill.in_progress, .pill.queued, .pill.pending, .pill.scheduled, .pill.awaiting_approval, .pill.new, .pill.proposed, .pill.waiting_on_subtasks { color: var(--info); }
.pill.blocked, .pill.awaiting_manual_execution, .pill.modification_requested, .pill.draft, .pill.paused, .pill.medium, .pill.high-prio { color: var(--warn); }
.pill.failed, .pill.rejected, .pill.cancelled, .pill.deactivated, .pill.high, .pill.urgent, .pill.execution_failed, .pill.level3 { color: var(--bad); }
.pill.historical, .pill.low, .pill.normal { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
tr.click:hover td { background: var(--accent-soft); cursor: pointer; }
.table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- workforce */
.dept-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.dept-head h2 { margin: 0; }
.dept-head .line { flex: 1; height: 1px; background: var(--line); }
.agent-card { display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.agent-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.agent-card .top { display: flex; gap: 12px; align-items: center; }
.agent-card h3 { margin: 0; }
.agent-card .dept { font-size: .78rem; color: var(--muted); }
.agent-card .task { font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------------------------------------------------------- chat */
.chat { display: grid; grid-template-columns: 290px 1fr; gap: 14px; height: calc(100vh - 114px); }
.conv-list { overflow-y: auto; padding: 10px; }
.conv-list a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: .9rem; }
.conv-list a:hover { background: var(--accent-soft); }
.conv-list a.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--orange); font-weight: 600; }
.conv-list .grp { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 12px 10px 4px; }
.conv { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.conv-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.conv-head .grow { flex: 1; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.msg-row { display: flex; gap: 10px; align-items: flex-start; max-width: 86%; }
.msg-row.founder { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.system { align-self: center; }
.msg { padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; min-width: 0; }
.msg-row.founder .msg { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.msg-row.agent .msg { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; white-space: normal; }
.msg-row.system .msg { font-size: .84rem; color: var(--muted); background: transparent; }
.msg .who { font-size: .74rem; opacity: .75; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.msg .speak { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; opacity: .7; display: inline-flex; }
.msg .speak:hover { opacity: 1; color: var(--orange); }
.msg .speak svg { width: 15px; height: 15px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 48px; max-height: 200px; }
.typing { font-size: .82rem; color: var(--muted); padding: 6px 16px; display: flex; gap: 8px; align-items: center; min-height: 30px; }
.typing:not(:empty)::before { content: ""; width: 26px; height: 8px; background: radial-gradient(circle, var(--orange) 3px, transparent 3.5px) 0 50% / 9px 8px repeat-x; animation: dots 1s steps(3) infinite; }

/* ---------------------------------------------------------------- drawer, misc */
.drawer { position: fixed; inset: 0; background: rgba(5,15,30,.5); display: flex; justify-content: flex-end; z-index: 40; backdrop-filter: blur(2px); }
.drawer-panel { background: var(--surface); width: min(780px, 100%); height: 100%; overflow-y: auto; padding: 26px; position: relative; box-shadow: -10px 0 40px rgba(0,0,0,.25); }
.drawer-close { position: absolute; right: 16px; top: 16px; }
.pre { white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .9rem; }
.pre.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; max-height: 420px; overflow: auto; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.timeline li { border-left: 2px solid var(--line); padding: 2px 0 10px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.ap-card .head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 160px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy-ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 60; max-width: 90vw; box-shadow: var(--shadow); }
.toast.err { background: var(--bad); }
.md h1, .md h2, .md h3, .md h4 { margin-top: .7rem; }
.md ul { margin: .3rem 0; padding-left: 1.2rem; }
.report-card .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--text); }
.switch input { width: auto; }

/* ---------------------------------------------------------------- voice assistant */
.orb { --s: 120px; width: var(--s); height: var(--s); position: relative; display: grid; place-items: center; }
.orb.big { --s: 180px; }
.orb.sm { --s: 64px; }
.orb span { position: absolute; inset: 0; border-radius: 50%; }
.orb span:nth-child(1) { background: radial-gradient(circle at 35% 30%, #ffb27d 0%, var(--orange) 30%, #b44d0c 70%); box-shadow: 0 0 40px rgba(248,128,52,.55), inset 0 0 20px rgba(255,255,255,.25); inset: 22%; }
.orb span:nth-child(2) { border: 2px solid rgba(248,128,52,.45); inset: 10%; animation: breathe 3.2s ease-in-out infinite; }
.orb span:nth-child(3) { border: 1px solid rgba(120,170,255,.35); animation: breathe 3.2s ease-in-out infinite .6s; }
.orb.listening span:nth-child(2), .orb.listening span:nth-child(3) { animation: pulse 1.1s ease-out infinite; border-color: rgba(248,128,52,.7); }
.orb.listening span:nth-child(3) { animation-delay: .35s; }
.orb.speaking span:nth-child(1) { animation: talk .5s ease-in-out infinite alternate; }
.orb.thinking span:nth-child(2) { border-style: dashed; animation: spin 2.4s linear infinite; }
.voice { position: fixed; inset: 0; z-index: 50; background: rgba(4, 14, 30, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.voice-panel { position: relative; width: min(560px, 100%); background: radial-gradient(120% 100% at 50% 0%, #0d3f7a 0%, var(--navy-ink) 50%, var(--navy-deep) 100%); color: #fff; border-radius: 22px; padding: 34px 26px 22px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08); }
.voice-panel .orb { margin: 0 auto 14px; }
.voice-close { position: absolute; right: 14px; top: 14px; background: transparent; color: #fff; border-color: rgba(255,255,255,.2); }
.voice-state { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #ffb27d; }
.voice-heard { font-size: 1.2rem; font-weight: 600; min-height: 1.6em; margin: 10px 0 6px; }
.voice-reply { color: #c9d8ee; white-space: pre-wrap; max-height: 40vh; overflow-y: auto; text-align: left; }
.voice-reply:empty { display: none; }
.voice-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.voice-actions:empty { display: none; }
.voice-actions .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.voice-hints { margin-top: 18px; color: #8ea6c9 !important; }

@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: .5; } }
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes talk { from { transform: scale(.94); } to { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(248,128,52,.6); } 100% { box-shadow: 0 0 0 12px rgba(248,128,52,0); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes dots { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .nav.open { transform: none; }
  .only-mobile { display: inline-grid; }
  .hide-mobile { display: none; }
  .topbar { padding: 10px 16px; gap: 6px; }
  .topbar #theme-btn, .topbar #voice-settings-btn, .wake-pill { display: none !important; }
  .main { padding: 16px; }
  .two, .chat { grid-template-columns: 1fr; }
  .chat { height: auto; }
  .msgs { max-height: 60vh; }
  .kv { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero .orb { display: none; }
  .msg-row { max-width: 100%; }
}
.hero-date { color: #ffb27d; letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; }
.grow-min { flex: 1; min-width: 0; }
.main svg, .voice svg, .drawer svg { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.kpi .ic svg { width: 20px; height: 20px; vertical-align: 0; }
.msg .speak svg { width: 15px; height: 15px; }
.nav-brand img { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
kbd { white-space: nowrap; }

/* CRM */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: 9px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--orange); }
.grow { flex: 1; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 140px; border-top: 3px solid var(--navy); }
.kcol.qualified, .kcol.proposal { border-top-color: var(--orange); }
.kcol.won { border-top-color: #1f9d55; } .kcol.lost { border-top-color: #b4232c; } .kcol.nurture { border-top-color: var(--muted); }
.khead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kval { margin-bottom: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .05s; }
.kcard:hover { border-color: var(--accent); }
.kt { font-weight: 600; overflow-wrap: anywhere; }
.kmeta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.score { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; font-weight: 600; }
.kn { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.kempty { font-size: .82rem; color: var(--muted); text-align: center; padding: 18px 0; }

/* Marketing */
.plat { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.plat-linkedin { background: rgba(10, 102, 194, .12); color: #0a66c2; }
.plat-instagram { background: rgba(193, 53, 132, .12); color: #c13584; }
.plat-facebook { background: rgba(24, 119, 242, .12); color: #1877f2; }
.plat-x, .plat-tiktok { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.plat-youtube { background: rgba(255, 0, 0, .1); color: #d40000; }
.plat-blog, .plat-newsletter, .plat-website { background: rgba(248, 128, 52, .14); color: var(--orange-ink); }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { position: relative; min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.past { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-date { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cal-item { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; padding: 4px 6px; border-radius: 7px; cursor: pointer; border-left: 3px solid var(--muted); background: var(--surface-2); min-width: 0; }
.cal-item:hover { outline: 1px solid var(--accent); }
.cal-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-draft, .st-idea { border-left-color: var(--warn); }
.st-awaiting_approval { border-left-color: var(--info); }
.st-approved { border-left-color: var(--ok); }
.st-published { border-left-color: var(--navy); background: var(--accent-soft); }
.legend { border-left-width: 3px; border-left-style: solid; padding-left: 5px; margin-left: 6px; }
.cal-add { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 6px; border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add svg { width: 14px; height: 14px; }
.post-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.pp-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pp-head img { width: 38px; height: 38px; border-radius: 50%; }
.pp-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.pp-tags { color: var(--accent); margin-top: 8px; overflow-wrap: anywhere; }
.pp-cta { margin: 10px 0 6px; font-weight: 600; color: var(--orange-ink); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; padding: 6px 10px; border-radius: 8px; margin-top: 6px; }
.check svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.check.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.check.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); }
.check.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.chan-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text); }
.chk input { width: auto; }
@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; border-right: 0; }
  .cal-day.past { display: none; }
  .cal-add { opacity: 1; }
}


/* ---- media gallery, invoice lines (autonomy and Phase 5) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.gallery .media { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.gallery img, .gallery video { width: 100%; height: auto; display: block; border-radius: 6px; background: var(--line); }
.gallery figcaption { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 4px; }
.inv-line { grid-template-columns: 1fr 90px 140px; gap: 8px; margin-bottom: 6px; align-items: center; }
label.btn { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
code { font-size: .85em; background: color-mix(in srgb, var(--text) 8%, transparent); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
@media (max-width: 640px) { .inv-line { grid-template-columns: 1fr 70px 100px; } }
