@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&family=Noto+Color+Emoji&display=swap');

/* ============ Tokens: dark is the default, light is opt-in ============ */
:root{
  --paper:#000000;
  --paper-raised:#040405;
  --paper-sunken:#09090B;
  --paper-hover:#111215;
  --ink:#E9EBEE;
  --ink-soft:#9BA1AB;
  --ink-faint:#666D78;
  --line:#17191E;
  --line-strong:#24272E;
  --accent:#3DD68C;
  --accent-hover:#62E4A5;
  --accent-soft:rgba(61,214,140,0.12);
  --accent-ink:#03140B;
  --gold:#E5B454;
  --gold-soft:rgba(229,180,84,0.12);
  --red:#F07A72;
  --red-soft:rgba(240,122,114,0.12);
  --blue:#7CB2F0;
  --blue-soft:rgba(124,178,240,0.12);
  --purple:#B89CF5;
  --purple-soft:rgba(184,156,245,0.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm:0 2px 10px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:0 12px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.35);
  --shadow-lg:0 30px 80px rgba(0,0,0,0.6), 0 10px 24px rgba(0,0,0,0.4);
  --glow:0 0 0 1px rgba(61,214,140,0.25), 0 8px 28px -8px rgba(61,214,140,0.35);
  --radius-xs:6px;
  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:18px;
  --ease:cubic-bezier(.22,.8,.22,1);
  color-scheme:dark;
}
body.light-mode{
  --paper:#FAFAF8;
  --paper-raised:#FFFFFF;
  --paper-sunken:#F1F1EE;
  --paper-hover:#ECECE8;
  --ink:#171A18;
  --ink-soft:#5F645D;
  --ink-faint:#8E9389;
  --line:#E7E5DE;
  --line-strong:#D7D5CC;
  --accent:#0E6B54;
  --accent-hover:#0A5643;
  --accent-soft:#E6F3EC;
  --accent-ink:#FFFFFF;
  --gold:#A2740F; --gold-soft:#FBF0DA;
  --red:#B23B31; --red-soft:#FBEAE7;
  --blue:#2A5D8C; --blue-soft:#E8F1F9;
  --purple:#6A4CA0; --purple-soft:#EFE9F9;
  --shadow-xs:0 1px 2px rgba(23,26,24,0.05);
  --shadow-sm:0 2px 10px rgba(23,26,24,0.06), 0 1px 2px rgba(23,26,24,0.05);
  --shadow-md:0 10px 30px rgba(23,26,24,0.10), 0 2px 8px rgba(23,26,24,0.06);
  --shadow-lg:0 28px 70px rgba(23,26,24,0.22), 0 10px 24px rgba(23,26,24,0.10);
  --glow:0 0 0 1px rgba(14,107,84,0.2), 0 8px 24px -10px rgba(14,107,84,0.35);
  color-scheme:light;
}

*{box-sizing:border-box;}
html,body{height:100%; overflow:hidden; overscroll-behavior:none; position:fixed; inset:0; width:100%;}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'IBM Plex Sans','Apple Color Emoji','Noto Color Emoji',system-ui,sans-serif;   /* emoji: Apple's own on iPhone and Mac, the Android/WhatsApp-style set (Noto) everywhere else; listed before system-ui so Windows never picks its own */
  font-size:14px;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{ font-family:'Source Serif 4',serif; font-weight:600; letter-spacing:-0.012em; margin:0; }
::selection{ background:var(--accent-soft); color:var(--accent-hover); }
kbd{
  font-family:'IBM Plex Mono',monospace;
  font-size:10.5px;
  line-height:1;
  padding:2px 5px;
  border-radius:4px;
  background:var(--paper-sunken);
  border:1px solid var(--line-strong);
  border-bottom-width:2px;
  color:var(--ink-soft);
}

/* ============ Base controls ============ */
input, select, textarea{
  font-family:inherit;
  font-size:13.5px;
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:var(--radius-xs);
  background:var(--paper-sunken);
  color:var(--ink);
  transition:border-color .14s var(--ease), box-shadow .14s var(--ease), background .14s var(--ease);
}
input:hover, select:hover, textarea:hover{ border-color:var(--line-strong); }
input::placeholder, textarea::placeholder{ color:var(--ink-faint); }
input:focus, select:focus, textarea:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); background:var(--paper-raised); }
button{ font-family:inherit; cursor:pointer; border:none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
button:disabled{ cursor:default; }
.btn-primary{
  background:var(--accent);
  color:var(--accent-ink);
  padding:9px 15px;
  border-radius:var(--radius-xs);
  font-size:13.5px;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:background .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.btn-primary:hover:not(:disabled){ background:var(--accent-hover); transform:translateY(-1px); box-shadow:var(--glow); }
.btn-primary:active{ transform:translateY(0); }
.btn-primary:disabled{ opacity:.5; }
.btn-ghost{
  background:transparent;
  color:var(--ink-soft);
  border:1px solid var(--line-strong);
  padding:8px 13px;
  border-radius:var(--radius-xs);
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  text-decoration:none;
  transition:border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease);
}
.btn-ghost:hover{ border-color:var(--ink-faint); color:var(--ink); background:var(--paper-hover); }
.btn-ghost.danger:hover{ border-color:var(--red); color:var(--red); background:var(--red-soft); }
.btn-sm{ padding:5px 10px; font-size:12px; }
.icon-btn{
  flex-shrink:0;
  background:transparent;
  border:1px solid var(--line-strong);
  border-radius:var(--radius-xs);
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--ink-soft);
  transition:border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease);
}
.icon-btn:hover{ border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.icon-btn.danger:hover{ border-color:var(--red); color:var(--red); background:var(--red-soft); }

/* ============ App shell ============ */
.app{
  display:grid;
  grid-template-columns:320px 1fr;
  height:100vh;
  transition:grid-template-columns 0.2s var(--ease);
  overscroll-behavior:none;
}
.app.collapsed{ grid-template-columns:0px 1fr; }
.app.collapsed .sidebar{ overflow:hidden; border-right:none; }
.rail-toggle, .panel-rail-toggle{
  position:fixed;
  top:14px;
  z-index:20;
  background:var(--paper-raised);
  border:1px solid var(--line-strong);
  border-radius:999px;
  padding:7px 13px;
  font-size:12.5px;
  color:var(--ink-soft);
  display:none;
  align-items:center;
  gap:7px;
  box-shadow:var(--shadow-md);
  transition:border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.rail-toggle{ left:14px; }
.panel-rail-toggle{ right:14px; }
.rail-toggle:hover, .panel-rail-toggle:hover{ border-color:var(--accent); color:var(--ink); transform:translateY(-1px); }
.app.collapsed .rail-toggle{ display:inline-flex; }
.main.panel-collapsed .panel-rail-toggle{ display:inline-flex; }

/* ============ Sidebar ============ */
.sidebar{
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  background:var(--paper-raised);
  min-width:0;
  height:100vh;
  overflow:hidden;
  position:relative;
  z-index:2;
  overscroll-behavior:contain;
}
.sidebar-head{
  padding:18px 16px 14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-mark{
  flex-shrink:0;
  width:30px;
  height:30px;
  border-radius:9px;
  background:radial-gradient(120% 120% at 20% 10%, var(--accent-hover), var(--accent) 45%, #0B5A3B);
  color:var(--accent-ink);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--glow);
}
body.light-mode .brand-mark{ color:#fff; }
.brand h1{ font-size:18px; letter-spacing:-0.015em; white-space:nowrap; }
.brand .sub{ color:var(--ink-faint); font-size:11.5px; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.head-icons{ display:flex; gap:5px; flex-shrink:0; }
.head-icons .icon-btn{ width:28px; height:28px; border-color:transparent; }
.head-icons .icon-btn:hover{ border-color:var(--line-strong); color:var(--ink); background:var(--paper-hover); }

.plans-row{
  padding:0 16px 12px 18px;
  display:flex;
  gap:5px;
  align-items:center;
}
.plans-row select{ flex:1; min-width:0; padding:6px 8px; font-size:12.5px; font-weight:500; }
.plans-row .icon-btn{ width:28px; height:28px; }

.stats{
  display:flex;
  gap:5px;
  padding:10px 16px 10px 18px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  overflow-x:auto;
  scrollbar-width:none;
  mask-image:linear-gradient(90deg, #000 88%, transparent);
  -webkit-mask-image:linear-gradient(90deg, #000 88%, transparent);
}
.stats::-webkit-scrollbar{ display:none; }
.stat-pill{
  flex-shrink:0;
  font-size:11.5px;
  padding:4px 10px;
  border-radius:999px;
  background:transparent;
  border:1px solid var(--line-strong);
  color:var(--ink-soft);
  cursor:pointer;
  user-select:none;
  font-weight:500;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease);
}
.stat-pill b{ font-family:'IBM Plex Mono',monospace; font-weight:600; color:var(--ink); }
.stat-pill .dot{ width:6px; height:6px; border-radius:50%; }
.stat-pill:hover{ border-color:var(--ink-faint); color:var(--ink); }
.stat-pill.active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.stat-pill.active b{ color:var(--accent-ink); }

.search-row{ padding:12px 16px 12px 18px; display:flex; gap:7px; border-bottom:1px solid var(--line); }
.search-wrap{ position:relative; flex:1; min-width:0; }
.search-wrap svg{ position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--ink-faint); pointer-events:none; }
.search-wrap input{ width:100%; padding-left:31px; }
.search-row .btn-primary{ padding:8px 12px; }

.list-section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 8px 8px 10px;
  margin-bottom:4px;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ink-soft);
}
.list{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:8px 8px 16px;
}
.empty-list{ padding:34px 20px; color:var(--ink-soft); font-size:13px; line-height:1.6; text-align:center; }
.empty-list .btn-primary{ margin-top:14px; }
.contact-row{
  padding:10px 12px;
  margin-bottom:2px;
  border-radius:var(--radius-sm);
  border:1px solid transparent;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:4px;
  position:relative;
  transition:background .12s var(--ease), border-color .12s var(--ease);
}
.contact-row:hover{ background:var(--paper-hover); }
.contact-row.active{ background:var(--accent-soft); border-color:rgba(61,214,140,0.28); }
body.light-mode .contact-row.active{ border-color:rgba(14,107,84,0.18); }
.contact-row.active::before{
  content:'';
  position:absolute;
  left:-8px; top:10px; bottom:10px;
  width:3px;
  border-radius:0 3px 3px 0;
  background:var(--accent);
}
.row-top{ display:flex; align-items:baseline; gap:8px; min-width:0; }
.contact-row .name{ font-weight:600; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lead-num{
  font-family:'IBM Plex Mono',monospace;
  font-size:10.5px;
  color:var(--ink-faint);
  min-width:22px;
  flex-shrink:0;
}
.contact-row.active .lead-num{ color:var(--accent); }
.row-bottom{ display:flex; justify-content:space-between; align-items:center; gap:8px; padding-left:30px; }
.row-phone{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pill{
  font-size:10.5px;
  padding:2px 8px;
  border-radius:999px;
  font-weight:600;
  letter-spacing:.01em;
  white-space:nowrap;
  flex-shrink:0;
}
.sidebar-footer{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px 10px 18px;
  color:var(--ink-faint);
  font-size:11.5px;
  border-top:1px solid var(--line);
  min-height:48px;
}
.sync-dot{ width:7px; height:7px; border-radius:50%; background:var(--ink-faint); flex-shrink:0; }
.sync-dot.saved{ background:var(--accent); }
.sync-dot.saving{ background:var(--gold); animation:pulse 1s ease-in-out infinite; }
.sync-dot.error{ background:var(--red); }
@keyframes pulse{ 50%{ opacity:.35; } }
.footer-user{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.footer-user strong{ color:var(--ink-soft); font-weight:500; }

/* ============ Main ============ */
.main{ display:flex; flex-direction:column; min-width:0; height:100vh; background:var(--paper); overscroll-behavior:contain; }
.main-body{ flex:1; display:flex; min-height:0; }
.main-left{ flex:1; display:flex; flex-direction:column; min-width:0; overflow:hidden; overscroll-behavior:none; }
.main-empty{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:var(--ink-soft);
  text-align:center;
  padding:40px;
  gap:14px;
}
.main-empty .empty-icon{ color:var(--ink-faint); }
.main-empty p{ max-width:340px; line-height:1.6; font-size:14px; margin:0; }
.main-empty .actions{ display:flex; gap:8px; }

/* Lead header: name + hero phone + dispositions, then editable fields */
.detail-head{
  padding:18px 24px 16px;
  border-bottom:1px solid var(--line);
  background:var(--paper-raised);
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  gap:14px;
  overscroll-behavior:none;
}
.head-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.head-title{ flex:1; min-width:0; }
.lead-pos{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-faint); margin-bottom:4px; display:flex; gap:10px; align-items:center; }
.name-input{
  width:100%;
  font-family:'Source Serif 4',serif;
  font-size:24px;
  font-weight:600;
  letter-spacing:-0.015em;
  padding:2px 6px;
  margin-left:-7px;
  border:1px solid transparent;
  background:transparent;
}
.name-input:hover{ border-color:var(--line); background:transparent; }
.head-actions{ display:flex; gap:6px; align-items:center; flex-shrink:0; }
.confirm-row{ display:flex; gap:6px; align-items:center; }

.hero-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.phone-hero{
  display:flex;
  align-items:stretch;
  border:1px solid var(--line-strong);
  border-radius:var(--radius-sm);
  background:var(--paper-sunken);
  overflow:hidden;
  transition:border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.phone-hero.flash{ border-color:var(--accent); box-shadow:var(--glow); }
.phone-hero input{
  font-family:'IBM Plex Mono',monospace;
  font-size:19px;
  font-weight:500;
  letter-spacing:0.02em;
  width:230px;
  border:none;
  border-radius:0;
  background:transparent;
  padding:8px 12px;
}
.phone-hero input:focus{ box-shadow:none; background:transparent; }
.copy-hero{
  display:flex;
  align-items:center;
  gap:6px;
  padding:0 14px;
  border-left:1px solid var(--line-strong);
  background:transparent;
  color:var(--ink-soft);
  font-size:12.5px;
  font-weight:600;
  min-width:92px;
  justify-content:center;
  transition:background .14s var(--ease), color .14s var(--ease);
}
.copy-hero:hover:not(:disabled){ background:var(--accent-soft); color:var(--accent); }
.copy-hero.copied{ background:var(--accent); color:var(--accent-ink); }
.copy-hero:disabled{ opacity:.4; }
.geo-strip{ display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--ink-soft); min-height:16px; }
.geo-strip .geo-time{ font-weight:600; color:var(--ink); }
.geo-strip .geo-error{ opacity:0.7; }

.dispo-bar{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.dispo-btn{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:6px 11px 6px 7px;
  border-radius:var(--radius-xs);
  border:1px solid var(--line-strong);
  background:transparent;
  color:var(--ink);
  font-size:12.5px;
  font-weight:500;
  transition:border-color .14s var(--ease), background .14s var(--ease), transform .1s var(--ease);
}
.dispo-btn kbd{ min-width:18px; text-align:center; }
.dispo-btn:hover{ border-color:var(--c); background:color-mix(in srgb, var(--c) 14%, transparent); }
.dispo-btn:active{ transform:scale(.97); }
.dispo-btn.current{ border-color:var(--c); background:color-mix(in srgb, var(--c) 20%, transparent); }
.dispo-btn .swatch{ width:8px; height:8px; border-radius:50%; background:var(--c); }
.dispo-sep{ width:1px; height:22px; background:var(--line-strong); margin:0 4px; }
.dispo-bar select{ padding:5px 8px; font-size:12.5px; }

.field-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:10px 12px; }
.field-grid .half{ grid-column:span 2; }
.field-grid .full{ grid-column:1 / -1; }
.field-label{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:0.07em;
  color:var(--ink-faint);
  margin-bottom:4px;
  display:block;
  font-weight:600;
}
.field-grid input, .field-grid select{ width:100%; padding:7px 10px; }
.input-row{ display:flex; gap:6px; }
.input-row input{ flex:1; min-width:0; }
.mini-btn{
  flex-shrink:0;
  font-size:11.5px;
  padding:0 10px;
  border-radius:var(--radius-xs);
  border:1px solid var(--line-strong);
  background:transparent;
  color:var(--ink-soft);
  transition:border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease);
}
.mini-btn:hover:not(:disabled){ border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.mini-btn:disabled{ opacity:0.4; }

.preview-wrap{ flex:1; display:flex; flex-direction:column; min-height:0; padding:14px 24px 20px; }
.preview-bar{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; }
.preview-bar .url-text{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-faint); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preview-frame-box{
  flex:1;
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  overflow:hidden;
  background:#fff;
  position:relative;
  min-height:0;
  box-shadow:var(--shadow-sm);
}
body:not(.light-mode) .preview-frame-box{ background:#050607; }
body:not(.light-mode) .preview-frame-box iframe{ filter:brightness(.42) saturate(.85); transition:filter .25s var(--ease); }   /* dimmed until you point at it */
body:not(.light-mode) .preview-frame-box:hover iframe{ filter:none; }
.preview-frame-box iframe{ width:100%; height:100%; border:none; }
.no-site, .preview-off{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:12px;
  border:1.5px dashed var(--line-strong);
  border-radius:var(--radius-lg);
  color:var(--ink-soft);
  padding:30px;
  text-align:center;
  font-size:13px;
  line-height:1.5;
}
.no-site .empty-icon, .preview-off .empty-icon{ color:var(--ink-faint); }
.no-site .input-row{ width:320px; }
.preview-note{ font-size:11.5px; color:var(--ink-faint); margin-top:9px; line-height:1.5; }

/* Call notes panel */
.call-panel{
  flex-shrink:0;
  border-left:1px solid var(--line);
  background:var(--paper-raised);
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overscroll-behavior:contain;
  position:relative;
}
.main.panel-collapsed .call-panel{ display:none; }
.panel-resize-handle{ position:absolute; left:-4px; top:0; bottom:0; width:8px; cursor:col-resize; z-index:2; }
.panel-resize-handle:hover, .panel-resize-handle:active{ background:linear-gradient(90deg, transparent, var(--accent) 50%, transparent); opacity:.5; }
.call-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  font-weight:600;
  font-size:13.5px;
}
.notes-section{ flex:1; display:flex; flex-direction:column; padding:14px 18px 18px; }
.notes-section textarea{ flex:1; min-height:180px; width:100%; resize:none; line-height:1.6; font-size:13.5px; }
.notes-hint{ font-size:11px; color:var(--ink-faint); margin-top:8px; }

/* ============ Modals ============ */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(3,4,5,0.66);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:100;
  padding:20px;
  animation:fadeIn .15s var(--ease);
}
body.light-mode .modal-overlay{ background:rgba(15,18,16,0.45); }
@keyframes fadeIn{ from{ opacity:0; } }
@keyframes popIn{ from{ opacity:0; transform:translateY(6px) scale(.985); } }
.modal-box{
  background:var(--paper-raised);
  border:1px solid var(--line-strong);
  border-radius:var(--radius-lg);
  width:100%;
  max-width:540px;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow-lg);
  animation:popIn .18s var(--ease);
}
.modal-box.wide{ max-width:900px; }
.modal-head{ padding:16px 22px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:10px; flex-shrink:0; }
.modal-head h2{ font-size:17px; }
.modal-body{ padding:18px 22px; display:flex; flex-direction:column; gap:15px; overflow-y:auto; overscroll-behavior:contain; }
.modal-foot{ padding:14px 22px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; align-items:center; gap:8px; flex-shrink:0; }
.modal-foot .spacer{ flex:1; }
.modal-body textarea{ width:100%; min-height:110px; font-family:'IBM Plex Mono',monospace; font-size:12px; resize:vertical; }
.modal-body input[type="text"]{ width:100%; }
.hint{ font-size:12px; color:var(--ink-faint); line-height:1.55; }
.modal-error{ font-size:12.5px; color:var(--red); background:var(--red-soft); border-radius:var(--radius-xs); padding:9px 11px; }
.dropzone{
  border:1.5px dashed var(--line-strong);
  border-radius:var(--radius-md);
  padding:22px;
  text-align:center;
  font-size:12.5px;
  color:var(--ink-soft);
  cursor:pointer;
  transition:border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone:hover{ border-color:var(--ink-faint); background:var(--paper-hover); }
.dropzone.drag{ border-color:var(--accent); background:var(--accent-soft); }
.dropzone strong{ color:var(--ink); }
.dropzone .ok{ color:var(--accent); font-weight:600; }
.or-divider{ display:flex; align-items:center; gap:10px; font-size:11px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.06em; }
.or-divider::before, .or-divider::after{ content:''; flex:1; height:1px; background:var(--line); }
.seg{ display:inline-flex; border:1px solid var(--line-strong); border-radius:var(--radius-xs); overflow:hidden; }
.seg button{ background:transparent; color:var(--ink-soft); padding:6px 12px; font-size:12.5px; border-right:1px solid var(--line-strong); }
.seg button:last-child{ border-right:none; }
.seg button.active{ background:var(--accent-soft); color:var(--accent); font-weight:600; }

/* Import mapping */
.map-table-wrap{ overflow:auto; border:1px solid var(--line); border-radius:var(--radius-sm); max-height:46vh; }
.map-table{ border-collapse:collapse; font-size:12.5px; min-width:100%; }
.map-table th, .map-table td{ padding:7px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; max-width:220px; overflow:hidden; text-overflow:ellipsis; }
.map-table thead th{ position:sticky; top:0; background:var(--paper-raised); z-index:1; vertical-align:top; }
.map-table thead .src{ font-size:11px; color:var(--ink-faint); font-weight:500; margin-bottom:5px; }
.map-table thead select{ font-size:12px; padding:4px 6px; min-width:120px; }
.map-table thead select.mapped{ border-color:var(--accent); color:var(--accent); }
.map-table thead select.skip{ color:var(--ink-faint); }
.map-table td{ color:var(--ink-soft); }
.map-table td.dim{ opacity:.4; }
.map-summary{ display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-soft); }
.map-summary b{ color:var(--ink); font-family:'IBM Plex Mono',monospace; }

/* Smart paste */
.sp-grid{ display:grid; grid-template-columns:110px 1fr; gap:8px 10px; align-items:center; }
.sp-grid label{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-soft); }
.sp-grid input[type="text"]{ width:100%; }

/* Settings */
.settings-row{ padding:10px 2px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; font-size:13px; color:var(--ink-soft); gap:12px; }
.settings-row:last-of-type{ border-bottom:none; }
.settings-row small{ display:block; color:var(--ink-faint); font-size:11.5px; margin-top:2px; }
.settings-section-title{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-faint); margin:10px 0 0; }
/* Collapsible settings sections (grouped by groupSettings() in app.js). */
.settings-group{ border-bottom:1px solid var(--line); }
.settings-group:last-child{ border-bottom:0; }
.settings-group-title{ display:flex; align-items:center; gap:7px; width:100%; margin:0; padding:11px 2px; cursor:pointer; user-select:none; background:none; border:0; text-align:left; }
.settings-group-title:hover{ color:var(--ink); }
.settings-group-title:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
.sg-chev{ width:0; height:0; flex-shrink:0; border-left:4.5px solid currentColor; border-top:3.5px solid transparent; border-bottom:3.5px solid transparent; transition:transform .15s ease; }
.settings-group.open > .settings-group-title .sg-chev{ transform:rotate(90deg); }
.settings-group-body{ display:none; padding-bottom:10px; }
.settings-group.open > .settings-group-body{ display:block; }
.settings-group-body > .settings-row:first-child{ margin-top:0; }
.status-editor-row{ display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.status-color-input{ width:32px; height:32px; padding:2px; border-radius:6px; flex-shrink:0; cursor:pointer; }
.modal-body input.status-label-input{ flex:1; min-width:0; width:auto; }
.modal-body input.status-key-input{ width:46px; text-align:center; flex-shrink:0; font-family:'IBM Plex Mono',monospace; font-weight:600; }
.toggle-switch{
  position:relative;
  width:36px;
  height:20px;
  flex-shrink:0;
  background:var(--line-strong);
  border-radius:999px;
  transition:background 0.16s var(--ease);
  padding:0;
}
.toggle-switch.on{ background:var(--accent); }
.toggle-switch .knob{ position:absolute; top:2px; left:2px; width:16px; height:16px; background:#fff; border-radius:50%; transition:left 0.16s var(--ease); box-shadow:0 1px 3px rgba(0,0,0,0.35); }
.toggle-switch.on .knob{ left:18px; }

/* Stats */
.range-bar{ display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.range-presets{ display:flex; gap:4px; flex-wrap:wrap; }
.range-presets button{ background:transparent; border:1px solid var(--line-strong); color:var(--ink-soft); padding:5px 10px; font-size:12px; border-radius:999px; }
.range-presets button:hover{ color:var(--ink); border-color:var(--ink-faint); }
.range-presets button.active{ background:var(--accent-soft); color:var(--accent); border-color:var(--accent); font-weight:600; }
.range-inputs{ display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
.range-inputs input, .range-inputs select{ padding:6px 8px; font-size:12.5px; }
.tiles{ display:grid; grid-template-columns:repeat(5, 1fr); gap:10px; }
.tile{ background:var(--paper-sunken); border:1px solid var(--line); border-radius:var(--radius-md); padding:12px 14px; }
.tile-label{ font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.06em; font-weight:600; }
.tile-value{ font-family:'IBM Plex Mono',monospace; font-size:22px; font-weight:600; margin-top:4px; color:var(--ink); }
.tile-sub{ font-size:11.5px; color:var(--ink-soft); margin-top:2px; }
.chart-card{ border:1px solid var(--line); border-radius:var(--radius-md); padding:14px 16px; background:var(--paper-raised); }
.chart-title{ font-size:12.5px; font-weight:600; color:var(--ink); margin-bottom:10px; display:flex; justify-content:space-between; gap:8px; }
.chart-title span{ font-weight:400; color:var(--ink-faint); }
.stats-cols{ display:grid; grid-template-columns:1fr 1.35fr; gap:12px; }
.hbar-row{ display:grid; grid-template-columns:120px 1fr 38px; gap:10px; align-items:center; font-size:12.5px; padding:4px 0; }
.hbar-label{ display:flex; align-items:center; gap:7px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hbar-label .dot{ width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.hbar-track{ height:10px; background:var(--paper-sunken); border-radius:4px; overflow:hidden; }
.hbar-fill{ height:100%; border-radius:0 4px 4px 0; min-width:2px; }
.hbar-count{ font-family:'IBM Plex Mono',monospace; text-align:right; color:var(--ink); }
.col-chart{ position:relative; }
.col-chart svg{ display:block; width:100%; overflow:visible; }
.col-chart .bar{ fill:var(--accent); transition:opacity .12s; }
.col-chart .bar-hit:hover + .bar, .col-chart .bar.hover{ fill:var(--accent-hover); }
.col-chart .axis-text{ font-size:10px; fill:var(--ink-faint); font-family:'IBM Plex Mono',monospace; }
.col-chart .grid{ stroke:var(--line); stroke-width:1; }
.chart-tip{
  position:absolute;
  pointer-events:none;
  background:var(--paper-hover);
  border:1px solid var(--line-strong);
  border-radius:var(--radius-xs);
  padding:6px 9px;
  font-size:12px;
  color:var(--ink);
  white-space:nowrap;
  box-shadow:var(--shadow-md);
  transform:translate(-50%, -100%);
  margin-top:-8px;
  display:none;
  z-index:3;
}
.chart-tip b{ font-family:'IBM Plex Mono',monospace; }
.ev-table-wrap{ max-height:260px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius-sm); }
.ev-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.ev-table th, .ev-table td{ padding:6px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
.ev-table th{ position:sticky; top:0; background:var(--paper-raised); color:var(--ink-faint); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.ev-table td.mono{ font-family:'IBM Plex Mono',monospace; color:var(--ink-soft); }
.stats-empty{ padding:30px; text-align:center; color:var(--ink-soft); font-size:13px; }

/* Shortcut sheet */
.kb-grid{ display:grid; grid-template-columns:auto 1fr; gap:9px 16px; font-size:13px; color:var(--ink-soft); align-items:center; }
.kb-grid .keys{ display:flex; gap:4px; justify-content:flex-end; }

/* ============ Toasts ============ */
.toast-stack{ position:fixed; bottom:18px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; gap:8px; align-items:center; z-index:200; pointer-events:none; }
.toast{
  background:var(--paper-hover);
  border:1px solid var(--line-strong);
  color:var(--ink);
  border-radius:999px;
  padding:8px 16px;
  font-size:13px;
  box-shadow:var(--shadow-md);
  display:flex;
  gap:8px;
  align-items:center;
  animation:toastIn .22s var(--ease);
  pointer-events:auto;
}
.toast.ok svg{ color:var(--accent); }
.toast.warn svg{ color:var(--gold); }
.toast .mono{ font-family:'IBM Plex Mono',monospace; font-weight:600; }
.toast button{ background:transparent; color:var(--accent); font-weight:600; font-size:12.5px; padding:0 0 0 4px; }
.toast.out{ animation:toastOut .2s var(--ease) forwards; }
@keyframes toastIn{ from{ opacity:0; transform:translateY(8px); } }
@keyframes toastOut{ to{ opacity:0; transform:translateY(6px); } }

/* ============ Auth screen ============ */
.auth-screen, .boot-loader{
  position:fixed;
  inset:0;
  z-index:300;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(61,214,140,0.10), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(124,178,240,0.08), transparent 60%),
    var(--paper);
}
.auth-card{
  width:100%;
  max-width:380px;
  background:var(--paper-raised);
  border:1px solid var(--line-strong);
  border-radius:var(--radius-lg);
  padding:28px;
  box-shadow:var(--shadow-lg);
  display:flex;
  flex-direction:column;
  gap:16px;
}
.auth-card .brand h1{ font-size:20px; }
.auth-card h2{ font-family:'IBM Plex Sans',sans-serif; font-size:15px; font-weight:600; color:var(--ink-soft); }
.auth-card form{ display:flex; flex-direction:column; gap:12px; }
.auth-card input{ width:100%; padding:10px 12px; }
.auth-card .btn-primary{ justify-content:center; padding:10px; }
.btn-google{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px;
  border-radius:var(--radius-xs);
  border:1px solid var(--line-strong);
  background:var(--paper-sunken);
  color:var(--ink);
  font-weight:500;
  font-size:13.5px;
}
.btn-google:hover{ border-color:var(--ink-faint); background:var(--paper-hover); }
.auth-links{ display:flex; justify-content:space-between; gap:10px; font-size:12.5px; }
.auth-links a{ color:var(--accent); text-decoration:none; }
.auth-links a:hover{ text-decoration:underline; }
.auth-msg{ font-size:12.5px; min-height:0; }
.auth-msg:empty{ display:none; }
.auth-msg.error{ color:var(--red); background:var(--red-soft); padding:8px 10px; border-radius:var(--radius-xs); }
.auth-msg.ok{ color:var(--accent); background:var(--accent-soft); padding:8px 10px; border-radius:var(--radius-xs); }
.boot-loader{ color:var(--ink-soft); gap:12px; flex-direction:column; font-size:13px; }
.spinner{ width:22px; height:22px; border-radius:50%; border:2px solid var(--line-strong); border-top-color:var(--accent); animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.boot-error{ max-width:420px; text-align:center; line-height:1.6; }
.boot-error a{ color:var(--accent); }

/* ============ Scrollbars ============ */
.list, .call-panel, .modal-body, .map-table-wrap, .ev-table-wrap{ scrollbar-width:thin; scrollbar-color:transparent transparent; }
.list:hover, .call-panel:hover, .modal-body:hover, .map-table-wrap:hover, .ev-table-wrap:hover{ scrollbar-color:var(--line-strong) transparent; }
::-webkit-scrollbar{ width:7px; height:7px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--line-strong); border-radius:8px; }

@media (max-width: 1100px){
  .field-grid{ grid-template-columns:repeat(2, 1fr); }
  .tiles{ grid-template-columns:repeat(3, 1fr); }
  .stats-cols{ grid-template-columns:1fr; }
}
/* Settings → Motion off: everything settles instantly. (This used to follow the
   Windows "Animation effects" setting; the in-app switch decides now.) */
body.no-motion *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }

/* ============ Feature additions ============ */
.link-btn{ background:transparent; color:var(--accent); font-size:12px; font-weight:600; padding:2px 4px; border-radius:4px; }
.link-btn:hover:not(:disabled){ text-decoration:underline; }
.link-btn:disabled{ color:var(--ink-faint); }
.icon-btn.active{ border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.avatar{ width:24px; height:24px; border-radius:50%; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; font-size:10px; font-weight:600; background:var(--purple-soft); color:var(--purple); border:1px solid color-mix(in srgb, var(--purple) 35%, transparent); }
.avatar.sm{ width:22px; height:22px; font-size:9.5px; }
.avatar.xs{ width:18px; height:18px; font-size:8.5px; margin-left:auto; }

/* Daily goals */
.goal-bar{ padding:0 16px 12px 18px; display:flex; flex-direction:column; gap:6px; cursor:pointer; }
.goal-row{ display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--ink-soft); }
.goal-label{ width:52px; flex-shrink:0; color:var(--ink-faint); font-weight:600; text-transform:uppercase; letter-spacing:.05em; font-size:10px; }
.goal-plain{ flex:1; }
.goal-plain b, .goal-num b{ color:var(--ink); font-family:'IBM Plex Mono',monospace; }
.goal-track{ flex:1; height:6px; border-radius:3px; background:var(--paper-sunken); overflow:hidden; }
.goal-fill{ height:100%; border-radius:3px; background:var(--accent); transition:width .4s var(--ease); }
.goal-fill.pos{ background:var(--purple); }
.goal-row.met .goal-fill{ box-shadow:0 0 10px var(--accent); }
.goal-num{ font-family:'IBM Plex Mono',monospace; font-size:11px; min-width:52px; text-align:right; }
.goal-streak{ font-size:11.5px; color:var(--gold); font-weight:600; }

/* Callbacks */
.cb-badge{ display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:600; color:var(--gold); white-space:nowrap; margin-left:auto; margin-right:6px; }
.cb-badge.due{ color:var(--accent-ink); background:var(--gold); padding:1px 7px; border-radius:999px; animation:pulse 1.6s ease-in-out infinite; }
.stat-pill.cb-pill{ color:var(--gold); border-color:color-mix(in srgb, var(--gold) 45%, transparent); }
.stat-pill.cb-pill.due{ background:var(--gold-soft); }
.stat-pill.cb-pill.active{ background:var(--gold); border-color:var(--gold); color:var(--accent-ink); }
.stat-pill svg{ flex-shrink:0; }
.cb-chip{ display:inline-flex; align-items:center; gap:6px; background:var(--gold-soft); color:var(--gold); border:1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius:999px; padding:5px 11px; font-size:12px; font-weight:600; }
.cb-chip.due{ background:var(--gold); color:var(--accent-ink); }
.cb-options{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.cb-opt{ display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:9px; align-items:center; text-align:left; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--line-strong); background:var(--paper-sunken); color:var(--ink); font-size:13px; font-weight:500; transition:border-color .14s var(--ease), background .14s var(--ease); }
.cb-opt kbd{ grid-row:span 2; }
.cb-opt small{ color:var(--ink-faint); font-size:11px; font-weight:400; }
.cb-opt:hover, .cb-opt:focus-visible{ border-color:var(--gold); background:var(--gold-soft); outline:none; }
.modal-head h2 span{ color:var(--accent); }

/* Call button + timer */
.call-btn{ display:flex; align-items:center; gap:7px; padding:0 16px; border-left:1px solid var(--line-strong); background:var(--accent); color:var(--accent-ink); font-weight:600; font-size:13px; font-family:'IBM Plex Mono',monospace; min-width:96px; justify-content:center; transition:background .14s var(--ease); }
.call-btn:hover:not(:disabled){ background:var(--accent-hover); }
.call-btn:disabled{ background:transparent; color:var(--ink-faint); }
.call-btn.live{ background:var(--red); color:#fff; }
.call-btn .rec{ width:8px; height:8px; border-radius:50%; background:#fff; animation:pulse 1s ease-in-out infinite; }
.call-btn .end{ font-family:'IBM Plex Sans',sans-serif; font-size:11px; opacity:.85; padding-left:6px; border-left:1px solid rgba(255,255,255,.35); }

.call-btn.ringing{ background:var(--gold); color:var(--accent-ink); }
.call-btn.ringing .rec{ background:var(--accent-ink); }
.call-btn.ringing .end{ border-left-color:rgba(0,0,0,.25); }
.autodial-chip{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line-strong); background:transparent; color:var(--ink-soft); border-radius:999px; padding:5px 11px; font-size:12px; }
.autodial-chip b{ font-weight:600; color:var(--ink-faint); }
.autodial-chip.on{ border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.autodial-chip.on b{ color:var(--accent); }
.dispo-bar.prompt{ animation:dispoPrompt 1.2s var(--ease) 2; border-radius:var(--radius-sm); }
@keyframes dispoPrompt{ 0%,100%{ box-shadow:0 0 0 0 transparent; } 40%{ box-shadow:0 0 0 3px var(--gold-soft), 0 0 0 1px var(--gold); } }

/* All statuses visible */
.stat-pill.zero{ opacity:.5; }
.stat-pill.zero:hover, .stat-pill.zero.active{ opacity:1; }
.dispo-btn.nokey{ padding:5px 10px 5px 8px; font-size:12px; color:var(--ink-soft); }
.dispo-btn.nokey.current, .dispo-btn.nokey:hover{ color:var(--ink); }

/* Clickable stats log + other-plan search results */
.log-table tbody tr{ cursor:pointer; }
.log-table tbody tr:hover td{ background:var(--paper-hover); }
.log-table .lead-link{ color:var(--ink); font-weight:500; }
.log-table tbody tr:hover .lead-link{ color:var(--accent); text-decoration:underline; }
.other-plans{ margin-top:8px; border-top:1px dashed var(--line-strong); padding-top:4px; }
.contact-row.other .row-top, .contact-row.other .row-bottom{ padding-left:0; }
.contact-row.other .row-snippet{ padding-left:0; }

/* Same lead in other lists */
.xlist{ border:1px solid var(--line); border-left:2px solid var(--purple); border-radius:var(--radius-sm); background:var(--paper-sunken); margin-bottom:10px; max-height:200px; overflow-y:auto; scrollbar-width:thin; }
.xl-head{ padding:7px 10px; border-bottom:1px solid var(--line); }
.xl-item{ padding:8px 10px; border-bottom:1px solid var(--line); font-size:12.5px; }
.xl-item:last-child{ border-bottom:none; }
.xl-top{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.xl-when{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--ink-faint); }
.xl-open{ margin-left:auto; color:var(--accent); font-size:11.5px; text-decoration:none; }
.xl-open:hover{ text-decoration:underline; }
.xl-sub{ color:var(--ink-faint); font-size:11.5px; margin-top:3px; }
.xl-notes{ color:var(--ink-soft); white-space:pre-wrap; margin-top:4px; line-height:1.45; }
.xl-badge{ font-size:10px; font-family:'IBM Plex Mono',monospace; color:var(--purple); border:1px solid color-mix(in srgb, var(--purple) 40%, transparent); border-radius:999px; padding:0 6px; flex-shrink:0; }

/* Search match preview */
.row-snippet{ font-size:11.5px; color:var(--ink-soft); padding-left:30px; line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row-snippet span{ color:var(--ink-faint); font-size:10px; text-transform:uppercase; letter-spacing:.05em; font-weight:600; margin-right:2px; }
.row-snippet mark{ background:var(--gold-soft); color:var(--gold); border-radius:3px; padding:0 2px; }

/* Status editor: shortcut preview */
.status-preview{ display:flex; align-items:center; gap:6px; width:220px; flex-shrink:0; overflow:hidden; }
.modal-box:has(#statusEditorList){ max-width:600px; }
.dispo-btn.preview{ pointer-events:none; padding:4px 9px 4px 5px; font-size:12px; }
.key-none{ font-size:11px; color:var(--ink-faint); }
.key-warn{ font-size:10.5px; color:var(--gold); white-space:nowrap; }

/* Share leads */
.share-options{ display:flex; flex-direction:column; gap:6px; }
.share-opt{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line-strong); border-radius:var(--radius-sm); cursor:pointer; font-size:13px; color:var(--ink-soft); }
.share-opt.on{ border-color:var(--accent); background:var(--accent-soft); color:var(--ink); }
.share-opt input[type=number]{ width:80px; padding:4px 7px; margin:0 4px; }
.share-opt .chips{ display:flex; gap:4px; margin-left:auto; }
.chip-btn{ background:transparent; border:1px solid var(--line-strong); color:var(--ink-soft); border-radius:999px; padding:3px 9px; font-size:11.5px; font-family:'IBM Plex Mono',monospace; }
.chip-btn:hover, .chip-btn.on{ border-color:var(--accent); color:var(--accent); }
.modal-foot .hint b{ color:var(--ink); }

/* Assignee */
.assign-wrap{ display:flex; align-items:center; gap:6px; }
.assign-wrap select{ padding:5px 8px; font-size:12px; max-width:150px; }

/* Call panel tabs */
.panel-tabs{ display:flex; gap:2px; background:var(--paper-sunken); border:1px solid var(--line); border-radius:var(--radius-xs); padding:2px; }
.panel-tab{ background:transparent; color:var(--ink-soft); font-size:12.5px; font-weight:500; padding:5px 11px; border-radius:5px; display:inline-flex; align-items:center; gap:5px; }
.panel-tab:hover{ color:var(--ink); }
.panel-tab.active{ background:var(--paper-raised); color:var(--ink); box-shadow:var(--shadow-xs); }
.tab-count{ font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--ink-faint); }
.call-panel-body{ flex:1; display:flex; flex-direction:column; min-height:0; }
.panel-scroll{ flex:1; overflow-y:auto; padding:14px 18px 18px; display:flex; flex-direction:column; gap:8px; overscroll-behavior:contain; scrollbar-width:thin; }
.hist{ display:flex; flex-direction:column; }
.hist-item{ display:grid; grid-template-columns:10px 1fr; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:12.5px; }
.hist-item:last-child{ border-bottom:none; }
.hist-dot{ width:8px; height:8px; border-radius:50%; margin-top:5px; }
.hist-text{ color:var(--ink); line-height:1.45; }
.hist-note{ color:var(--ink-soft); white-space:pre-wrap; }
.hist-meta{ color:var(--ink-faint); font-size:11px; margin-top:2px; font-family:'IBM Plex Mono',monospace; }
.hist-auto{ color:var(--ink-faint); font-weight:400; }
.hist-empty{ color:var(--ink-soft); font-size:13px; line-height:1.6; padding:6px 0; }
.script-view{ font-size:14px; line-height:1.65; color:var(--ink); }
.script-view .sc-h, .obj-a .sc-h{ font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--accent); margin:12px 0 2px; }
.script-view .sc-h:first-child{ margin-top:0; }
.sc-li{ padding-left:14px; position:relative; }
.sc-li::before{ content:""; position:absolute; left:3px; top:.7em; width:4px; height:4px; border-radius:50%; background:var(--ink-faint); }
.sc-gap{ height:8px; }
.ph{ background:var(--accent-soft); color:var(--accent); border-radius:4px; padding:0 4px; font-weight:600; }
.ph.empty{ background:var(--gold-soft); color:var(--gold); }
.obj{ border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--paper-sunken); margin-bottom:6px; }
.obj summary{ cursor:pointer; padding:9px 12px; font-size:13px; font-weight:600; list-style:none; display:flex; gap:8px; align-items:center; }
.obj summary::before{ content:"\203A"; color:var(--ink-faint); transition:transform .15s var(--ease); display:inline-block; }
.obj[open] summary::before{ transform:rotate(90deg); }
.obj summary::-webkit-details-marker{ display:none; }
.obj-a{ padding:0 12px 11px 26px; font-size:13px; line-height:1.6; color:var(--ink-soft); }
.script-edit textarea{ min-height:180px; width:100%; resize:vertical; line-height:1.55; font-size:13px; }
.obj-edit{ display:flex; flex-direction:column; gap:6px; padding:10px; border:1px solid var(--line); border-radius:var(--radius-sm); margin-bottom:8px; }
.obj-edit textarea{ min-height:60px; width:100%; resize:vertical; font-size:12.5px; }
.obj-edit .icon-btn{ width:30px; height:auto; }
.btn-primary.btn-sm{ padding:5px 11px; font-size:12px; }

/* Bulk */
.contact-row.checked{ background:var(--accent-soft); border-color:rgba(61,214,140,0.28); }
.row-check{ width:16px; height:16px; border-radius:4px; border:1.5px solid var(--line-strong); flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; color:var(--accent-ink); align-self:center; }
.contact-row.checked .row-check{ background:var(--accent); border-color:var(--accent); }
.row-check svg{ width:11px; height:11px; }
.bulk-bar{ flex-shrink:0; flex-direction:column; gap:8px; padding:10px 14px 10px 18px; border-top:1px solid var(--line); background:var(--paper-sunken); animation:popIn .15s var(--ease); }
.bulk-top{ display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-soft); }
.bulk-top b{ color:var(--ink); font-family:'IBM Plex Mono',monospace; }
.bulk-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.bulk-actions select{ flex:1; min-width:110px; padding:5px 7px; font-size:12px; }

/* Team */
.team-card{ border:1px solid var(--line); border-radius:var(--radius-md); padding:14px 16px; display:flex; flex-direction:column; gap:10px; background:var(--paper-sunken); }
.team-head{ display:flex; align-items:center; gap:8px; }
.team-head h3{ font-size:15px; flex:1; }
.role-badge{ font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); border:1px solid var(--line-strong); border-radius:999px; padding:1px 8px; }
.role-badge.owner{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, transparent); }
.member-list{ display:flex; flex-direction:column; }
.member{ display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); font-size:13px; }
.member:last-child{ border-bottom:none; }
.member-id{ flex:1; min-width:0; }
.member-id small{ color:var(--ink-faint); font-size:11.5px; }
.member .icon-btn{ width:24px; height:24px; }

/* Smart sort: toolbar, group headers, local-time badge */
.sort-row{ display:flex; gap:6px; align-items:center; padding:8px 16px 8px 18px; border-bottom:1px solid var(--line); }
.sort-row .seg{ display:flex; background:var(--paper-sunken); border:1px solid var(--line-strong); border-radius:var(--radius-sm); padding:2px; gap:2px; flex-shrink:0; }
.sort-row .seg button{ background:none; border:0; color:var(--ink-soft); font:inherit; font-size:12px; padding:4px 9px; border-radius:calc(var(--radius-sm) - 2px); cursor:pointer; }
.sort-row .seg button:hover{ color:var(--ink); }
.sort-row .seg button.on{ background:var(--accent-soft); color:var(--accent); font-weight:600; }
.sort-row select{ flex:1; min-width:0; font-size:12px; padding:4px 6px; }
.list-group-hdr{ position:sticky; top:-8px; z-index:1; display:flex; justify-content:space-between; gap:8px; padding:7px 10px 5px; margin:6px 0 2px; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); background:var(--paper); border-bottom:1px solid var(--line); }
.list-group-hdr .n{ font-family:'IBM Plex Mono',monospace; color:var(--ink-faint); }
.lt-badge{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; padding:1px 5px; border-radius:4px; margin-left:auto; margin-right:6px; flex-shrink:0; }
.lt-badge.open{ color:var(--accent); background:var(--accent-soft); }
.lt-badge.soon{ color:var(--gold, #E5B454); background:color-mix(in srgb, var(--gold, #E5B454) 14%, transparent); }
.lt-badge.closed{ color:var(--ink-faint); background:color-mix(in srgb, var(--ink-faint) 12%, transparent); }
.row-bottom .lt-badge + .pill, .row-bottom .lt-badge + .cb-badge{ margin-left:0; }
.list-more, .list-less{ padding:10px; text-align:center; font-size:12px; color:var(--ink-faint); cursor:pointer; }
.list-more:hover, .list-less:hover{ color:var(--ink-soft); }
.contact-row{ content-visibility:auto; contain-intrinsic-size:auto 58px; }

.status-show{ display:flex; align-items:center; gap:4px; font-size:11.5px; color:var(--ink-soft); flex-shrink:0; cursor:pointer; }

.xlist.compact{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 6px; padding:6px 10px; max-height:none; font-size:12.5px; }
.xlist.compact .xl-name{ margin-left:0; font-size:12.5px; font-weight:600; }
.xl-sep{ color:var(--ink-faint); }

.shared-badge{ font-size:10.5px; color:var(--purple); white-space:nowrap; flex-shrink:0; }

/* =====================================================================
   Motion and the new Stats
   Everything that moves animates transform or opacity only, so it runs on
   the compositor and never makes the CRM itself redraw. Off with
   Settings → Motion.
   ===================================================================== */
:root{
  --o1:#3987e5; --o2:#d95926; --o3:#199e70; --o4:#c98500; --o5:#d55181; --o6:#008300;   /* validated in this order */
}
body.light-mode{
  --o1:#2a78d6; --o2:#eb6834; --o3:#1baf7a; --o4:#eda100; --o5:#e87ba4; --o6:#008300;
}
.o1{ background:var(--o1); } .o2{ background:var(--o2); } .o3{ background:var(--o3); }
.o4{ background:var(--o4); } .o5{ background:var(--o5); } .o6{ background:var(--o6); }

/* A slow light drifting behind the Stats panel. */
#statsModal .modal-box{ position:relative; overflow:hidden; isolation:isolate; }
#statsModal .modal-box::before{
  content:''; position:absolute; z-index:-1; width:620px; height:620px; top:-320px; right:-180px; pointer-events:none;
  background:radial-gradient(closest-side, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  animation:drift 18s ease-in-out infinite alternate; will-change:transform;
}
@keyframes drift{ to{ transform:translate(-260px, 200px) scale(1.25); } }
/* The goal bar has a sheen sliding across it while you're working toward it. */
.goal-track{ position:relative; overflow:hidden; }
.goal-row:not(.met) .goal-track::after{
  content:''; position:absolute; inset:0; width:40%; pointer-events:none;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  animation:sheen 2.8s ease-in-out infinite; will-change:transform;
}
@keyframes sheen{ from{ transform:translateX(-120%); } to{ transform:translateX(320%); } }

body.no-motion #statsModal .modal-box::before, body.no-motion .goal-track::after, body.no-motion .animate *, body.no-motion .live-pill i{ animation:none !important; }


/* ---- Stats: header ---- */
.shift-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:2px 0 -2px; }
.shift-title{ font-size:15px; font-weight:700; letter-spacing:-.01em; color:var(--ink); }
.shift-sub{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; font-family:'IBM Plex Mono',monospace; }
.live-pill{ display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); border:1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding:4px 10px; border-radius:999px; }
.live-pill i{ width:7px; height:7px; border-radius:50%; background:var(--accent); animation:livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(.55); opacity:.45; } }

/* ---- tiles ---- */
.tiles.tiles6{ grid-template-columns:repeat(auto-fit, minmax(118px, 1fr)); }
.tiles6 .tile{ position:relative; transition:transform .18s var(--ease), border-color .18s var(--ease); }
.tiles6 .tile:hover{ transform:translateY(-2px); border-color:var(--line-strong); }
.tiles6 .tile-value{ font-size:22px; }
.tiles6 .tile-sub{ font-size:11px; }
.animate .tile{ animation:riseIn .5s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i) * 45ms); }
@keyframes riseIn{ from{ opacity:0; transform:translateY(10px); } }

/* ---- main chart ---- */
.chart-card{ position:relative; }
.chart-card.big{ padding:16px 18px 12px; }
.chart-head{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.chart-head .chart-title{ margin:0 auto 0 0; }
.seg-ctl{ display:inline-flex; background:var(--paper-sunken); border:1px solid var(--line-strong); border-radius:999px; padding:2px; }
.seg-ctl button{ background:none; border:0; font:inherit; font-size:11.5px; color:var(--ink-soft); padding:3px 10px; border-radius:999px; cursor:pointer; transition:background .15s, color .15s; }
.seg-ctl button.on{ background:var(--accent-soft); color:var(--accent); font-weight:600; }
.legend{ display:flex; flex-wrap:wrap; gap:4px 14px; font-size:11.5px; color:var(--ink-soft); margin:2px 0 10px; }
.legend span{ display:inline-flex; align-items:center; gap:6px; }
.legend b{ color:var(--ink); font-family:'IBM Plex Mono',monospace; font-weight:600; }
.sw{ display:inline-block; width:9px; height:9px; border-radius:2px; flex-shrink:0; }
.tl{ display:grid; grid-template-columns:28px 1fr; gap:6px; }
.tl-y{ display:flex; flex-direction:column; justify-content:space-between; height:190px; font-size:10px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; text-align:right; transform:translateY(-5px); }
.tl-plot{ position:relative; }
.tl-grid{ position:absolute; inset:0 0 auto 0; height:190px; display:flex; flex-direction:column; justify-content:space-between; pointer-events:none; }
.tl-grid i{ display:block; border-top:1px solid var(--line); }
.tl-grid i:last-child{ border-top-color:var(--line-strong); }
.tl-cols{ position:relative; height:190px; display:grid; grid-template-columns:repeat(var(--n), 1fr); gap:2px; align-items:end; }
.tl-col{ height:100%; display:flex; align-items:flex-end; justify-content:center; background:none; border:0; padding:0; cursor:pointer; border-radius:4px; transition:background .12s; }
.tl-col:hover{ background:color-mix(in srgb, var(--ink) 6%, transparent); }
.tl-col.sel{ background:color-mix(in srgb, var(--accent) 12%, transparent); box-shadow:inset 0 -2px 0 var(--accent); }
.tl-col.empty{ cursor:default; }
.tl-stack{ width:min(100%, 26px); display:flex; flex-direction:column-reverse; gap:2px; border-radius:4px 4px 0 0; overflow:hidden; transform-origin:bottom; transition:opacity .15s; }
.tl-stack .seg{ min-height:2px; }
.tl-cols:hover .tl-col:not(:hover) .tl-stack{ opacity:.55; }
.animate .tl-stack{ animation:growUp .6s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i) * 10ms + 120ms); }
@keyframes growUp{ from{ transform:scaleY(0); } }
.tl-now{ position:absolute; top:-6px; height:196px; border-left:1.5px dashed var(--accent); pointer-events:none; }
.tl-now span{ position:absolute; top:-12px; left:-12px; font-size:9.5px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.06em; }
.tl-x{ position:relative; height:18px; margin-top:4px; }
.tl-x span{ position:absolute; font-size:10px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; white-space:nowrap; }
.tl-tip{ position:absolute; left:0; top:0; z-index:5; width:180px; pointer-events:none; background:var(--paper-raised); border:1px solid var(--line-strong); border-radius:var(--radius-sm); padding:9px 11px; box-shadow:0 12px 32px rgba(0,0,0,.35); font-size:12px; color:var(--ink-soft); }
.tip-title{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-faint); margin-bottom:4px; }
.tip-big{ color:var(--ink); margin-bottom:6px; } .tip-big b{ font-family:'IBM Plex Mono',monospace; }
.tip-row{ display:flex; align-items:center; gap:7px; padding:1px 0; } .tip-row b{ margin-left:auto; color:var(--ink); font-family:'IBM Plex Mono',monospace; }
.tip-foot{ margin-top:6px; padding-top:6px; border-top:1px solid var(--line); font-size:11.5px; }

/* ---- heatmap ---- */
.hm{ display:flex; flex-direction:column; gap:2px; overflow-x:auto; }
.hm-row{ display:grid; grid-template-columns:62px repeat(24, minmax(14px, 1fr)); gap:2px; align-items:center; }
.hm-head span{ font-size:9.5px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; white-space:nowrap; }
.hm-day{ font-size:11px; color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; }
.hm-cell{ height:18px; border:0; padding:0; border-radius:3px; cursor:pointer; background:color-mix(in srgb, var(--o1) calc(var(--v) * 100%), var(--paper-sunken)); transition:transform .12s; }
.hm-cell:hover{ transform:scale(1.18); box-shadow:0 0 0 2px var(--paper-raised); }
.animate .hm-row{ animation:fadeIn .5s both; }

/* ---- status bars, hour table, filter chip ---- */
.hbar-row[data-status]{ cursor:pointer; border-radius:6px; padding:4px 6px; margin:0 -6px; transition:background .12s; }
.hbar-row[data-status]:hover{ background:var(--paper-hover); }
.hbar-fill{ width:100%; transform:scaleX(var(--w)); transform-origin:left; border-radius:0 4px 4px 0; }
.animate .hbar-fill{ animation:growRight .7s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i) * 40ms + 200ms); }
@keyframes growRight{ from{ transform:scaleX(0); } }
.hour-table-wrap{ max-height:300px; }
.hour-table tbody tr{ cursor:pointer; }
.hour-table tbody tr.sel td{ background:var(--accent-soft); }
.mini-bar{ display:inline-block; width:36px; height:6px; margin-right:7px; border-radius:3px; background:var(--o1); transform:scaleX(var(--w)); transform-origin:left; vertical-align:middle; opacity:.85; }
.filter-chip{ display:inline-flex; align-items:center; gap:6px; margin-left:8px; font:inherit; font-size:11.5px; color:var(--accent); background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius:999px; padding:2px 10px; cursor:pointer; }

/* ---- every list ---- */
.across-top{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.across-top select{ min-width:180px; }
.across-table tbody tr{ cursor:pointer; }
.across-notes{ color:var(--ink-soft); max-width:280px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.status-group-input{ max-width:150px; font-size:12px; padding:5px 6px; flex-shrink:0; }

#statsModal .modal-box.wide{ max-width:1180px; width:calc(100vw - 48px); }
.tiles.tiles6{ grid-template-columns:repeat(7, minmax(0, 1fr)); }
@media (max-width: 1000px){ .tiles.tiles6{ grid-template-columns:repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px){ .tiles.tiles6{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* Stats header: room between the title and the tiles */
.shift-head{ align-items:center; margin:6px 0 4px; }
/* Website preview: the whole area is the site; a small label shows on hover */
.preview-frame-box{ position:relative; cursor:pointer; }
.frame-open{ position:absolute; top:8px; right:8px; font-size:11.5px; font-family:'IBM Plex Mono',monospace; color:var(--ink-soft); background:var(--paper-raised); border:1px solid var(--line-strong); border-radius:999px; padding:3px 10px; pointer-events:none; opacity:0; transform:translateY(-3px); transition:opacity .15s, transform .15s; }
.preview-frame-box:hover .frame-open{ opacity:1; transform:none; }

/* Show notes / Show list live in the layout now, so they can't cover the header */
.head-actions .panel-rail-toggle{ position:static; box-shadow:none; padding:5px 11px; font-size:12px; }
.head-actions .panel-rail-toggle:hover{ transform:none; }
.list-inline-toggle{ display:none; align-items:center; gap:5px; font:inherit; font-size:11px; color:var(--ink-soft); background:var(--paper-sunken); border:1px solid var(--line-strong); border-radius:999px; padding:2px 9px; cursor:pointer; }
.list-inline-toggle:hover{ color:var(--ink); border-color:var(--accent); }
.app.collapsed .list-inline-toggle{ display:inline-flex; }
.app.collapsed:has(.detail-head) .rail-toggle{ display:none; }

/* Niche menu */
.sort-row{ position:relative; }
.nf{ position:relative; flex:1; min-width:0; }
.nf-btn{ width:100%; display:flex; align-items:center; gap:7px; font:inherit; font-size:12px; color:var(--ink-soft); background:var(--paper-sunken); border:1px solid var(--line-strong); border-radius:var(--radius-sm); padding:5px 9px; cursor:pointer; transition:border-color .15s, color .15s; }
.nf-btn:hover, .nf.open .nf-btn{ border-color:var(--accent); color:var(--ink); }
.nf-btn.set{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 45%, transparent); background:var(--accent-soft); }
.nf-label{ flex:1; min-width:0; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.nf-count{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-faint); }
.nf-btn svg{ flex-shrink:0; transition:transform .18s var(--ease); }
.nf.open .nf-btn svg{ transform:rotate(180deg); }
.nf-pop{ position:absolute; top:calc(100% + 6px); left:0; right:-60px; min-width:250px; z-index:60; background:var(--paper-raised); border:1px solid var(--line-strong); border-radius:var(--radius-md); box-shadow:0 18px 44px rgba(0,0,0,.6); padding:6px; transform-origin:top left; animation:nfIn .16s cubic-bezier(.2,.8,.2,1); }
@keyframes nfIn{ from{ opacity:0; transform:translateY(-4px) scale(.98); } }
.nf-pop input{ width:100%; margin-bottom:6px; font-size:12.5px; padding:6px 9px; }
.nf-list{ max-height:330px; overflow-y:auto; scrollbar-width:thin; }
.nf-sep{ height:1px; background:var(--line); margin:4px 2px; }
.nf-item{ width:100%; display:grid; grid-template-columns:14px 1fr 46px 34px; align-items:center; gap:8px; font:inherit; font-size:12.5px; color:var(--ink-soft); background:none; border:0; border-radius:6px; padding:6px 8px; cursor:pointer; text-align:left; }
.nf-item:hover{ background:var(--paper-hover); color:var(--ink); }
.nf-item.on{ color:var(--accent); }
.nf-item[hidden]{ display:none; }
.nf-check{ display:flex; color:var(--accent); }
.nf-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nf-bar{ height:4px; border-radius:2px; background:var(--line); overflow:hidden; }
.nf-bar i{ display:block; height:100%; background:var(--o1); transform-origin:left; border-radius:2px; }
.nf-item.on .nf-bar i{ background:var(--accent); }
.nf-n{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-faint); text-align:right; }

/* List picker */
#planSelect{ display:none; }
.pm{ flex:1; min-width:0; }
.pm-btn{ height:34px; font-size:13px; }
.pm-btn .nf-label{ font-weight:600; color:var(--ink); }
.pm-btn > svg:first-child{ color:var(--purple); flex-shrink:0; }
.pm-pop{ right:auto; width:300px; }
.pm-head{ display:flex; align-items:center; gap:6px; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-faint); padding:8px 8px 4px; }
.pm-head svg{ color:var(--purple); }
.pm-head span{ margin-left:auto; font-family:'IBM Plex Mono',monospace; font-weight:500; }
.pm-group + .pm-group{ border-top:1px solid var(--line); margin-top:4px; }
.pm-group[hidden]{ display:none; }
.pm-item{ grid-template-columns:14px 1fr auto; }
.pm-meta{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--ink-faint); white-space:nowrap; }
.pm-new{ width:100%; display:flex; align-items:center; gap:7px; margin-top:6px; padding:7px 8px; font:inherit; font-size:12.5px; color:var(--accent); background:none; border:0; border-top:1px solid var(--line); cursor:pointer; border-radius:0 0 6px 6px; }
.pm-new:hover{ background:var(--accent-soft); }

/* Icon A in the corner */
.brand-mark{ background:#000; border:1px solid #1d2a23; overflow:hidden; }
body.light-mode .brand-mark{ background:#000; }
/* Menus: shorter, and kept inside the sidebar so nothing shifts sideways */
.nf-pop{ right:0; left:0; min-width:0; }
.nf-list{ max-height:165px; overscroll-behavior:contain; }
.pm-pop{ width:auto; right:auto; min-width:250px; max-width:calc(320px - 32px); }
.pm-pop .nf-list{ max-height:215px; }
.sidebar{ overflow-x:hidden; }
/* Stats: snappier */
.animate .tile{ animation-duration:.28s; animation-delay:calc(var(--i) * 18ms); }
.animate .tl-stack{ animation-duration:.32s; animation-delay:calc(var(--i) * 3ms); }
.animate .hbar-fill{ animation-duration:.35s; animation-delay:calc(var(--i) * 15ms); }
.animate .hm-row{ animation-duration:.25s; }
#statsModal .modal-box::before{ will-change:auto; }

/* Niche menu: as wide as the sort row, still inside the sidebar */
.sort-row .nf{ position:static; }
.sort-row .nf-pop{ left:14px; right:14px; top:calc(100% - 2px); }

/* Team window: renaming */
.member-rename{ width:24px; height:24px; flex-shrink:0; opacity:.55; }
.member:hover .member-rename{ opacity:1; }
.rename-input{ width:100%; font-size:13px; padding:3px 7px; }

.member-closes{ font-size:11.5px; color:var(--ink-faint); white-space:nowrap; }
.member-closes b{ font-family:'IBM Plex Mono',monospace; font-weight:600; }
.member-closes.has{ color:var(--accent); }
.invite-name{ flex:0 0 auto; }

/* A teammate already called this number */
.dupe-banner{ margin:0 0 10px; padding:7px 11px; border-radius:var(--radius-sm); font-size:12.5px; color:var(--gold); background:var(--gold-soft); border:1px solid color-mix(in srgb, var(--gold) 40%, transparent); }

/* Activity: KPI charts and rep check */
.kpi-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.kpi-card{ padding:12px 14px 8px; }
.kpi-big{ font-family:'IBM Plex Mono',monospace; font-size:24px; font-weight:600; margin-top:3px; color:var(--ink); }
.kpi-big small{ font-size:11px; font-weight:500; color:var(--ink-faint); font-family:inherit; }
.kpi-svg{ width:100%; height:92px; display:block; margin-top:6px; }
.rep-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:10px; margin-top:10px; }
.rep-card{ text-align:left; background:var(--paper-sunken); border:1px solid var(--line); border-radius:var(--radius-md); padding:10px 12px; color:var(--ink); font:inherit; cursor:pointer; display:flex; flex-direction:column; gap:7px; transition:border-color .15s var(--ease), transform .15s var(--ease); }
.rep-card:hover{ border-color:var(--line-strong); transform:translateY(-1px); }
.rep-card.sel{ border-color:var(--accent); box-shadow:var(--glow); }
.rep-top{ display:flex; align-items:center; gap:8px; font-size:13px; min-width:0; }
.rep-top b{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rep-state{ font-size:11.5px; color:var(--ink-soft); }
.rep-state.on{ color:var(--accent); }
.rep-state.idle{ color:var(--gold); }
.rep-state.quiet{ color:var(--ink-faint); }
.rep-bar{ height:4px; border-radius:2px; background:var(--line); overflow:hidden; }
.rep-bar i{ display:block; height:100%; background:var(--accent); border-radius:2px; }
.rep-nums{ display:grid; grid-template-columns:repeat(5, 1fr); gap:4px; }
.rep-nums div{ display:flex; flex-direction:column; min-width:0; }
.rep-nums b{ font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:600; }
.rep-nums small{ font-size:9.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.05em; }
.rep-spark{ display:flex; align-items:flex-end; gap:2px; height:26px; }
.rep-spark i{ flex:1; max-width:14px; background:var(--accent); border-radius:1px; min-width:2px; }
@media (max-width:720px){ .kpi-grid{ grid-template-columns:1fr; } }

/* Profile photos */
.avatar{ overflow:hidden; }
.avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.photo-links{ display:block; font-size:11px; color:var(--ink-faint); }
.photo-links a{ color:var(--ink-soft); cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.photo-links a:hover{ color:var(--accent); }

/* Team chat */
.chat-btn{ position:relative; }
.chat-badge{ position:absolute; top:-4px; right:-4px; min-width:15px; height:15px; padding:0 4px; border-radius:8px; background:var(--accent); color:var(--accent-ink); font:600 9.5px/15px 'IBM Plex Mono',monospace; text-align:center; font-style:normal; }
.chat-box{ width:min(560px, 96vw); max-height:86vh; display:flex; flex-direction:column; }
.chat-body{ padding:12px 16px 16px; display:flex; flex-direction:column; min-height:0; flex:1; }
.chat-top{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.chat-team-name{ font-size:13px; }
.chat-pill{ display:inline-block; min-width:16px; padding:0 5px; border-radius:8px; background:var(--gold); color:#1a1300; font:600 10px/16px 'IBM Plex Mono',monospace; text-align:center; }
#chatMain{ display:flex; flex-direction:column; min-height:0; flex:1; }
.msg-list{ height:min(52vh, 420px); overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:4px 2px 8px; }
.msg-day{ align-self:center; font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.06em; margin:6px 0 2px; }
.msg{ display:flex; gap:8px; align-items:flex-end; max-width:86%; }
.msg.mine{ align-self:flex-end; flex-direction:row-reverse; }
.msg-bubble{ background:var(--paper-sunken); border:1px solid var(--line); border-radius:12px 12px 12px 4px; padding:6px 10px; min-width:0; }
.msg.mine .msg-bubble{ background:var(--accent-soft); border-color:color-mix(in srgb, var(--accent) 30%, transparent); border-radius:12px 12px 4px 12px; }
.msg-who{ font-size:11px; color:var(--ink-soft); font-weight:600; margin-bottom:1px; }
.msg-text{ font-size:13.5px; white-space:pre-wrap; word-break:break-word; line-height:1.4; }
.msg-time{ font-size:10px; color:var(--ink-faint); margin-top:2px; }
.msg-del{ cursor:pointer; margin-left:6px; opacity:0; text-decoration:underline; }
.msg:hover .msg-del{ opacity:1; }
.chat-compose{ display:flex; gap:8px; align-items:flex-end; margin-top:8px; }
.chat-compose textarea{ flex:1; resize:none; max-height:110px; }
.report-form select, .report-form textarea{ width:100%; }
.report-list{ display:flex; flex-direction:column; gap:8px; max-height:min(58vh, 460px); overflow-y:auto; }
.report{ border:1px solid var(--line); border-radius:var(--radius-md); padding:10px 12px; background:var(--paper-sunken); }
.report.open{ border-color:color-mix(in srgb, var(--gold) 45%, transparent); }
.report-head{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; font-size:13px; }
.report-reason{ color:var(--gold); font-size:12px; }
.report-when{ margin-left:auto; font-size:11px; color:var(--ink-faint); }
.report-note{ font-size:13px; color:var(--ink-soft); margin:6px 0; white-space:pre-wrap; }
.report-foot{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:6px; }
.report-foot small{ color:var(--ink-faint); font-size:11px; }

.chat-btn{ color:var(--accent); background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.chat-btn:hover{ background:color-mix(in srgb, var(--accent) 22%, transparent); color:var(--accent-hover); }
.admin-self{ display:flex; align-items:center; gap:8px; margin:8px 0 4px; }
.head-icons .chat-btn{ border-color:color-mix(in srgb, var(--accent) 40%, transparent); }
/* Header: title and all five icons on one line, no empty corners. The lead count lives in the list below, so only a team name (if any) shows under the title. */
.sidebar-head{ padding:16px 12px 12px 14px; gap:6px; flex-wrap:nowrap; }
.brand{ gap:8px; flex:1 1 auto; }
.brand-mark{ width:26px; height:26px; border-radius:8px; }
.brand-mark svg{ width:24px; height:24px; }
.brand h1{ font-size:16px; overflow:hidden; text-overflow:ellipsis; }
.brand .sub:empty{ display:none; }
.head-icons{ gap:3px; margin-left:auto; }
.head-icons .icon-btn{ width:26px; height:26px; }
.goal-bar:empty{ display:none; }

/* Seen status */
.msg-seen{ display:flex; align-items:center; justify-content:flex-start; gap:3px; margin:-4px 0 0 34px; min-height:14px; }
.msg-seen.mine{ align-self:flex-end; margin:-4px 2px 0 0; flex-direction:row-reverse; }
.seen-txt{ font-size:10.5px; color:var(--ink-faint); }
.seen-txt.on{ color:var(--accent); }
.avatar.xs.seen-face{ width:14px; height:14px; font-size:7px; margin-left:0; }

/* Emoji picker */
.emoji-btn{ width:34px; height:34px; font-size:17px; flex-shrink:0; }
.emoji-panel{ margin-top:8px; padding:8px 10px; border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--paper-raised); max-height:170px; overflow-y:auto; }
.emoji-cat{ font-size:10px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.06em; margin:4px 0 2px; }
.emoji-row{ display:flex; flex-wrap:wrap; gap:2px; }
.emoji-row button{ width:30px; height:30px; font-size:18px; background:none; border:0; border-radius:6px; cursor:pointer; }
.emoji-row button:hover{ background:var(--paper-hover); }

/* ===== Chat extras: scrolling, media, voice, reactions, replies, pins, typing, trippy logo ===== */
.msg-wrap{ position:relative; }
.msg-list{ scroll-behavior:auto; overscroll-behavior:contain; }
.msg-day{ position:sticky; top:0; z-index:2; background:color-mix(in srgb, var(--paper-raised) 88%, transparent); padding:2px 10px; border-radius:999px; backdrop-filter:blur(4px); }
.msg-unread{ display:flex; align-items:center; gap:10px; color:var(--accent); font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; margin:4px 0; }
.msg-unread::before, .msg-unread::after{ content:''; flex:1; height:1px; background:color-mix(in srgb, var(--accent) 45%, transparent); }
.jump-btn{ position:absolute; right:12px; bottom:10px; z-index:3; display:flex; align-items:center; gap:4px; padding:6px 11px; border-radius:999px; background:var(--accent); color:var(--accent-ink); font-weight:600; font-size:13px; box-shadow:var(--shadow-md); }
.jump-btn[hidden]{ display:none; }
.jump-btn b{ font-size:11.5px; }
.msg{ position:relative; }
.msg.flash .msg-bubble{ animation:msgflash 1.3s var(--ease); }
@keyframes msgflash{ 0%,60%{ box-shadow:0 0 0 2px var(--accent); } 100%{ box-shadow:0 0 0 0 transparent; } }
.msg-bubble{ position:relative; max-width:100%; }
.msg-actions{ position:absolute; top:-14px; right:6px; display:none; gap:1px; padding:2px; border:1px solid var(--line-strong); border-radius:999px; background:var(--paper-raised); box-shadow:var(--shadow-sm); z-index:2; }
.msg.mine .msg-actions{ right:auto; left:6px; }
.msg:hover .msg-actions{ display:flex; }
.msg-actions button{ background:none; border:0; width:24px; height:24px; border-radius:50%; font-size:13px; line-height:1; cursor:pointer; }
.msg-actions button:hover{ background:var(--paper-hover); }
.msg-quote{ display:flex; flex-direction:column; gap:1px; border-left:3px solid var(--accent); padding:2px 8px; margin-bottom:5px; border-radius:4px; background:rgba(255,255,255,.04); cursor:pointer; font-size:11.5px; color:var(--ink-soft); }
.msg-quote b{ color:var(--accent); font-size:11px; }
.msg-quote span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:260px; }
.msg-img{ display:block; max-width:min(260px, 100%); max-height:260px; border-radius:10px; margin-bottom:4px; cursor:zoom-in; background:var(--paper-sunken); min-width:80px; min-height:60px; object-fit:cover; }
.voice{ display:flex; align-items:center; gap:8px; min-width:200px; padding:2px 0; }
.vplay{ width:30px; height:30px; border-radius:50%; background:var(--accent); color:var(--accent-ink); font-size:12px; flex-shrink:0; }
.vbar{ flex:1; height:4px; background:var(--line-strong); border-radius:2px; overflow:hidden; }
.vbar i{ display:block; width:0; height:100%; background:var(--accent); }
.vtime{ font:500 11px 'IBM Plex Mono',monospace; color:var(--ink-soft); min-width:32px; text-align:right; }
.rchips{ display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.rchip{ display:inline-flex; align-items:center; gap:4px; padding:1px 7px; border-radius:999px; background:var(--paper-hover); border:1px solid var(--line-strong); font-size:13px; color:var(--ink); }
.rchip b{ font-size:11px; color:var(--ink-soft); }
.rchip.mine{ border-color:var(--accent); background:var(--accent-soft); }
.react-pop{ position:absolute; bottom:-34px; left:6px; z-index:5; display:flex; gap:2px; padding:3px 5px; border:1px solid var(--line-strong); border-radius:999px; background:var(--paper-raised); box-shadow:var(--shadow-md); }
.react-pop button{ background:none; border:0; font-size:18px; width:30px; height:30px; border-radius:50%; cursor:pointer; }
.react-pop button:hover{ background:var(--paper-hover); transform:scale(1.15); }
.pin-bar{ display:flex; align-items:center; gap:8px; padding:6px 10px; margin-bottom:6px; border:1px solid color-mix(in srgb, var(--gold) 40%, transparent); background:var(--gold-soft); border-radius:var(--radius-sm); font-size:12.5px; }
.pin-bar[hidden]{ display:none; }
.pin-main{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.pin-bar small{ color:var(--ink-faint); }
.typing-line{ min-height:16px; font-size:11.5px; color:var(--ink-faint); padding:2px 4px 0; font-style:italic; }
.reply-strip, .pending{ display:flex; align-items:center; gap:8px; padding:6px 10px; margin-top:6px; border:1px solid var(--line-strong); border-left:3px solid var(--accent); border-radius:var(--radius-sm); background:var(--paper-sunken); font-size:12px; color:var(--ink-soft); }
.reply-strip[hidden], .pending[hidden]{ display:none; }
.reply-strip span, .pending span{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pending img{ width:38px; height:38px; object-fit:cover; border-radius:6px; }
#chatMain.dragging{ outline:2px dashed var(--accent); outline-offset:-6px; }
.rec-bar{ display:none; align-items:center; gap:10px; margin-top:8px; padding:8px 12px; border:1px solid color-mix(in srgb, var(--red) 50%, transparent); border-radius:var(--radius-md); background:var(--red-soft); }
#chatMain.recording .rec-bar{ display:flex; }
#chatMain.recording .chat-compose, #chatMain.recording .emoji-panel, #chatMain.recording .reply-strip{ display:none; }
.rec-dot{ width:10px; height:10px; border-radius:50%; background:var(--red); animation:recpulse 1s ease-in-out infinite; }
@keyframes recpulse{ 50%{ opacity:.25; transform:scale(.8); } }
.rec-hint{ color:var(--ink-soft); font-size:12px; }
.lightbox{ position:fixed; inset:0; z-index:99999; background:rgba(0,0,0,.88); display:flex; align-items:center; justify-content:center; cursor:zoom-out; }
.lightbox img{ max-width:92vw; max-height:90vh; border-radius:8px; }
/* the Pine Peak Creatives logo at the top of the emoji picker */
.emoji-logo{ display:flex; justify-content:center; align-items:center; height:76px; overflow:hidden; transition:height .35s var(--ease), opacity .3s var(--ease), margin .35s var(--ease); }
.emoji-logo img{ height:62px; width:auto; user-select:none; }
.emoji-logo.gone{ height:0; opacity:0; margin:0; pointer-events:none; }
/* Chat window: fixed height that fits the screen; the message list takes whatever the composer leaves */
.chat-box{ height:min(680px, 88vh); max-height:none; }
.chat-body{ overflow:hidden; }
#chatMain{ flex:1; min-height:0; }
.msg-wrap{ flex:1; min-height:110px; display:flex; }
.msg-list{ flex:1; height:auto; min-height:0; }
.chat-compose, .reply-strip, .pending, .typing-line, .pin-bar, .rec-bar{ flex-shrink:0; }
.emoji-panel{ flex-shrink:0; max-height:min(190px, 30vh); }

/* Chat icons: line icons, tinted, no emoji glyphs */
.emoji-btn{ color:var(--ink-soft); width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; padding:0; flex-shrink:0; }
.emoji-btn:hover{ color:var(--accent); background:var(--accent-soft); }
#chatMain.recording #micBtn{ color:var(--red); }
.msg-actions button{ display:inline-flex; align-items:center; justify-content:center; color:var(--ink-soft); }
.msg-actions button:hover{ color:var(--accent); }
.vplay{ display:inline-flex; align-items:center; justify-content:center; padding:0; }
.vplay svg{ margin-left:1px; }
.pin-ic{ display:inline-flex; color:var(--gold); }
.pin-sm{ display:inline-flex; vertical-align:-2px; margin-right:3px; color:var(--gold); }
.jump-btn svg{ display:block; }
.reply-strip .icon-btn, .pending .icon-btn{ width:24px; height:24px; color:var(--ink-faint); display:inline-flex; align-items:center; justify-content:center; }

/* Emoji picker: category tabs and one smooth scrolling area */
.emoji-panel{ display:flex; flex-direction:column; padding:6px 8px 4px; max-height:min(250px, 38vh); overflow:hidden; }
.emoji-panel[hidden]{ display:none; }
.emoji-tabs{ display:flex; gap:2px; overflow-x:auto; flex-shrink:0; padding-bottom:4px; border-bottom:1px solid var(--line); scrollbar-width:none; }
.emoji-tabs::-webkit-scrollbar{ display:none; }
.emoji-tabs button{ background:none; border:0; color:var(--ink-faint); font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:999px; white-space:nowrap; cursor:pointer; }
.emoji-tabs button:hover{ color:var(--ink); }
.emoji-tabs button.on{ color:var(--accent); background:var(--accent-soft); }
.emoji-scroll{ position:relative; flex:1; min-height:0; overflow-y:auto; scroll-behavior:smooth; overscroll-behavior:contain; padding-top:2px; scrollbar-width:thin; }
.emoji-scroll .emoji-cat{ position:sticky; top:0; background:var(--paper-raised); z-index:1; padding:3px 2px; }

/* @mentions */
.mention{ color:var(--blue); font-weight:600; }
.mention.me{ color:var(--accent-ink); background:var(--accent); padding:0 4px; border-radius:4px; }
.msg.mentions-me .msg-bubble{ box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.mention-pop{ display:flex; flex-direction:column; margin:4px 0 0; padding:4px; border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--paper-raised); box-shadow:var(--shadow-md); flex-shrink:0; }
.mention-pop[hidden]{ display:none; }
.mention-pop button{ display:flex; align-items:center; gap:8px; background:none; border:0; color:var(--ink); text-align:left; padding:5px 8px; border-radius:6px; font-size:13px; cursor:pointer; }
.mention-pop button:hover, .mention-pop button.on{ background:var(--accent-soft); color:var(--accent); }

/* Pine Peak Creatives touches: the logo in the chat header, a pine mark behind the messages, custom reactions, double-tap heart */
.modal-head .head-logo{ flex:1; display:flex; justify-content:center; align-items:center; height:34px; min-width:0; overflow:hidden; transition:opacity .35s var(--ease), max-width .35s var(--ease); }
.head-logo img{ height:32px; width:auto; max-width:100%; user-select:none; }
.head-logo.gone{ opacity:0; pointer-events:none; }
.msg-list{ position:relative; z-index:1; touch-action:manipulation; }
.cemoji{ vertical-align:-4px; display:inline-block; }
.msg-text .cemoji{ margin:0 1px; }
.emoji-row button .cemoji{ vertical-align:middle; }
.react-pop{ flex-direction:column; gap:2px; border-radius:var(--radius-md); }
.react-pop > div{ display:flex; gap:2px; }
.react-pop .react-custom{ border-top:1px solid var(--line); padding-top:2px; }
.react-pop .react-custom button{ display:inline-flex; align-items:center; justify-content:center; }
.rchip .cemoji{ vertical-align:-3px; }
.like-pop{ position:absolute; left:50%; top:50%; margin:-23px 0 0 -23px; pointer-events:none; animation:likepop .8s var(--ease) forwards; z-index:6; }
@keyframes likepop{ 0%{ transform:scale(.2); opacity:0; } 25%{ transform:scale(1.25); opacity:1; } 60%{ transform:scale(1); opacity:1; } 100%{ transform:scale(1) translateY(-16px); opacity:0; } }
body.no-motion .like-pop{ animation:none; opacity:0; }
.msg-bubble{ user-select:text; }

/* Sound waves: live while recording, bars in a voice note, dancing at the playhead while it plays */
.rec-wave{ flex:1; min-width:0; height:30px; color:var(--red); display:block; }
.vwave{ flex:1; display:flex; align-items:center; gap:2px; height:30px; min-width:0; }
.vwave i{ flex:1; max-width:4px; min-height:3px; border-radius:2px; background:var(--line-strong); transition:background .15s var(--ease); transform-origin:center; }
.vwave i.played{ background:var(--accent); }
.vwave i.live{ background:var(--accent-hover); animation:wavebounce .45s ease-in-out infinite alternate; }
.vwave i.live:nth-child(odd){ animation-duration:.6s; animation-delay:-.2s; }
@keyframes wavebounce{ from{ transform:scaleY(.55); } to{ transform:scaleY(1.35); } }
body.no-motion .vwave i.live{ animation:none; }
.voice{ min-width:230px; }

/* Header logo stays */
.head-logo img{ height:38px; }
.modal-head .head-logo{ height:40px; }




.head-logo img{ display:block; }

/* Slimmer chat: tighter bubbles, and much slimmer voice notes */
.msg-list{ gap:4px; }
.msg{ max-width:80%; gap:6px; }
.msg-bubble{ padding:4px 9px 3px; border-radius:11px 11px 11px 3px; }
.msg.mine .msg-bubble{ border-radius:11px 11px 3px 11px; }
.msg-who{ font-size:10.5px; margin-bottom:0; }
.msg-text{ font-size:13px; line-height:1.32; }
.msg-time{ font-size:9.5px; margin-top:1px; }
.msg-quote{ padding:1px 7px; margin-bottom:3px; font-size:11px; }
.msg-quote b{ font-size:10.5px; }
.msg-img{ max-width:min(200px, 100%); max-height:200px; border-radius:8px; margin-bottom:2px; }
.rchips{ margin-top:3px; gap:3px; }
.rchip{ padding:0 6px; font-size:12px; }
.msg .avatar.sm{ width:20px; height:20px; font-size:9px; }
.msg-seen{ margin-top:-2px; min-height:12px; }
.voice{ min-width:0; width:176px; gap:6px; padding:0; }
.vplay{ width:24px; height:24px; }
.vplay svg{ width:10px; height:10px; }
.vwave{ height:22px; gap:1.5px; }
.vwave i{ max-width:3px; }
.vtime{ font-size:10px; min-width:26px; }
.msg-day{ font-size:9.5px; padding:1px 9px; margin:4px 0 0; }

/* Minimize button and the docked tab */
.modal-head .head-btns{ display:flex; gap:6px; align-items:center; }
.head-btns .btn-ghost svg{ display:block; }
.chat-dock{ position:fixed; right:18px; bottom:16px; z-index:90; display:flex; align-items:center; gap:9px; max-width:290px; padding:7px 8px 7px 11px; border:1px solid var(--line-strong); border-radius:999px; background:var(--paper-raised); color:var(--ink); box-shadow:var(--shadow-md); cursor:pointer; transition:transform .18s var(--ease), border-color .18s var(--ease); }
.chat-dock[hidden]{ display:none; }
.chat-dock:hover{ transform:translateY(-2px); border-color:var(--accent); }
.chat-dock.has-new{ border-color:var(--accent); box-shadow:var(--glow); animation:dockpulse 2.4s ease-in-out infinite; }
@keyframes dockpulse{ 50%{ box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow-md); } }
body.no-motion .chat-dock.has-new{ animation:none; }
.dock-mark{ width:20px; height:20px; flex-shrink:0; background:url('brand/pine-peak-mark.svg') center / contain no-repeat; }
.dock-text{ display:flex; flex-direction:column; min-width:0; line-height:1.2; }
.dock-text b{ font-size:12.5px; }
.dock-text small{ font-size:10.5px; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dock-text small:empty{ display:none; }
.dock-badge{ position:static; flex-shrink:0; }
.dock-x{ background:none; border:0; color:var(--ink-faint); font-size:16px; line-height:1; width:20px; height:20px; border-radius:50%; cursor:pointer; flex-shrink:0; }
.dock-x:hover{ background:var(--paper-hover); color:var(--ink); }
@media (max-width:560px){ .chat-dock{ right:10px; bottom:10px; } }

/* The docked tab can be dragged */
.chat-dock{ touch-action:none; user-select:none; cursor:grab; }
.chat-dock.dragging{ cursor:grabbing; transform:scale(1.04); box-shadow:var(--shadow-lg); transition:none; }
.dock-x{ cursor:pointer; }

/* Shift stats card at the bottom left while the chat is open */
.chat-stats{ position:fixed; left:18px; bottom:16px; z-index:1100; width:212px; padding:10px 12px; border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--paper-raised); box-shadow:var(--shadow-md); font-size:12px; }
.chat-stats[hidden]{ display:none; }
.cs-head{ display:flex; align-items:center; gap:7px; font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-faint); font-weight:600; margin-bottom:7px; }
.cs-live{ width:7px; height:7px; border-radius:50%; background:var(--accent); animation:recpulse 1.8s ease-in-out infinite; }
body.no-motion .cs-live{ animation:none; }
.cs-row{ display:grid; grid-template-columns:50px 1fr auto; align-items:center; gap:8px; margin:5px 0; color:var(--ink-soft); }
.cs-row b{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--ink); }
.cs-row b small{ font-size:10.5px; color:var(--ink-faint); font-weight:500; }
.cs-track{ height:5px; border-radius:3px; background:var(--line-strong); overflow:hidden; }
.cs-track i{ display:block; height:100%; background:var(--accent); border-radius:3px; transition:width .5s var(--ease); }
.cs-track i.pos{ background:var(--purple); }
.cs-row.met b{ color:var(--accent); }
.cs-foot{ display:flex; justify-content:space-between; gap:8px; margin-top:8px; padding-top:7px; border-top:1px solid var(--line); color:var(--ink-faint); font-size:11px; }
.cs-foot b{ color:var(--ink); font-family:'IBM Plex Mono',monospace; }
@media (max-width:900px){ .chat-stats{ display:none; } }


/* Unsent and edited messages, the editor, and the admin history view */
.msg-bubble.tomb{ background:transparent; border:1px dashed var(--line-strong); }
.msg-bubble.tomb .msg-text{ color:var(--ink-faint); font-style:italic; font-size:12px; }
.edited-tag, .hist-link{ color:var(--ink-faint); font-size:9.5px; font-style:italic; margin-left:4px; }
.hist-link{ cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.hist-link:hover{ color:var(--accent); }
.msg-edit textarea{ width:100%; min-width:200px; resize:none; font-size:13px; line-height:1.32; padding:5px 8px; }
.msg-edit-btns{ display:flex; align-items:center; gap:6px; margin-top:4px; }
.msg-edit-btns span{ flex:1; font-size:10px; color:var(--ink-faint); }
.hist-modal{ cursor:default; }
.hist-box{ width:min(440px, 92vw); max-height:80vh; overflow:auto; padding:14px 16px; border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--paper-raised); box-shadow:var(--shadow-lg); }
.hist-title{ font-weight:600; font-size:14px; margin-bottom:10px; }
.hist-title small{ color:var(--ink-faint); font-weight:400; margin-left:6px; font-size:11.5px; }
.hist-row{ padding:7px 10px; margin-bottom:6px; border-left:3px solid var(--line-strong); background:var(--paper-sunken); border-radius:6px; }
.hist-row.unsent{ border-left-color:var(--red); }
.hist-row.now{ border-left-color:var(--accent); }
.hist-meta{ font-size:10.5px; color:var(--ink-faint); margin-bottom:2px; }
.hist-body{ font-size:13px; white-space:pre-wrap; word-break:break-word; }
.hist-foot{ display:flex; justify-content:flex-end; margin-top:8px; }
.team-chat-row{ margin-top:10px; }

/* Reaction picker: floats above the page */
.react-pop{ position:fixed; z-index:100000; bottom:auto; right:auto; display:flex; flex-direction:column; gap:2px; padding:5px 6px; border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--paper-raised); box-shadow:var(--shadow-lg); }
.react-pop > div{ display:flex; gap:2px; }
.react-pop .react-custom{ border-top:1px solid var(--line); padding-top:3px; }
.react-pop button{ background:none; border:0; font-size:19px; width:32px; height:32px; border-radius:50%; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.react-pop button:hover{ background:var(--paper-hover); transform:scale(1.15); }

/* Edit / Unsend links: always visible, quiet until you point at them */
.msg-links{ display:inline-flex; gap:7px; margin-left:7px; }
.msg-links a{ color:var(--ink-faint); font-size:9.5px; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.msg-links a:hover{ color:var(--accent); }
.msg-links a[data-act="unsend"]:hover{ color:var(--red); }

/* Edit / Unsend links appear when you point at a message (always shown on touch screens, which have no hover) */
.msg-links{ opacity:0; transition:opacity .12s var(--ease); }
.msg:hover .msg-links, .msg:focus-within .msg-links{ opacity:1; }
@media (hover:none){ .msg-links{ opacity:1; } }

/* Lead bank: the # results panel and the full view */
.bank-panel{ flex:1; min-height:0; display:flex; flex-direction:column; padding:8px 14px 0 16px; }
.bank-panel[hidden]{ display:none; }
.bank-head{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; font-size:13px; }
.bank-head small{ color:var(--ink-faint); font-size:11.5px; }
.bank-meta{ font-size:10.5px; color:var(--ink-faint); margin:2px 0 6px; }
.bank-chips{ display:flex; flex-wrap:wrap; gap:5px; margin:8px 0; }
.bank-chip{ padding:3px 9px; border-radius:999px; border:1px solid var(--line-strong); background:var(--paper-sunken); color:var(--ink-soft); font-size:11.5px; cursor:pointer; }
.bank-chip:hover{ color:var(--accent); border-color:var(--accent); }
.bank-chip.all{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 45%, transparent); }
.bank-help{ font-size:12px; color:var(--ink-soft); line-height:1.6; }
.bank-rows{ flex:1; min-height:0; overflow-y:auto; margin:0 -6px; padding:0 6px 12px; overscroll-behavior:contain; scrollbar-width:thin; }
.bank-row{ display:block; width:100%; text-align:left; padding:7px 9px; margin-bottom:3px; border:1px solid transparent; border-radius:var(--radius-sm); background:none; color:var(--ink); cursor:pointer; }
.bank-row:hover, .bank-row.on{ background:var(--paper-hover); border-color:var(--line-strong); }
.br-top{ display:flex; align-items:center; gap:7px; font-size:13px; min-width:0; }
.br-top b{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.br-list{ margin-left:auto; font-size:10.5px; color:var(--ink-faint); max-width:42%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-shrink:0; }
.br-sub{ font-size:11.5px; color:var(--ink-soft); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.br-snip{ font-size:11.5px; color:var(--ink-soft); margin-top:3px; line-height:1.4; }
.bank-panel mark, .bank-table mark{ background:color-mix(in srgb, var(--gold) 35%, transparent); color:inherit; border-radius:2px; padding:0 1px; }
.bank-empty, .bank-more{ display:block; width:100%; padding:10px; text-align:center; font-size:12px; color:var(--ink-soft); background:none; border:0; cursor:pointer; }
.bank-more:hover{ color:var(--accent); }
.bank-box{ width:min(1080px, 96vw); height:min(86vh, 780px); display:flex; flex-direction:column; }
.bank-box .modal-head h2 small{ font:400 12px 'IBM Plex Sans',sans-serif; color:var(--ink-faint); margin-left:8px; }
.bank-ctl{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); }
.bank-ctl input[type=search]{ flex:1 1 260px; min-width:180px; }
.bank-ctl select{ max-width:190px; }
.bank-chk{ display:flex; align-items:center; gap:5px; font-size:12px; color:var(--ink-soft); white-space:nowrap; }
.bank-table-wrap{ flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
.bank-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.bank-table th{ position:sticky; top:0; z-index:1; background:var(--paper-raised); text-align:left; padding:7px 10px; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); border-bottom:1px solid var(--line-strong); }
.bank-table td{ padding:6px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
.bank-table tbody tr{ cursor:pointer; }
.bank-table tbody tr:hover{ background:var(--paper-hover); }
.bank-table .bt-list{ color:var(--ink-soft); max-width:170px; }
.bank-table .bt-email{ max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bank-table .bt-notes{ color:var(--ink-soft); max-width:300px; }
.bank-end{ text-align:center; padding:14px; font-size:12px; color:var(--ink-faint); }
@media (max-width:720px){ .bank-table .bt-notes, .bank-table .bt-email{ display:none; } }
.modal-box.bank-box{ width:min(1080px, 96vw); max-width:96vw; }

/* "All leads" folder at the top of the list picker */
.pm-item.pm-folder{ margin-bottom:6px; border-bottom:1px solid var(--line); border-radius:var(--radius-sm) var(--radius-sm) 0 0; }
.pm-item.pm-folder .nf-check{ color:var(--accent); }
.pm-item.pm-folder .nf-name{ font-weight:600; }

/* Lead's local time + Pakistan, next to the address */
.geo-strip .geo-time{ display:inline-flex; align-items:center; gap:10px; flex-wrap:wrap; }
.geo-strip .geo-time small{ font-weight:500; color:var(--ink-faint); font-size:11px; }
.geo-strip .geo-their{ cursor:help; }
.geo-strip .geo-their.late{ color:var(--gold); }
.geo-strip .geo-pk{ font-weight:500; color:var(--ink-soft); padding-left:10px; border-left:1px solid var(--line); cursor:help; }
.geo-strip .geo-late{ font-weight:500; color:var(--gold); font-size:11.5px; }
/* Pakistan + US zone clocks above the sidebar footer */
.world-clock{ flex-shrink:0; display:flex; justify-content:space-between; gap:6px; padding:7px 14px 7px 18px; border-top:1px solid var(--line); font-size:11px; color:var(--ink-soft); font-variant-numeric:tabular-nums; white-space:nowrap; }
.world-clock .wc{ cursor:help; }
.world-clock .wc b{ font-weight:600; color:var(--ink-faint); margin-right:4px; font-size:10px; letter-spacing:.04em; }
.world-clock .wc-home{ color:var(--ink); font-weight:600; }
.world-clock .wc-home b{ color:var(--accent); }
