html.crm {
  color-scheme: light;
  --paper: #edf2f3;
  --panel: #fafcfc;
  --surface: #f0f5f6;
  --field: #fff;
  --ink: #233d48;
  --muted: #536d77;
  --line: #cfdbdf;
  --border: #a9bec5;
  --green: #446773;
  --ink-accent: #3c5e6b;
  --on-accent: #fff;
  --wash: #e2edf0;
  --selection: #83a4b0;
  --focus: #547e8b;
  --red: #844d51;
  --warning: #f6ecee;
  --warning-line: #d9bcc2;
  --depth: 0 3px 12px #2947560f;
}
html.crm[data-theme="dark"] {
  color-scheme: dark;
  --paper: #293d48;
  --panel: #314955;
  --surface: #36515e;
  --field: #2a424e;
  --ink: #edf4f6;
  --muted: #c2d2d8;
  --line: #4b6672;
  --border: #6e8995;
  --green: #a1bdc7;
  --ink-accent: #c1d9e1;
  --on-accent: #203c48;
  --wash: #3f5d6b;
  --selection: #91acb7;
  --focus: #afd5df;
  --red: #f3c2c7;
  --warning: #53444e;
  --warning-line: #8e707b;
  --depth: 0 3px 12px #1f303a33;
}
.crm body { min-width: 285px; }
.crm a, .crm .plain { color: var(--ink-accent); }
.crm :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.crm main:not(.standalone) { max-width: 1600px; padding: 27px clamp(12px, 2.35vw, 36px) 46px; }
.crm .heading { align-items: center; gap: 12px 26px; }
.crm .heading h1 { letter-spacing: -.045em; font-weight: 780; }
.crm .heading p { font-size: .96rem; }
.crm .button, .crm .icon-btn { display:inline-flex; align-items:center; gap:7px; min-height:40px; border-radius:8px; }
.crm .button { color: var(--on-accent); background: var(--green); border-color: var(--green); white-space: normal; }
.crm .button:hover { filter: brightness(.94); }
.crm .secondary, .crm .icon-btn, .crm .plain-button { background: var(--panel); color: var(--ink-accent); border: 1px solid var(--border); }
.crm .secondary:hover, .crm .icon-btn:hover { background: var(--wash); }
.crm .danger { background: var(--warning); color: var(--red); border-color: var(--warning-line); }
.crm .panel, .crm .metric { background: var(--panel); border-color: var(--line); border-radius: 12px; box-shadow: var(--depth); }
.crm .metric, .crm .hire-overview { border-top-color: var(--selection); }
.crm .metric.low { border-top-color: var(--red); }
.crm input, .crm select, .crm textarea { background: var(--field); color: var(--ink); border-color: var(--border); border-radius: 8px; min-height: 38px; }
.crm input[type="radio"], .crm input[type="checkbox"] { min-height: auto; accent-color: var(--ink-accent); flex: 0 0 auto; }
.crm input::placeholder, .crm textarea::placeholder { color: var(--muted); opacity: .86; }
.crm label, .crm .read-field { color: var(--ink); font-weight: 625; }
.crm th { background: var(--surface); color: var(--muted); vertical-align:middle; }
.crm th, .crm td, .crm .alerts a { border-color: var(--line); }
.crm tbody tr:nth-child(even), .crm .receipt, .crm .bubble, .crm .connection-state p { background: var(--surface); }
.crm tbody tr:hover { background: var(--wash); }
.crm .status, .crm .positive, .crm .notice.good { background: var(--wash); color: var(--ink-accent); border-color: var(--selection); }
.crm .negative, .crm .notice:not(.good) { background: var(--warning); color: var(--red); border-color: var(--warning-line); }
.crm .worker-bubble { background: var(--green); color: var(--on-accent); }
.crm .actions { flex-wrap: wrap; }
.crm details > summary { list-style: none; }
.crm details > summary::-webkit-details-marker { display: none; }
.crm details.document-fields > summary::before { content: "▸ "; }
.ui-icon { flex: 0 0 auto; vertical-align: middle; width: 19px; height: 19px; }
.icon-btn { padding: 6px 9px; justify-content: center; min-width: 40px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.crm .skip { z-index:15; color:var(--ink); background:var(--panel); }
.crm-shell {
  position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px 24px;
  max-width: 1530px; min-height: 66px; margin: 11px auto 0; padding: 5px 15px 5px 18px;
  width: calc(100% - clamp(24px,4.7vw,72px)); border: 1px solid var(--line);
  background: var(--panel); border-radius: 12px; box-shadow: var(--depth);
}
.crm-brand { display:block; flex:none; width:min(312px, 100%); border-radius:4px; }
.crm-brand img { display:block; width:100%; height:auto; border-radius:inherit; }
.crm[data-theme="dark"] .crm-brand img { filter:invert(1) hue-rotate(180deg); }
.crm-tabs, .crm-tools { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.crm-tabs { margin-inline-end: auto; border-inline-start:1px solid var(--line); padding-inline-start:14px; }
.crm-tabs > a, .crm-tools > a, .crm-menu > summary {
  display:flex; align-items:center; gap:7px; padding:7px 10px; min-height:40px; border-radius:8px;
  color:var(--muted); text-decoration:none; font-size:.92rem; font-weight:610; white-space:nowrap;
}
.crm-tools { flex:0 0 auto; }
.crm-tools > a, .crm-account > summary { padding-inline: 8px; }
.crm-tabs > a:hover, .crm-tabs a[aria-current], .crm-tools a[aria-current], .crm-tools > a:hover, .crm-menu[open] > summary, .crm-menu > summary:hover {
  background:var(--wash); color:var(--ink-accent);
}
.crm-tabs a[aria-current] { background:var(--green); color:var(--on-accent); }
.crm .crm-menu { margin:0; position:relative; }
.crm-menu > summary .ui-icon:last-child:not(:first-child) { width:15px; height:15px; }
.crm-menu .menu-panel {
  position:absolute; top:calc(100% + 8px); background:var(--panel); border:1px solid var(--border);
  border-radius:10px; padding:12px; box-shadow:0 14px 38px #172e3c34; max-height:calc(80vh - 35px); overflow:auto;
}
.crm-shell .crm-sections { position:static; }
.crm-sections .menu-panel { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; width:min(640px,100%); left:0; }
.crm-account .menu-panel { width:210px; right:0; }
.crm-account .menu-panel > strong, .crm-account .menu-panel > small { display:block; margin:3px 7px; overflow-wrap:anywhere; }
.crm-account .menu-panel form { margin:0; }
.crm-account .menu-panel a, .crm-account .menu-panel button, .crm .nav-group a {
  width:100%; display:flex; align-items:center; gap:8px; min-height:36px;
  background:transparent; border:0; border-radius:7px; padding:6px 8px;
  color:var(--ink); text-decoration:none; text-align:left; font:inherit; font-size:.875rem;
}
.crm .nav-group { margin:0; min-width:0; }
.crm .nav-group span { display:block; padding:5px 8px; color:var(--muted); font-weight:700; }
.crm .nav-group a:hover, .crm .nav-group a[aria-current], .crm-account .menu-panel a:hover, .crm-account .menu-panel button:hover { background:var(--wash); color:var(--ink); }
.crm-account .ui-icon, .nav-group a .ui-icon { width:16px; height:16px; }
.crm-code {
  color:var(--ink-accent); background:var(--wash); border:1px solid var(--line); border-radius:6px;
  display:inline-flex; gap:5px; align-items:center; white-space:nowrap; padding:3px 7px;
  text-decoration:none; font:620 .81rem/1.25 "Segoe UI", sans-serif; font-variant-numeric:tabular-nums;
}
.crm-code .ui-icon { width:14px; height:14px; }
.crm-copy:hover { border-color:var(--border); }
.crm-links { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; align-items:center; }
.day-picker { display:flex; align-items:center; gap:6px; }
.day-picker label { display:flex; flex-direction:row; align-items:center; gap:6px; }
.control-top, .workload-grid { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); gap:14px; }
.coverage-card, .attention, .replacement, .roster, .object-tree { padding:clamp(12px,1.4vw,22px); }
.crm .coverage-card h2, .crm .attention h2, .crm .replacement h2, .crm .roster h2, .crm .object-tree h2 {
  display:flex; align-items:center; gap:9px; padding:0; line-height:1.2;
}
.coverage-card > header, .replacement > header, .coverage-footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px 12px; }
.coverage-card > header p { color:var(--muted); margin:4px 0 0; }
.coverage-plan { padding-inline-start:13px; border-inline-start:1px solid var(--line); }
.coverage-plan > * { display:block; }
.coverage-number { display:flex; align-items:baseline; gap:10px 19px; flex-wrap:wrap; margin:12px 0 8px; }
.coverage-number strong { font-size:clamp(35px,4.2vw,59px); line-height:1.1; letter-spacing:-.055em; font-variant-numeric:tabular-nums; }
.coverage-number strong span { font-size:.72em; }
.coverage-number > span { color:var(--muted); font-weight:650; }
.coverage-card progress { display:block; appearance:none; width:100%; height:14px; background:var(--wash); border:0; border-radius:6px; overflow:hidden; }
.coverage-card progress::-webkit-progress-bar { background:var(--wash); }
.coverage-card progress::-webkit-progress-value { background:var(--green); border-radius:6px; }
.coverage-card progress::-moz-progress-bar { background:var(--green); border-radius:6px; }
.coverage-footer { margin-top:11px; color:var(--muted); font-size:.83rem; }
.coverage-footer .ui-icon { margin-right:5px; width:15px; height:15px; }
.attention-list { display:grid; gap:7px; margin-top:12px; max-height:265px; overflow:auto; }
.crm .attention-row { display:grid; grid-template-columns:32px minmax(0,1fr) auto 16px; gap:9px; align-items:center;
  padding:7px 9px; border-radius:8px; border:1px solid var(--line); color:var(--ink); background:var(--surface); text-decoration:none; }
.crm .attention-row:hover, .crm .attention-row[aria-current] { border-color:var(--selection); background:var(--wash); }
.attention-row strong, .attention-row small { display:block; }
.action-icon { display:grid; place-items:center; width:32px; height:32px; border:1px solid var(--border); border-radius:7px; color:var(--ink-accent); }
.attention-row > .ui-icon { width:15px; height:15px; }
.replacement { margin:14px 0; }
.replacement > header { padding-bottom:11px; border-bottom:1px solid var(--line); }
.replacement-fields, .replacement-bottom { display:grid; gap:12px; margin-top:11px; align-items:end; min-width:0; }
.replacement-fields { grid-template-columns:minmax(0,1.2fr) minmax(115px,.63fr) minmax(0,1fr); }
.replacement-bottom { grid-template-columns:minmax(0,1fr) auto; }
.number-control { display:flex; min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:8px; }
.number-control > * { border:0; min-height:38px; }
.number-control button { display:grid; place-items:center; width:35px; flex:0 0 auto; background:var(--surface); color:var(--ink-accent); }
.number-control button:hover { background:var(--wash); }
.crm .number-control input { border:0; border-inline:1px solid var(--border); border-radius:0; text-align:center; width:100%; }
.workload-grid { grid-template-columns:minmax(0,.78fr) minmax(0,1.3fr); margin-top:15px; }
.object-tree > div { margin-top:10px; }
.object-tree details { border-top:1px solid var(--line); margin-top:3px; padding-top:3px; }
.object-tree summary { display:grid; grid-template-columns:15px 20px minmax(0,1fr) auto; align-items:center; gap:8px; padding:7px 4px; }
.object-tree summary:hover { background:var(--surface); }
.object-tree summary > .ui-icon:first-child { width:15px; height:15px; color:var(--muted); }
.object-tree details[open] summary > .ui-icon:first-child { transform:rotate(90deg); }
.object-tree details > div { margin-left:14px; border-inline-start:1px solid var(--border); padding-left:10px; }
.crm .tree-shift { display:grid; grid-template-columns:18px minmax(0,1fr) auto; align-items:center; gap:8px;
  min-height:35px; margin:3px 0; padding:5px 8px; border:1px solid transparent; border-radius:6px;
  text-decoration:none; color:var(--ink); }
.crm .tree-shift[aria-current], .crm .tree-shift:hover { background:var(--wash); border-color:var(--selection); }
.roster-body { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px 16px; margin:13px 0; }
.roster-body small { grid-column:2; }
.roster-number { font-size:1.6rem; letter-spacing:-.025em; white-space:nowrap; }
.person-grid { display:grid; grid-template-columns:repeat(12,minmax(0,22px)); gap:0 4px; justify-content:start; }
.person { color:var(--border); }
.person .ui-icon { width: min(100%,17px); height:17px; }
.person.filled { color:var(--ink-accent); }
.person.filled .ui-icon { fill:currentColor; }
.theme-options { border:0; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.theme-choice { flex-direction:row; align-items:center; gap:9px; min-height:60px; padding:8px; background:var(--surface); border:1px solid var(--line); border-radius:8px; }
.theme-choice:has(:checked) { background:var(--wash); border-color:var(--selection); }
.theme-choice strong, .theme-choice small { display:block; }
.theme-sw { border-radius:6px; display:grid; place-items:center; width:36px; height:36px; border:1px solid #9bb3bd; flex:0 0 auto; }
.theme-sw.light { background:#e5eef1; color:#3c5e6c; }
.theme-sw.dark { background:#344e5b; color:#dcebf0; }
.comm-controls { display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px; margin-bottom:13px; }
.comm-tabs, .comm-search { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.crm .tab-link { padding:7px 10px; border:1px solid var(--line); border-radius:8px; color:var(--muted); background:var(--panel); text-decoration:none; }
.crm .tab-link[aria-current], .crm .tab-link:hover { background:var(--wash); border-color:var(--selection); color:var(--ink); }
.comm-grid { display:grid; grid-template-columns:minmax(175px,.85fr) minmax(275px,1.65fr) minmax(185px,.9fr); gap:11px; }
.comm-queue, .comm-thread, .comm-outcome { min-width:0; display:flex; flex-direction:column; }
.comm-queue h2, .comm-thread header { border-bottom:1px solid var(--line); }
.comm-queue > div { overflow:auto; max-height:540px; padding:6px; }
.crm .comm-person { display:grid; grid-template-columns:35px minmax(0,1fr) auto; align-items:center; gap:8px; color:var(--ink);
  text-decoration:none; border:1px solid transparent; border-bottom-color:var(--line); padding:8px 5px; }
.crm .comm-person[aria-current], .crm .comm-person:hover { background:var(--wash); border:1px solid var(--selection); border-radius:8px; }
.comm-person strong, .comm-person small { display:block; overflow-wrap:anywhere; }
.comm-id { font-size:.7rem; align-self:start; }
.avatar { display:grid; place-items:center; width:35px; height:35px; border-radius:8px; color:var(--ink-accent); background:var(--wash); font-size:.82rem; font-weight:700; }
.comm-thread > header { display:flex; align-items:center; gap:9px; padding:11px 12px; flex-wrap:wrap; }
.comm-thread > header h2 { padding:0; }
.comm-thread > header > div { flex:1 1 110px; min-width:0; }
.comm-thread > header p { color:var(--muted); margin:4px 0 0; font-size:.84rem; overflow-wrap:anywhere; }
.comm-history { display:grid; align-content:start; gap:8px; padding:12px; min-height:215px; max-height:475px; overflow:auto; flex:1; }
.comm-event { padding:9px 10px; background:var(--surface); border:1px solid var(--line); border-radius:8px; min-width:0; }
.comm-event > div { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.comm-event .ui-icon { color:var(--ink-accent); }
.comm-event small { margin-inline-start:auto; }
.comm-event p { white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0 0; }
.contact-form { display:grid; grid-template-columns:minmax(78px,.52fr) minmax(0,1.4fr); align-items:end; gap:8px; padding:11px; border-top:1px solid var(--line); }
.contact-form .button { grid-column:2; justify-self:end; }
.comm-outcome form, .comm-outcome > p { padding:0 13px 13px; }
.comm-outcome form { flex:1; }
.outcome-radios { border:0; padding:0; margin:0; display:grid; gap:8px; }
.radio-option { display:flex; flex-direction:row; gap:7px; align-items:center; }
.comm-empty { grid-column:span 2; display:grid; place-items:center; min-height:165px; padding:14px; color:var(--muted); }
@media(max-width:1100px) {
  .crm-shell { gap: 6px 11px; }
  .crm-tabs { padding-inline-start: 6px; }
  .crm-tools .tool-label { display:none; }
  .crm-tabs > a, .crm-menu > summary { padding-inline: 7px; }
  .comm-person .comm-id { display:none; }
}
@media(max-width:865px) {
  .crm-shell { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .crm-tabs { grid-area:2 / 1 / 3 / -1; margin:0; border:0; padding:0; }
  .crm .nav-group span { display:block; }
  .control-top, .workload-grid { grid-template-columns: minmax(0,1fr); }
  .comm-grid { grid-template-columns:minmax(135px,.8fr) minmax(0,1.65fr); }
  .comm-outcome { grid-column:2; }
  .comm-empty { grid-column:auto; }
}
@media(max-width:560px) {
  .crm-shell { padding:5px 8px; }
  .crm-brand { width:min(280px,100%); }
  .crm-tools > a, .crm-account > summary { padding-inline:4px; }
  .crm-tools .ui-icon { width:17px; height:17px; }
  .crm-tabs { gap:2px; }
  .crm-tabs > a, .crm-menu > summary { min-height:34px; font-size:.78rem; padding:3px 5px; gap:4px; }
  .crm-tabs .ui-icon { width:15px; height:15px; }
  .crm-sections .menu-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm .heading { flex-wrap:wrap; }
  .replacement-fields, .replacement-bottom, .theme-options, .comm-grid { grid-template-columns:minmax(0,1fr); }
  .replacement-bottom .button { justify-self:start; }
  .attention-row .status { white-space:normal; max-width:80px; }
  .comm-queue > div { max-height:180px; }
  .comm-outcome, .comm-empty { grid-column:1; }
  .comm-controls, .comm-search { flex-wrap:wrap; }
  .comm-search input { flex:1 1 auto; }
  .person-grid { grid-template-columns:repeat(8,minmax(0,22px)); }
}
@media print {
  .crm { --panel:#fff; --surface:#fff; --ink:#000; --muted:#333; --line:#bbb; }
  .crm-shell, .crm-code.crm-copy, .crm-links, .crm .day-picker, .crm .comm-controls { display:none !important; }
  .crm .panel, .crm .metric { box-shadow:none; }
}

.quick-assign { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:end; margin-top:10px; }

.crm .deal-editor, .crm .deal-more, .crm .deal-nav { max-width:1060px; }
.deal-nav { position:sticky; top:6px; z-index:4; display:flex; flex-wrap:wrap; gap:4px 12px; margin:12px 0; padding:5px 10px; }
.deal-form-section, .deal-more { scroll-margin-top:66px; }
.deal-nav a { display:inline-flex; align-items:center; min-height:38px; padding:5px 7px; font-weight:620; }
.deal-form-section + .deal-form-section { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.deal-details { margin-top:14px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; }
.deal-details > summary, .deal-more > summary { display:flex; align-items:center; gap:8px; cursor:pointer; min-height:28px; font-weight:680; }
.deal-details > summary::before, .deal-more > summary::before { content:"›"; width:12px; color:var(--ink-accent); font-size:1.2em; }
.deal-details[open] > summary::before, .deal-more[open] > summary::before { transform:rotate(90deg); }
.deal-details[open] > summary { margin-bottom:10px; }
.deal-fields, .deal-estimate-link { margin-top:12px; }
.deal-estimate-link { display:flex; align-items:center; flex-wrap:wrap; gap:2px 15px; margin:0 0 14px; }
.deal-estimate-link p { margin:0; }
.deal-results { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap:8px; margin:14px 0 0; }
.deal-results > div { display:flex; flex-direction:column; justify-content:space-between; gap:6px; padding:10px; border:1px solid var(--line); border-radius:7px; background:var(--surface); }
.deal-results dt { color:var(--muted); font-size:.86rem; }
.deal-results dd { margin:0; font-size:1.14rem; font-weight:700; font-variant-numeric:tabular-nums; }
.deal-fields[hidden] { display:none; }
.crm .deal-editor .form-actions .button { margin-top:0; }
.deal-save { margin-top:16px; border-top:1px solid var(--line); }
.crm .deal-more > .panel { border:0; padding:10px 0 0; box-shadow:none; max-width:none; }
.crm .deal-more .table-scroll { margin-bottom:8px; }
@media(max-width:560px) { .quick-assign { grid-template-columns:minmax(0,1fr); } .quick-assign .button { justify-self:start; } }
@media(max-width:430px) {
  .crm-brand { grid-column:1 / -1; width:min(280px,100%); }
  .crm-tools { display:grid; grid-template-columns:repeat(2, max-content); gap:1px 4px; align-self:start; grid-column:2; grid-row:2; }
  .crm-tabs { grid-row:2; grid-column:1; }
  .crm .deal-editor, .crm .deal-more { padding:12px; }
  .deal-form-section, .deal-more { scroll-margin-top:104px; }
}
.ui-icon { fill:none; }
.replacement-quantity label { margin-bottom:5px; }
