/* Keystone (27 Oct 2026). Same cards and type as the other screens; phone first. No :has(), no runtime custom properties
   (see the 22 Oct perf rules in app.css). Component classes (.btn, .pill, .cs, .note, .fields, .kpi, .chips) are shared with
   the plug-ins (Doc Vault, Blueprint, workflows, chief of staff); bare element styles (inputs, textareas, selects, rows) are
   scoped to Keystone's own cards (.kc) so they never leak into a plug-in's panel. */
.crm .crm-top { display: flex; gap: 8px; align-items: center; position: relative; }
.crm .crm-agency { flex: none; max-width: 34%; font-family: "Instrument Serif", Georgia, serif; font-size: 20px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm .crm-agency small { display: block; font-family: "Geist", system-ui, sans-serif; font-size: 11px; color: var(--muted); }
.crm .crm-top > select, .crm .k-sbox > input { width: 100%; min-width: 0; height: 40px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: 15px; }
.crm .crm-top > select { flex: 0 1 38%; }
.crm .k-sbox { flex: 1; min-width: 0; }   /* results open across the whole top row (phone-friendly) */
/* phones: the agency gets its own line so its whole name shows (it was cut to "Northgate Prop…" at 375 px) */
@media (max-width: 560px) {
  .crm .crm-top { flex-wrap: wrap; }
  .crm .crm-top > select { flex: 1 1 100%; text-overflow: ellipsis; }
  .crm .crm-agency { flex: 1 1 100%; max-width: none; white-space: normal; overflow: visible; }
}
.crm .k-sbox > input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.crm .k-drop, .kpick .k-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; }
.crm .k-grp + .k-grp { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 4px; }
.crm .k-gh { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; }
.k-hit { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 8px 8px; border-radius: 8px; min-height: 44px; justify-content: center; }
.k-hit:hover, .k-hit:focus { background: var(--notice); }
.k-hit .ct { font-size: 15px; font-weight: 500; white-space: normal; overflow: visible; }
.k-hit .cs { font-size: 12.5px; color: var(--muted); }
.crm .k-took { padding: 4px 8px 2px; margin: 0; }
.crm-new { flex: none; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
/* places (28 Oct 2026): Keystone | Blueprint | Doc Vault | Agents | Settings. A segmented bar on wide screens; on a phone
   five equal buttons, icon over label, big enough for a thumb. The current place's own screens sit under it as chips. */
.crm .k-places { display: flex; gap: 3px; padding: 3px; background: var(--notice); border-radius: 12px; overflow-x: auto; scrollbar-width: none; flex: none; }
.crm .k-places::-webkit-scrollbar { display: none; }
.crm .k-places button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.crm .k-places button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.crm .k-places button.on { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
@media (prefers-color-scheme: dark) { .crm .k-places button.on { background: var(--accent-soft); box-shadow: none; } }
.crm .k-places button:focus-visible, .crm .chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* "‹ Back to <the listing>" after one section sends you to another (29 Oct 2026) */
.crm .k-from { flex: none; }
.crm .k-from button { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm .k-from button b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crm .k-from button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) {
  .crm .k-places button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 5px 2px; min-height: 50px; font-size: 11.5px; }
  .crm .k-places button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .crm .k-places button svg { width: 20px; height: 20px; }
  .crm .crm-agency { font-size: 17px; }
}
@media (max-width: 420px) { .crm .k-nl { display: none; } }
.crm .k-loading { padding: 18px 4px; }
.crm .k-lede { font-size: 16px; margin: 0 0 12px; }
.crm .k-feed .kpis { margin-bottom: 10px; }
.crm .k-feed .kpi { cursor: default; }
.crm .k-arch-s { font-size: 12.5px; }
.crm .chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
.crm .chips::-webkit-scrollbar { display: none; }
.crm .chips button { flex: none; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.crm .chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* saved views row */
.crm .k-views { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.crm .k-views::-webkit-scrollbar { display: none; }
.crm .k-views .kv { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; font-size: 13px; color: var(--ink); background: var(--notice); white-space: nowrap; }
.crm .k-views .kv.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.crm .k-views .kv.add, .crm .k-views .kv.mode { background: transparent; color: var(--accent); border: 1px dashed var(--rule); }
.crm .k-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.crm .k-dot.call { background: #22a06b; } .crm .k-dot.dup { background: #d97706; }
/* lists */
.crm .kc .clist, .crm .kc .plist, .crm .kc .hist, .crm .kc .skip, .crm .clist { list-style: none; margin: 0; padding: 0; }
.crm .crow { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--rule); min-height: 52px; }
.crm .crow:first-child { border-top: 0; }
.crm .crow.due .ct { color: #c2410c; }
.crm .crow.past { opacity: .6; }
.crm .cmain { flex: 1; min-width: 0; text-align: left; padding: 8px 0; display: flex; flex-direction: column; }
.crm .ct { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm .ct.big { font-size: 20px; font-weight: 600; white-space: normal; }
.crm .cs { font-size: 12.5px; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.crm .cs.ok, .crm .note.ok { color: #13744a; }
.crm .crow .cs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm .crow.dup .cs { white-space: normal; }
.crm .k-amp { color: var(--muted); font-weight: 400; }
.crm .tick { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule); color: var(--accent-ink); font-size: 14px; line-height: 1; }
.crm .kc .tick:not(.on) { color: var(--muted); }
.crm .tick.on { background: #22a06b; border-color: #22a06b; color: #fff; }
.crm .pill { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.crm .pill.p-current, .crm .pill.p-listed, .crm .pill.p-hot, .crm .pill.p-responded, .crm .pill.p-certain { background: #dcf3e8; color: #13744a; }
.crm .pill.p-under_offer, .crm .pill.p-warm, .crm .pill.p-appraisal, .crm .pill.p-new, .crm .pill.p-likely { background: #fdecd6; color: #a14b00; }
.crm .pill.p-sold, .crm .pill.p-settled, .crm .pill.p-leased, .crm .pill.p-converted { background: #e3e6f8; color: #2b45e0; }
.crm .pill.p-draft, .crm .pill.p-withdrawn, .crm .pill.p-lost, .crm .pill.p-cold, .crm .pill.p-offmarket, .crm .pill.p-closed, .crm .pill.p-possible { background: var(--notice); color: var(--muted); }
@media (prefers-color-scheme: dark) { .crm .pill.p-current, .crm .pill.p-listed, .crm .pill.p-hot, .crm .pill.p-responded, .crm .pill.p-certain { background: #12352a; color: #6fd3a5; }
  .crm .pill.p-under_offer, .crm .pill.p-warm, .crm .pill.p-appraisal, .crm .pill.p-new, .crm .pill.p-likely { background: #3a2a14; color: #f2b366; }
  .crm .pill.p-sold, .crm .pill.p-settled, .crm .pill.p-leased, .crm .pill.p-converted { background: #1d2340; color: #9fb0ff; }
  .crm .cs.ok, .crm .note.ok { color: #6fd3a5; } }
.crm .kanban { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scroll-snap-type: x proximity; }
.crm .kcol { flex: 0 0 78%; max-width: 260px; background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; padding: 8px; scroll-snap-align: start; }
@media (min-width: 640px) { .crm .kcol { flex-basis: 220px; } }
.crm .khead { font-size: 13px; font-weight: 600; margin: 2px 2px 8px; }
.crm .khead small { font-weight: 400; color: var(--muted); }
.crm .kcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 2px 10px 8px; margin-bottom: 8px; }
.crm .kcard .ct { white-space: normal; }
.crm .kcard select { width: 100%; height: 34px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }
.crm .fields { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.crm .fields dt { color: var(--muted); }
.crm .fields dd { margin: 0; overflow-wrap: anywhere; }
.crm .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.crm .btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--rule); }
.crm .btn.danger { color: #c2410c; }
.crm .btn[disabled] { opacity: .45; cursor: default; }
.crm .lnk { color: var(--accent); font: inherit; padding: 0; text-align: left; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.crm .kc .prow { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--rule); padding: 10px 0; font-size: 14px; }
.crm .kc .prow:first-child { border-top: 0; }
.crm .kc .prow > div { min-width: 0; }
.crm .note.warn, .crm .warn { color: #c2410c; }
.crm .kc .addnote { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.crm .kc textarea, .crm .kc.form input:not([type=checkbox]):not([type=radio]), .crm .kc.form select, .crm .kc .att input, .crm .kc .att select, .crm .kc .k-filter, .crm .kc .kpick input, .crm .kc .k-cond select, .crm .kc .k-cond input, .crm .kc .k-mrow input[data-mv], .crm .kc .k-mrow select {
  width: 100%; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 9px 10px; font: inherit; font-size: 16px; min-width: 0; }
.crm .kc .k-filter { margin: 0 0 6px; font-size: 15px; height: 38px; padding: 0 10px; }
.crm .kc .nt { border-top: 1px solid var(--rule); padding: 8px 0; font-size: 14px; }
.crm .kc .hist li { border-top: 1px solid var(--rule); padding: 7px 0; font-size: 13px; }
.crm .form { display: flex; flex-direction: column; gap: 10px; }
.crm .kc .fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.crm .kc .chk { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.crm .kc .chk input { width: 20px; height: 20px; }
.crm .kc .att { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.crm .kc .att > .fld, .crm .kc .att #attF, .crm .kc .att .btn { grid-column: 1 / -1; }
.crm-sheet .viewer-body { background: var(--bg); }
.crm-sheet .dash-inner { padding: 0 0 24px; max-width: 760px; margin: 0 auto; }
.crm .grid2 > .card, .crm .card, .crm .cmain { min-width: 0; }
.crm .kpis .kpi { text-align: left; }
.crm .k-acts { display: flex; gap: 8px; flex-wrap: wrap; }
/* a person's page */
.crm .k-head h3 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.crm .k-reach { list-style: none; margin: 10px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crm .k-reach li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; }
.crm .k-num { color: var(--ink); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.crm .k-mini { font-size: 12.5px; color: var(--accent); text-decoration: none; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 999px; }
.crm .k-cons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.crm .k-cp { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--notice); color: var(--muted); }
.crm .k-cp.yes { background: #dcf3e8; color: #13744a; } .crm .k-cp.no { background: #fde4dc; color: #b42318; }
@media (prefers-color-scheme: dark) { .crm .k-cp.yes { background: #12352a; color: #6fd3a5; } .crm .k-cp.no { background: #3b1a14; color: #f4a28c; } }
.crm .k-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.crm .k-quick .btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.crm .k-dupb { border-color: #d97706; font-size: 14px; }
.crm .k-arch { margin: 0 0 8px; }
.crm details.k-more > summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.crm details.k-more > summary::-webkit-details-marker { display: none; }
.crm details.k-more > summary small { color: var(--muted); font-weight: 400; }
.crm details.k-more[open] > summary { margin-bottom: 10px; }
/* consent sheet */
.crm .k-crow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; border-top: 1px solid var(--rule); padding: 10px 0; }
.crm .k-crow:first-child { border-top: 0; }
.crm .k-cbtn { display: flex; gap: 6px; flex-wrap: wrap; }
/* timeline */
.crm .k-tlf { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.crm .k-tlf button { flex: none; font-size: 12.5px; padding: 5px 10px; border-radius: 999px; background: var(--notice); color: var(--muted); }
.crm .k-tlf button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.crm .k-tl { list-style: none; margin: 0; padding: 0 0 0 4px; }
.crm .k-ti { position: relative; display: flex; gap: 10px; padding: 0 0 12px 0; }
.crm .k-ti::before { content: ""; position: absolute; left: 3px; top: 12px; bottom: 0; width: 1px; background: var(--rule); }
.crm .k-ti:last-child::before { display: none; }
.crm .k-ti .k-dot { margin-top: 6px; width: 8px; height: 8px; }
.crm .k-tb { min-width: 0; flex: 1; }
.crm .k-tt { font-size: 14px; font-weight: 500; }
.crm .k-ts { font-size: 13.5px; margin: 2px 0; overflow-wrap: anywhere; }
.crm .k-call .k-dot, .crm .k-sms .k-dot, .crm .k-email .k-dot, .crm .k-dm .k-dot, .crm .k-chat .k-dot, .crm .k-meeting .k-dot { background: #22a06b; }
.crm .k-note .k-dot, .crm .k-task .k-dot, .crm .k-task_done .k-dot, .crm .k-mention .k-dot { background: var(--accent); }
.crm .k-visit .k-dot, .crm .k-enquiry .k-dot, .crm .k-requirement .k-dot { background: #d97706; }
.crm .k-merge .k-dot, .crm .k-unmerge .k-dot, .crm .k-consent .k-dot { background: #b42318; }
/* call lists */
.crm .k-bar { height: 6px; border-radius: 3px; background: var(--notice); overflow: hidden; margin: 2px 0 12px; }
.crm .k-bar i { display: block; height: 100%; background: #22a06b; }
.crm .k-next { display: flex; flex-direction: column; gap: 8px; }
.crm .k-talk { font-size: 14.5px; background: var(--notice); border-radius: 10px; padding: 8px 10px; }
.crm .k-phones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crm .k-outs { display: flex; flex-wrap: wrap; gap: 6px; }
.crm .k-recent { border-left: 2px solid var(--rule); padding-left: 8px; }
/* merge */
.crm .k-seg { display: flex; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.crm .k-seg button { flex: 1; padding: 9px 8px; font-size: 14px; color: var(--muted); }
.crm .k-seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.crm .k-cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; table-layout: fixed; }
.crm .k-cmp th, .crm .k-cmp td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--rule); vertical-align: top; overflow-wrap: anywhere; }
.crm .k-cmp th { color: var(--muted); font-weight: 500; font-size: 12px; }
.crm .k-cmp td:first-child { color: var(--muted); width: 28%; }
.crm .k-rad { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 13.5px; color: var(--ink); }
.crm .k-rad input { margin-top: 2px; flex: none; }
/* pickers, phone/email rows, view conditions */
.kpick { position: relative; }
.kpick .kchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.kpick .kchips:empty { display: none; }
.kchip { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 4px 4px 10px; }
.kchip button { width: 22px; height: 22px; border-radius: 50%; color: inherit; }
.crm .kc .k-mrow { display: grid; grid-template-columns: 1fr 112px; gap: 6px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.crm .kc .k-mrow:first-child { border-top: 0; }
.crm .kc .k-mopts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.crm .kc .k-mopts .k-rad { font-size: 13.5px; color: var(--muted); align-items: center; }
.crm .kc .k-mx { margin-left: auto; font-size: 13px; color: #c2410c; text-decoration: none; }
/* tick boxes and radio buttons stay tick-box sized whatever a plug-in's stylesheet says about inputs */
.crm .kc input[type="checkbox"], .crm .kc input[type="radio"] { width: 18px; height: 18px; min-width: 0; padding: 0; margin: 0; border: 0; flex: none; accent-color: var(--accent); }
.crm .kc .k-multi { display: flex; flex-direction: column; }
.crm .kc .k-multi > .btn { align-self: flex-start; margin-top: 4px; }
.crm .kc .k-cond { display: grid; grid-template-columns: 1fr 1fr 28px; gap: 6px; margin-bottom: 6px; align-items: center; }
.crm .kc .k-cond input { grid-column: 1 / 3; }
.crm .k-two { gap: 8px; }
.k-toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.k-toast.bad { background: #b42318; color: #fff; }
@media (min-width: 640px) { .crm .kc .k-cond { grid-template-columns: 1fr 1fr 1fr 28px; } .crm .kc .k-cond input { grid-column: auto; } }

/* sheet titles take focus for screen readers on open; no focus box for mouse/touch */
.viewer-top .title:focus:not(:focus-visible), .viewer-top [tabindex="-1"]:focus { outline: none; }

/* ═════ Desktop (28 Oct 2026): everything below is inside min-width: 1024px, so phones are untouched. A header row (agency,
   search, + New), the places as a tab strip with the current place's screens as a second row, lists as real tables, and every
   record / form / review in a right-hand drawer over the dimmed list (min(760px, 62vw); the listing workspace gets a wider one).
   Click outside or Esc closes it. ═════ */
.crm .k-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 1024px) {
  #view-crm > .dash-inner.crm { gap: 14px; }
  .crm .crm-top { gap: 16px; min-height: 44px; }
  .crm .crm-agency { flex: 0 1 auto; max-width: 45%; font-size: 28px; }
  .crm .crm-agency small { font-size: 12px; margin-top: 3px; }
  .crm .crm-top > select { flex: 0 1 280px; }
  .crm .k-sbox { flex: 1 1 auto; max-width: 460px; min-width: 200px; margin-left: auto; position: relative; }     /* results open under the box itself */
  .crm .crm-top > select, .crm .k-sbox > input { height: 40px; font-size: 14.5px; }
  .crm-new:hover, .crm .btn:not([disabled]):hover { filter: brightness(1.08); }
  .crm .btn.ghost:not([disabled]):hover { filter: none; background: var(--accent-soft); }
  .crm .btn { min-height: 36px; }
  .k-hit { min-height: 38px; }

  /* places: a tab strip with an underline; the place's own screens as a second, lighter row */
  .crm .k-places { background: none; padding: 0; gap: 2px; border-radius: 0; border-bottom: 1px solid var(--rule); overflow: visible; }
  .crm .k-places button { flex: none; min-height: 44px; padding: 0 16px; border-radius: 8px 8px 0 0; font-size: 14.5px; }
  .crm .k-places button:hover { color: var(--ink); background: var(--notice); }
  .crm .k-places button.on, .crm .k-places button.on:hover { background: none; box-shadow: inset 0 -2px 0 var(--accent); color: var(--accent); }
  .crm .chips.k-sub { flex-wrap: wrap; overflow: visible; gap: 6px; margin-top: -2px; }
  .crm .chips button { min-height: 32px; padding: 0 13px; font-size: 13.5px; }
  .crm .chips button:not(.on):hover { color: var(--ink); border-color: var(--muted); }
  .crm .k-views { flex-wrap: wrap; overflow: visible; }
  .crm .k-views .kv:not(.on):hover { background: var(--accent-soft); color: var(--accent); }
  .crm .kpi[data-ctab] { cursor: pointer; transition: border-color .12s; } .crm .kpi[data-ctab]:hover { border-color: var(--accent); }

  /* rows: tighter, with hover */
  .crm .crow { min-height: 46px; }
  .crm .crow:hover { background: var(--notice); box-shadow: -8px 0 0 var(--notice), 8px 0 0 var(--notice); }
  .crm .kc .k-filter { max-width: 360px; height: 36px; font-size: 14px; }

  /* tables */
  .crm .k-tw { overflow-x: auto; margin: 2px -20px -6px; }
  .crm .k-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
  .crm .k-tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
  .crm .k-tbl th button { display: inline-flex; align-items: center; gap: 5px; font: inherit; color: inherit; padding: 2px 0; }
  .crm .k-tbl th button:hover { color: var(--ink); }
  .crm .k-tbl .k-sa { font-style: normal; opacity: .35; font-size: 11px; }
  .crm .k-tbl th.on { color: var(--ink); } .crm .k-tbl th.on .k-sa { opacity: 1; color: var(--accent); }
  .crm .k-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crm .k-tbl th:first-child, .crm .k-tbl td:first-child { padding-left: 20px; } .crm .k-tbl th:last-child, .crm .k-tbl td:last-child { padding-right: 20px; }
  .crm .k-tbl tbody tr { cursor: pointer; }
  .crm .k-tbl tbody tr:hover td { background: var(--notice); }
  .crm .k-tbl tbody tr:last-child td { border-bottom: 0; }
  .crm .k-tbl .k-tt { font: inherit; font-weight: 500; color: var(--ink); text-align: left; padding: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .crm .k-tbl tbody tr:hover .k-tt { color: var(--accent); }
  .crm .k-tbl td.k-tc { max-width: 340px; }
  .crm .k-tbl .k-tk { width: 44px; padding-right: 0; }
  .crm .k-tbl tr.due .k-tt { color: #c2410c; }
  .crm .k-tbl .pill { display: inline-block; }
  .crm .k-t-enquiry td:last-child { white-space: normal; min-width: 220px; color: var(--muted); }

  /* Today: two balanced columns of cards under the numbers (columns, so a short card never leaves a hole beside a long one) */
  .crm .k-today { columns: 2; column-gap: 16px; }
  .crm .k-today > .kpis { column-span: all; margin-bottom: 16px; }
  .crm .k-today > .grid2 { display: contents; }
  .crm .k-today .card { break-inside: avoid; margin-bottom: 16px; }

  /* pipeline: the columns share the width */
  .crm .kcol { flex: 1 0 210px; max-width: none; }
  .crm .kcard:hover { border-color: var(--accent); }

  /* the record / form drawer */
  #crmSheet { left: auto; width: min(760px, 62vw); background: transparent; }
  #crmSheet.k-wide { width: min(1240px, calc(100vw - var(--side-w) - 40px)); }
  #crmSheet::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(8, 10, 16, .45); }
  #crmSheet > .viewer-top, #crmSheet > .viewer-body { border-left: 1px solid var(--rule); }
  #crmSheet.k-in > .viewer-top, #crmSheet.k-in > .viewer-body { animation: drawer-in .18s ease-out; }
  #crmSheet .viewer-body { padding: 20px 24px 32px; }
  #crmSheet .dash-inner { max-width: none; padding: 0 0 24px; gap: 14px; }
  #crmSheet .k-head .ct.big, #crmSheet .k-head h3 { font-size: 26px; }
  .crm .fields { grid-template-columns: minmax(120px, 28%) 1fr; gap: 8px 16px; }
  .crm .kc .form, .crm .kc.form { gap: 12px; }
  .crm .kc textarea, .crm .kc.form input:not([type=checkbox]):not([type=radio]), .crm .kc.form select { font-size: 15px; }
  /* the edit form in two columns where there's room (crm.js marks the long boxes k-w: they keep the full width) */
  #crmSheet .kc.form.k-ef { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
  #crmSheet .k-ef > .k-w, #crmSheet .k-ef > .note { grid-column: 1 / -1; }
  #crmSheet .k-ef > .chk { align-self: center; }
  .crm .k-quick .btn, .crm .k-outs .btn { min-height: 34px; }
  .crm .k-tlf button:not(.on):hover, .crm .k-mini:hover { color: var(--accent); }
  .crm .lnk:hover { text-decoration-color: var(--accent); }
  .k-toast { bottom: 32px; left: calc(50% + var(--side-w) / 2); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .crm .k-tbl .k-cx { display: none; }
  .crm .k-tbl th, .crm .k-tbl td { padding-left: 8px; padding-right: 8px; }
  .crm .k-tbl td { max-width: 220px; }
  #crmSheet.k-wide { width: calc(100vw - 48px); }     /* the listing workspace needs the room more than the sidebar does */
}
