@font-face { font-family: "Manrope"; src: url("../brand/fonts/man400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../brand/fonts/man700.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("../brand/fonts/unb500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../brand/fonts/jbm500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* CeraMix Palette v1.0 (approved 7 Sep 2026).
     The app's own token values had drifted from the kit - accent #FF714B vs
     #FF5C2B, secondary #4D2D8C vs #6B1FB3, and four more. Nobody chose those;
     they accumulated. Every app token is now an alias to the kit, so the two
     stylesheets resolve to one truth. Variable names are unchanged - no
     component needed touching. ceramix-ui.css must load first (it does). */
  --primary: var(--ember);           /* was #FF714B */
  --secondary: var(--violet);        /* was #4D2D8C */
  --page: var(--paper);              /* was #F2F2F2 */
  --text: var(--ink);                /* was #211832 */
  --muted: var(--grey);              /* was #746A84 */
  --line: var(--hairline);           /* was #DED8E8 - used 33 times; alias, never delete */
  --panel: var(--white);             /* was #FFFFFF - unchanged */
  --secondary-50: var(--violet-tint-10);   /* was #F0EAFB, a tint of the drifted purple */
  --primary-50: var(--ember-tint-10);      /* was #FFF0EB, a tint of the drifted orange */
  --dark-panel: var(--plum);         /* was #2A203E - 8.8 dE off plum; there is one dark */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  background: var(--text);
  color: var(--white);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: Unbounded, sans-serif; font-weight: 600; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transform: rotate(0deg); }
.brand-mark span { border-radius: 8px; background: var(--secondary); }
.brand-mark span:nth-child(2) { background: var(--primary); transform: rotate(45deg) scale(.78); }
.nav-menu { display: grid; gap: 8px; }
.nav-menu a {
  color: var(--hairline);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}
.nav-menu a:hover, .nav-menu a.active { background: var(--dark-panel); color: var(--white); }
.content { padding: 26px; overflow: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
h1, h2, h3 { font-family: Unbounded, sans-serif; letter-spacing: 0; line-height: 1.2; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0 0 14px; font-size: 20px; }
.muted { color: var(--muted); }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 8px 18px var(--ember-tint-25); }
.btn-ghost { background: var(--white); color: var(--secondary); border: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.stat .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat .value { font-family: "JetBrains Mono", monospace; color: var(--secondary); font-size: 28px; margin-top: 8px; }
.dashboard-grid { grid-template-columns: 1.3fr .7fr; margin-top: 16px; }
.inbox-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 92px); min-height: 480px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.inbox-layout:has(.lead-panel) { grid-template-columns: 320px minmax(0, 1fr) 320px; }
.lead-panel { border-left: 1px solid var(--line); border-radius: 0; overflow-y: auto; min-height: 0; max-width: none !important; padding: 0 !important; background: var(--white); }
.lead-panel > * { padding-left: 18px; padding-right: 18px; }
.lead-panel h3 { position: sticky; top: 0; background: var(--white); margin: 0; padding: 16px 18px 8px; font-size: 16px; z-index: 2; }
.lead-panel h4 { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.lead-panel dl { display: grid; grid-template-columns: 1fr; gap: 0; margin: 6px 0 4px; font-size: 13px; }
.lead-panel dt { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.lead-panel dt b { font-weight: 700; }
.lead-panel dd { margin: 2px 0 0; color: var(--ink, var(--ink)); line-height: 1.4; overflow-wrap: anywhere; }
.lead-panel ul li { padding: 3px 0; }
.lead-panel form { display: grid; gap: 8px; padding-bottom: 18px; }
.lead-panel select, .lead-panel input[type=text], .lead-panel input:not([type]) { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; background: var(--white); }
.lead-panel label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.inbox-layout > * { min-width: 0; }  /* grid children may shrink below content width */
.conversation-list { border-right: 1px solid var(--line); overflow: auto; background: var(--white); }
.conversation-item { display: block; padding: 13px 16px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.conversation-item .conversation-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.conversation-item time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.conversation-item.active { background: var(--secondary-50); border-left-color: var(--secondary); }
.conversation-item b { display: block; }
.conversation-item span { color: var(--muted); font-size: 13px; }
/* Inbox thread column. min-height:0 on BOTH the column and the message list is
   what keeps the composer on screen: a grid row defaults to min-height:auto and
   so refuses to shrink below its content, pushing the composer below the fold. */
.thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.thread-head h2 { font-size: 19px; margin: 0; line-height: 1.2; }
.thread-head .muted { font-size: 13px; }
.thread-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.thread-actions form { display: flex; margin: 0; }
.thread-actions .cx-status { white-space: nowrap; font-size: 12px; padding: 5px 10px; }
.thread-actions .cx-btn { white-space: nowrap; padding: 8px 14px; font-size: 13px; }
.messages { padding: 22px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; background: var(--paper); }
.bubble { max-width: min(72%, 560px); padding: 11px 14px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 1px 2px var(--ink-tint-04); overflow-wrap: anywhere; }
.bubble .message-meta { display: flex; justify-content: space-between; gap: 14px; font-size: 11px; opacity: .75; margin-bottom: 4px; }
.bubble.outbound, .bubble.ai { align-self: flex-end; background: var(--secondary); color: var(--white); border-color: var(--secondary); }
/* Assistant replies sit back: a tinted panel with an ember edge, not a solid
   ember block. House rule is one ember element per view, and on a busy thread
   the old treatment fought the Take over button for attention. (Build 25;
   re-applied on Palette v1.0 using ember tints rather than literals.) */
.bubble.ai { background: var(--ember-tint-08); border-color: var(--ember-tint-25); color: var(--text); border-left: 3px solid var(--primary); }
.bubble.ai .message-meta b { color: var(--primary); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--white); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-height: 46px; max-height: 120px; font: inherit; }
.composer .cx-btn { align-self: stretch; padding: 0 22px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.searchbar input, .auth-card input { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%; background: var(--white); }
table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--secondary); background: var(--secondary-50); font-weight: 800; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page); }
.auth-card { width: min(440px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 30px; }
.auth-card label { display: block; font-weight: 800; margin: 14px 0 6px; }
.auth-card .btn { width: 100%; margin-top: 16px; }
.home-frame iframe { width: 100%; min-height: 100vh; border: 0; display: block; }
.report-band { background: var(--text); color: var(--white); border-radius: 8px; padding: 22px; }

/* Application extensions for the sales workspace UI kit. */
.metric-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--plum); color: var(--white); }
.metric-strip > div { padding: 17px 20px; border-right: 1px solid var(--white-14); display: grid; gap: 5px; }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span { color: var(--plum-text-muted); font-size: 9.5px; }
.metric-strip strong { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: 0; line-height: 1.35; }
.metric-strip small { color: var(--plum-text-muted); font-size: 11px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); gap: 14px; margin-top: 14px; }
.dash-grid.lower { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); }
.bar-chart { height: 205px; display: flex; align-items: flex-end; justify-content: space-around; gap: 12px; padding: 16px 4px 0; border-bottom: 1px solid var(--hairline); }
.bar-col { height: 100%; flex: 1; min-width: 52px; display: grid; grid-template-rows: 1fr auto auto; align-items: end; gap: 5px; text-align: center; }
.bar-col .bar { width: min(34px, 62%); min-height: 4px; margin: 0 auto; background: var(--violet); border-radius: 5px 5px 0 0; box-shadow: inset 0 -2px 0 var(--shadow-soft); }
.bar-col b { color: var(--plum); font-family: var(--font-mono); font-size: 9px; font-weight: 500; white-space: nowrap; }
.bar-col span { color: var(--grey); font-family: var(--font-mono); font-size: 10px; }
.pipeline { display: grid; gap: 14px; }
.pipeline > div { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
.pipeline span { font-weight: 700; font-size: 12.5px; text-transform: capitalize; }
.pipeline b { font-family: var(--font-mono); color: var(--plum); font-size: 12px; }
.pipeline i { grid-column: 1 / -1; height: 7px; border-radius: 9px; background: var(--plum-tint); overflow: hidden; }
.pipeline i::before { content: ""; display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--violet); }
.focus-list { display: grid; gap: 0; }
.focus-list p { padding: 12px 0; margin: 0; border-bottom: 1px solid var(--hairline); display: grid; gap: 3px; }
.focus-list p:first-child { padding-top: 0; }
.focus-list p:last-child { padding-bottom: 0; border-bottom: 0; }
.focus-list b { font-size: 13px; color: var(--plum); }
.focus-list span { font-size: 11.5px; color: var(--grey); }
.record-form { max-width: 860px; }
.record-form .cb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 22px; }
.form-field { min-width: 0; display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--plum); font-size: 11px; font-weight: 800; font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--white); color: var(--ink); font: inherit; }
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid var(--violet-tint-14); border-color: var(--violet); }
.form-actions { padding: 15px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--hairline); background: var(--paper); }
.error { color: var(--stop); font-weight: 700; font-size: 11px; }
.cx-user-menu { position: relative; }
.cx-user-menu summary { list-style: none; cursor: pointer; }
.cx-user-menu summary::-webkit-details-marker { display: none; }
.cx-user-menu[open] summary .av { outline: 3px solid var(--plum-tint2); }
.cx-user-menu form { position: absolute; z-index: 10; right: 0; top: calc(100% + 10px); min-width: 150px; padding: 6px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--white); box-shadow: var(--shadow); }
.cx-user-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--stop); cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; text-align: left; }
.cx-user-menu button:hover { background: var(--stop-bg); }
.cx-home { min-height: 100vh; color: var(--ink); background: var(--paper); }
.home-nav, .home-hero, .home-points { width: min(1120px, calc(100% - 48px)); margin: auto; }
.home-nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; }
.home-nav img { display: block; width: 166px; max-height: 38px; }
.home-hero { min-height: 540px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .72fr); align-items: center; gap: 70px; padding: 66px 0 82px; }
.home-kicker { margin: 0 0 16px; color: var(--ember-label); font-size: 10px; }
.home-hero h1 { max-width: 700px; font-size: 38px; line-height: 1.3; }
.home-hero > div > p:not(.home-kicker) { max-width: 620px; margin: 20px 0 26px; color: var(--grey); font-size: 17px; line-height: 1.7; }
.home-preview { background: var(--plum); color: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: 0 22px 45px var(--plum-tint-18); }
.preview-top { display: flex; align-items: center; gap: 8px; color: var(--hairline); font-size: 12px; }
.preview-top small { margin-left: auto; font-family: var(--font-mono); font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.home-preview > strong { display: block; margin: 35px 0 3px; font-family: var(--font-display); font-size: 25px; font-weight: 500; }
.home-preview > span { color: var(--plum-text-muted); font-size: 12px; }
.preview-bars { height: 130px; display: flex; align-items: end; gap: 11px; margin: 25px 0; padding-bottom: 4px; border-bottom: 1px solid var(--white-17); }
.preview-bars i { flex: 1; display: block; border-radius: 4px 4px 0 0; background: var(--violet); }
.preview-bars i:nth-child(1) { height: 32%; }.preview-bars i:nth-child(2) { height: 54%; }.preview-bars i:nth-child(3) { height: 42%; }.preview-bars i:nth-child(4) { height: 78%; }.preview-bars i:nth-child(5) { height: 61%; }.preview-bars i:nth-child(6) { height: 92%; background: var(--ember); }
.preview-line { display: flex; gap: 9px; align-items: center; color: var(--plum-text-muted); font-size: 12px; }.preview-line b { color: var(--white); font-family: var(--font-mono); }
.home-points { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hairline); }.home-points > div { padding: 24px 26px 30px 0; display: grid; gap: 6px; }.home-points b { color: var(--plum); font-size: 14px; }.home-points span { color: var(--grey); font-size: 12.5px; line-height: 1.6; }

.table-scroll { overflow-x: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.source-chart { display: grid; gap: 15px; }
.source-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: end; }
.source-row b { display: block; font-size: 13px; }
.source-row span { color: var(--grey); font-size: 11.5px; }
.source-row strong { font-family: var(--font-mono); color: var(--plum); font-size: 13px; }
.source-row i { grid-column: 1 / -1; height: 7px; display: block; background: var(--plum-tint); border-radius: 7px; overflow: hidden; }
.source-row em { display: block; height: 100%; background: var(--violet); border-radius: inherit; }
.conversion-rows { display: grid; gap: 0; }
.conversion-rows p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 11px 0; border-bottom: 1px solid var(--hairline); color: var(--grey); font-size: 12.5px; }
.conversion-rows p:first-child { padding-top: 0; }
.conversion-rows p:last-child { border: 0; padding-bottom: 0; }
.conversion-rows b { color: var(--plum); font-family: var(--font-mono); }
.cx-queue .ch { padding: 15px 18px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; background: var(--white); }
.cx-queue .ch h3 { font-family: var(--font-display); color: var(--plum); font-size: 13.5px; font-weight: 500; }
.cx-queue .cx-qrow { min-height: 66px; }
/* Empty states inside a queue: the .cb padding rule only applies inside a
   card, so a queue's "nothing here yet" line was rendering flush against the
   card edge, out of line with its own header. */
.cx-queue .cb { padding: 16px 18px; }
.cx-queue .cx-qrow .d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .cx-btn { margin-left: 7px; }
.report-summary .cx-tile .v { font-family: var(--font-mono); font-size: 23px; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere; }
.report-summary .cx-tile .k { min-height: 16px; }
.report-nav { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }.report-nav a { padding: 7px 10px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--white); color: var(--violet); font-weight: 800; font-size: 11.5px; }.report-nav a:hover { border-color: var(--violet); }
.document-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.document-card { max-width: 860px; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.document-card > header { padding: 27px 30px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; color: var(--white); background: var(--plum); }
.document-card > header .mono { color: var(--ember-tint-50); font-size: 10px; }
.document-card h2 { margin: 8px 0 0; font-size: 23px; }
.document-status { padding-top: 3px; }
.document-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 26px 30px; border-bottom: 1px solid var(--hairline); }
.document-parties > div { display: grid; gap: 5px; }.document-parties .mono { color: var(--ember-label); font-size: 9.5px; }.document-parties b { color: var(--plum); font-size: 15px; }.document-parties p { margin: 0; color: var(--grey); font-size: 12.5px; line-height: 1.7; }
.document-lines { padding: 26px 30px 30px; }.document-line { display: grid; grid-template-columns: 1fr 100px 150px; gap: 14px; align-items: center; padding: 13px 12px; border-bottom: 1px solid var(--hairline); font-size: 13px; }.document-line.head { background: var(--paper); color: var(--grey); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; }.document-line span:nth-child(2), .document-line b { text-align: right; }.document-line b { font-family: var(--font-mono); font-weight: 500; }
.document-total { display: flex; justify-content: flex-end; gap: 42px; padding: 16px 12px; color: var(--white); background: var(--ember); font-weight: 800; }.document-total strong { min-width: 150px; text-align: right; font-family: var(--font-mono); font-weight: 500; }
.document-tax { display: flex; justify-content: flex-end; gap: 42px; padding: 12px; color: var(--grey); border-bottom: 1px solid var(--hairline); font-size: 12px; }.document-tax b { min-width: 150px; text-align: right; font-family: var(--font-mono); color: var(--ink); font-weight: 500; }
.document-card > footer { padding: 18px 30px; background: var(--paper); color: var(--grey); font-size: 12px; }
.document-logo { display: block; width: auto; height: 28px; max-width: 210px; object-fit: contain; object-position: left center; }
.inbox-search { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--hairline); background: var(--white); }
.inbox-search input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); color: var(--ink); font: inherit; font-size: 12px; }
.inbox-search input:focus { outline: 2px solid var(--violet-tint-14); border-color: var(--violet); }
.inbox-search .cx-btn { padding: 9px 11px; font-size: 12px; }
.conversation-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conversation-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-name time, .message-meta time { color: var(--grey); font-family: var(--font-mono); font-size: 9.5px; white-space: nowrap; }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; font-size: 10px; }
.bubble.outbound .message-meta time { color: var(--white-78); }
.bubble.ai .message-meta time { color: var(--muted); }  /* tinted panel, not a dark bubble */

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats, .dashboard-grid, .inbox-layout, .inbox-layout:has(.lead-panel) { grid-template-columns: 1fr; }
  .inbox-layout { height: auto; min-height: 0; }
  .thread { min-height: 60vh; }
  .messages { max-height: 60vh; }
  .lead-panel h3 { position: static; }
  .bubble { max-width: 88%; }
  /* Phone: chip and action button get their own line, full width and tappable */
  .thread-head { align-items: flex-start; gap: 10px; }
  .thread-actions { width: 100%; justify-content: space-between; }
  .thread-actions .cx-btn { flex: 1; text-align: center; padding: 11px 14px; }
  .lead-panel { border-left: 0; border-top: 1px solid var(--line); }
  .bubble { max-width: 92%; }
  .metric-strip, .dash-grid, .dash-grid.lower, .home-hero { grid-template-columns: 1fr; }
  .metric-strip > div { border-right: 0; border-bottom: 1px solid var(--white-14); }
  .metric-strip > div:last-child { border-bottom: 0; }
  .home-hero { gap: 36px; padding: 44px 0 55px; }.home-hero h1 { font-size: 29px; }.home-points { grid-template-columns: 1fr; }.home-points > div { padding: 18px 0; border-bottom: 1px solid var(--hairline); }
  .document-parties { grid-template-columns: 1fr; gap: 20px; }.document-line { grid-template-columns: 1fr 70px 120px; }.document-total strong { min-width: 120px; }
}
@media (max-width: 600px) {
  .cx-wrap { padding: 20px 16px 44px; }.cx-top { padding: 0 16px; }.cx-top .cx-crumb, .cx-top .cx-refresh, .cx-top .cx-tenant { display: none; }.cx-top .right { margin-left: auto; }.cx-tiles, .cx-tiles.cols-3 { grid-template-columns: 1fr; }.record-form .cb { grid-template-columns: 1fr; padding: 18px; }.form-actions { padding: 14px 18px; }.home-nav, .home-hero, .home-points { width: min(calc(100% - 32px), 1120px); }.home-preview { padding: 18px; }
  .document-card > header, .document-parties, .document-lines { padding-left: 18px; padding-right: 18px; }.document-card > footer { padding: 16px 18px; }.document-line { grid-template-columns: 1fr 50px 90px; gap: 8px; font-size: 11.5px; }.document-total { gap: 12px; }.document-total strong { min-width: 90px; }.document-actions { width: 100%; }
  .inbox-search { padding: 10px; }.inbox-search .cx-btn { padding: 9px; }.conversation-name time { font-size: 9px; }
}

/* Lead panel detail classes (replacing former inline styles) */
.lead-panel .lead-sub { margin: 0 0 4px; font-size: 12.5px; }
.lead-panel .lead-checklist { list-style: none; padding: 0; margin: 0 0 4px; font-size: 13px; }
.lead-panel .lead-checklist li.done { color: var(--ok); }
.lead-panel .lead-checklist li.todo { color: var(--muted); }
.lead-panel .lead-note { font-size: 11px; margin: 2px 0 0; line-height: 1.45; }

/* ---------------------------------------------------------------------------
   Sidebar footer: brand casing is fixed text, never uppercased by CSS.
   --------------------------------------------------------------------------- */
.cx-side .foot { text-transform: none; letter-spacing: .06em; }
.cx-side .foot .brand-name { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--plum-text-muted); }

/* ---------------------------------------------------------------------------
   LEAD PANEL - the closer's working surface. Dense but calm: the captured
   facts read at a glance, gaps read as gaps, and the write path sits last.
   --------------------------------------------------------------------------- */
.lead-panel .lead-head { position: sticky; top: 0; background: var(--white); z-index: 2; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.lead-panel .lead-head h3 { position: static; padding: 0; margin: 0 0 6px; font-size: 15px; }
.lead-panel .lead-sub { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; }
.lead-panel .stage-pill { font-size: 11px; padding: 3px 9px; }

.lead-panel .lead-fields { display: block; margin: 12px 0 4px; }
.lead-panel .lead-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.lead-panel .lead-row:last-child { border-bottom: 0; }
.lead-panel .lead-row dt { margin: 0; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.lead-panel .lead-row dd { margin: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.lead-panel .empty { color: var(--rest); font-style: italic; font-size: 12.5px; }
.lead-panel .zone-tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--secondary-50, var(--violet-tint-10)); color: var(--secondary); white-space: nowrap; }

.lead-panel .lead-section { margin: 14px 0 4px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.lead-panel .lead-section h4 { margin: 0 0 8px; }
.lead-panel .lead-checklist li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.lead-panel .lead-checklist .mark { width: 15px; display: inline-block; text-align: center; font-weight: 700; }
.lead-panel .lead-checklist li.done { color: var(--ok); }
.lead-panel .lead-checklist li.todo { color: var(--rest); }

.lead-panel h4 { margin: 16px 0 8px; }
.lead-panel form { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.lead-panel form .cx-btn { justify-self: start; padding: 8px 18px; }

/* Auth pages use the real brand asset (the previous CSS-drawn mark did not
   match the logo). Height-constrained so the wordmark stays legible. */
.auth-card .brand { display: flex; justify-content: flex-start; margin-bottom: 4px; }
.auth-card .auth-logo { height: 30px; width: auto; display: block; }

/* ---------------------------------------------------------------------------
   QUOTE AND INVOICE LINE ITEMS
   A real order is several things at once, so documents carry many lines.
   --------------------------------------------------------------------------- */
.line-items { padding: 0 22px 6px; }
.line-items h3 { font-size: 15px; margin: 6px 0 10px; }
.line-head, .line-row { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,2fr) .8fr .7fr 1fr .9fr 70px; gap: 10px; align-items: center; }
.line-row select.product-pick { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 8px; font: inherit; font-size: 13px; background: var(--white); }
.line-head { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.line-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.line-row input[type=text], .line-row input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px; background: var(--white); }
.line-row .line-total { font-family: "JetBrains Mono", monospace; font-size: 12.5px; text-align: right; color: var(--secondary); }
.line-row .line-delete { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.line-items #add-line { margin: 12px 0 4px; }
.line-totals { margin-top: 14px; margin-left: auto; width: min(340px, 100%); border-top: 2px solid var(--line); padding-top: 10px; }
.line-totals p { display: flex; justify-content: space-between; gap: 20px; margin: 6px 0; font-size: 13px; }
.line-totals b { font-family: "JetBrains Mono", monospace; }
.line-totals .grand { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 9px; font-size: 15px; }
.line-totals .grand b { color: var(--primary); }

.document-line, .document-line.head { grid-template-columns: minmax(0,2.4fr) .9fr 1fr 1fr; }
.document-subtotal { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0 4px; font-size: 14px; }
.document-subtotal b { font-family: "JetBrains Mono", monospace; }

@media (max-width: 900px) {
  .line-head { display: none; }
  .line-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; }
  .line-row [data-cell="description"] { grid-column: 1 / -1; }
  .line-row .line-total { text-align: left; }
}

/* Hidden formset plumbing must never occupy a grid cell. */
.line-row .line-hidden { display: none !important; }
.line-items .management-form, .line-items input[type=hidden] { display: none; }

/* A claimed thread should look claimed, and a forgotten one should look wrong. */
.conversation-item .held { color: var(--secondary); }
.conversation-item .held.stale { color: var(--stop); font-weight: 600; }

/* ---------------------------------------------------------------------------
   OPERATOR CONSOLE
   Deliberately distinct from a tenant workspace: an operator must never be in
   any doubt about which they are looking at.
   --------------------------------------------------------------------------- */
.console-banner { background: var(--plum); color: var(--plum-text-muted); padding: 9px 18px; border-radius: 8px; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 18px; }
.console-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.console-note { font-size: 12px; margin-top: 14px; }
.warning-row td { background: var(--ember-tint-08); padding-top: 4px; padding-bottom: 10px; }
.warn-chip { display: inline-block; font-size: 11.5px; padding: 3px 9px; margin: 3px 6px 3px 0; border-radius: 999px; background: var(--stop-bg); color: var(--stop); }
.warn-card { padding: 16px 18px; margin-bottom: 18px; border-left: 3px solid var(--violet); }
.warn-card h3 { margin: 0 0 8px; font-size: 15px; }
.warn-card ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.check-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.check-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.check-list .mark { width: 15px; text-align: center; font-weight: 700; }
.check-list li.done { color: var(--ok); }
.check-list li.todo { color: var(--stop); }
.head-actions { display: flex; gap: 10px; align-items: center; }
.access-note { font-size: 12px; line-height: 1.5; margin: 0 0 10px; }
.access-form { display: grid; gap: 10px; }
.access-form input[type=text], .access-form input[type=date] { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px; }
.access-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.access-until { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.onboard-steps { font-size: 13px; line-height: 1.8; padding-left: 20px; margin: 8px 0 0; }

/* Duplicate review: read-only comparison, merging stays a human decision. */
.dup-group { margin-bottom: 16px; }
.dup-note { font-size: 12px; margin: 10px 0 0; }

/* ---------------------------------------------------------------------------
   QUICK LEAD CAPTURE
   Someone is at the counter. Three fields, one save. The optional detail is
   behind a disclosure so the eye never has to skip past it.
   --------------------------------------------------------------------------- */
.quick-lead { margin-bottom: 18px; }
.quick-lead > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
.quick-lead > summary::-webkit-details-marker { display: none; }
.quick-lead[open] > summary { margin-bottom: 12px; }
.quick-lead-form { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.quick-lead-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.quick-lead-form input[type=text], .quick-lead-form input[type=email], .quick-lead-form textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; font: inherit; font-size: 14px;
  text-transform: none; letter-spacing: 0; color: var(--ink, var(--ink)); background: var(--white);
}
.quick-source { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 4px; font-size: 13px; }
.quick-source label { flex-direction: row; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink, var(--ink)); }
.quick-more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.quick-more > summary { cursor: pointer; font-size: 12.5px; color: var(--secondary); }
.quick-more .quick-row { margin-top: 10px; }
.quick-notes { margin-top: 10px; }
.quick-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.quick-actions .cx-muted { font-size: 12px; }
@media (max-width: 700px) { .quick-row { grid-template-columns: 1fr; } }

/* --- Quick lead, corrected alignment -------------------------------------
   The auto-fit grid dropped "what do they want" onto its own row with a gap
   beside it. Explicit tracks keep the three fields on one line, and the
   trigger hides once the form is open so there is one thing to look at. */
.quick-lead[open] > summary { display: none; }
.quick-lead-form .primary-row { grid-template-columns: 1fr 1fr 1.5fr; align-items: start; }
.quick-lead-form .quick-row > label.wide { grid-column: auto; }
.quick-lead-form input { width: 100%; box-sizing: border-box; }
.quick-more .quick-row { grid-template-columns: repeat(4, 1fr); }
.quick-lead-form label { min-width: 0; }
.quick-source { border-top: 1px dashed var(--line); padding-top: 12px; }

@media (max-width: 1100px) {
  .quick-lead-form .primary-row { grid-template-columns: 1fr 1fr; }
  .quick-lead-form .quick-row > label.wide { grid-column: 1 / -1; }
  .quick-more .quick-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .quick-lead-form .primary-row,
  .quick-more .quick-row { grid-template-columns: 1fr; }
  .quick-lead-form .quick-row > label.wide { grid-column: auto; }
  .quick-source { justify-content: flex-start; }
  .quick-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .quick-actions .cx-btn { width: 100%; }
}

/* --- Source choices: never break a label across lines ---------------------
   "Walk-in" was wrapping to "Walk-" / "in". Each choice is one unbreakable
   unit, laid out as chips so the row reads as a set of options rather than
   loose text beside loose circles. */
.quick-source { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quick-source > span { display: inline-flex; }
.quick-source label {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; cursor: pointer; background: var(--white); margin: 0;
}
.quick-source label:hover { border-color: var(--secondary); }
.quick-source input[type=radio] { margin: 0; accent-color: var(--secondary); }
.quick-source input[type=radio]:checked + * { font-weight: 600; }
.quick-source label:has(input:checked) { border-color: var(--secondary); background: var(--secondary-50, var(--violet-tint-10)); font-weight: 600; }

/* Products page: the safe fields are editable in place. */
.products-table input[type=text] { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; font: inherit; font-size: 13px; }
.products-table td { vertical-align: middle; }
.products-table .active-cell { text-align: center; }
.on-request { color: var(--stop); font-size: 11.5px; font-weight: 600; }
.products-note { font-size: 12px; margin-top: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--stop-bg); color: var(--stop); }

/* --- Inbox thread: day separators, WhatsApp Web convention -------------
   Build 25, re-applied on Palette v1.0. */
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-sep span { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: transparent; }

/* --- Onboarding checklist ---------------------------------------------
   The cross-client view is the point: one screen showing who is missing
   what, so chasing does not depend on memory. */
.onboarding-tiles { margin-bottom: 18px; }
.progress-cell { min-width: 150px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--hairline); overflow: hidden; margin-bottom: 5px; }
.progress-bar i { display: block; height: 100%; background: var(--ok); }
.onboarding-table td { vertical-align: top; }
.onboarding-table .row-actions { display: flex; gap: 6px; align-items: flex-start; white-space: nowrap; }
/* A not-applicable row stays visible but recedes, so nobody wonders whether
   it was forgotten. */
.item-na { opacity: .55; }
.na-form { display: inline-block; }
.na-form > summary { list-style: none; cursor: pointer; }
.na-form > summary::-webkit-details-marker { display: none; }
.na-form form { display: flex; gap: 6px; margin-top: 6px; }
.na-form input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 13px; min-width: 220px; }
.inline-settle { display: inline; }
.template-pick { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.template-pick select { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; font: inherit; font-size: 14px; background: var(--white); }

/* Brand attribution in the sidebar foot. Quiet by design: the brand leads,
   the platform is acknowledged. */
.attribution { display: inline-block; margin-top: 3px; font-size: 9.5px; letter-spacing: .06em; opacity: .7; }

/* --- Brand preview, operator console ---------------------------------- */
.brand-preview-card { margin-top: 18px; }
.brand-preview-card h3 { margin: 0 0 4px; font-size: 15px; }
.preview-form { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.preview-form select { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; font: inherit; font-size: 14px; background: var(--white); min-width: 300px; }
