/* Cosmo 3.8: familiar messaging, Kleinanzeigen greens, restrained liquid glass. */
:root,:root[data-theme="light"]{color-scheme:light;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;--bg:#f6f7f6;--surface:#fff;--surface-soft:#f0f3ef;--ink:#202b24;--muted:#657168;--line:#e2e7e2;--accent:#315d25;--accent-hover:#224719;--accent-wash:#edf5e8;--lime:#b9ec41;--brand-ink:#20461a;--bubble:#fff;--bubble-out:#e5f1da;--unread:#f4f9ef;--chat-bg:#eef2eb;--rail-bg:#f0f4ee;--radius:14px;--glass:rgba(249,252,247,.88);--glass-border:rgba(255,255,255,.94);--glass-line:rgba(56,83,43,.13);--shadow:0 12px 40px #172e1712;--glass-shadow:inset 0 1px 0 var(--glass-border),0 4px 20px #172e1709;--warning-ink:#78551d;--warning-bg:#fff5e2;--danger:#a23e34;--danger-bg:#fff0ec;--motion:160ms ease;--nav-width:84px;--page-width:1280px;color:var(--ink);background:var(--bg)}
:root[data-theme="dark"]{color-scheme:dark;--bg:#101512;--surface:#181f1a;--surface-soft:#222c25;--ink:#e5ebe5;--muted:#9ba99e;--line:#303a32;--accent:#b9ec41;--accent-hover:#c6f367;--accent-wash:#293b23;--brand-ink:#b9ec41;--bubble:#222c25;--bubble-out:#344a2b;--unread:#1c2a1e;--chat-bg:#111914;--rail-bg:#161e18;--glass:rgba(28,39,31,.88);--glass-border:rgba(202,233,189,.11);--glass-line:rgba(195,220,184,.13);--shadow:0 12px 40px #0003;--glass-shadow:inset 0 1px 0 var(--glass-border),0 4px 24px #0002;--warning-ink:#e7c784;--warning-bg:#3a301c;--danger:#ffb4a7;--danger-bg:#392721}
*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;min-width:320px;line-height:1.5;background:var(--bg);color:var(--ink)}body{font-size:14px}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{border:0;background:none;cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button,a{touch-action:manipulation}a{color:inherit;text-decoration:none}button,input,select,textarea,a{transition:background-color var(--motion),border-color var(--motion),box-shadow var(--motion),color var(--motion)}:focus-visible{outline:3px solid var(--accent);outline-offset:3px}svg{width:22px;height:22px;flex:none;vertical-align:middle}h1,h2,h3,h4,p{margin:0}small{font-size:12px}img{max-width:100%}h1,h2,h3,h4,strong{color:var(--ink)}::selection{color:var(--ink);background:var(--accent-wash)}
/* One stable navigation surface in every section. */
.app-shell{display:grid;grid-template-columns:var(--nav-width) minmax(0,1fr);height:100vh;height:100dvh;min-height:0;overflow:hidden}.nav-strip{display:flex;flex-direction:column;align-items:center;gap:12px;min-height:0;padding:20px 7px 12px;border-right:1px solid var(--glass-line);background:var(--glass);backdrop-filter:blur(24px) saturate(1.15);-webkit-backdrop-filter:blur(24px) saturate(1.15);box-shadow:var(--glass-shadow);z-index:20}
.logo{display:flex;align-items:center;gap:10px;min-height:44px;color:var(--brand-ink);font-size:25px;font-weight:750;letter-spacing:-1px}.brand-orbit{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:14px;background:var(--lime);color:#20461a;font:bold 40px/1 Arial,sans-serif;padding-bottom:6px;transform:rotate(-12deg);box-shadow:inset 0 1px 0 #fff8,0 4px 12px #315d2512}.logo .suite{display:block;font-size:10px;letter-spacing:2px;text-transform:uppercase}
.nav{display:flex;flex-direction:column;gap:6px;width:100%;min-height:0;overflow-y:auto;scrollbar-width:none}.nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;min-height:58px;border-radius:16px;padding:8px 2px;color:var(--muted);font-size:10px;font-weight:550;line-height:1.2}.nav button svg{width:23px;height:23px;stroke-width:1.7}.nav button:hover{background:var(--surface-soft);color:var(--ink)}.nav button.active{color:var(--accent);background:var(--accent-wash);box-shadow:inset 0 0 0 1px var(--glass-line);font-weight:700}.rail-footer{display:flex;flex-direction:column;align-items:center;gap:12px;margin-top:auto;padding-top:10px}.header-user{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}.header-user .avatar{width:36px;height:36px;font-size:12px;border:2px solid var(--glass-border)}
.main{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}.topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;flex:none;min-height:72px;padding:12px 32px;border-bottom:1px solid var(--glass-line);background:var(--glass);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);box-shadow:var(--glass-shadow);z-index:10}.breadcrumb{display:flex;align-items:center;gap:20px;min-width:0}.breadcrumb strong{font-size:13px;font-weight:500;color:var(--muted)}.workspace-wordmark{color:var(--ink);font-size:24px;letter-spacing:-1.2px;font-weight:750}.topbar-right{display:flex;align-items:center;gap:14px;min-width:0}
.top-search{display:flex;align-items:center;gap:8px;width:280px;min-width:0;min-height:42px;padding:0 4px 0 13px;background:var(--surface-soft);border:1px solid transparent;border-radius:12px;color:var(--muted)}.top-search:focus-within{border-color:var(--accent)}.top-search svg{width:19px;height:19px}.top-search input{width:100%;flex:1;min-width:0;min-height:40px;border:0;background:transparent;padding:8px 0;outline:none;font-size:13px}.top-search button{flex:none}.status-indicator{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;white-space:nowrap}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent);flex:none}
.content{flex:1;min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain;padding:32px clamp(20px,3vw,48px) 40px}.content>:not(.inbox-layout){max-width:var(--page-width);margin-left:auto;margin-right:auto}.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:28px}.page-heading .eyebrow{display:none}.page-heading h1{font-size:30px;line-height:1.2;letter-spacing:-.8px;font-weight:700}.page-heading p{margin-top:8px;max-width:650px;color:var(--muted);font-size:14px;line-height:1.6}.heading-buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding-top:2px}.eyebrow{color:var(--accent);font-size:10px;letter-spacing:1.2px;font-weight:700;text-transform:uppercase}
.ai-workspace { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); gap:20px; align-items:start; }
.ai-workspace .section-card { background:var(--surface); border-radius:16px; padding:24px; }
.ai-workspace h2 { font-size:20px; margin-bottom:8px; }
.ai-workspace .field { margin-top:20px; }
.ai-workspace textarea { min-height:96px; resize:vertical; line-height:1.55; }
.ai-workspace .ai-main-prompt > .field textarea { min-height:280px; }
.ai-memory-compose-actions,.ai-rule-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.ai-memory-compose-actions { margin-top:12px; }
.ai-rule-actions { justify-content:flex-end; margin-top:12px; }
.ai-sync-note { min-height:24px; margin:16px 0; color:var(--muted); font-size:13px; line-height:1.5; }
.ai-sync-note.is-error { color: var(--muted); }
:root[data-theme="dark"] .ai-sync-note.is-error { color: var(--danger); }
.ai-memory-list { display:grid; gap:12px; }
.ai-memory-rule { padding:18px; border:1px solid var(--line); background:var(--surface-soft); border-radius:12px; }
.ai-workspace .ai-rule-text { color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; line-height:1.6; }
.ai-memory-empty { display:flex; align-items:flex-start; flex-direction:column; gap:10px; padding:24px 0 8px; color:var(--muted); }
.ai-memory-empty strong { color:var(--ink); font-size:16px; }
.ai-memory-empty svg { color:var(--accent); }
.ai-connection-settings { margin:20px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); }
.ai-connection-settings summary { cursor:pointer; font-weight:600; }
.ai-connection-settings .checkbox-label { color:var(--ink); margin-top:12px; }
.ai-main-prompt > .form-note { margin-top:14px; }
.ai-remote-comparison { margin-top:16px; padding:14px; border:1px solid var(--line); border-radius:12px; }
.ai-remote-comparison textarea { margin:10px 0; }
.ai-rule-server-version { margin-top:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:900px) { .ai-workspace { grid-template-columns:1fr; } }
@media(max-width:520px) { .ai-workspace .section-card { padding:18px; } .ai-memory-compose-actions > .button { flex:1; } }


/* Shared controls and surfaces */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button svg { width: 18px; height: 18px; }
.button:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-soft); color: var(--accent); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--muted); }
.button.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--muted); }
.button.subtle { border-color: transparent; background: var(--surface-soft); color: var(--muted); }
.button.subtle:hover:not(:disabled) { background: var(--accent-wash); color: var(--accent); }
.button.small { min-height: 44px; padding: 9px 12px; font-size: 13px; }
.button.danger { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.button.danger:hover:not(:disabled) { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.icon-button, .row-more {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
}
.icon-button:hover:not(:disabled), .row-more:hover { background: var(--accent-wash); color: var(--accent); }
.icon-button.danger:hover:not(:disabled) { background: var(--surface-soft); color: var(--muted); }
.icon-button svg { width: 20px; height: 20px; }
.panel, .section-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.panel { overflow: hidden; }
.section-card { padding: 28px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title h2 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.25px; }
.section-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.section-card .form-note { font-size: 13px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.settings-stack { display: grid; gap: 24px; }
.settings-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

/* Overview counters and contacts */

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.stat-card { min-width: 0; min-height: 108px; padding: 12px 20px; border-right: 1px solid var(--line); }
.stat-card:last-child { border-right: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.stat-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); }
.stat-icon svg { width: 15px; height: 15px; }
.stat-icon.orange { color: var(--muted); background: var(--surface-soft); }
.stat-icon.green { color: var(--muted); background: var(--surface-soft); }
.stat-icon.blue { color: var(--muted); background: var(--surface-soft); }
.stat-value { margin-top: 8px; color: var(--muted); font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.7px; }
.stat-bottom { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pill { display: inline-block; margin-right: 5px; padding: 2px 6px; border-radius: 10px; color: var(--accent); background: var(--surface-soft); font-size: 12px; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; min-height: 64px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.table-tabs { display: flex; align-items: stretch; align-self: stretch; gap: 24px; }
.table-tab { position: relative; min-height: 44px; padding: 10px 0; color: var(--muted); font-size: 15px; }
.table-tab.active { color: var(--accent); font-weight: 600; }
.table-tab.active::after { content: ""; position: absolute; right: 0; bottom: -9px; left: 0; height: 2px; background: var(--accent); }
.count-pill { display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.toolbar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.search-field { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-soft); color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); background: var(--surface-soft); }
.search-field svg { width: 19px; height: 19px; }
.search-field input { width: 230px; min-height: 42px; padding: 9px 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.filter-select { min-height: 44px; max-width: 220px; font-size: 15px; }
.chips-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.filter-chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.filter-chip:hover, .filter-chip.selected { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.chips-row > .muted { font-size: 12px !important; }
.view-toggle, .contact-view-toggle { display: inline-flex; flex: none; gap: 2px; padding: 1px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.view-toggle button, .contact-view-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 7px 11px; border: 1px solid transparent; border-radius: 3px; color: var(--muted); font-size: 13px; }
.view-toggle button.active, .contact-view-toggle button.active { border-color: var(--line); background: var(--surface-soft); color: var(--accent); }
.contacts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 16px 20px 20px; }
.contact-grid-summary { min-height: 44px; margin: 4px 20px -8px; color: var(--muted); font-size: 13px; }
.contact-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.contact-card:hover { border-color: var(--line); }
.contact-card.selected { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--surface-soft); }
.contact-card-top { position: absolute; top: 17px; right: 17px; left: 17px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.contact-card-top > * { pointer-events: auto; }
.contact-card-top .icon-button { border-color: var(--line); background: var(--surface-soft); }
.contact-card-select { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-soft); }
.contact-card-top .contact-sub { max-width: 140px; margin: 0 auto 0 0; padding: 5px 8px; overflow: hidden; border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.contact-card-open { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; min-width: 0; padding: 0; text-align: left; }
.contact-card-avatar, .avatar.contact-card-avatar { display: grid; place-items: center; width: 100%; height: 140px; margin-bottom: 9px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 44px; font-weight: 500; }
.contact-card-avatar .avatar { width: 80px; height: 80px; background: var(--surface-soft); font-size: 28px; font-weight: 500; }
.contact-card-open h3, .contact-card-open strong, .contact-card-open .contact-name { max-width: 100%; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.contact-card-open small, .contact-card-open .contact-sub { color: var(--muted); font-size: 13px; }
.contact-card-phone { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; max-width: 100%; padding: 8px 0; color: var(--accent); font-size: 14px; overflow-wrap: anywhere; }
a.contact-card-phone:hover { text-decoration: underline; }
.contact-card .labels-wrap { max-width: 100%; min-height: 30px; margin-top: 3px; }
.contact-card-labels { margin-top: 4px; font-size: 12px; }
.contact-card-meta { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.contact-card-meta svg { width: 15px; height: 15px; }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 1050px; border-collapse: collapse; text-align: left; font-size: 14px; white-space: nowrap; }
thead { background: var(--surface-soft); color: var(--muted); font-size: 12px; letter-spacing: .3px; }
th { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
td { padding: 20px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { width: 60px; padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.contact-row { cursor: pointer; }
tbody tr.contact-row:hover { background: var(--surface-soft); }
.check-cell { padding: 6px 8px !important; }
.check-cell input { display: block; }
.name-cell { display: flex; align-items: center; gap: 12px; min-width: 215px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 13px; font-weight: 600; }
.avatar.a1 { background: var(--surface-soft); color: var(--muted); }
.avatar.a2 { background: var(--surface-soft); color: var(--muted); }
.avatar.a3 { background: var(--surface-soft); color: var(--muted); }
.avatar.a4 { background: var(--surface-soft); color: var(--muted); }
.contact-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 15px; font-weight: 600; }
.contact-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.phone { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.date-cell { color: var(--muted); font-size: 13px; }
.labels-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: 310px; }
.label-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; border: 1px solid var(--chip-border, var(--line)); border-radius: 10px; color: var(--chip-color, #5b6b51); background: var(--chip-bg, #f3f6f1); font-size: 12px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.chip-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
.account-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.account-pill svg { width: 16px; height: 16px; color: var(--accent); }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 16px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; gap: 6px; }
.page-number { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 14px; }
.page-number.active { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--accent-wash); color: var(--muted); font-size: 14px; }
.bulk-bar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 26px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.footer-note span { display: flex; align-items: center; gap: 6px; }
.footer-note svg { width: 15px; height: 15px; color: var(--muted); }

/* Inputs, settings and labels */

input, select, textarea { min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-soft); font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface-soft); }
textarea { max-width: 100%; min-height: 104px; resize: vertical; line-height: 1.6; }
input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; }
input[type="checkbox"] {
  appearance: none;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect x='1' y='1' width='18' height='18' rx='3' fill='white' stroke='%23829394' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  vertical-align: middle;
  cursor: pointer;
}
input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' rx='3' fill='%23326916'/%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type="color"] { width: 66px; height: 46px; padding: 5px; background: var(--surface-soft); }
input[type="file"] { width: 100%; padding: 7px; background: var(--surface-soft); }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 10px; border: 0; border-radius: 3px; background: var(--accent-wash); color: var(--accent); font: inherit; cursor: pointer; }
.field { display: grid; flex: 1; gap: 8px; min-width: 0; margin-bottom: 20px; }
.field > span, .field > label { color: var(--muted); font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; font-size: 16px; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.field.invalid input { border-color: var(--line); }
.field-row { display: flex; gap: 16px; }
.form-note { color: var(--muted); font-size: 13px; line-height: 1.65; }
.form-error, .error-panel { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 14px; line-height: 1.65; }
.form-error { margin-bottom: 18px; }
.error-panel { padding: 28px; }
.error-panel strong { font-size: 18px; }
.error-panel p { margin: 8px 0 18px; }
.error-text { color: var(--muted); font-size: 14px; line-height: 1.6; }
.checkbox-label { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; line-height: 1.5; cursor: pointer; }
.labels-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.labels-grid .checkbox-label { gap: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.label-list { display: grid; gap: 12px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.label-row > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.label-row strong { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.label-row small { color: var(--muted); font-size: 12px; }
.label-swatch { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.label-actions { display: flex; flex: none; gap: 2px; }
.info-banner { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 14px; line-height: 1.65; }
.info-banner svg { width: 20px; height: 20px; margin-top: 2px; }
.info-banner.warning { border-color: var(--line); color: var(--muted); background: var(--surface-soft); }
.account-row { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; padding-bottom: 0; }
.account-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-wash); color: var(--accent); }
.account-row h3 { color: var(--muted); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.account-row p { color: var(--muted); font-size: 13px; }
.account-row > .button { margin-left: auto; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.account-actions .button { margin-left: 0; }
.connection-status { display: inline-block; padding: 5px 8px; border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 12px; white-space: nowrap; }
.connection-status.off { color: var(--muted); background: var(--surface-soft); }
.integration-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.integration-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.integration-toggle { align-items: flex-start; margin: 14px 0; }
.integration-toggle input { margin-top: -8px; }
.integration-card .connection-status { font-size: 12px; }

/* Modal and persistent buyer drawer */

.overlay-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface-soft); }
.modal { display: flex; flex-direction: column; width: 560px; max-width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.modal.large { width: 800px; }
.modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { color: var(--muted); font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.3px; }
.modal-body { min-height: 0; padding: 26px; overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { display: flex; flex: none; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.modal .field:last-child { margin-bottom: 0; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: var(--surface-soft); }
.drawer { display: flex; flex-direction: column; width: 560px; max-width: 100%; height: 100vh; height: 100dvh; overflow: hidden; border-left: 1px solid var(--line); background: var(--surface-soft); }
.drawer-toolbar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-toolbar > span { color: var(--muted); font-size: 12px; letter-spacing: .7px; }
.drawer-body { flex: 1; min-height: 0; padding: 28px; overflow: auto; overscroll-behavior: contain; }
.drawer-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.drawer-profile .avatar { width: 66px; height: 66px; font-size: 22px; }
.drawer-profile h2 { color: var(--muted); font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; overflow-wrap: anywhere; }
.drawer-profile p { margin-top: 7px; color: var(--muted); font-size: 15px; }
.drawer-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.drawer-section h3 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: 15px; font-weight: 600; }
.drawer-section h3 small { color: var(--muted); font-size: 12px; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.detail-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.detail-value { color: var(--muted); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.notes-list { display: grid; gap: 14px; }
.note-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.note-card textarea { width: 100%; min-height: 92px; padding: 0; border: 0; background: transparent; font-size: 16px; }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.private-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 12px; font-weight: 400; }
.private-tag svg { width: 14px; height: 14px; }
.new-note textarea { width: 100%; min-height: 112px; margin-bottom: 10px; font-size: 16px; }
.new-note .button { display: flex; margin-left: auto; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding-bottom: 21px; }
.timeline-item::before { content: ""; position: absolute; top: 12px; bottom: -7px; left: 3px; width: 1px; background: var(--surface-soft); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; flex: none; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--surface-soft); }
.timeline-item p { color: var(--muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.timeline-item time { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.product-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 0; }
.product-item > div { min-width: 0; }
.product-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); }
.product-item strong { display: block; color: var(--muted); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.product-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.product-item > span:not(.label-chip):last-child { font-size: 14px !important; }
.product-item .label-chip { margin-left: auto; }
.product-url { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 5px; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.product-url svg { width: 14px; height: 14px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.drawer-actions .button { flex: 1; }
.save-state { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; max-width: 210px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.save-state svg { width: 15px; height: 15px; }
.save-state.dirty, .composer-save.dirty { color: var(--muted); }
.save-state.error { color: var(--muted); }
.import-preview { max-width: 100%; max-height: 210px; padding: 14px; margin: 12px 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-soft); font: 12px/1.65 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }


/* Sales board and overview */

.deals-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; width: 100%; min-width: 0; }
.deal-column { min-width: 0; min-height: 240px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.deal-column-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; margin-bottom: 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.deal-card { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); text-align: left; }
.deal-card:hover { border-color: var(--line); }
.deal-card h3 { color: var(--muted); font-size: 16px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.deal-card p { margin: 10px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.deal-amount { color: var(--muted); font-size: 25px; font-weight: 600; letter-spacing: -.5px; }
.deal-card .labels-wrap { margin-top: 16px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; }
.guide-item { display: flex; align-items: flex-start; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.guide-item:last-child { padding-bottom: 0; border-bottom: 0; }
.guide-number { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; color: var(--accent); background: var(--accent-wash); font-size: 14px; }
.guide-number svg { width: 20px; height: 20px; }
.guide-item h3 { margin: 1px 0 8px; color: var(--muted); font-size: 16px; font-weight: 500; }
.guide-item p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: 0; }
.mini-row .name-cell { min-width: 0; }
.mini-row strong { color: var(--muted); font-size: 15px; font-weight: 500; }
.mini-row small { color: var(--muted); font-size: 13px; }
.mini-row .labels-wrap { justify-content: flex-end; max-width: 220px; }
.mini-row > svg { width: 18px; height: 18px; color: var(--muted); }

/* Empty, loading, login and feedback */

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 70px 28px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-soft); }
.empty-icon svg { width: 30px; height: 30px; }
.empty h3 { color: var(--muted); font-size: 22px; font-weight: 500; line-height: 1.4; letter-spacing: -.3px; }
.empty p { max-width: 480px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.empty .button { margin-top: 10px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 76px 24px; color: var(--muted); font-size: 16px; text-align: center; }
.spinner { display: inline-block; flex: none; width: 21px; height: 21px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; min-height: 100vh; min-height: 100dvh; padding: 24px; color: var(--muted); background: var(--surface-soft); font-size: 15px; text-align: center; }
.login-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--surface-soft); }
.login-brand { display: flex; flex-direction: column; min-width: 0; padding: 58px 64px; border-right: 1px solid var(--line); color: var(--brand-ink); background: var(--surface-soft); }
.login-brand .logo { align-self: flex-start; }
.login-copy { max-width: 490px; margin: auto 0; padding: 78px 0; }
.login-copy .eyebrow { margin-bottom: 18px; color: var(--muted); }
.login-copy h1 { color: var(--brand-ink); font-size: clamp(36px, 3.4vw, 54px); font-weight: 600; line-height: 1.15; letter-spacing: -1.5px; }
.login-copy h1 span { color: var(--accent); }
.login-copy > p { max-width: 440px; margin-top: 24px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.login-features { display: grid; gap: 20px; margin-top: 40px; color: var(--muted); font-size: 14px; }
.login-features > div { display: flex; align-items: center; gap: 12px; }
.login-features svg { width: 20px; height: 20px; color: var(--muted); }
.login-brand-footer { color: var(--muted); font-size: 12px; letter-spacing: .5px; }
.login-main { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 64px; }
.login-form { width: 100%; max-width: 400px; }
.login-form .eyebrow { margin-bottom: 14px; }
.login-form h2 { color: var(--muted); font-size: 32px; font-weight: 600; line-height: 1.3; letter-spacing: -.6px; }
.login-form > p { margin: 12px 0 30px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.login-form .field { margin-bottom: 22px; }
.login-form .field input { min-height: 48px; padding: 12px 14px; }
.login-form .button.primary { width: 100%; min-height: 48px; margin-top: 4px; }
.login-form .login-note { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }

/* Small utility classes remain shared by all existing screens. */

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.align-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 9px; }
.spacer { flex: 1; }
.help-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.storage-callout { padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
.storage-callout p { margin-top: 8px; }
.workspace-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent); background: var(--accent-wash); border-radius: 10px; }


/* Connection workspace, diagnostics and explicit migration controls. */
.connection-center { display: grid; gap: 18px; }
.connection-center > .section-card { min-width: 0; }
.connection-center .section-title { align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.connection-account-select { display: flex; align-items: center; gap: 12px; min-width: 0; }
.connection-account-select select { flex: 1; width: 100%; }
.connection-account-select > .avatar { width: 48px; height: 48px; }
.connection-status-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.connection-status-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.connection-status-card > small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.connection-status-card > strong { display: block; overflow-wrap: anywhere; font-size: 16px; }
.connection-status-card > p { margin-top: 6px; font-size: 12px; line-height: 1.45; }
.provider-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.provider-badge.pending { color: var(--muted); background: var(--surface-soft); border-color: var(--line); }
.provider-badge.error { color: var(--muted); background: var(--surface-soft); border-color: var(--line); }
.connection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.connection-center .button, .meta-connection-form .button, .migration-dialog .button { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.connection-center .form-note, .meta-connection-form .form-note { margin-top: 10px; }
.meta-connection-form { min-width: 0; overflow-wrap: anywhere; }
.meta-connection-form .field { margin-bottom: 16px; }
.meta-secret-status { display: inline-flex; margin-left: 8px; color: var(--muted); font-size: 12px; }
.meta-secret-grid { display: grid; gap: 14px; padding: 16px; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.diagnostic-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.diagnostic-check { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.diagnostic-check > .check-indicator { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); background: var(--surface-soft); }
.diagnostic-check.passed > .check-indicator { color: var(--muted); background: var(--surface-soft); }
.diagnostic-check.failed > .check-indicator { color: var(--muted); background: var(--surface-soft); }
.diagnostic-check.warning > .check-indicator { color: var(--muted); background: var(--surface-soft); }
.diagnostic-check strong { display: block; color: var(--ink); font-size: 14px; }
.diagnostic-check p { margin-top: 4px; font-size: 13px; }
.diagnostic-check .remedy { color: var(--muted); }
.migration-steps { display: grid; gap: 0; padding: 0; margin: 12px 0 0; list-style: none; counter-reset: migration; }
.migration-step { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.migration-step:last-child { border-bottom: 0; }
.migration-step-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.migration-step h3 { font-size: 15px; line-height: 1.45; }
.migration-step p { margin-top: 4px; font-size: 13px; }
.migration-step .provider-badge { align-self: start; }
.migration-blockers { display: grid; gap: 8px; margin: 14px 0; padding: 14px 14px 14px 32px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.migration-dialog .form-note { margin: 10px 0; }
@media (max-width: 700px) {
  .connection-status-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .connection-status-card { padding: 12px; }
  .connection-center > .section-card { padding: 19px; }
  .connection-center .section-title { flex-wrap: wrap; }
  .connection-actions > .button { flex: 1 1 140px; }
  .migration-step { grid-template-columns: 30px minmax(0,1fr); gap: 9px; }
  .migration-step > .provider-badge { grid-column: 2; justify-self: start; }
  .meta-connection-form .field-row { flex-direction: column; gap: 0; }
}
/* Remaining list/detail surfaces share the dark palette. */
.deal-column, .boot { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.deal-column-title, .deal-card p, .guide-item p, .mini-row small,
.empty p, .loading, .muted, .login-features, .login-brand-footer { color: var(--muted); }
.deal-card h3, .deal-amount, .guide-item h3, .mini-row strong, .empty h3 { color: var(--ink); }
.empty-icon, .stat-icon.orange, .stat-icon.green, .stat-icon.blue { color: var(--muted); background: var(--surface-soft); border-color: var(--line); }
.login-copy .eyebrow { color: var(--muted); }
.account-row-title { min-width: 0; }
.account-row-title small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.account-color-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 1px solid var(--line); border-radius: 50%; vertical-align: 1px; }
.app-shell.messenger-mode #inbox-account-filter { grid-column: 1 / -1; }
.app-shell.messenger-mode .thread-labels-group { display: flex; align-items: flex-start; gap: 5px; margin-top: 7px; }
.app-shell.messenger-mode .thread-labels-group .labels-wrap { margin-top: 0; }
.thread-labels-caption { flex: none; padding-top: 4px; color: var(--muted); font-size: 10px; }
.migration-dialog .meta-test-recipient { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface-soft); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.meta-test-result .info-banner { margin-top: 14px; margin-bottom: 10px; }
.whapi-pairing { width: 100%; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.whapi-pairing-steps { display: grid; gap: 8px; padding: 0 0 0 21px; margin: 20px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.whapi-pairing-status { display: grid; justify-items: center; gap: 14px; min-width: 0; padding: 20px 0; text-align: center; }
.whapi-pairing-status > h3 { color: var(--ink); font-size: 19px; line-height: 1.35; }
.whapi-pairing-status > .field, .whapi-pairing-status > .info-banner { width: 100%; text-align: left; }
.whapi-pairing-status > .form-note { max-width: 420px; margin: 0; }
.whapi-pairing-status > .button { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.whapi-qr-frame { display: grid; place-items: center; width: min(100%, 312px); aspect-ratio: 1; padding: 16px; border-radius: 16px; background: var(--surface-soft); }
.whapi-qr-frame img { display: block; width: 280px; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--surface-soft); }
.whapi-pairing-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 80px; color: var(--muted); }
.whapi-pairing-success { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--muted); background: var(--surface-soft); }
.whapi-pairing-success svg { width: 32px; height: 32px; }
.whapi-pairing-advanced { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.whapi-pairing-advanced summary { min-height: 40px; color: var(--muted); cursor: pointer; }
.whapi-pairing-advanced > .button { max-width: 100%; min-width: 0; margin: 5px 5px 5px 0; white-space: normal; overflow-wrap: anywhere; }
.cosmo-connect-card { border-color: var(--line); background: var(--surface); }
.connect-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.cosmo-connect-flow { min-width: 0; overflow-wrap: anywhere; }
.connect-status { display: grid; justify-items: center; gap: 16px; padding: 20px 0; text-align: center; }
.connect-status > h3 { font-size: 20px; line-height: 1.4; }
.connect-status > .info-banner { width: 100%; text-align: left; }
.connect-phone { color: var(--ink); font-size: 20px; letter-spacing: .02em; }
.cosmo-connect-flow .connection-actions { margin-top: 18px; }
.cosmo-connect-flow .checkbox-label { margin: 18px 0; align-items: flex-start; line-height: 1.6; }
.cosmo-connect-flow .checkbox-label input { flex: none; margin-top: 5px; }
.connect-proxy-settings { width: 100%; min-width: 0; margin-top: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); text-align: left; }
.connect-proxy-settings > .checkbox-label { margin: 0; }
.connect-proxy-settings > .button { max-width: 100%; min-width: 0; white-space: normal; }
.connect-proxy-fields { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 14px; }
.connect-proxy-fields .field { margin: 0; min-width: 0; }
.connect-proxy-fields input { width: 100%; min-width: 0; }
.connect-proxy-check { display: grid; gap: 10px; justify-items: start; margin-top: 14px; }
.connect-proxy-check .button { max-width: 100%; white-space: normal; }
.connect-proxy-check .form-note { margin: 0; }
@media (max-width: 700px) {
  .whapi-pairing-status { padding: 16px 0; }
  .whapi-pairing-status > .button { width: 100%; }
  .whapi-pairing-advanced > .button { width: 100%; margin-right: 0; }
  .whapi-qr-frame { padding: 12px; }
}


/* Shared component geometry and hierarchy. */
.button{min-height:44px;max-width:100%;padding:10px 16px;border-radius:12px;border-color:var(--line);background:var(--surface);color:var(--ink);font-size:13px;font-weight:600;white-space:normal;overflow-wrap:anywhere}.button:hover:not(:disabled){background:var(--surface-soft);border-color:var(--muted);color:var(--ink)}.button.primary{background:var(--lime);border-color:transparent;color:#20351b;box-shadow:inset 0 1px 0 #fff5}.button.primary:hover:not(:disabled){background:#c6f367;border-color:transparent;color:#20351b}.button.subtle{border-color:transparent;background:transparent;color:var(--muted)}.button.small{min-height:40px;padding:8px 12px;font-size:12px}.button.danger,.icon-button.danger{color:var(--danger)}.button.danger:hover,.icon-button.danger:hover{background:var(--danger-bg);border-color:var(--danger)}
.icon-button,.row-more{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border:1px solid transparent;border-radius:12px;color:var(--muted)}.icon-button svg{width:21px;height:21px}.icon-button:hover:not(:disabled){background:var(--surface-soft);color:var(--ink)}
.panel,.section-card,.contact-card,.stat-card,.deal-card{background:var(--surface);border-color:var(--line)}.panel,.section-card{border-radius:18px}.section-card{padding:24px}.section-title{margin-bottom:18px}.section-title h2,.ai-workspace h2{font-size:18px;font-weight:650;letter-spacing:-.25px}.section-card p{font-size:14px}.section-card .form-note{font-size:12px}.grid-two,.overview-grid,.settings-stack{gap:20px}.settings-form{gap:12px;margin-top:20px}.settings-form>.field{margin-bottom:0}
input,select,textarea{border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);color:var(--ink);font-size:14px;padding:11px 13px}input::placeholder,textarea::placeholder{color:var(--muted);opacity:.85}input:not([type=checkbox]):focus,select:focus,textarea:focus{background:var(--surface);border-color:var(--accent)}.field>span,.field>label{font-size:13px;font-weight:600;color:var(--ink)}.field input,.field textarea,.field select{font-size:14px}.field small,.form-note{font-size:12px;line-height:1.6;color:var(--muted)}
.form-error,.error-panel{border-color:color-mix(in srgb,var(--danger) 25%,transparent);background:var(--danger-bg);color:var(--danger);border-radius:12px}.error-panel strong,.error-text{color:var(--danger)}.info-banner{padding:14px 16px;border-color:var(--line);border-radius:12px;background:var(--accent-wash);color:var(--accent);font-size:13px}.info-banner.warning{background:var(--warning-bg);color:var(--warning-ink);border-color:color-mix(in srgb,var(--warning-ink) 20%,transparent)}
:is(.contact-name,.contact-card-open h3,.stat-value,.drawer-profile h2,.drawer-section h3,.detail-value,.product-item strong,.deal-card h3,.deal-amount,.guide-item h3,.mini-row strong,.empty h3,.modal-head h2,.account-row h3,.label-row strong){color:var(--ink)}
.avatar{background:var(--accent-wash);color:var(--accent);font-weight:650}.avatar.a1,.avatar.a3{background:var(--accent-wash);color:var(--accent)}.avatar.a2{background:#8c8cb51c;color:var(--ink)}.avatar.a4{background:#c6976c22;color:var(--ink)}.customer-avatar,.account-avatar{object-fit:cover}.label-chip{background:var(--surface-soft);border-color:var(--line);color:var(--ink);border-radius:6px;font-size:10px;padding:4px 7px}.chip-dot{background:var(--chip-color,var(--accent))}
.stats-grid{gap:16px;border:0;background:transparent;margin-bottom:24px}.stat-card{padding:20px;border:1px solid var(--line);border-radius:16px}.stat-top{font-size:12px}.stat-value{font-weight:650;font-size:30px;margin:10px 0 4px}.stat-bottom{font-size:11px}.stat-icon,.stat-icon.orange,.stat-icon.green,.stat-icon.blue{width:30px;height:30px;border-radius:10px;background:var(--accent-wash);color:var(--accent)}
.panel-toolbar{padding:16px 20px;gap:16px}.table-tab{font-size:14px;font-weight:650}.count-pill{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding:3px 7px;border-radius:8px;background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:600}.toolbar-controls{gap:10px}.search-field{border-radius:11px;background:var(--surface-soft)}.search-field input{width:200px;font-size:14px;background:transparent}.filter-select{width:170px;font-size:13px}.chips-row{padding:12px 20px}.chips-row>.muted,.chips-row>.spacer{display:none}.filter-chip{min-height:36px;padding:8px 12px;border-radius:20px;font-size:12px;background:var(--surface);color:var(--muted)}.filter-chip.selected,.filter-chip:hover{color:var(--accent);background:var(--accent-wash);border-color:var(--accent-wash)}.contact-view-toggle{padding:2px;background:var(--surface-soft);border:0;border-radius:11px}.contact-view-toggle button{min-width:40px;min-height:40px;border:0;border-radius:8px}.contact-view-toggle button.active{background:var(--surface);color:var(--accent);box-shadow:0 1px 3px #0001}
.contacts-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.contact-grid-summary{margin:0;padding:8px 14px 0;font-size:12px}.contact-card{padding:16px;border-radius:14px}.contact-card.selected{border-color:var(--accent);background:var(--accent-wash)}.contact-card-top{position:static;min-height:32px;margin:-8px -8px 8px;pointer-events:auto}.contact-card-select{width:40px;height:40px;background:transparent;border-radius:10px}.contact-card-select input{width:40px;height:40px;min-height:40px}.contact-card-top .contact-sub{padding:0;font-size:10px;background:transparent;color:var(--muted)}.contact-card-top>.icon-button{width:36px;height:36px;min-width:36px;min-height:36px;background:transparent;border:0}.contact-card-open{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:12px;row-gap:2px;align-items:center;flex:initial}.contact-card-avatar{grid-row:1/3;width:48px;height:48px;margin:0;background:transparent}.contact-card-avatar .avatar{width:48px;height:48px;font-size:16px;background:var(--accent-wash);color:var(--accent)}.contact-card-open h3{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contact-card-phone{font-size:12px;color:var(--muted);min-height:0;padding:0}.contact-card-labels{min-height:26px;margin-top:16px;font-size:11px}.contact-card-labels>.muted{opacity:.65}.contact-card-meta{gap:8px;margin-top:14px;padding-top:12px;border-color:var(--line);font-size:10px}.contact-card-meta svg{width:13px;height:13px;margin-right:4px}table{min-width:900px;font-size:13px}thead{background:var(--surface-soft);color:var(--muted);font-size:10px}th,td{padding:14px 16px;border-color:var(--line)}tbody tr.contact-row:hover{background:var(--surface-soft)}.phone,.date-cell{color:var(--muted)}.table-footer{padding:16px 20px;font-size:12px}.page-number{width:40px;height:40px;border-radius:10px}.page-number.active{background:var(--accent-wash);border-color:transparent;color:var(--accent)}
/* Messenger geometry is defined once; no generations of layout overrides. */
body:has(.messenger-mode){overflow:hidden}.app-shell.messenger-mode{position:fixed;inset:var(--messenger-top,0px) 0 auto;height:var(--messenger-height,100dvh)}.messenger-mode .topbar{display:none}.messenger-mode .content{padding:0;overflow:hidden}.inbox-layout{display:grid;grid-template-columns:var(--list-width,360px) minmax(0,1fr);height:100%;min-height:0;min-width:0;border:0;border-radius:0;background:var(--surface)}.inbox-list{display:flex;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--line);background:var(--surface)}.inbox-list-head{flex:none;padding:22px 20px 14px;border-bottom:1px solid var(--line)}.inbox-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}.inbox-heading h3{display:flex;align-items:center;gap:10px;font-size:25px;font-weight:700;letter-spacing:-.7px}.inbox-heading-actions{display:flex;gap:2px}.inbox-list-count{font-size:11px}.inbox-search-row{display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid transparent;border-radius:12px;background:var(--surface-soft);color:var(--muted)}.inbox-search-row:focus-within{border-color:var(--accent)}.inbox-search-row svg{width:18px;height:18px}.inbox-search{width:100%;min-width:0;padding:10px 0;border:0;background:transparent;outline:none;font-size:14px}.inbox-filterbar{display:flex;align-items:center;gap:8px;margin-top:12px}.inbox-unread-toggle,.inbox-filter-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:8px 12px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--muted);font-size:12px;font-weight:500}.inbox-filter-toggle svg{width:15px;height:15px}.inbox-unread-toggle.selected{background:var(--accent-wash);color:var(--accent);border-color:var(--accent-wash)}
.conversation-items{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.conversation-entry{position:relative;min-width:0}.conversation-item{display:flex;align-items:center;gap:13px;width:100%;min-height:86px;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--surface);text-align:left}.conversation-item:hover{background:var(--surface-soft)}.conversation-item.active{background:var(--accent-wash)}.conversation-item.whatsapp-unread:not(.active){background:var(--unread)}.conversation-item>.avatar{width:48px;height:48px;font-size:16px}.thread-content{flex:1;min-width:0}.thread-title-row,.thread-preview-row{display:flex;align-items:center;gap:10px}.thread-title-row strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:600}.thread-title-row strong span{margin-right:4px;color:var(--accent)}.thread-title-row time{flex:none;font-size:10px;color:var(--muted)}.whatsapp-unread .thread-title-row time{color:var(--accent)}.thread-preview-row{margin-top:5px}.thread-preview-row p{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--muted)}.whatsapp-unread .thread-title-row strong{font-weight:700}.whatsapp-unread .thread-preview-row p{color:var(--ink)}.unread-chat-count{display:grid;place-items:center;flex:none;min-width:21px;min-height:21px;padding:1px 6px;border-radius:20px;background:var(--lime);color:#20351b;font-size:11px;font-weight:700}.thread-labels-group{margin-top:7px}.thread-labels-group .labels-wrap{max-height:22px;overflow:hidden}.thread-labels-group .label-chip{font-size:9px;padding:3px 6px}.thread-actions{position:absolute;right:6px;bottom:6px;opacity:0;width:30px;height:30px;min-width:30px;min-height:30px;padding:5px;border-radius:9px;background:var(--surface);box-shadow:0 0 0 1px var(--line);transition:opacity var(--motion)}.thread-actions svg{width:16px;height:16px}.conversation-entry:hover .thread-actions,.conversation-entry:focus-within .thread-actions{opacity:1}.inbox-filter-empty{padding:40px 24px;color:var(--muted);display:grid;gap:12px}.inbox-filter-empty h3{font-size:17px}.inbox-filter-empty p{font-size:13px;line-height:1.6}.inbox-filter-empty .button{justify-self:start}
.chat-area{display:flex;flex-direction:column;position:relative;height:100%;min-height:0;min-width:0;overflow:hidden;background:var(--chat-bg);background-image:radial-gradient(circle at 80% 12%,color-mix(in srgb,var(--lime) 7%,transparent),transparent 45%)}.chat-area>.empty{margin:auto}.chat-head{display:flex;align-items:center;gap:10px;flex:none;min-height:76px;padding:12px 24px;border-bottom:1px solid var(--glass-line);background:var(--glass);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);box-shadow:var(--glass-shadow);z-index:3}.chat-head .mobile-chat-back{display:none}.chat-head>.icon-button:has(.avatar){padding:0;border-radius:50%;width:44px;min-width:44px}.chat-head .avatar{width:44px;height:44px}.chat-title{flex:1;min-width:0;text-align:left;padding:4px}.chat-title h3{font-size:16px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-title p{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
.message-list{display:flex;flex-direction:column;flex:1;gap:12px;min-height:0;padding:24px clamp(20px,4vw,60px);overflow-y:auto;overscroll-behavior:contain;overflow-anchor:none;scrollbar-width:thin;scrollbar-gutter:stable}.message-row{display:flex;width:100%;min-width:0}.message-row.outgoing{justify-content:flex-end}.message-avatar{display:none}.message-stack{display:flex;flex-direction:column;align-items:flex-start;min-width:0;max-width:min(82%,620px)}.outgoing .message-stack{align-items:flex-end}.message{max-width:100%;min-width:0;padding:10px 13px;border:1px solid var(--line);border-radius:3px 14px 14px 14px;background:var(--bubble);color:var(--ink);font-size:14px;line-height:1.55;overflow-wrap:anywhere;box-shadow:0 1px 2px #00000005}.message.out{border-color:transparent;border-radius:14px 3px 14px 14px;background:var(--bubble-out)}.message-text{white-space:pre-wrap}.message-revoked{font-style:italic;color:var(--muted)}.message-meta{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;margin:4px 2px 0;color:var(--muted);font-size:10px;line-height:1.4}.outgoing .message-meta{justify-content:flex-end}.message-meta time{font-size:10px}.message-status{font-size:10px;white-space:normal}.message-status.whatsapp-read{color:var(--accent)}.message-status.warning{color:var(--warning-ink)}.message-actions{min-width:28px;min-height:24px;width:28px;height:24px;padding:3px;border-radius:6px}.message-actions svg{width:15px;height:15px}.message-reaction{font-size:15px}.message-photo{display:block;max-width:320px;width:100%;min-width:100px;padding:0;border-radius:10px;overflow:hidden}.message-photo img{display:block;max-width:100%;max-height:360px;object-fit:contain}.message-photo+.message-text{margin-top:8px}.voice-message-player{display:block;width:min(280px,58vw);max-width:100%;height:40px}.new-inbound-message .message{border-color:color-mix(in srgb,var(--accent) 20%,var(--line))}.chat-empty-note{margin:auto;color:var(--muted);font-size:14px}
.chat-foot{display:flex;flex-direction:column;flex:none;min-height:0;max-height:55%;padding:10px 20px max(16px,env(safe-area-inset-bottom));background:transparent}.message-composer{display:flex;flex-direction:column;min-height:0;padding:8px;border:1px solid var(--glass-line);border-radius:24px;background:var(--glass);backdrop-filter:blur(24px) saturate(1.15);-webkit-backdrop-filter:blur(24px) saturate(1.15);box-shadow:var(--glass-shadow)}.composer-extras{flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}.composer-line{display:flex;flex:none;align-items:flex-end;gap:4px;min-width:0}#composer-text{display:block;flex:1;min-width:0;width:100%;height:44px;min-height:44px;max-height:144px;resize:none;overflow-y:hidden;margin:0;padding:11px 9px;border:0;border-radius:12px;background:transparent;font-size:14px;line-height:22px}#composer-text:focus{outline:0;background:var(--surface)}#composer-text[readonly]{opacity:.65}.composer-line .icon-button{width:44px;height:44px;min-width:44px;min-height:44px;flex:none;border-radius:50%;padding:11px}.composer-line .icon-button svg{width:22px;height:22px}.composer-line .composer-ai{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;min-height:44px;height:44px;padding:0;border:1px solid var(--glass-line);border-radius:50%;background:var(--accent-wash);color:var(--accent);font-size:12px;font-weight:750}.composer-ai[aria-busy=true]{animation:workspace-pulse 1s ease infinite alternate}.composer-line .composer-send{background:var(--lime);color:#20351b}.composer-line .composer-send:hover:not(:disabled){background:#c6f367;color:#20351b}.composer-line .composer-send:disabled{background:var(--surface-soft);color:var(--muted);opacity:.65}
.composer-capability{margin:2px 8px 10px;color:var(--warning-ink);font-size:12px;line-height:1.5}.composer-photo-preview{display:flex;align-items:center;gap:10px;margin:2px 4px 8px;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.composer-photo-preview img{width:52px;height:52px;object-fit:cover;border-radius:8px}.composer-photo-preview>div{flex:1;min-width:0}.composer-photo-preview strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.composer-photo-preview small{display:block;color:var(--muted);font-size:11px}.composer-photo-preview:has(audio){flex-wrap:wrap}.send-result{padding:12px;margin:4px 4px 10px;border:1px solid var(--line);border-radius:12px;background:var(--accent-wash);color:var(--accent);font-size:12px;line-height:1.5}.send-result.warning{color:var(--warning-ink);background:var(--warning-bg)}.send-result p{margin-top:5px}.send-result .button{margin:8px 6px 0 0}.composer-ai-status{font-size:12px;color:var(--muted)}
.buyer-memory{position:absolute;right:16px;top:88px;bottom:96px;z-index:4;width:min(320px,calc(100% - 32px));padding:20px;border:1px solid var(--glass-line);border-radius:18px;background:var(--glass);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);box-shadow:var(--shadow);overflow:auto;font-size:13px}.buyer-memory-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.buyer-memory p{margin-top:12px;line-height:1.7;color:var(--muted)}.new-message-jump{position:absolute;bottom:100px;left:50%;transform:translateX(-50%);z-index:4;background:var(--surface);color:var(--accent);border-radius:22px;box-shadow:var(--shadow);font-size:12px;white-space:nowrap}.chat-menu{display:grid;gap:6px}.chat-menu-action{justify-content:flex-start;width:100%;min-height:48px;border-color:transparent;background:var(--surface-soft);text-align:left}.chat-transcript{width:100%;min-height:240px}
/* Filter sheet: reveal secondary controls only when needed. */
.workspace-rail{display:flex;flex-direction:column;gap:6px;min-width:0}.rail-heading{font-size:10px;letter-spacing:1px;color:var(--muted);font-weight:700;margin:18px 0 6px}.rail-item,.rail-account,.rail-search{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:44px;padding:10px 12px;border-radius:11px;background:var(--surface-soft);color:var(--ink);text-align:left;font-size:13px}.rail-item svg,.rail-search svg{width:19px;height:19px}.rail-item[aria-pressed=true],.rail-account[aria-pressed=true]{background:var(--accent-wash);color:var(--accent)}.rail-account span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.rail-account small{display:block;color:var(--muted);font-size:11px}.rail-account b{color:var(--accent);font-size:12px}.rail-empty{font-size:13px;color:var(--muted)}.rail-width{margin-top:18px;color:var(--muted);font-size:12px}.rail-width input{display:block;width:100%;margin-top:10px;min-height:24px;padding:0;accent-color:var(--accent)}.account-color-dot{display:inline-block;flex:none;width:8px;height:8px;border-radius:50%;border:1px solid var(--glass-line)}
.ai-workspace{gap:20px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.ai-workspace .section-card{padding:24px;border-radius:18px}.ai-main-prompt>.field textarea{min-height:360px}.ai-memory-rule{padding:16px;border-radius:12px}.ai-rule-text{font-size:14px}.ai-memory-empty strong{font-size:15px}.ai-sync-note{font-size:12px}.ai-sync-note.is-error{color:var(--danger)}.ai-connection-settings{background:var(--surface-soft)}.ai-connection-settings summary{font-size:13px;min-height:24px}
.deals-board{gap:16px}.deal-column{border-radius:16px;background:var(--surface-soft);padding:14px}.deal-column-title{font-size:12px;min-height:44px}.deal-card{padding:18px;border-radius:12px}.deal-card h3{font-size:14px}.deal-card p{margin:8px 0 16px;font-size:12px}.deal-amount{font-size:24px;font-weight:650}.guide-item h3{font-size:14px}.guide-item p{font-size:13px}.guide-number{border-radius:12px;background:var(--accent-wash);color:var(--accent)}
.account-row{padding:18px 0}.account-row-title{flex:1}.account-actions{gap:8px}.account-row p,.account-row-title small{font-size:12px}.account-icon{border-radius:12px;background:var(--accent-wash);color:var(--accent)}.connection-status,.provider-badge{background:var(--accent-wash);color:var(--accent);border-color:var(--line);font-size:11px;border-radius:8px}.provider-badge.pending{background:var(--warning-bg);color:var(--warning-ink)}.provider-badge.error{background:var(--danger-bg);color:var(--danger)}.connection-status.off{background:var(--surface-soft);color:var(--muted)}.diagnostic-check .check-indicator,.whapi-pairing-success{background:var(--accent-wash);color:var(--accent)}.diagnostic-check.failed .check-indicator{background:var(--danger-bg);color:var(--danger)}.diagnostic-check.warning .check-indicator,.migration-blockers{background:var(--warning-bg);color:var(--warning-ink)}.migration-step-number{background:var(--accent-wash);color:var(--accent)}.cosmo-connect-card{border-color:color-mix(in srgb,var(--accent) 30%,var(--line));background:var(--surface)}
/* Floating sheets use glass chrome; forms remain solid and readable. */
.overlay-backdrop{background:#07110b60;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.modal{border:1px solid var(--glass-border);border-radius:22px;background:var(--surface);box-shadow:0 24px 80px #0003}.modal-head{min-height:76px;padding:16px 22px;background:var(--glass);box-shadow:var(--glass-shadow);border-color:var(--glass-line)}.modal-head h2{font-size:20px;font-weight:650}.modal-body{padding:24px}.modal-footer{padding:16px 22px;background:var(--glass)}.drawer-backdrop{background:#07110b50;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}.drawer{width:520px;background:var(--surface);border-color:var(--glass-border);box-shadow:var(--shadow)}.drawer-toolbar{min-height:72px;padding:14px 20px;background:var(--glass)}.drawer-profile h2{font-size:24px}.drawer-profile p{font-size:13px}.drawer-section h3{font-size:14px}.detail-value{font-size:14px}.note-card{background:var(--surface-soft);border-color:var(--line);border-radius:12px}.note-card textarea{font-size:14px;background:transparent}.private-tag{font-size:10px}.empty-icon{width:72px;height:72px;border-radius:24px;background:var(--accent-wash);color:var(--accent);border-color:var(--glass-line)}.empty{padding:60px 28px}.empty h3{font-size:22px;font-weight:600}.empty p{max-width:400px;font-size:14px}.login-brand{background:linear-gradient(155deg,#dbf3ad,#b9ec41);color:#20461a}.login-brand .logo,.login-copy h1{color:#20461a}.login-copy h1 span,.login-copy .eyebrow{color:#315d25}.login-copy>p,.login-features{color:#3f6134}.login-brand-footer{color:#426936}.login-form h2{color:var(--ink)}.login-form{background:transparent}.login-screen{background:var(--surface)}.login-main{padding:48px}.login-form .login-note{font-size:12px}
.workspace-skeleton{display:grid;gap:20px;padding:24px}.workspace-skeleton>div{display:flex;align-items:center;gap:14px}.workspace-skeleton i{display:block;flex:none;width:44px;height:44px;border-radius:50%;background:var(--line)}.workspace-skeleton span{display:block;width:55%;height:20px;border-radius:8px;background:var(--line);animation:workspace-pulse 1.2s ease infinite alternate}.quick-result{display:flex;width:100%;justify-content:flex-start;text-align:left;margin-top:8px;background:var(--surface-soft)}.photo-viewer{text-align:center}.photo-viewer-image{display:block;max-height:65dvh;margin:0 auto 16px;object-fit:contain}
/* Notifications stay top-left and never cover the send controls. */
#toast-region{position:fixed;top:max(18px,env(safe-area-inset-top));left:calc(var(--nav-width) + 18px);right:auto;bottom:auto;z-index:100;display:flex;flex-direction:column;gap:8px;width:360px;max-width:calc(100vw - var(--nav-width) - 36px);pointer-events:none}.toast{display:flex;align-items:center;gap:10px;min-height:58px;padding:8px 8px 8px 14px;border:1px solid var(--glass-border);border-radius:16px;background:var(--glass);backdrop-filter:blur(28px) saturate(1.3);-webkit-backdrop-filter:blur(28px) saturate(1.3);box-shadow:var(--shadow),inset 0 1px 0 var(--glass-border);color:var(--ink);font-size:13px;line-height:1.5;overflow-wrap:anywhere;pointer-events:auto;animation:toast-in .18s ease}.toast>svg{width:19px;height:19px;color:var(--accent)}.toast.error>svg{color:var(--danger)}.toast.error{border-color:color-mix(in srgb,var(--danger) 30%,var(--line))}.toast-copy{flex:1;min-width:0;max-height:160px;overflow:auto}.toast-close{align-self:flex-start;flex:none;width:36px;height:36px;min-width:36px;min-height:36px;padding:8px}.toast-close svg{width:17px;height:17px}
[aria-busy=true]{cursor:progress}.muted{color:var(--muted)}@keyframes workspace-pulse{to{opacity:.4}}@keyframes toast-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
/* Responsive layouts: page controls wrap; messenger owns the visual viewport. */
@media(min-width:1700px){.inbox-layout{grid-template-columns:var(--list-width,400px) minmax(0,1fr)}}
@media(max-width:1200px){.contacts-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.deals-board{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar-controls{flex-wrap:wrap}.panel-toolbar{align-items:flex-start}.topbar{padding:12px 24px}.status-indicator{display:none}.inbox-layout{grid-template-columns:320px minmax(0,1fr)}.message-list{padding:22px}.chat-head{padding:12px 16px}.chat-foot{padding:10px 12px 14px}}
@media(max-width:1000px){.ai-workspace,.overview-grid,.grid-two{grid-template-columns:minmax(0,1fr)}.page-heading{flex-wrap:wrap}.heading-buttons{justify-content:flex-start}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.account-row{flex-wrap:wrap}.account-actions{width:100%;justify-content:flex-start;margin-left:58px}.panel-toolbar{flex-direction:column;align-items:stretch}.toolbar-controls{justify-content:flex-start}.search-field{flex:1}.search-field input{width:100%}.connection-status-grid{grid-template-columns:1fr}.top-search{width:230px}.inbox-layout{grid-template-columns:300px minmax(0,1fr)}.message-stack{max-width:90%}.chat-head{gap:6px}.chat-title h3{font-size:15px}.chat-title p{font-size:11px}.chat-head>.icon-button{min-width:40px;width:40px}.composer-line{gap:2px}.composer-line .icon-button,.composer-line .composer-ai{width:40px;min-width:40px;flex-basis:40px}.chat-foot{padding:8px}.message-composer{padding:6px}}
@media(max-width:760px){
:root{--nav-width:0px}.app-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}.main{grid-row:1}.nav-strip{grid-row:2;display:block;padding:5px 4px max(7px,env(safe-area-inset-bottom));border-right:0;border-top:1px solid var(--glass-line)}.nav-strip>.logo,.rail-footer{display:none}.nav{flex-direction:row;gap:0;overflow:visible}.nav button{flex:1;min-width:0;min-height:52px;padding:6px 1px;border-radius:12px;font-size:9px;gap:4px}.nav button svg{width:22px;height:22px}.nav button.active{box-shadow:none}.app-shell.messenger-mode:has(.has-conversation){grid-template-rows:minmax(0,1fr)}.messenger-mode:has(.has-conversation)>.nav-strip{display:none}
.topbar{min-height:64px;padding:10px 16px;gap:10px}.breadcrumb{gap:10px}.breadcrumb strong{display:none}.workspace-wordmark{font-size:23px}.topbar-right{gap:4px;flex:1;justify-content:flex-end}.top-search{max-width:240px;flex:1;width:100%}.top-search input{font-size:12px}.topbar .status-indicator{display:none}.content{padding:24px 16px 28px}.page-heading{gap:16px;margin-bottom:22px}.page-heading h1{font-size:27px}.page-heading p{font-size:13px}.heading-buttons{width:100%;gap:8px}.heading-buttons .button{flex:1;font-size:12px;padding:10px}.section-card{padding:20px;border-radius:16px}.section-title{gap:12px;flex-wrap:wrap}.section-title h2{font-size:17px}
.inbox-layout{grid-template-columns:minmax(0,1fr)}.inbox-layout.has-conversation .inbox-list{display:none}.inbox-layout:not(.has-conversation) .chat-area{display:none}.inbox-list{height:100%;border-right:0}.inbox-list-head{padding:max(16px,env(safe-area-inset-top)) 18px 12px}.inbox-heading{margin-bottom:14px}.inbox-heading h3{font-size:27px}.inbox-filterbar{margin-top:10px}.inbox-search{font-size:16px}.inbox-unread-toggle,.inbox-filter-toggle{min-height:40px}.conversation-item{min-height:88px;padding:16px 18px;gap:13px}.conversation-item>.avatar{width:50px;height:50px}.thread-title-row strong{font-size:16px}.thread-title-row time{font-size:11px}.thread-preview-row p{font-size:14px}.thread-actions{right:8px;bottom:7px}
.chat-head{min-height:68px;padding:max(8px,env(safe-area-inset-top)) 8px 8px;gap:4px}.chat-head .mobile-chat-back{display:inline-flex}.chat-head>.icon-button{width:44px;min-width:44px}.chat-head>.icon-button:has(.avatar){width:40px;min-width:40px}.chat-head .avatar{width:38px;height:38px}.chat-title{padding:3px}.chat-title h3{font-size:15px}.chat-title p{font-size:11px}.message-list{padding:18px 12px;gap:12px}.message-stack{max-width:88%}.message{font-size:15px;line-height:1.5;padding:9px 12px}.message-meta{gap:2px 6px;font-size:10px}.message-meta time{font-size:10px}.message-photo{max-width:280px}.chat-foot{padding:8px 8px max(10px,env(safe-area-inset-bottom));max-height:55%}.message-composer{padding:6px;border-radius:24px}.composer-line{gap:1px}.composer-line .icon-button,.composer-line .composer-ai{width:40px;min-width:40px;min-height:44px;height:44px;flex-basis:40px}.composer-line .icon-button svg{width:21px;height:21px}#composer-text{font-size:16px;padding:11px 6px;max-height:clamp(44px,calc(var(--messenger-height,100dvh) * .25),120px)}.composer-capability{font-size:11px}.new-message-jump{bottom:88px}.buyer-memory{top:78px;bottom:88px}.rail-width{display:none}
.contacts-grid{padding:14px;gap:12px}.contact-card{padding:14px}.contact-card-open{grid-template-columns:42px minmax(0,1fr);gap:2px 9px}.contact-card-avatar{width:42px;height:42px}.contact-card-avatar .avatar{width:42px;height:42px;font-size:14px}.contact-card-open h3{font-size:14px}.contact-card-phone{font-size:11px}.contact-card-meta{font-size:10px;gap:6px}.panel-toolbar{padding:14px;gap:8px}.toolbar-controls{gap:8px}.toolbar-controls>.search-field{flex:1 1 100%}.filter-select{flex:1;width:auto}.chips-row{padding:10px 14px;gap:6px}.filter-chip{font-size:11px}.contact-grid-summary{padding-left:8px}.table-footer{padding:14px}.table-footer,.pagination{font-size:11px}.stat-card{padding:16px}.stat-value{font-size:28px}.stat-bottom{font-size:10px}.deals-board{gap:12px}.deal-column{padding:12px}.deal-card{padding:14px}.deal-column-title{font-size:11px}.deal-amount{font-size:22px}
.ai-main-prompt>.field textarea{min-height:280px}.ai-workspace{gap:16px}.ai-workspace .section-card{padding:20px}.ai-memory-rule{padding:14px}.ai-memory-compose-actions>.button{flex:1}.account-actions{margin-left:0}.account-actions .button{flex:1 1 120px}.account-row{gap:12px}.connection-actions>.button{flex:1 1 140px}.integration-summary{grid-template-columns:1fr}.migration-step{grid-template-columns:30px minmax(0,1fr)}.migration-step>.provider-badge{grid-column:2;justify-self:start}.whapi-pairing-status>.button{width:100%}.whapi-pairing-advanced>.button{width:100%;margin-right:0}
.overlay-backdrop{padding:12px}.modal{max-height:calc(100dvh - 24px);border-radius:20px}.modal-head{padding:14px 16px;min-height:68px}.modal-head h2{font-size:18px}.modal-body{padding:20px}.modal-footer{padding:14px 16px}.modal-footer>.button{flex:1}.drawer-body{padding:22px}.drawer-profile h2{font-size:22px}.drawer-section h3{font-size:14px}.field input,.field textarea,.field select{font-size:16px}.field-row{gap:12px}.labels-grid{gap:8px}.label-row{padding:12px}.label-row strong{font-size:13px}.label-swatch{width:36px;height:36px}.label-actions .icon-button{width:40px;min-width:40px}.detail-grid{gap:16px}.profile-summary>.avatar{width:56px;height:56px}
#toast-region{top:max(12px,env(safe-area-inset-top));left:12px;width:350px;max-width:calc(100vw - 24px)}.toast{font-size:12px;min-height:56px}.toast-close{width:40px;height:40px;min-width:40px;min-height:40px}
.login-screen{grid-template-columns:1fr}.login-brand{padding:28px;min-height:200px}.login-copy{padding:32px 0 0}.login-copy h1{font-size:34px;max-width:350px}.login-copy>p,.login-features,.login-brand-footer{display:none}.login-main{padding:36px 24px}.login-form h2{font-size:27px}
}
@media(max-width:479px){.contacts-grid,.deals-board{grid-template-columns:minmax(0,1fr)}.contact-card-top{margin-bottom:4px}.contact-card-open{grid-template-columns:48px minmax(0,1fr)}.contact-card-avatar,.contact-card-avatar .avatar{width:48px;height:48px}.contact-card-open h3{font-size:15px}.contact-card-phone{font-size:12px}.contact-card-meta{font-size:11px}.field-row{flex-direction:column;gap:0}.labels-grid{grid-template-columns:1fr}.settings-form{align-items:stretch;flex-direction:column}.settings-form>.field{width:100%}.section-card{padding:18px}.label-row{gap:6px}.label-row>div{gap:9px}.label-actions{gap:0}.drawer-profile{gap:12px}.drawer-profile>.avatar{width:54px;height:54px}.drawer-profile h2{font-size:21px}.ai-rule-actions>.button{flex:1}.stats-grid{gap:10px}.stat-card{padding:14px}.stat-top{font-size:11px}.topbar{padding:10px 12px}.topbar-right{gap:0}.top-search{padding-left:10px}.top-search>.icon-button{display:none}.top-search svg{width:16px;height:16px}.top-search input{font-size:11px}.workspace-wordmark{font-size:21px}.heading-buttons>.button{flex:1 1 auto}.message-meta .message-status{max-width:100%}.chat-head>.icon-button:has(.avatar){width:36px;min-width:36px}.chat-head .avatar{width:34px;height:34px}.chat-head .chat-title h3{font-size:14px}.chat-head .chat-title p{font-size:10px}}
@media(max-width:360px){.nav button{font-size:8px}.topbar .breadcrumb{display:none}.chat-head .chat-title p{max-width:110px}.message-meta time{font-size:9px}.message-status{font-size:9px}.message-list{padding:14px 10px}.message-stack{max-width:92%}.composer-line .icon-button,.composer-line .composer-ai{width:38px;min-width:38px;flex-basis:38px;padding:8px}.composer-line .composer-ai{padding:0}.inbox-list-head{padding-left:14px;padding-right:14px}.conversation-item{padding-left:14px;padding-right:14px}}
@media(hover:none){.button.small{min-height:44px}.thread-actions{opacity:1;background:transparent;box-shadow:none;bottom:4px;right:2px;min-width:40px;min-height:40px}.conversation-item{padding-right:40px}.thread-title-row time{font-size:10px}.message-actions{min-width:36px;min-height:32px}.label-actions .icon-button{min-width:44px}}
@media(max-height:520px) and (min-width:761px){.nav-strip{padding-top:10px;gap:8px}.nav button{min-height:46px;font-size:9px;gap:3px}.nav button svg{width:20px;height:20px}.rail-footer{gap:4px}.rail-footer>.icon-button{display:none}}
@media(prefers-reduced-transparency:reduce){:root,:root[data-theme="dark"]{--glass:var(--surface)}.nav-strip,.topbar,.chat-head,.message-composer,.buyer-memory,.toast,.overlay-backdrop,.drawer-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}}
@supports not (backdrop-filter:blur(1px)){.nav-strip,.topbar,.chat-head,.message-composer,.buyer-memory,.toast{background:var(--surface)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Secondary settings are disclosures so daily work starts with the numbers. */
.settings-disclosure{min-width:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden}.settings-disclosure>summary{display:flex;align-items:center;gap:12px;min-height:66px;padding:16px 22px;cursor:pointer;font-weight:600;font-size:14px;list-style:none}.settings-disclosure>summary::-webkit-details-marker{display:none}.settings-disclosure>summary>svg:first-child{color:var(--accent);width:20px;height:20px}.settings-disclosure>summary>span{flex:1}.settings-disclosure>summary>svg:last-child{width:18px;height:18px;color:var(--muted);transition:transform var(--motion)}.settings-disclosure[open]>summary{border-bottom:1px solid var(--line)}.settings-disclosure[open]>summary>svg:last-child{transform:rotate(180deg)}.settings-disclosure>.grid-two,.settings-diagnostics{padding:20px;display:grid;gap:18px}.settings-quick-actions{display:flex;gap:10px;flex-wrap:wrap}.settings-appearance .section-title{margin-bottom:14px}.settings-stack .section-title>.connection-actions{margin-top:0}.account-row>.account-actions{width:auto;margin-left:auto;flex:none}.account-actions>.icon-button{background:var(--surface-soft)}.account-row>.connection-status{font-size:11px;white-space:nowrap}.account-row-title h3{font-size:14px}.account-row-title p{margin-top:3px}
.message-day{align-self:center;flex:none;max-width:100%;padding:5px 11px;margin:4px 0 8px;border:1px solid var(--glass-line);border-radius:10px;background:var(--glass);color:var(--muted);font-size:10px;box-shadow:inset 0 1px 0 var(--glass-border)}.message-meta{min-height:14px}.conversation-item{min-height:84px;padding-top:10px;padding-bottom:10px}.thread-title-row strong{line-height:22px}.thread-preview-row{margin-top:3px}.thread-preview-row p{line-height:20px}.thread-labels-group{margin-top:4px}.thread-labels-group .label-chip{font-size:9px;line-height:12px;padding:2px 5px}.thread-labels-group .labels-wrap{max-height:18px}
.contact-card-top .contact-sub{display:none}.contact-card-top{min-height:36px;margin-top:-10px;margin-bottom:2px}.contact-card-top>.icon-button{margin-left:auto}.contact-card-meta{margin-top:10px;padding-top:10px}.contact-card-meta>span:first-child{font-size:10px}.contact-card-labels{margin-top:12px;min-height:20px}.contact-card-labels>.muted{display:none}.table-tab.active::after{display:none}
@media(max-width:760px){.settings-quick-actions>.button{flex:1}.settings-disclosure>summary{padding:14px 18px;font-size:13px;min-height:62px}.settings-disclosure>.grid-two,.settings-diagnostics{padding:14px}.conversation-item{min-height:84px;padding-top:10px;padding-bottom:10px}.thread-actions{bottom:2px}.account-row>.account-actions{width:auto;margin-left:auto}.account-row>.connection-status{margin-left:auto}.account-row .account-icon{width:40px;height:40px}.account-icon>.avatar{width:36px;height:36px}.account-row-title{flex:1 1 100px}.account-row{gap:10px}.account-row-title h3{font-size:13px}.account-actions>.button{flex:0 1 auto}.account-actions{gap:4px}}
/* Form controls never inherit text-field widths; aligned sibling fields share the same baseline. */
.field input[type=checkbox],.labels-grid input[type=checkbox]{width:36px;min-width:36px;max-width:36px;height:36px;min-height:36px;flex:0 0 36px;padding:0;border:0;background-color:transparent}.labels-grid .checkbox-label{min-width:0;padding:8px;gap:4px;min-height:52px}.labels-grid .label-chip{min-width:0;flex:1;background:transparent;border:0;font-size:12px;line-height:1.4;padding:0;overflow-wrap:normal}.field-row{align-items:flex-start}.field-row>.field{margin-top:0;margin-bottom:20px}.ai-workspace textarea{width:100%;box-sizing:border-box}.nav>.nav-more{display:none}
@media(max-width:760px){.nav button[data-page=overview],.nav button[data-page=labels],.nav button[data-page=settings]{display:none}.nav>.nav-more{display:flex}.nav button{font-size:11px;gap:5px;min-height:56px}.nav button svg{width:23px;height:23px}.app-shell:has(.contacts-panel) .topbar{display:none}.content:has(.contacts-panel){padding-top:20px}.content:has(.contacts-panel)>.page-heading{align-items:center;flex-wrap:nowrap;gap:12px;margin-bottom:18px}.content:has(.contacts-panel)>.page-heading p{display:none}.content:has(.contacts-panel)>.page-heading .heading-buttons{width:auto;flex-wrap:nowrap;gap:6px;padding:0}.contact-primary{width:44px;min-width:44px;padding:10px}.contact-primary>span{display:none}.contacts-panel .table-tabs{display:none}.contacts-panel .panel-toolbar{padding:12px;gap:0}.contacts-panel .toolbar-controls{gap:8px}.contact-grid-summary{min-height:40px;padding-top:2px}.contact-grid-summary input{width:40px;height:40px;min-height:40px}.contacts-grid{padding-top:8px}.field-row>.field{margin-bottom:20px}.labels-grid .label-chip{font-size:13px}}
/* Chat work stays within reach; the task list shares the same quiet surfaces. */
.chat-heading{flex:none;min-width:0;z-index:3;background:var(--surface);border-bottom:1px solid var(--line)}
.chat-heading .chat-head{border-bottom:0;box-shadow:none}
.inbox-stage-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:10px}
.inbox-stage-controls select{width:100%;min-width:0;min-height:36px;padding:7px 24px 7px 10px;border-radius:10px;border:1px solid var(--line);background-color:var(--surface-soft);color:var(--muted);font-size:11px;text-overflow:ellipsis}
.inbox-stage-controls select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.inbox-stage-controls select:has(option:checked:not([value=""]):not([value="newest"])){color:var(--accent);border-color:var(--accent)}
.thread-client-stage{display:inline-flex;max-width:100%;margin-top:5px;padding:2px 7px;border-radius:6px;background:var(--accent-wash);color:var(--accent);font-size:10px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}
.chat-title .chat-presence{color:var(--muted);font-size:11px;line-height:15px;margin-top:3px}
.chat-title .chat-presence.active{color:var(--accent)}
.chat-title .chat-presence[hidden]{display:none}
@media(max-width:767px){.inbox-stage-controls select{min-height:40px;font-size:12px}.thread-client-stage{font-size:11px}.chat-title .chat-presence{font-size:10px;line-height:14px}}
.chat-quick-actions{display:flex;align-items:center;gap:8px;padding:0 24px 10px;min-width:0}
.chat-quick-actions .button{min-height:36px;padding:7px 11px;background:var(--surface-soft);border:1px solid var(--line);font-size:12px;box-shadow:none}
.chat-quick-actions .client-stage-button{max-width:300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--accent);background:var(--accent-wash)}
.client-stage-copy{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-quick-actions .button svg{flex:none;width:16px;height:16px}.chat-quick-actions .chat-task-list{width:36px;min-width:36px;height:36px;min-height:36px;margin-left:auto;background:var(--surface-soft)}
.stage-choices{display:grid;gap:6px}.stage-choice{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:48px;padding:12px 14px;text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);color:var(--ink);font:inherit;font-size:14px;cursor:pointer}.stage-choice svg{width:18px;height:18px;flex:none;color:var(--muted)}.stage-choice.selected{background:var(--accent-wash);color:var(--accent);border-color:var(--accent)}.stage-choice.selected svg{color:var(--accent)}.stage-choice:disabled{cursor:wait;opacity:.6}
.tasks-panel{padding:0;overflow:hidden}.tasks-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:18px 22px;border-bottom:1px solid var(--line)}.task-tabs{display:flex;padding:4px;gap:3px;border-radius:12px;background:var(--surface-soft)}.task-tabs button{border:0;padding:9px 15px;min-height:40px;border-radius:9px;font:inherit;font-size:13px;color:var(--muted);background:transparent;cursor:pointer}.task-tabs button.active{background:var(--accent-wash);color:var(--accent);font-weight:600}.tasks-total{margin-left:auto;font-size:12px}.task-filter{max-width:100%;overflow:hidden;text-overflow:ellipsis}.tasks-list{display:grid}.task-row{display:flex;align-items:flex-start;gap:14px;padding:20px 22px;border-bottom:1px solid var(--line);min-width:0}.task-row:last-child{border-bottom:0}.task-complete{flex:none;width:38px;height:38px;min-width:38px;min-height:38px;border:1px solid var(--line);border-radius:12px;color:var(--muted);background:var(--surface-soft)}.task-complete svg{opacity:.3}.task-complete.completed{border-color:transparent;background:var(--accent-wash);color:var(--accent)}.task-complete.completed svg{opacity:1}.task-row-copy{flex:1;min-width:0;padding-top:3px}.task-title{display:block;text-align:left;color:var(--ink);font:inherit;font-size:15px;font-weight:600;line-height:1.45;background:none;padding:0;border:0;cursor:pointer;overflow-wrap:anywhere}.task-title:disabled{opacity:1;cursor:default}.task-row.done .task-title{color:var(--muted);text-decoration:line-through}.task-meta{display:flex;align-items:center;flex-wrap:wrap;gap:7px 14px;margin-top:8px;font-size:12px;color:var(--muted)}.task-meta svg{width:14px;height:14px;flex:none}.task-client{display:inline-flex;align-items:center;gap:6px;color:var(--accent);padding:0;max-width:100%;font:inherit;border:0;background:none;cursor:pointer;overflow-wrap:anywhere;text-align:left}.task-meta time{display:inline-flex;align-items:center;gap:5px}.task-overdue{color:var(--danger);font-weight:600}.task-account{overflow-wrap:anywhere}.task-delete{flex:none;color:var(--muted);width:38px;height:38px;min-width:38px;min-height:38px}.tasks-more{display:flex;margin:16px auto}.task-customer-context{display:flex;align-items:center;gap:8px;padding:10px 12px;margin-bottom:18px;background:var(--surface-soft);border-radius:10px;overflow-wrap:anywhere}.task-customer-context svg{width:18px;height:18px;flex:none;color:var(--accent)}.task-form input[type=datetime-local]{min-width:0}.rail-account>.avatar{width:36px;height:36px;flex:none;font-size:12px;object-fit:cover}.rail-account-copy{min-width:0;overflow:hidden;text-overflow:ellipsis}.rail-account-copy small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-icon>.account-avatar{width:40px;height:40px;object-fit:cover;border-radius:50%}.account-row-title{min-width:0;overflow-wrap:anywhere}
@media(max-width:760px){.nav button[data-page=deals]{display:none}.chat-quick-actions{padding:0 12px 8px;gap:6px}.chat-quick-actions .client-stage-button{flex:1;max-width:none;justify-content:flex-start}.chat-quick-actions .button{min-height:40px;padding:7px 10px;font-size:11px}.chat-quick-actions .chat-task-list{height:40px;min-height:40px;width:40px;min-width:40px;margin-left:0}.tasks-toolbar{padding:14px;gap:10px}.task-tabs{flex:1}.task-tabs button{flex:1;padding:8px 10px}.tasks-total{font-size:11px}.task-row{padding:16px 14px;gap:10px}.task-title{font-size:14px}.task-meta{font-size:11px;gap:6px 10px}.task-complete,.task-delete{width:40px;min-width:40px;height:40px;min-height:40px}.task-delete{width:32px;min-width:32px;padding:6px}.task-filter{width:100%;justify-content:flex-start}.tasks-panel{padding:0}.buyer-memory{top:120px}}

.returning-client-badge{display:inline-block;max-width:100%;box-sizing:border-box;margin:4px 5px 0 0;padding:3px 7px;border-radius:6px;background:#fbe1e2;color:#9e2630;font-size:11px;font-weight:600;line-height:1.35;white-space:normal;vertical-align:middle}

.returning-client-badge[role=button]{cursor:pointer}.returning-client-badge:focus-visible{outline:2px solid #bd414d;outline-offset:3px}.previous-client-chats{display:grid;gap:10px}.previous-client-chat{display:grid;gap:5px;text-align:left;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink)}.previous-client-chat:hover{background:var(--surface-soft)}.previous-client-chat small{color:var(--muted)}.previous-client-open{color:var(--accent);font-size:12px;margin-top:4px}
