/* Unison CRM. Plain CSS, no build step.
   Same family as the rest of Unison (blue and white, soft glass), tuned for dense data: a sidebar,
   solid white work surfaces, compact tables. */

:root {
  --bg-a: #f5f8ff;
  --bg-b: #e3ecfb;
  --ink: #0b1b3a;
  --muted: #4a5d83;
  --faint: #7b8bab;
  --line: #e3e9f4;
  --line-2: #cfd8ea;
  --blue: #1d5bff;
  --blue-d: #1548d8;
  --blue-soft: #edf2ff;
  --ok: #0b6a3a;      --ok-bg: #dcf5e6;
  --warn: #8a5300;    --warn-bg: #ffefc9;
  --bad: #b3261e;     --bad-bg: #fde3e0;
  --info: #1548d8;    --info-bg: #e0eaff;
  --purple: #5b3fd6;  --purple-bg: #ebe6ff;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --shadow: 0 1px 2px rgba(20, 50, 120, .06), 0 8px 24px -14px rgba(29, 91, 255, .28);
  --r: 14px;
  --r-sm: 9px;
  --side: 228px;
  --font: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #e9f0fc; }
body { margin: 0; color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vw 50vh at 100% -10%, rgba(112, 164, 255, .26), transparent 62%), linear-gradient(180deg, var(--bg-a), var(--bg-b)); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- text helpers ---------- */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; } .grow { flex: 1 1 auto; min-width: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- frame ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; overflow-y: auto;
  background: var(--glass); border-right: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
/* The Unison Labs flask on its cream chip, the same mark as unisonlabs.co. */
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 9px; background: #FDF8EE url(icons/icon.svg) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(20, 27, 77, .12); }
.nav-group { margin: 12px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--blue-soft); text-decoration: none; }
.nav a.on { background: var(--blue); color: #fff; }
.nav a svg { opacity: .8; }
.nav .badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav a.on .badge { background: #fff; color: var(--blue-d); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--r-sm); width: 100%; text-align: left; }
.who:hover { background: var(--blue-soft); text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 22px;
  background: var(--glass); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.search-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; flex: 0 1 420px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line-2); color: var(--faint); text-align: left; }
.search-btn:hover { border-color: var(--blue); }
.search-btn kbd { margin-left: auto; font: inherit; font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--bg-b); color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #1fb866; } .live.off i { background: #c7a23a; }
.page { padding: 20px 22px 60px; min-width: 0; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-h h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.page-h .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }

/* ---------- layout ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s-3 { grid-column: span 3; } .s-4 { grid-column: span 4; } .s-5 { grid-column: span 5; } .s-6 { grid-column: span 6; }
.s-7 { grid-column: span 7; } .s-8 { grid-column: span 8; } .s-9 { grid-column: span 9; } .s-12 { grid-column: span 12; }
@media (max-width: 1150px) { .s-3 { grid-column: span 6; } .s-4, .s-5, .s-6, .s-7, .s-8, .s-9 { grid-column: span 12; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 30px; flex-wrap: wrap; }
.card-h h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-v { font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- rows and tables ---------- */
.rows > * { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rows > *:last-child { border-bottom: 0; }
.row-click { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding-left: 6px !important; padding-right: 6px !important; width: calc(100% + 12px); text-align: left; }
.row-click:hover { background: var(--blue-soft); }
.row-t { font-weight: 600; } .row-s { color: var(--muted); font-size: 12.5px; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; background: #f6f8fd; border-bottom: 1px solid var(--line-2); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tbody tr:hover td { background: #f8faff; }
.tbl tbody tr.sel td { background: var(--blue-soft); }
.tbl td.pick, .tbl th.pick { width: 38px; padding-right: 0; }
.tbl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); vertical-align: middle; }
.tbl a.name { font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; max-width: 100%; }
.tbl a.name:hover { color: var(--blue-d); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #9fb0d0; background: #fafcff; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--blue-d); padding: 0 8px; }
.btn.quiet:hover { background: var(--blue-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; } .btn.icon.sm { width: 28px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input { height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #fff; min-width: 0; }
textarea.input { height: auto; min-height: 40px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.input.sm { height: 28px; font-size: 12.5px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #e7edf8; }
.seg button { height: 28px; padding: 0 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 50, 120, .16); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { padding: 9px 13px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--blue-d); border-bottom-color: var(--blue); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: #eef2f9; color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.purple { background: var(--purple-bg); color: var(--purple); }
.chip button { margin-left: 2px; color: inherit; opacity: .7; } .chip button:hover { opacity: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #1fb866; flex: none; }
.dot.warn { background: #f0a92b; } .dot.bad { background: #e0453b; } .dot.info { background: var(--blue); } .dot.mute { background: #b4c0d8; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 700; flex: none; }
.avatar.p2 { background: #0b1b3a; } .avatar.none { background: #e7edf8; color: var(--muted); }
.avatar.rec { background: #dfe8fb; color: var(--blue-d); border-radius: 8px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }
.avatar.lg.round { border-radius: 50%; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; background: #fff; }
.check:hover { border-color: var(--blue); } .check.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.bar { height: 8px; border-radius: 999px; background: #e7edf8; overflow: hidden; min-width: 50px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.note { padding: 9px 13px; border-radius: 10px; background: var(--info-bg); font-size: 13px; }
.note.warn { background: var(--warn-bg); }

/* ---------- list page toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fafcff; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; background: var(--blue-soft); border-bottom: 1px solid var(--line); font-weight: 600; }

/* ---------- deal board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #eef3fb; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 220px; }
.col.over { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--blue-soft); }
.col-h { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.col-h b { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.col-h span { color: var(--muted); font-size: 12px; font-weight: 500; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.col-foot { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.deal { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; box-shadow: 0 1px 2px rgba(20, 50, 120, .06); cursor: grab; }
.deal:hover { border-color: var(--blue); }
.deal .row-t { display: block; color: var(--blue-d); }
.deal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 12.5px; color: var(--muted); }

/* ---------- record page ---------- */
.record { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1250px) { .record { grid-template-columns: 280px minmax(0, 1fr); } .record > .rec-right { grid-column: 1 / -1; } }
@media (max-width: 860px) { .record { grid-template-columns: 1fr; } }
.rec-head { display: flex; gap: 12px; align-items: center; }
.rec-head h1 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.quick { display: flex; gap: 6px; margin-top: 14px; justify-content: space-between; }
.quick button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 9px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.quick button:hover { background: var(--blue-soft); color: var(--blue-d); }
.quick button span.ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: #fff; color: var(--blue-d); }
.props { margin-top: 6px; }
.prop { padding: 7px 0; border-bottom: 1px solid var(--line); }
.prop:last-child { border-bottom: 0; }
.prop-l { font-size: 12px; color: var(--muted); }
.prop-v { display: block; width: 100%; text-align: left; min-height: 24px; padding: 2px 5px; margin: 1px -5px 0; border-radius: 6px; overflow-wrap: anywhere; }
button.prop-v:hover { background: var(--blue-soft); }
.prop-v.blank { color: var(--faint); }
.prop .input { width: 100%; margin-top: 2px; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-month { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 2px 0; }
.act { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.act-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-d); flex: none; }
.act-ic.call { background: var(--ok-bg); color: var(--ok); } .act-ic.task { background: var(--warn-bg); color: var(--warn); }
.act-ic.meeting { background: var(--purple-bg); color: var(--purple); } .act-ic.email { background: var(--info-bg); color: var(--info); }
.act-body { margin-top: 8px; }
.act.done .act-title { text-decoration: line-through; color: var(--faint); }
.assoc-item { display: block; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.assoc-item:hover { border-color: var(--blue); text-decoration: none; }
.stagebar { display: flex; gap: 3px; margin-bottom: 14px; }
.stagebar button { flex: 1; min-width: 0; padding: 7px 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: #e7edf8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagebar button:first-child { border-radius: 8px 0 0 8px; } .stagebar button:last-child { border-radius: 0 8px 8px 0; }
.stagebar button:hover { background: #d7e2f8; color: var(--ink); }
.stagebar button.past { background: #b9cdfb; color: var(--ink); } .stagebar button.on { background: var(--blue); color: #fff; }
.stagebar button.on.won { background: #169b55; } .stagebar button.on.lost { background: #c6392f; }

/* ---------- charts ---------- */
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 180px; padding-top: 6px; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; min-width: 0; }
.chart-bars { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; border-bottom: 1px solid var(--line-2); }
.chart-bars i { display: block; width: min(28px, 60%); border-radius: 5px 5px 0 0; background: var(--blue); min-height: 2px; }
.chart-bars i.b { background: #9db8f5; }
.chart-x { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--blue); } .legend i.b { background: #9db8f5; }

/* ---------- modal and forms ---------- */
.modal { border: 0; padding: 0; border-radius: 16px; background: #fff; color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 30px 80px -20px rgba(11, 27, 58, .5); }
.modal.wide { width: min(820px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(11, 27, 58, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal form, .modal .modal-body { padding: 20px 22px; }
.modal h2 { font-size: 19px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 4px; padding-right: 30px; }
.modal .intro { color: var(--muted); margin-bottom: 4px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.modal-x:hover { background: var(--blue-soft); color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.f { grid-column: span 2; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f.half { grid-column: span 1; }
@media (max-width: 520px) { .f.half { grid-column: span 2; } }
.f > span { font-size: 12.5px; font-weight: 600; }
.f > small { color: var(--muted); font-size: 12px; }
.f input, .f select, .f textarea { width: 100%; height: 38px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #fff; }
.f textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.f input:focus-visible, .f select:focus-visible, .f textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.f.check-f { flex-direction: row; align-items: center; gap: 9px; }
.f.check-f input { width: 17px; height: 17px; accent-color: var(--blue); }
.f.err input, .f.err select, .f.err textarea { border-color: var(--bad); }
.f-err { color: var(--bad); font-size: 12.5px; font-weight: 500; }
.form-err { color: var(--bad); font-weight: 500; margin-top: 10px; }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.modal-foot .sp { flex: 1; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 500; font-size: 13.5px; box-shadow: 0 12px 30px -10px rgba(11, 27, 58, .6); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }
.menu { position: absolute; z-index: 60; min-width: 190px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 5px; box-shadow: 0 18px 44px -14px rgba(11, 27, 58, .4); }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--ink); font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--blue-soft); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- search palette ---------- */
.palette { width: min(620px, calc(100vw - 24px)); }
.palette input { width: 100%; height: 50px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); font-size: 16px; outline: none; border-radius: 16px 16px 0 0; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink); }
.palette-list a:hover, .palette-list a.on { background: var(--blue-soft); text-decoration: none; }
.palette-group { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 3px; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 26px 26px 22px; }
.auth-card .brand { padding: 0 0 18px; font-size: 18px; }
.auth-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.auth-card .intro { color: var(--muted); margin-top: 6px; }
.auth-card .btn { width: 100%; height: 40px; margin-top: 16px; }
.copy-box { display: flex; gap: 8px; margin-top: 8px; }
.copy-box input { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .18s; background: #fff; box-shadow: 0 0 60px rgba(11, 27, 58, .3); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .page { padding: 16px 14px 60px; } .topbar { padding: 10px 14px; }
}
@media print { .side, .topbar, .toasts, .no-print { display: none !important; } .shell { display: block; } body::before { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- sidebar: the less-used screens fold under "More" ---------- */
.nav-more { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; text-align: left; }
.nav-more:hover { background: var(--blue-soft); color: var(--ink); }
.nav-more svg { transition: transform .15s; transform: rotate(-90deg); } .nav-more.open svg { transform: none; }

/* ---------- the voice assistant: a microphone on every screen ---------- */
.voice-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue);
  box-shadow: 0 14px 34px -10px rgba(29, 91, 255, .7), 0 2px 6px rgba(11, 27, 58, .2); transition: transform .12s, background .12s; }
.voice-fab:hover { background: var(--blue-d); transform: scale(1.05); }
.voice-fab.on { background: var(--bad); animation: voice-pulse 1.4s ease-out infinite; }
.voice-fab.busy { opacity: .75; }
@keyframes voice-pulse { 0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .5); } 100% { box-shadow: 0 0 0 20px rgba(179, 38, 30, 0); } }
.voice-panel { position: fixed; right: 22px; bottom: 94px; z-index: 70; width: min(400px, calc(100vw - 28px)); max-height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px -24px rgba(11, 27, 58, .55); overflow: hidden; }
.voice-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.voice-x { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); } .voice-x:hover { background: var(--blue-soft); color: var(--ink); }
.voice-log { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px; }
.voice-hi { color: var(--muted); } .voice-hi b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.voice-eg { text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--blue-soft); color: var(--ink); line-height: 1.4; } .voice-eg:hover { background: var(--info-bg); }
.voice-you { align-self: flex-end; max-width: 88%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--blue); color: #fff; overflow-wrap: anywhere; }
.voice-crm { align-self: flex-start; max-width: 94%; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: #f1f5fc; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.voice-done { display: flex; flex-direction: column; gap: 4px; } .voice-done li { display: flex; gap: 6px; align-items: flex-start; } .voice-done svg { color: var(--ok); margin-top: 3px; }
.voice-done a { font-weight: 600; } .voice-done.undone { opacity: .55; text-decoration: line-through; }
.voice-err { color: var(--bad); }
.voice-dots { flex-direction: row; gap: 5px; padding: 13px 14px; } .voice-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: voice-dot 1s infinite ease-in-out; }
.voice-dots i:nth-child(2) { animation-delay: .15s; } .voice-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes voice-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.voice-status { padding: 2px 16px 6px; }
.voice-in { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px 12px; border-top: 1px solid var(--line); }
.voice-box { flex: 1 1 auto; min-width: 0; resize: none; max-height: 140px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; line-height: 1.4; }
.voice-box:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.voice-mic, .voice-send { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.voice-mic { background: var(--blue-soft); color: var(--blue-d); } .voice-mic:hover { background: var(--info-bg); } .voice-mic.on { background: var(--bad); color: #fff; } .voice-mic:disabled { opacity: .4; cursor: not-allowed; }
.voice-send { background: var(--blue); color: #fff; } .voice-send:hover { background: var(--blue-d); }
.page { padding-bottom: 96px; }   /* room so the microphone never covers the last row */
@media (max-width: 860px) { .voice-fab { right: 14px; bottom: 14px; } .voice-panel { right: 14px; bottom: 84px; } }
