/* Post-Call Sender — interface.
 *
 * Design intent: the quiet, dense, deliberate feel of a native Mac app.
 * Neutral greys carry the structure, one system blue carries every action,
 * and colour is spent only where it means something (a green connect, a red
 * missing email). No decorative gradients, no glow, no emoji as chrome —
 * a tool a salesperson uses forty times a day should recede, not perform.
 *
 * Mobile-first: Liv works this on a phone between dials as often as at a
 * desk, so the phone layout is the real layout and the desktop is the
 * enhancement.
 */

:root {
  /* Surfaces — flat, layered, near-black like macOS dark mode. */
  --bg: #0a0a0b;
  --bg-raised: #141416;
  --surface-1: #151517;
  --surface-2: #1c1c1f;
  --surface-3: #242428;
  --stroke: rgba(255, 255, 255, 0.11);
  --stroke-strong: rgba(255, 255, 255, 0.2);

  /* Ink — Apple's label hierarchy: primary, secondary, tertiary. */
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;

  /* Accents — system colours, used sparingly and only with meaning. */
  --blue: #0a84ff;
  --blue-hover: #3b9bff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;

  /* Sharp by intent. Big radii read soft and consumer; this is a work
     tool, so corners are just enough to avoid looking unfinished. */
  --r-lg: 8px;
  --r: 6px;
  --r-sm: 4px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.6);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Inter, Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A single, almost-imperceptible cool wash at the top. It gives the page a
   horizon without announcing itself as a gradient. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(90, 120, 180, 0.10), transparent 70%),
    var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

::selection { background: rgba(10, 132, 255, 0.32); }

/* Scrollbars: present when needed, invisible when not. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.13); border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); background-clip: content-box; }

/* ── Shell ───────────────────────────────────────────────────────── */
.shell { max-width: 1340px; margin: 0 auto; padding: 0 16px 120px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 2px 12px;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--stroke); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 6px;
  background: linear-gradient(180deg, #3d3d42, #232327);
  border: 1px solid var(--stroke-strong);
  display: grid; place-items: center; color: var(--ink);
  box-shadow: var(--shadow-1);
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-text { min-width: 0; }
.brand-title {
  font-weight: 600; font-size: 15px; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--ink); white-space: nowrap;
}
.brand-sub {
  font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.topbar-spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--stroke);
  font-size: 11.5px; color: var(--ink-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chip.warn .dot { background: var(--orange); }

/* Icon-only control — the ↻ and ⚙ in the top bar. */
.icon-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center; cursor: pointer;
  border-radius: 5px; border: 1px solid var(--stroke);
  background: var(--surface-2); color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--stroke-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Segmented control ───────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 2px; margin: 4px 0 18px;
  background: var(--surface-1); border: 1px solid var(--stroke);
  border-radius: 6px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; padding: 7px 18px; border: 0; border-radius: 4px;
  background: transparent; color: var(--ink-2);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
  letter-spacing: -0.01em;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.on {
  color: var(--ink); background: var(--surface-3);
  box-shadow: var(--shadow-1); font-weight: 550;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--stroke);
}
.card-title { font-weight: 600; font-size: 14px; letter-spacing: -0.015em; }
.card-head .topbar-spacer { flex: 1; }

/* ── Stat strip ──────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-1); border: 1px solid var(--stroke);
}
.stat-n {
  font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat-l { font-size: 12px; color: var(--ink-3); margin-top: 3px; letter-spacing: -0.005em; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--stroke); background: var(--surface-2);
  color: var(--ink); font-weight: 500; font-size: 13px;
  letter-spacing: -0.01em; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), opacity .15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--stroke-strong); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; flex: 0 0 14px; }

.btn-primary {
  background: var(--blue); border-color: transparent; color: #fff; font-weight: 550;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); border-color: transparent; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 4px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--stroke); }
/* Destructive actions sit quiet until you're actually on them — a column of
   seven red "Archive" buttons reads as a warning the page doesn't mean. */
.btn-danger { color: var(--ink-2); border-color: var(--stroke); background: transparent; }
.btn-danger:hover:not(:disabled) {
  color: #ff6961; background: rgba(255, 69, 58, .12); border-color: rgba(255, 69, 58, .45);
}
.btn-block { width: 100%; }

/* ── Inputs ──────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.label {
  display: block; font-size: 12px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 6px; letter-spacing: -0.005em;
}
.label .label-note { color: var(--ink-3); font-weight: 400; }

.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border-radius: 5px;
  background: var(--bg-raised); border: 1px solid var(--stroke);
  color: var(--ink); outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--stroke-strong); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .22);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.textarea { resize: vertical; min-height: 140px; line-height: 1.6; font-family: inherit; }
.textarea.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 12.5px; }

.select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.75L6 7.75l3-3' stroke='%23a1a1a6' stroke-width='1.3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
.select option { background: #1c1c1f; color: var(--ink); }

/* ── Sections ────────────────────────────────────────────────────────
   The composer asks for three different kinds of thing — who it goes to,
   what happened on the call, and the email itself. Left as one flat column
   of equal-weight fields it reads as a form with no shape, so each gets a
   quiet header and its own block of space. */
.section { margin-bottom: 26px; }
.section:last-of-type { margin-bottom: 0; }
.section-head {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 1px solid var(--stroke);
}

/* An input with a button welded to its right edge. Keeps the right margin
   flush with the full-width fields above and below it. */
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row > .input, .input-row > .select { flex: 1; min-width: 0; }
.input-row > .btn { flex: 0 0 auto; }

/* ── Call box ────────────────────────────────────────────────────────
   Facts, tags, recording, transcript and notes are all the same subject,
   so they live in one bordered unit instead of floating as separate rows
   divided by stray hairlines. */
.callbox {
  border: 1px solid var(--stroke); border-radius: var(--r);
  background: var(--bg-raised); overflow: hidden;
}
.callbox-row { padding: 13px 14px; }
.callbox-row + .callbox-row { border-top: 1px solid var(--stroke); }

/* Call facts read as a sentence, not as seven identical chips. */
.meta-line { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.meta-line .dur { color: #4fd869; font-weight: 550; }
/* Contact-only composer: there is no call to be pleased about. */
.meta-line .dur.none { color: var(--orange); }
.meta-line .sep { color: var(--ink-3); margin: 0 6px; }

/* Inside the box a disclosure IS a row, so it takes the row's padding and
   the row's divider rather than its own stand-alone rule. Declared after
   .callbox-row so the two same-specificity rules can't fight. */
.callbox > .disclosure { padding: 13px 14px; border-top: 1px solid var(--stroke); }
.callbox .transcript { background: var(--bg); }
.summary-note { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.send-bar {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--stroke);
}

/* ── Rich text editor ─────────────────────────────────────────────
   Liv is a salesperson, not a developer — he never sees a tag. The editor
   stores HTML underneath and renders it formatted. */
.editor-wrap {
  border: 1px solid var(--stroke); border-radius: 5px;
  background: var(--bg-raised); overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.editor-wrap:hover { border-color: var(--stroke-strong); }
.editor-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .22);
}
.toolbar {
  display: flex; gap: 2px; align-items: center; flex-wrap: wrap;
  padding: 5px 6px; border-bottom: 1px solid var(--stroke);
  background: var(--surface-1);
}
.tbtn {
  min-width: 28px; padding: 5px 9px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-size: 12.5px; line-height: 1;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.tbtn:hover { background: var(--surface-3); color: var(--ink); }
.tbtn.on { background: rgba(10, 132, 255, .2); color: #6cb4ff; }
.tbtn-tags { color: var(--ink-2); font-weight: 500; }
.tbtn-tags:hover { color: var(--ink); }

.editor {
  min-height: 200px; max-height: 440px; overflow-y: auto;
  padding: 13px 14px; outline: none;
  font-size: 14px; line-height: 1.62; color: var(--ink);
}
.editor:empty::before {
  content: attr(data-placeholder); color: var(--ink-3); pointer-events: none;
}
.editor p { margin: 0 0 12px; }
.editor p:last-child { margin-bottom: 0; }
.editor ul, .editor ol { margin: 0 0 12px; padding-left: 22px; }
.editor li { margin: 0 0 4px; }
.editor a { color: var(--blue); text-decoration: underline; }
.editor strong, .editor b { color: #fff; font-weight: 600; }

/* Single-line variant for subject lines — same pills, no toolbar. */
.editor-line {
  min-height: 0; max-height: none; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--stroke); border-radius: 4px;
  background: var(--bg-raised); outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.editor-line:hover { border-color: var(--stroke-strong); }
.editor-line:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .22);
}
.editor-line:empty::before {
  content: attr(data-placeholder); color: var(--ink-3); pointer-events: none;
}

/* Merge tags render as tokens so they read as "a detail that fills itself
   in" rather than as code. */
.editor .mt {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  background: rgba(10, 132, 255, .16); border: 1px solid rgba(10, 132, 255, .3);
  color: #6cb4ff; font-size: 12.5px; font-weight: 500; white-space: nowrap;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }

/* ── Layout ──────────────────────────────────────────────────────── */
/* minmax(0, 1fr), never a bare 1fr: a grid track's default floor is
   min-content, and one long unbroken lead name in the feed was enough to
   push the whole column past the viewport and give the phone a sideways
   scroll. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.feed-card { display: flex; flex-direction: column; overflow: hidden; }

@media (min-width: 1080px) {
  .layout { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); align-items: start; }
  /* The feed rides along as Liv scrolls the composer, and caps its own
     height so the list scrolls internally instead of running off-screen. */
  .feed-col { position: sticky; top: 72px; }
  .feed-card { max-height: calc(100vh - 96px); }
  .feed-list { flex: 1 1 auto; min-height: 0; }
}
@media (max-width: 1079px) { .feed-list { max-height: 58vh; } }

.feed-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }

.call {
  /* flex-shrink:0 is load-bearing — without it the flex column squeezes
     every row down to overlapping slivers once the list overflows. */
  flex: 0 0 auto;
  padding: 10px 12px; border-radius: 5px; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  transition: background .13s var(--ease);
  position: relative;
}
.call:hover { background: var(--surface-2); }
.call.on { background: rgba(10, 132, 255, .14); border-color: rgba(10, 132, 255, .3); }
.call.on .call-name { color: #fff; }
.call-top { display: flex; align-items: baseline; gap: 8px; }
.call-name {
  font-weight: 550; font-size: 13.5px; letter-spacing: -0.012em; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.call-when { font-size: 11px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.call-co {
  font-size: 12px; color: var(--ink-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.call-meta { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }

/* ── Pills ───────────────────────────────────────────────────────── */
.pill {
  font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 3px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
  letter-spacing: -0.005em;
}
.pill.live { background: rgba(48, 209, 88, .14); color: #4fd869; }
.pill.hot { background: rgba(255, 69, 58, .15); color: #ff6961; }
.pill.warn { background: rgba(255, 159, 10, .14); color: #ffb340; }
.pill.sent { background: rgba(10, 132, 255, .16); color: #6cb4ff; }
.pill.stage {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--stroke-strong);
}

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty-mark { color: var(--ink-3); opacity: .5; margin-bottom: 12px; }
.empty-mark svg { width: 28px; height: 28px; }

/* ── Transcript ──────────────────────────────────────────────────── */
.transcript {
  max-height: 300px; overflow-y: auto; padding: 14px;
  border-radius: var(--r); background: var(--bg-raised);
  border: 1px solid var(--stroke); font-size: 13px; line-height: 1.6;
}
.t-line { margin-bottom: 10px; display: flex; gap: 10px; }
.t-line:last-child { margin-bottom: 0; }
.t-who {
  flex: 0 0 38px; font-size: 11px; font-weight: 600; padding-top: 1px;
  letter-spacing: -0.005em;
}
.t-who.them { color: #6cb4ff; }
.t-who.us { color: #4fd869; }
.t-text { flex: 1; color: var(--ink-2); }

/* ── Disclosure (transcript / notes) ─────────────────────────────── */
.disclosure { border-top: 1px solid var(--stroke); padding-top: 12px; }
.disclosure > summary {
  cursor: pointer; font-size: 13px; color: var(--ink-2);
  padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 7px;
  user-select: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 6px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .18s var(--ease);
  margin-left: 2px;
}
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { color: var(--ink); }

/* ── Toggle chips ────────────────────────────────────────────────── */
.toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; user-select: none;
  background: var(--surface-2); border: 1px solid var(--stroke);
  font-size: 12.5px; color: var(--ink-2);
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.toggle:hover { background: var(--surface-3); color: var(--ink); }
.toggle.on {
  background: rgba(10, 132, 255, .16); border-color: rgba(10, 132, 255, .4); color: #8cc4ff;
}
.toggle input { display: none; }

/* ── Stage control ───────────────────────────────────────────────── */
/* A GHL lead's stage lives on its opportunity, so this reads as a status
   you can act on: current stage on the left, the move on the right. */
.stage-wrap { position: relative; display: inline-flex; }
.stage-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 12px; border-radius: 5px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--stroke);
  color: var(--ink); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.stage-btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--stroke-strong); }
.stage-btn:disabled { opacity: .5; cursor: not-allowed; }
.stage-btn .stage-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: 0 0 6px;
}
.stage-btn.has-stage .stage-dot { background: var(--blue); }
.stage-btn .stage-caret {
  width: 9px; height: 9px; opacity: .55; flex: 0 0 9px; margin-left: 1px;
}
.stage-label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.stage-none { color: var(--ink-3); }

/* On a phone the lead's name and the two controls beside it fight for the
   same 390px and the name wraps to three lines. Give the name the full
   width and let the controls sit under it. */
.composer-who { min-width: 0; flex: 1; }
@media (max-width: 560px) {
  #composer .card-head { row-gap: 12px; }
  .composer-who { flex: 1 0 100%; }
  .stage-label { max-width: 150px; }
}

/* Popover menu — the stage list. */
.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0;
  min-width: 244px; max-height: 60vh; overflow-y: auto;
  padding: 5px;
  background: rgba(32, 32, 36, .92);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--stroke-strong); border-radius: var(--r);
  box-shadow: var(--shadow-3);
  animation: menu-in .14s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.menu-head {
  padding: 7px 10px 6px; font-size: 11.5px; color: var(--ink-3);
  border-bottom: 1px solid var(--stroke); margin-bottom: 4px;
}
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  border: 0; background: transparent; color: var(--ink);
  font-size: 13px; text-align: left; letter-spacing: -0.008em;
  transition: background .12s var(--ease);
}
.menu-item:hover { background: rgba(10, 132, 255, .9); color: #fff; }
.menu-item .tick { width: 13px; flex: 0 0 13px; color: var(--blue); }
.menu-item:hover .tick { color: #fff; }
.menu-item.current { color: var(--ink-2); }
.menu-item.current:hover { color: #fff; }

/* ── Notes ───────────────────────────────────────────────────────── */
.note-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.note {
  padding: 11px 13px; border-radius: var(--r);
  background: var(--bg-raised); border: 1px solid var(--stroke);
}
.note.unsynced { border-color: rgba(255, 159, 10, .4); background: rgba(255, 159, 10, .06); }
.note-body { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.note-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 11.5px; color: var(--ink-3);
}
.note-meta .grow { flex: 1; }
.note-del {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  padding: 2px 6px; border-radius: 3px; font-size: 11.5px;
}
.note-del:hover { color: #ff6961; background: rgba(255, 69, 58, .12); }

/* ── Preview ─────────────────────────────────────────────────────── */
.preview-frame {
  width: 100%; height: 440px; border: 1px solid var(--stroke);
  border-radius: var(--r); background: #fff;
}

/* ── Toast ───────────────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px));
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: 6px; font-size: 13px;
  background: rgba(38, 38, 42, .94); color: var(--ink);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-3);
  animation: toast-in .22s var(--ease);
}
.toast::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
  background: var(--ink-3);
}
.toast.ok::before { background: var(--green); }
.toast.err::before { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  padding: 18px; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade-in .16s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(660px, 100%); max-height: 88vh; overflow-y: auto;
  border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px solid var(--stroke-strong); box-shadow: var(--shadow-3);
  animation: modal-in .2s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ── Misc ────────────────────────────────────────────────────────── */
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border-radius: var(--r); background: var(--bg-raised);
  border: 1px solid var(--stroke);
  transition: border-color .14s var(--ease);
}
.list-row:hover { border-color: var(--stroke-strong); }
.muted { color: var(--ink-3); font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--stroke); margin: 16px 0; border: 0; }

.spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: currentColor;
  animation: spin .7s linear infinite;
}

.tagbtn {
  padding: 4px 9px; border-radius: 4px; cursor: pointer; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--ink-2);
  transition: background .13s var(--ease), color .13s var(--ease);
}
.tagbtn:hover { background: var(--surface-3); color: var(--ink); }

/* ── Login ───────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(380px, 100%); padding: 32px 28px; }
.auth-mark {
  width: 48px; height: 48px; border-radius: 10px; margin: 0 auto 18px;
  background: linear-gradient(180deg, #3d3d42, #232327);
  border: 1px solid var(--stroke-strong);
  display: grid; place-items: center; color: var(--ink);
  box-shadow: var(--shadow-2);
}
.auth-mark svg { width: 22px; height: 22px; }
.auth-title { text-align: center; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.auth-sub { text-align: center; color: var(--ink-3); font-size: 13px; margin: 6px 0 24px; }
.auth-err {
  padding: 10px 12px; border-radius: 5px; margin-bottom: 14px; font-size: 13px;
  background: rgba(255, 69, 58, .12); border: 1px solid rgba(255, 69, 58, .32); color: #ff6961;
}

/* ── Call Desk handoff banner ─────────────────────────────────────────
 * Shown above the composer when the sender was opened from the desk with
 * `?contact=`. Four states, each a different accent, because "still pulling",
 * "no transcript yet" and "never called" all look identical if you only give
 * them prose — and the difference decides whether the AI draft will work. */
.handoff {
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  margin-bottom: 10px;
  animation: handoff-in .22s var(--ease) both;
}
@keyframes handoff-in { from { opacity: 0; transform: translateY(-4px); } }

.handoff-in {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 13px; line-height: 1.45; color: var(--ink-2);
  flex-wrap: wrap;
}
.handoff-in b { color: var(--ink); font-weight: 600; }
.handoff-in .grow { min-width: 180px; }
.handoff-in .btn { flex: 0 0 auto; }

.handoff-dot {
  width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%;
  background: var(--ink-3);
}
/* Ready: the call and its transcript are loaded — nothing to act on. */
.handoff.ok     { border-color: rgba(48, 209, 88, .34);  background: rgba(48, 209, 88, .07); }
.handoff.ok     .handoff-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(48, 209, 88, .16); }
/* Waiting on GoHighLevel — the dot pulses so it reads as in-flight, not stuck. */
.handoff.wait   { border-color: rgba(10, 132, 255, .34); background: rgba(10, 132, 255, .07); }
.handoff.wait   .handoff-dot { background: var(--blue); animation: handoff-pulse 1.3s var(--ease) infinite; }
@keyframes handoff-pulse { 50% { opacity: .3; transform: scale(.8); } }
/* Compose is still possible, just without a transcript behind it. */
.handoff.warn   { border-color: rgba(255, 159, 10, .34); background: rgba(255, 159, 10, .07); }
.handoff.warn   .handoff-dot { background: var(--orange); }
.handoff.err    { border-color: rgba(255, 69, 58, .34);  background: rgba(255, 69, 58, .08); }
.handoff.err    .handoff-dot { background: var(--red); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
