/* ═══════════════════════════════════════════════════════════════
   EHB Power Dialer — Widget UI (refreshed)
   Narrow single-column layout for Zoho CRM sidebar / standalone
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg:        #09090b;
  --surface:   #18181b;
  --surface-2: #1f1f23;
  --card:      #121214;
  --card-hi:   #27272a;
  --border:    #27272a;
  --border-hi: #3f3f46;
  --accent:       #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft:  rgba(59,130,246,0.15);
  --ring:         rgba(59,130,246,0.55);   /* NEW additive token */
  --success:      #22c55e;
  --success-soft: rgba(34,197,94,0.14);
  --warning:      #f59e0b;
  --warning-soft: rgba(245,158,11,0.14);
  --danger:       #ef4444;
  --danger-soft:  rgba(239,68,68,0.14);
  --text:    #fafafa;
  --muted:   #a1a1aa;
  --muted-2: #71717a;
  --pill: #27272a;
  --radius:    8px;
  --radius-sm: 6px;
  --shadow:    0 1px 2px 0 rgba(0,0,0,0.30);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.55);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ══ Lead AI pre-call summary ══ */
.lead-summary { margin-bottom: 8px; }
.lead-summary-hdr {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--accent); margin-bottom: 5px;
}
.lead-summary-loading { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.lead-summary-list { margin: 0; padding-left: 15px; }
.lead-summary-list li { font-size: 12px; color: var(--text); line-height: 1.5; margin-bottom: 3px; }
.lead-rawnotes { margin-top: 6px; }
.lead-rawnotes > summary {
  font-size: 10px; color: var(--muted); cursor: pointer; list-style: revert;
  margin-bottom: 6px; user-select: none;
}
.lead-rawnotes > summary:hover { color: var(--text); }

/* ══ Quick Text meta line ══ */
.quicktext-meta {
  font-size: 11px; color: var(--muted); font-weight: 600;
  line-height: 1.45; margin-bottom: 9px;
}

/* ══ Discovery Checklist ══ */
.discovery-coverage {
  margin-left: auto; font-size: 10px; font-weight: 700;
  color: var(--muted); letter-spacing: .3px;
}
.discovery-section-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted-2); margin: 9px 0 3px;
}
.discovery-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 4px; font-size: 12px; line-height: 1.3;
  border-radius: 6px; cursor: pointer; user-select: none;
}
.discovery-item:hover { background: var(--surface); }
.discovery-item .di-box {
  flex-shrink: 0; width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid var(--border-hi); display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px;
  color: #fff; align-self: center;
}
.discovery-item .di-label { color: var(--muted); }
.discovery-item .di-value { color: var(--text); font-weight: 600; min-width: 0; }
.discovery-item.checked .di-box { background: var(--success); border-color: var(--success); }
.discovery-item.checked .di-box::after { content: '✓'; }
.discovery-item.checked .di-label { color: var(--text); }
/* AI thinks it's partially covered — a hint, still unchecked */
.discovery-item.partial .di-box { border-color: var(--warning); }
.discovery-item.partial .di-value { color: var(--warning); font-weight: 500; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ══ Login Screen ══ */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(circle at 50% 30%, #18181b 0%, var(--bg) 70%);
  display: flex; align-items: center; justify-content: center;
}
#login-screen.hidden { display: none; }
.login-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 34px 30px; width: 310px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-size: 20px; font-weight: 800; color: var(--text);
  text-align: center; letter-spacing: -0.4px;
}
.login-logo::before {
  content: "📞"; display: block; font-size: 30px; margin-bottom: 8px;
}
.login-subtitle {
  font-size: 12.5px; color: var(--muted); text-align: center; margin-top: -6px;
}
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600;
}
.login-select, .login-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); padding: 11px 13px;
  font-size: 14px; outline: none; width: 100%; transition: border-color .15s;
}
.login-select:focus, .login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-error { font-size: 12px; color: var(--danger); text-align: center; }
.login-btn { width: 100%; padding: 13px; font-size: 14.5px; font-weight: 700; margin-top: 4px; }

/* ══ Status Bar ══ */
#status-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted-2); flex-shrink: 0;
  transition: background .2s;
}
.status-dot.ready { background: var(--success); box-shadow: 0 0 8px var(--success-soft); }
.status-dot.ringing { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.connected { background: var(--accent); box-shadow: 0 0 8px var(--accent-soft); }
.status-dot.error { background: var(--danger); }
.status-dot.warning { background: var(--warning); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
#status-text { font-size: 12px; color: var(--text); font-weight: 500; flex: 1; }
#timer { font-size: 12.5px; font-weight: 700; color: var(--accent); font-family: var(--mono); }
#sip-badge {
  margin-left: auto; font-size: 10px; padding: 3px 8px; border-radius: 10px;
  background: var(--pill); color: var(--muted); font-weight: 600;
}

/* ══ Tabs ══ */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 4px;
}
.tab {
  flex: 1;
  padding: 11px 4px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Live ET clock — sits in the call-controls bar right next to the Log hint */
.tabs-clock {
  flex: none;
  align-self: center;
  text-align: left;
  padding: 0 4px;
  margin-left: 6px;
  line-height: 1.25;
  white-space: nowrap;
}
.tabs-clock .tc-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tabs-clock .tc-date { font-size: 10px; color: var(--muted); }

/* ══ Global Call Controls — one slim row between status bar and tabs ══ */
#call-controls-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  padding: 7px 14px; flex-shrink: 0; position: relative;
  background: var(--card); border-bottom: 1px solid var(--border);
}
#call-controls-bar .btn { padding: 6px 14px; font-size: 12px; white-space: nowrap; }
.ccb-label { font-size: 14px; margin-right: 2px; }
#call-controls-bar .ccb-shortcuts { margin: 0 0 0 10px; }
#call-controls-bar .ccb-shortcuts > span { font-size: 10px; color: var(--muted); }
#transfer-panel {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: 300px; max-width: calc(100vw - 28px); z-index: 60;
  padding: 10px; background: var(--surface); border-radius: 8px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (max-width: 1100px) { .ccb-shortcuts { display: none; } }

.tab-content { display: none; flex: 1; overflow-y: auto; padding: 18px; }
.tab-content.active { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* Web-app width — comfortable centered column for list/detail tabs (was a 460px
   sidebar strip). The Dialer overrides this with a multi-column grid below. */
.tab-content.active > * { width: 100%; max-width: 860px; }

/* ══ Dialer → full-page dashboard grid: fills the width, fits the viewport ══ */
#tab-dialer.active {
  display: grid;
  grid-template-columns: 0.9fr 1.05fr 0.9fr;  /* fills 100% — no dead space */
  gap: 16px;
  align-items: start;
  width: 100%; max-width: none; margin: 0;
  height: 100%;                 /* fill the tab area so the page itself never scrolls */
}
#tab-dialer.active > .dialer-col {
  min-width: 0; min-height: 0; max-height: 100%;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;             /* a column scrolls INSIDE itself only if too tall */
  padding-bottom: 4px;
}
.dialer-col > * { width: 100%; max-width: none; }
/* Long cards scroll inside themselves rather than stretching the column */
.dialer-col #discovery-checklist { max-height: 40vh; overflow-y: auto; }

@media (max-width: 1000px) {
  #tab-dialer.active { grid-template-columns: 1fr; height: auto; }
  #tab-dialer.active > .dialer-col { overflow: visible; max-height: none; }
}

/* Right lead panel: on wide screens, push the content left so it never covers
   anything; on narrow screens the drawer just overlays as before. */
@media (min-width: 1240px) {
  body.drawer-open .tab-content.active { padding-right: 420px; }
}

/* ══ List tabs (Queue / Voicemail / Missed) → responsive multi-column grid ══ */
#tab-queue.active > *, #tab-voicemail.active > *, #tab-missed.active > * { max-width: 1080px; }
#queue-list, #vm-list, #missed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
#queue-list > .empty, #vm-list > .empty, #missed-list > .empty,
#queue-list > .load-more-banner { grid-column: 1 / -1; }

/* ══ Cards ══ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══ Buttons ══ */
.btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s, transform .05s, opacity .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-accent { background: rgba(91,124,250,.18); color: var(--accent); border: 1px solid rgba(91,124,250,.35); }
.btn-accent:hover:not(:disabled) { background: rgba(91,124,250,.28); border-color: var(--accent); }
.btn-accent:not(:disabled) { font-weight: 700; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-warning { background: var(--warning); color: #1a1200; }
.btn-warning:hover:not(:disabled) { background: #d97706; }
.btn-ghost { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--card-hi); color: var(--text); border-color: var(--border-hi); }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn-xs { font-size: 10px; padding: 4px 9px; }
.btn-full { width: 100%; }

/* ══ Session Controls ══ */
.dialer-controls { display: flex; gap: 8px; align-items: center; }
.dialer-controls .btn { flex: 1; }
#btn-start { font-size: 13.5px; padding: 11px 16px; }

/* Load More banner */
#load-more-banner {
  display: none;
  margin-top: 10px; padding: 10px 12px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  align-items: center; justify-content: space-between;
}
#load-more-banner.banner-visible { display: flex; }
#load-more-banner span { font-size: 11.5px; color: var(--text); font-weight: 500; }

/* Wrap-up row */
.wrapup-row {
  margin-top: 10px; display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted);
}
.wrapup-row select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 4px 8px; font-size: 11.5px;
}

/* ══ Active Lead — the focal point ══ */
.lead-card {
  border-color: var(--border-hi);
  background: linear-gradient(160deg, var(--card-hi), var(--card));
}
.lead-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.1;
  margin-bottom: 4px;
}
.lead-phone {
  font-size: 15px;
  color: var(--accent);
  font-family: var(--mono);
  letter-spacing: 0.5px;
  font-weight: 600;
}
.lead-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.pill {
  background: var(--pill);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
.pill.hot { background: #4a1717; color: #fca5a5; }
.pill.warm { background: #4a3410; color: #fcd34d; }
.pill.cold { background: #16304d; color: #93c5fd; }

#lead-address { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
#active-last-call {
  font-size: 11px; color: var(--warning); margin-top: 6px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
#active-last-call::before { content: "🕐"; }

/* prior notes */
#lead-notes-display {
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--muted); line-height: 1.6;
  max-height: 200px; overflow-y: auto; overflow-x: hidden;
  overflow-wrap: anywhere; word-break: break-word;
}

/* current CRM record quick-dial */
#current-record-section { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* ══ CRM Qualifier Fields ══ */
.crm-fields { margin-top: 4px; display: flex; flex-direction: column; gap: 9px; }
.crm-field-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; }
.crm-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.crm-select, .crm-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
.crm-select:focus, .crm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.crm-select.changed, .crm-input.changed {
  border-color: var(--warning);
  background: var(--warning-soft);
}

/* ══ Notes ══ */
textarea.notes {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px;
  font-size: 12.5px;
  font-family: var(--font);
  resize: vertical;
  min-height: 66px;
  outline: none;
  line-height: 1.5;
}
textarea.notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.notes::placeholder { color: var(--muted-2); }


/* ══ Dispositions ══ */
.dispositions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.disp-btn {
  padding: 11px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: all 0.12s;
}
.disp-btn:hover { border-color: var(--border-hi); background: var(--card-hi); }
.disp-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Positive outcomes — green tint */
.disp-btn[data-disp="Qualified"],
.disp-btn[data-disp="Connected"],
.disp-btn[data-disp="Offer Made"],
.disp-btn[data-disp="Under Contract"] { border-color: rgba(34,197,94,.35); }
.disp-btn[data-disp="Qualified"]:hover,
.disp-btn[data-disp="Connected"]:hover,
.disp-btn[data-disp="Offer Made"]:hover,
.disp-btn[data-disp="Under Contract"]:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.disp-btn[data-disp="Qualified"].selected,
.disp-btn[data-disp="Connected"].selected,
.disp-btn[data-disp="Offer Made"].selected,
.disp-btn[data-disp="Under Contract"].selected { background: var(--success); border-color: var(--success); color: #fff; box-shadow: 0 0 0 3px var(--success-soft); }

/* Negative outcomes — red tint */
.disp-btn[data-disp="Not Interested"],
.disp-btn[data-disp="Bad Number"],
.disp-btn[data-disp="DNC"] { border-color: rgba(240,68,68,.32); }
.disp-btn[data-disp="Not Interested"]:hover,
.disp-btn[data-disp="Bad Number"]:hover,
.disp-btn[data-disp="DNC"]:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.disp-btn[data-disp="Not Interested"].selected,
.disp-btn[data-disp="Bad Number"].selected,
.disp-btn[data-disp="DNC"].selected { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 0 0 3px var(--danger-soft); }

/* Callback — amber tint */
.disp-btn[data-disp="Callback"] { border-color: rgba(245,158,11,.32); }
.disp-btn[data-disp="Callback"]:hover { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.disp-btn[data-disp="Callback"].selected { background: var(--warning); border-color: var(--warning); color: #1a1200; box-shadow: 0 0 0 3px var(--warning-soft); }

/* Log & Advance primary action */
#btn-submit-disp { padding: 13px; font-size: 14px; font-weight: 700; margin-top: 12px; }

/* ── Outcome panel signal + locked state ───────────────────────────── */
/* Signal banner: shown only after a call ends, prompting the agent to log */
#outcome-signal {
  display: none;               /* toggled to flex by updateOutcomePanel() */
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  animation: outcome-pulse 1.3s ease-in-out infinite;
}
@keyframes outcome-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--warning-soft); }
  50%      { box-shadow: 0 0 0 5px var(--warning-soft); }
}

/* Locked state: grays out the whole outcome panel until the next call is ready */
#outcome-card.outcome-locked .dispositions,
#outcome-card.outcome-locked #callback-section,
#outcome-card.outcome-locked #btn-submit-disp {
  opacity: .4;
  filter: grayscale(.5);
  pointer-events: none;
}
#outcome-card.outcome-locked .card-title { opacity: .55; }
.disp-btn:disabled, #btn-submit-disp:disabled { cursor: not-allowed; }

/* Callback scheduler */
.callback-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#callback-section {
  margin-top: 12px; padding: 12px; background: var(--warning-soft);
  border: 1px solid rgba(245,158,11,.3); border-radius: var(--radius-sm);
}

input[type="date"], input[type="time"], input[type="text"], input[type="number"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.75); }

/* ══ Keyboard shortcuts hint ══ */
.shortcuts {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 4px;
}
.shortcuts > span:first-child { font-size: 10px; color: var(--muted-2); }
kbd {
  background: var(--surface); border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 6px;
  font-size: 10px; font-family: var(--mono); color: var(--muted);
}

/* ══ Queue Builder ══ */
.qb-header { display: flex; align-items: center; cursor: pointer; user-select: none; }
.qb-header:hover .card-title { color: var(--text); }
.qb-module-toggle { display: flex; gap: 6px; }
.qb-mod-btn {
  flex: 1; padding: 8px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.15s;
}
.qb-mod-btn:hover { border-color: var(--border-hi); color: var(--text); }
.qb-mod-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.qb-status-grid { display: flex; flex-direction: column; gap: 3px; }
.qb-status-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 6px; cursor: pointer; transition: background 0.1s;
}
.qb-status-row:hover { background: var(--surface); }
.qb-status-row input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.qb-status-label { font-size: 12px; flex: 1; }
.qb-status-count { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
#qb-caller-id, #wrap-time {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 8px 10px; font-size: 12.5px;
}

/* ══ Lead Queue ══ */
.queue-item {
  display: flex; align-items: flex-start; gap: 11px; flex-wrap: wrap;
  padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all 0.15s; margin-bottom: 7px;
}
.queue-item:hover { background: var(--card-hi); border-color: var(--border-hi); }

/* Temperature color-coding (CRM Hot/Warm/Cold) — left stripe + faint tint */
.queue-item.q-temp-hot  { border-left: 4px solid #ef4444; background: rgba(239, 68, 68, .06); }
.queue-item.q-temp-warm { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, .06); }
.queue-item.q-temp-cold { border-left: 4px solid #3b82f6; background: rgba(59, 130, 246, .06); }
.queue-item.q-temp-hot:hover  { background: rgba(239, 68, 68, .11); }
.queue-item.q-temp-warm:hover { background: rgba(245, 158, 11, .11); }
.queue-item.q-temp-cold:hover { background: rgba(59, 130, 246, .11); }

.queue-item.active-lead { background: var(--accent-soft); border-color: var(--accent); }
.queue-item.called { opacity: 0.45; }
.q-number { font-size: 11px; color: var(--muted-2); min-width: 20px; text-align: right; font-family: var(--mono); padding-top: 2px; }
.q-info { flex: 1; min-width: 0; }
.q-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-chatarv-badge { display: inline-block; vertical-align: middle; font-size: 8.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; background: var(--accent, #7c3aed); color: #fff; border-radius: 3px; padding: 1px 4px; margin-left: 4px; }
.q-phone { font-size: 11.5px; color: var(--accent); font-family: var(--mono); margin-top: 1px; }
.q-address { font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-last-call { font-size: 10.5px; color: var(--warning); font-weight: 600; margin-top: 3px; }
.q-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.q-actions { flex-basis: 100%; display: flex; gap: 5px; justify-content: flex-end; margin-top: 2px; }
.q-actions .btn { text-decoration: none; padding: 4px 9px; font-size: 10.5px; }
.q-skipped .q-skip-btn { color: var(--accent); }

/* ══ Analytics ══ */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 10px; text-align: center;
}
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ══ Screen Pop overlay ══ */
#screen-pop {
  position: fixed; top: 12px; right: 12px; left: 12px;
  background: linear-gradient(160deg,#1c1c20,#161619);
  border: 1px solid var(--accent);
  border-radius: 14px; padding: 16px;
  z-index: 1000; display: none;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.22s cubic-bezier(.2,.9,.3,1.2);
}
#screen-pop.show { display: block; }
@keyframes slideIn { from { transform: translateY(-24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pop-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pop-badge {
  background: var(--accent); color: #fff; border-radius: 20px; padding: 3px 11px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  animation: badgePulse 1.4s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }
.pop-close { cursor: pointer; color: var(--muted); font-size: 17px; line-height: 1; }
.pop-close:hover { color: var(--text); }
#screen-pop .lead-name { font-size: 21px; }
#screen-pop .lead-phone { font-size: 14px; color: var(--accent); }

/* ══ Empty states ══ */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty h3 { font-size: 14px; margin-bottom: 6px; color: var(--text); }
.empty p { font-size: 12px; }

/* ══ Spinner ══ */
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ History (CDR) list ══ */
.cdr-row {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.cdr-row:last-child { border-bottom: none; }
.cdr-icon { font-size: 14px; flex-shrink: 0; }
.cdr-dir-wrap { flex-shrink: 0; }
.cdr-dir {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 4px; border-radius: 3px;
}
.cdr-dir-out { background: rgba(99,179,237,.15); color: #63b3ed; }
.cdr-dir-in  { background: rgba(104,211,145,.15); color: #68d391; }
.cdr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cdr-lead-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdr-phone-sub { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.cdr-via-sub { color: var(--muted); font-size: 10px; font-family: var(--mono); opacity: .6; }
.cdr-duration { color: var(--muted); font-family: var(--mono); flex-shrink: 0; }
.cdr-disp { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.cdr-call-btn {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  border-radius: 50%; width: 24px; height: 24px; cursor: pointer;
  color: var(--success); font-size: 13px; display: flex; align-items: center;
  justify-content: center; transition: background .15s;
}
.cdr-call-btn:hover { background: rgba(104,211,145,.15); border-color: var(--success); }

/* ══ History per-agent columns ══ */
.cdr-cols { display: flex; gap: 14px; align-items: flex-start; }
.cdr-col {
  flex: 1 1 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.cdr-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
}
.cdr-col-ext { font-weight: 500; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.cdr-col-you {
  font-size: 9px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(99,179,237,.18); color: #63b3ed;
}
.cdr-col-count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.cdr-col-body { padding: 2px 10px; max-height: 62vh; overflow-y: auto; }
@media (max-width: 640px) { .cdr-cols { flex-direction: column; } }
.cdr-row-clickable { cursor: pointer; border-radius: 6px; transition: background .12s; }
.cdr-row-clickable:hover { background: rgba(255,255,255,.04); }

/* ══ Comps & ARV panel (live call) ══ */
.comps-src { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: var(--muted); letter-spacing: .02em; }
.comps-addr { font-size: 11.5px; color: var(--text); margin-bottom: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.comps-loading { font-size: 12px; color: var(--muted); padding: 8px 0; }
.comps-headline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comps-headline .ch-label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.comps-headline .ch-val { font-family: var(--mono); font-size: 24px; font-weight: 620; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.comps-headline .ch-note { font-size: 11px; color: var(--muted); font-style: italic; }
.comps-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comps-facts span {
  font-size: 11px; font-family: var(--mono); color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.comps-subline { font-size: 11px; color: var(--muted); margin-top: 7px; font-family: var(--mono); }
.comps-comps-h { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.comp-row {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.comp-row:last-child { border-bottom: none; }
.comp-row .comp-a { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-row .comp-a a { color: var(--accent); text-decoration: none; }
.comp-row .comp-a a:hover { text-decoration: underline; }
.comp-row .comp-p { font-family: var(--mono); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.comp-row .comp-m { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comps-none { font-size: 11px; color: var(--muted); padding: 4px 0; }
.comps-asof { font-size: 10px; color: var(--muted-2, var(--muted)); margin-top: 8px; font-style: italic; }

/* ══ History detail panel (right slide-in) ══ */
#history-detail-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 900;
}
#history-detail-backdrop.open { opacity: 1; pointer-events: auto; }
#history-detail {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw;
  background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,.4);
  transform: translateX(100%); transition: transform .22s ease; z-index: 901;
  display: flex; flex-direction: column;
}
#history-detail.open { transform: translateX(0); }
.hd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.hd-title { font-weight: 700; font-size: 14px; }
.hd-close {
  background: none; border: none; color: var(--muted); font-size: 18px;
  cursor: pointer; line-height: 1; padding: 2px 6px;
}
.hd-close:hover { color: var(--text); }
.hd-body { padding: 16px; overflow-y: auto; flex: 1; }
.hd-lead { margin-bottom: 14px; }
.hd-name { font-size: 18px; font-weight: 700; }
.hd-phone { color: var(--muted); font-size: 13px; margin-top: 3px; font-family: var(--mono); }
.hd-status {
  color: var(--accent); font-family: var(--font); font-weight: 600;
}
.hd-address { margin-top: 8px; font-size: 13px; color: var(--text); }
.hd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hd-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); text-decoration: none;
  color: var(--text); background: var(--surface); transition: filter .12s;
}
.hd-btn:hover { filter: brightness(1.2); }
.hd-btn-call { background: rgba(104,211,145,.15); border-color: var(--success); color: #68d391; }
.hd-btn-zoho { background: rgba(99,179,237,.15); border-color: #63b3ed; color: #63b3ed; }
.hd-btn-zillow { background: rgba(0,106,255,.15); border-color: #4a90ff; color: #6aa8ff; }
.hd-btn-disabled { opacity: .45; cursor: default; }
.hd-section { margin-bottom: 20px; }
.hd-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-bottom: 8px; font-weight: 700;
}
.hd-summary, .hd-notes { font-size: 13px; line-height: 1.5; }
.hd-bullets { margin: 0; padding-left: 18px; }
.hd-bullets li { margin-bottom: 6px; }
.hd-note {
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.hd-note:last-child { border-bottom: none; }
.hd-note-meta { font-size: 10px; color: var(--muted); font-family: var(--mono); margin-bottom: 3px; }
.hd-note-text { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.hd-muted { color: var(--muted); font-size: 12px; }

/* ══ Monitor Tab ══ */
.monitor-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px; background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 7px; gap: 8px;
}
.monitor-item-busy {
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.04);
}
.monitor-agent { display: flex; align-items: center; gap: 10px; min-width: 0; }
.monitor-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.monitor-dot-busy {
  background: var(--warning);
  box-shadow: 0 0 7px rgba(245,158,11,.5);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.monitor-dot-free {
  background: var(--success);
  box-shadow: 0 0 5px rgba(34,197,94,.35);
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* Status-bar live-call pill — empty (zero width) when nobody else is on a call */
#live-call-badge:not(:empty) {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 20px; cursor: pointer;
  background: rgba(245,158,11,.15); color: var(--warning);
  border: 1px solid rgba(245,158,11,.35);
  white-space: nowrap;
}
#live-call-badge:not(:empty)::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,.6);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
#live-call-badge:not(:empty):hover { background: rgba(245,158,11,.25); }
.monitor-name { font-size: 13px; font-weight: 700; color: var(--text); }
.monitor-ext { font-size: 10px; color: var(--muted); }
.mon-badge {
  font-size: 9.5px; font-weight: 700; padding: 2px 6px;
  border-radius: 20px; letter-spacing: .3px; flex-shrink: 0;
}
.mon-badge-busy { background: rgba(245,158,11,.18); color: var(--warning); }
.mon-badge-free { background: rgba(34,197,94,.15); color: var(--success); }
.mon-call-detail { font-size: 10.5px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }
.mon-crm { font-size: 11px; color: var(--text); margin-top: 2px; font-weight: 600; }
.mon-crm:empty { display: none; }
.monitor-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* ══ AI Callback Banner ══ */
.ai-callback-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--success-soft); border: 1px solid var(--success); border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 10px; font-size: 12.5px; color: var(--success); gap: 8px;
}

/* ══ Live Transcript Drawer ══ */
.transcript-drawer {
  position: fixed; right: -360px; top: 0; bottom: 0; width: 340px;
  background: var(--card); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 500;
  transition: right 0.25s ease; box-shadow: -4px 0 20px rgba(0,0,0,.4);
}

/* ══ Full Lead drawer ══ */
.lead-drawer {
  position: fixed; right: -440px; top: 0; bottom: 0; width: 400px; max-width: 92vw;
  background: var(--card); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 1100;  /* above the inbound pop (1000) */
  transition: right 0.25s ease; box-shadow: var(--shadow-lg);
}
.lead-drawer.open { right: 0; }
.lead-drawer-header {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.lead-drawer-name { font-size: 15px; font-weight: 700; color: var(--text); }
.lead-drawer-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lead-drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.ld-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); margin: 14px 0 6px; }
.ld-section:first-child { margin-top: 0; }
.ld-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ld-row:last-child { border-bottom: none; }
.ld-key { color: var(--muted); flex: 0 0 42%; }
.ld-val { color: var(--text); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ld-zillow { color: var(--accent); text-decoration: none; font-weight: 600; }
.ld-zillow:hover { text-decoration: underline; }
.transcript-drawer.open { right: 0; }
.transcript-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.transcript-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.transcript-actions { display: flex; gap: 6px; align-items: center; }
.transcript-body { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.transcript-empty { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 24px; }
.transcript-error { font-size: 12.5px; color: var(--danger); text-align: center; margin-top: 24px; }
.transcript-line {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface);
  border-left: 3px solid var(--border);
}
.transcript-line.agent { border-left-color: var(--accent); }
.transcript-line.lead { border-left-color: var(--success); }
.transcript-line.interim { opacity: 0.55; }
.transcript-speaker { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.transcript-line.agent .transcript-speaker { color: var(--accent); }
.transcript-line.lead .transcript-speaker { color: var(--success); }
.transcript-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
#btn-transcribe.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══ Wrap-up flash ══ */
.wrap-flash { animation: wrapFlash 0.5s ease-in-out; }
@keyframes wrapFlash { 0%, 100% { background: var(--card); } 50% { background: #2d1f0a; } }

/* ══ Manual dial autocomplete ══ */
.dial-search-wrap { position: relative; }
.dial-autocomplete {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 280px;
  overflow-y: auto;
}
.dial-ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.dial-ac-item:last-child { border-bottom: none; }
.dial-ac-item:hover,
.dial-ac-item.ac-focus { background: var(--card-hi); }
.dial-ac-body { flex: 1; min-width: 0; }
.dial-ac-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dial-ac-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dial-ac-phone {
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dial-ac-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.dial-ac-badge.buyer { background: var(--success-soft); color: var(--success); }
.dial-ac-loading, .dial-ac-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ══ Prior notes ══ */
.prior-note {
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 6px;
}
.prior-note:last-child { margin-bottom: 0; }
.prior-note-hdr {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: .2px;
}
.prior-note-body {
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

/* ══ Voicemail ══ */
.vm-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 14px;
}
.vm-badge.vm-badge-muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  line-height: 12px;
}
.vm-folder-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.vm-folder-tab {
  flex: 1;
  padding: 7px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.vm-folder-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.vm-item {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.vm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.vm-item-from {
  font-size: 13px;
  font-weight: 600;
}
.vm-item-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.vm-item-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.vm-player { margin-top: 8px; }

/* ══ Messages (SMS) — iMessage-style two-pane ══ */

/* Full-bleed: Messages escapes the narrow centered column */
#tab-messages.active { padding: 0; overflow: hidden; align-items: stretch; }
#tab-messages.active > * { max-width: none; }
#sms-app {
  display: flex; flex: 1; width: 100%; min-height: 0;
  background: var(--bg);
}

/* ── Sidebar ── */
#sms-sidebar {
  width: 340px; min-width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.sms-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
}
.sms-side-title { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.sms-side-actions { display: flex; gap: 4px; align-items: center; }

.sms-icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px; line-height: 1;
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.sms-icon-btn:hover { background: var(--card-hi); color: var(--text); }
.sms-icon-btn.sms-compose { background: var(--accent-soft); color: var(--accent); }
.sms-icon-btn.sms-compose:hover { background: var(--accent); color: #fff; }
.sms-icon-btn.sound-off { opacity: 0.45; }

.sms-search-wrap { padding: 0 12px 8px; }
#sms-search {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px; color: var(--text);
}
#sms-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Chips size to their content and the row scrolls sideways. With the added
   Buyers/Sellers + custom folders there are too many to share the width, and
   flex:1 + nowrap made them overflow the container and cover the list. */
.sms-filters {
  display: flex; gap: 5px; padding: 0 12px 10px;
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.sms-filters::-webkit-scrollbar { height: 4px; }
.sms-filters::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
.sms-filter {
  flex: 0 0 auto; padding: 5px 10px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: all .12s; white-space: nowrap;
}
.sms-filter:hover { color: var(--text); border-color: var(--border-hi); }
.sms-filter.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.sms-filter-count {
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 15px; padding: 1px 4px; border-radius: 8px; text-align: center;
}
.sms-filter-count:empty { display: none; }

#sms-threads { flex: 1; overflow-y: auto; min-height: 0; padding: 0 8px 10px; }

/* Thread rows */
.sms-thread {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border-radius: 11px;
  cursor: pointer; transition: background .1s;
  border: none; background: none; margin: 0 0 1px;
}
.sms-thread:hover { background: var(--card-hi); }
.sms-thread.active { background: var(--accent); }
.sms-thread.active .sms-thread-name,
.sms-thread.active .sms-thread-preview,
.sms-thread.active .sms-thread-time,
.sms-thread.active .sms-thread-sub { color: #fff; }
.sms-thread.active .sms-thread-preview { opacity: .85; }

/* Loading placeholder for the thread list — mirrors .sms-thread's geometry so
   the real rows drop straight in without the list jumping. */
.sms-skel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin: 0 0 1px;
}
.sms-skel-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--pill);
}
.sms-skel-lines { flex: 1; min-width: 0; }
.sms-skel-line {
  height: 10px; border-radius: 5px; background: var(--pill);
  margin: 6px 0;
}
.sms-skel-line.short { width: 38%; }
.sms-skeleton { animation: pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .sms-skeleton { animation: none; opacity: .5; }
}

.sms-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--pill); letter-spacing: .5px;
  user-select: none;
}
.sms-thread-body { flex: 1; min-width: 0; }
.sms-thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sms-thread-name {
  font-size: 13.5px; font-weight: 650; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px; min-width: 0;
}
.sms-crm-check { font-size: 9px; color: var(--success); flex-shrink: 0; }
.sms-thread-time { font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.sms-thread-preview {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sms-thread-sub {
  font-size: 10.5px; color: var(--success); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sms-thread.unread .sms-thread-name { font-weight: 800; }
.sms-thread.unread .sms-thread-preview { color: var(--text); font-weight: 500; }
.sms-unread-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.sms-thread.active .sms-unread-dot { background: #fff; }

/* ── Main pane ── */
#sms-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
#sms-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: var(--muted);
}
.sms-ph-icon { font-size: 44px; opacity: .5; margin-bottom: 4px; }
#sms-placeholder h3 { font-size: 15px; color: var(--text); font-weight: 700; }
#sms-placeholder p { font-size: 12px; }

#sms-convo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sms-convo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.sms-convo-head .sms-avatar { width: 34px; height: 34px; font-size: 12px; }
#sms-back { display: none; }
.sms-convo-id { flex: 1; min-width: 0; }
#sms-convo-name { font-weight: 750; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sms-convo-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* Messages area */
.sms-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 14px 18px 8px;
}
.sms-bubble {
  max-width: 72%;
  padding: 8px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 2px;
  position: relative;
}
.sms-bubble.in {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
}
.sms-bubble.out {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}
/* iMessage tail on the last bubble of a run */
.sms-bubble.in.run-end { border-bottom-left-radius: 5px; }
.sms-bubble.out.run-end { border-bottom-right-radius: 5px; }
/* extra gap when the run/direction changes */
.sms-bubble.run-end { margin-bottom: 8px; }

.sms-bubble.pending { opacity: .65; }
.sms-bubble.failed { background: var(--danger); cursor: pointer; }

/* ── MMS media inside bubbles ── */
.sms-bubble.has-media { padding: 5px; }
.sms-bubble.has-media .sms-text { padding: 3px 8px 4px; }
.sms-bubble.has-media .sms-msg-time { padding: 0 6px 3px; }
.sms-media { display: flex; flex-direction: column; gap: 5px; }
.sms-media-img {
  display: block; max-width: min(280px, 100%); max-height: 320px;
  border-radius: 14px; cursor: zoom-in; object-fit: cover;
}
.sms-media-video {
  display: block; max-width: min(300px, 100%); max-height: 340px;
  border-radius: 14px; background: #000;
}
.sms-media-audio { max-width: 260px; }
.sms-media-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 11px; border-radius: 12px; font-size: 12px;
  background: rgba(0, 0, 0, 0.18); color: inherit;
  text-decoration: none; word-break: break-all;
}
.sms-bubble.in .sms-media-file { background: rgba(255, 255, 255, 0.07); }
.sms-media-file:hover { filter: brightness(1.15); }

/* ── Composer attachment chips (files staged to send) ── */
.sms-attach-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 7px 12px 0; background: var(--surface);
  border-top: 1px solid var(--border);
}
.sms-attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px 9px; max-width: 230px;
}
.sms-attach-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-attach-chip .size { color: var(--muted); font-size: 10px; }
.sms-attach-chip .x { cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 2px; }
.sms-attach-chip .x:hover { color: var(--danger); }

.sms-msg-time {
  font-size: 9.5px; opacity: .6; margin-top: 3px; text-align: right;
}
.sms-msg-status {
  align-self: flex-end; font-size: 10px; color: var(--muted);
  margin: -1px 4px 8px 0; font-weight: 600;
}
.sms-msg-status.failed { color: var(--danger); }
.sms-day-divider {
  text-align: center; font-size: 10.5px; font-weight: 600; color: var(--muted);
  margin: 14px 0 8px; flex-shrink: 0;
}
.sms-number-change {
  text-align: center; font-size: 10px; font-weight: 600; color: var(--accent);
  margin: 12px 0 6px; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.sms-number-change::before, .sms-number-change::after {
  content: ''; flex: 1; height: 1px; background: var(--accent); opacity: 0.3;
}

/* Quick reply templates */
.sms-templates {
  border-top: 1px solid var(--border); background: var(--surface);
  max-height: 190px; overflow-y: auto; flex-shrink: 0; padding: 6px 10px;
}
.sms-tpl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
}
.sms-tpl-row:hover { background: var(--card-hi); }
.sms-tpl-label { font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.sms-tpl-text {
  flex: 1; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sms-tpl-del {
  background: none; border: none; color: var(--muted-2); cursor: pointer;
  font-size: 11px; padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
}
.sms-tpl-del:hover { color: var(--danger); background: var(--danger-soft); }
.sms-tpl-add {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--accent);
  padding: 7px; cursor: pointer; border-radius: 8px;
}
.sms-tpl-add:hover { background: var(--accent-soft); }

/* Composer */
.sms-composer {
  display: flex; gap: 7px; align-items: flex-end;
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.sms-composer select {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 15px; color: var(--muted); padding: 7px 10px 7px 10px;
  font-size: 10.5px; max-width: 160px; min-width: 80px; height: 33px; cursor: pointer;
  flex-shrink: 0; overflow: hidden; text-overflow: ellipsis;
}
.sms-input-wrap { flex: 1; position: relative; display: flex; }
#sms-reply-text {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 17px; color: var(--text); padding: 8px 52px 8px 13px;
  font-size: 13px; font-family: var(--font); resize: none; outline: none;
  line-height: 1.35; max-height: 120px; min-height: 33px;
}
#sms-reply-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#sms-char-count {
  position: absolute; right: 12px; bottom: 8px;
  font-size: 9px; color: var(--muted-2); pointer-events: none;
}
#sms-reply-send {
  width: 33px; height: 33px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .12s, transform .05s;
}
#sms-reply-send:hover { background: var(--accent-hover); }
#sms-reply-send:active { transform: scale(.92); }
#sms-reply-send:disabled { opacity: .4; cursor: default; }

/* In-app toast alert */
.sms-toast {
  position: fixed; top: 14px; right: 14px; z-index: 1300;
  width: 320px; max-width: calc(100vw - 28px);
  background: var(--card); border: 1px solid var(--border-hi);
  border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); cursor: pointer;
  display: flex; gap: 10px; align-items: flex-start;
  animation: slideIn .22s cubic-bezier(.2,.9,.3,1.2);
}
.sms-toast .sms-avatar { width: 34px; height: 34px; font-size: 12px; }
.sms-toast-body { flex: 1; min-width: 0; }
.sms-toast-name { font-size: 13px; font-weight: 750; }
.sms-toast-text {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sms-toast-close {
  background: none; border: none; color: var(--muted-2); cursor: pointer;
  font-size: 13px; padding: 0 2px; flex-shrink: 0;
}
.sms-toast.hide { animation: toastOut .18s ease forwards; }
@keyframes toastOut { to { transform: translateY(-12px); opacity: 0; } }

/* Narrow widths (Zoho sidebar / mobile): single pane with slide */
@media (max-width: 700px) {
  #sms-sidebar { width: 100%; border-right: none; }
  #sms-main { display: none; }
  #sms-app.convo-open #sms-sidebar { display: none; }
  #sms-app.convo-open #sms-main { display: flex; }
  #sms-back { display: inline-flex; }
}

/* ══ Callback confirm modal ══ */
.cb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  display: flex; align-items: center; justify-content: center;
}
.cb-modal {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  padding: 18px;
  width: min(340px, calc(100vw - 40px));
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.18s cubic-bezier(.2,.9,.3,1.2);
}
.cb-modal-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.cb-modal-who {
  padding: 10px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
}

.crm-match-line { color: var(--success, #22c55e) !important; }

/* ══ Missed calls ══ */
.vm-item.missed-new { border-color: var(--danger); }
.missed-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 6px;
  vertical-align: middle;
}

/* ══ Scrollbar ══ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ══ Focus stars (weekly / monthly priority notepad) ══ */
.focus-chips { display: flex; gap: 8px; margin-top: 8px; }
.focus-chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--border-hi);
  background: var(--surface); color: var(--muted); transition: all .12s;
  white-space: nowrap;
}
.focus-chip:hover { color: var(--text); border-color: var(--warning); }
.focus-chip.active {
  background: var(--warning-soft); border-color: var(--warning); color: var(--warning);
}
.focus-chip.active::first-letter { color: var(--warning); }

/* Focus tab */
.focus-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.focus-agent-select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.focus-period-toggle { display: flex; gap: 4px; margin-left: auto; }
.focus-sub { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
#focus-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.focus-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 4px;
}
.focus-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.focus-item-name { font-weight: 700; font-size: 13px; color: var(--text); }
.focus-item-phone { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.focus-item-addr { font-size: 11px; color: var(--muted); }
.focus-item-meta { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.focus-item-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ── Caller-ID Recommendation card (Phase 1, advisory) ── */
#callerid-rec-card .rec-signal { font-size: 13px; margin-bottom: 4px; }
#callerid-rec-card .rec-conf { color: var(--muted); font-weight: 400; font-size: 11px; }
#callerid-rec-card .rec-cur { font-size: 12px; color: var(--text); margin-bottom: 4px; }
#callerid-rec-card .rec-explain { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 6px; }
#callerid-rec-card .rec-counts { font-size: 11px; color: var(--muted); font-family: var(--mono, monospace); margin-bottom: 6px; }
#callerid-rec-card .rec-suggest { font-size: 12px; margin-bottom: 8px; }
#callerid-rec-card .rec-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#callerid-rec-card .rec-status { font-size: 11px; margin-top: 6px; min-height: 14px; }
#callerid-rec-card .rec-warn { font-size: 11.5px; padding: 2px 0; }
#callerid-rec-card .rec-warn-info { color: var(--muted); }
#callerid-rec-card .rec-warn-warn { color: var(--warning, #eab308); }
#callerid-rec-card .rec-warn-alert { color: var(--danger, #ef4444); font-weight: 600; }

/* ── 🌙 Evening Retry list ── */
.ev-entry { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.ev-head { display: flex; align-items: center; gap: 8px; }
.ev-name { font-weight: 700; font-size: 14px; }
.ev-gap { font-size: 10.5px; color: var(--warning, #eab308); }
.ev-addr { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ev-day { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.ev-rec { font-size: 12px; margin-top: 6px; }
.ev-reason { color: var(--muted); font-size: 11px; }
.ev-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
#callerid-rec-card .rec-ai { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
#callerid-rec-card .rec-ai-btns a { color: var(--accent); text-decoration: none; margin-left: 4px; }
.sms-ai-chip { font-size: 10px; color: var(--muted); margin-top: 2px; opacity: .85; }
.ev-filter { display: flex; gap: 6px; margin-bottom: 10px; }
.ev-chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Queue skip (crossed out, stays visible) ── */
.queue-item.q-skipped { opacity: .45; }
.queue-item.q-skipped .q-name, .queue-item.q-skipped .q-phone, .queue-item.q-skipped .q-address { text-decoration: line-through; }
.queue-item .q-info { cursor: pointer; }
.queue-item[draggable="true"] { cursor: grab; }
.queue-item.q-dragging { opacity: .4; }
.queue-item.q-drag-over { outline: 2px dashed var(--accent, #7c3aed); outline-offset: -2px; }

/* ── ChatARV deep analysis ── */
#chatarv-section .ca-status { font-size: 11px; color: var(--muted); margin-top: 6px; }
#chatarv-section .input { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 5px 8px; font-size: 11.5px; }
.ca-headline { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; }
.ca-headline .ca-lbl { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.ca-note { font-size: 10.5px; color: var(--muted); margin-top: 6px; font-style: italic; }
.ca-feedback { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.ca-repairs { margin-top: 8px; }
.ca-repairs-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ca-repairs-row .ca-zsave-status { font-size: 10px; color: var(--muted); }
.ca-beta { font-size: 8.5px; background: var(--warning, #eab308); color: #000; border-radius: 3px; padding: 0 3px; font-weight: 700; }
.ca-repair-total { font-size: 12px; margin-top: 6px; }
.ca-line { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.ca-line-n { font-weight: 600; } .ca-line-t { color: var(--text); font-weight: 600; }
.ca-line-r { grid-column: 1 / -1; color: var(--muted); font-size: 10.5px; }
.ca-comps-h { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 8px 0 4px; }
.ca-comp { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.ca-comp-a a { color: var(--accent); } .ca-comp-p { font-weight: 600; }
.ca-comp-m { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.ca-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.ca-when { font-size: 10px; color: var(--muted); }

/* ── Reminders page (follow-up tasks auto-created by callback detection) ── */
#reminders-list { display: flex; flex-direction: column; gap: 8px; }
.rem-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; border-left: 3px solid var(--border); }
.rem-row.rem-overdue { border-left-color: var(--danger); }
.rem-row.rem-today   { border-left-color: var(--warning, #e0a03a); }
.rem-main { min-width: 0; flex: 1; }
.rem-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rem-name { font-weight: 700; font-size: 13px; color: var(--text); }
.rem-due { font-size: 11px; color: var(--muted); }
.rem-tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; color: #fff; }
.rem-tag-overdue { background: var(--danger); }
.rem-tag-today   { background: var(--warning, #e0a03a); }
.rem-msg { font-size: 12px; color: var(--text); margin-top: 4px; line-height: 1.4;
  overflow-wrap: anywhere; }
.rem-foot { margin-top: 4px; }
.rem-owner { font-size: 10px; color: var(--muted); }
.rem-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.rem-actions .btn { white-space: nowrap; }
