:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #eef2ef;
  --ink: #172625;
  --muted: #6c7a77;
  --line: #dfe6e1;
  --forest: #102a2a;
  --forest-2: #173c39;
  --mint: #b9f3d5;
  --teal: #16745f;
  --teal-soft: #e5f6ee;
  --blue: #3868cf;
  --amber: #a56a13;
  --red: #aa403b;
  --shadow: 0 18px 50px rgba(18, 43, 40, 0.1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 3% -4%, rgba(185, 243, 213, 0.34), transparent 28rem),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea { font: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(56, 104, 207, 0.25);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body.modal-open { overflow: hidden; }

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-size: clamp(29px, 5vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 7px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.network-banner {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  padding: max(9px, env(safe-area-inset-top)) 16px 9px;
  background: #82520f;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

/* Login */
.login-shell {
  width: min(1050px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 510px) minmax(300px, 1fr);
  align-items: center;
  gap: 86px;
  padding: 48px 0;
}

.login-card {
  padding: 34px;
  border: 1px solid rgba(219, 228, 222, 0.94);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-brand,
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.preview-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(16, 42, 42, 0.2);
}

.brand-product {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 850;
}

.login-heading { margin: 42px 0 27px; }

.login-heading h1 { margin-top: 18px; }

.login-heading p,
.install-preview p,
.section-heading p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.secure-label,
.connection-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2aaa82;
  box-shadow: 0 0 0 4px rgba(42, 170, 130, 0.12);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.field > span {
  color: #354641;
  font-size: 13px;
  font-weight: 780;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfa;
  color: var(--ink);
  font-size: 16px;
}

.field textarea {
  min-height: 118px;
  padding-top: 13px;
  padding-bottom: 13px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: #75a899;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 116, 95, 0.08);
}

.remember-account {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px;
  margin-top: 17px;
  color: #354641;
  cursor: pointer;
}
.remember-account input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}
.remember-account strong,
.remember-account small { display: block; }
.remember-account strong { font-size: 13px; }
.remember-account small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.form-error {
  margin: 14px 0 -2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0ef;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.primary-button,
.light-button,
.link-button,
.text-button,
.icon-button,
.sheet-action {
  border: 0;
  font-weight: 850;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 12px 28px rgba(16, 42, 42, 0.2);
}

.primary-button:disabled { cursor: wait; opacity: 0.62; }

.install-preview {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 34px;
}

.phone-preview {
  width: 190px;
  height: 386px;
  position: relative;
  padding: 14px;
  border: 7px solid #102a2a;
  border-radius: 42px;
  background: linear-gradient(160deg, #eff6f0, #cfe8db);
  box-shadow: 0 36px 68px rgba(16, 42, 42, 0.22);
}

.phone-island {
  width: 76px;
  height: 21px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #102a2a;
}

.phone-preview-content {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
}

.preview-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  font-size: 28px;
}

.phone-preview-content span { color: var(--muted); font-size: 12px; }

.preview-home {
  width: 68px;
  height: 4px;
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #102a2a;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.app-header {
  min-height: calc(70px + env(safe-area-inset-top));
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: calc(12px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 12px max(22px, env(safe-area-inset-left));
  background: rgba(16, 42, 42, 0.97);
  color: #f8fbfa;
  backdrop-filter: blur(18px);
}

.brand-mark.compact {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--forest);
  box-shadow: none;
  font-size: 17px;
}

.header-brand .eyebrow { color: #91aaa4; }
.header-brand strong { display: block; margin-top: 2px; font-size: 14px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.connection-pill { background: rgba(255, 255, 255, 0.09); color: #d8e9e4; }
.connection-pill.offline { color: #ffddb4; }
.header-account-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #eef8f4;
  font-size: 10px;
  font-weight: 900;
}
.header-account-button.active { border-color: var(--mint); background: var(--mint); color: var(--forest); }

.app-main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 54px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.welcome-row,
.section-heading,
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.welcome-row { margin-bottom: 20px; }
.welcome-row h1,
.section-heading h1 { margin: 5px 0 5px; }
.welcome-row > div > p:last-child,
.section-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.owner-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: #dde9e2;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 900;
}

.owner-avatar.large { width: 52px; height: 52px; background: var(--mint); font-size: 14px; }
.owner-avatar-button { padding: 0; border: 0; cursor: pointer; }

.priority-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 5%, rgba(185, 243, 213, 0.18), transparent 13rem),
    var(--forest);
  color: #fff;
  box-shadow: 0 20px 44px rgba(16, 42, 42, 0.16);
}

.priority-card .eyebrow { color: #8eb5a9; }
.priority-card h2 { margin: 7px 0 6px; font-size: clamp(22px, 4vw, 30px); }
.priority-card p:last-child { max-width: 570px; margin-bottom: 0; color: #aac0ba; font-size: 13px; line-height: 1.55; }

.light-button {
  min-width: 136px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--forest);
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.metric-card.accent { border-color: #bee1cf; background: linear-gradient(140deg, #edfaf3, #fff); }
.metric-card > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-card strong { display: block; margin-top: 14px; font-size: 34px; line-height: 1; letter-spacing: -0.04em; }
.metric-card small { display: block; margin-top: 13px; color: #8a9692; font-size: 11px; }

.source-card,
.recent-section,
.safety-strip,
.account-card,
.session-policy {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.source-card { margin-top: 14px; padding: 19px; }
.section-title-row { align-items: center; }
.section-title-row h2 { margin: 4px 0 0; }
.sync-label { color: var(--teal); font-size: 11px; font-weight: 850; }

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.source-grid > div {
  min-height: 74px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 9px;
  padding: 12px;
  border-radius: 14px;
  background: #f6f8f6;
}

.source-grid strong { font-size: 22px; }
.source-grid small { grid-column: 2; margin-top: -15px; color: var(--muted); font-size: 11px; }

.source-dot {
  width: 10px;
  height: 10px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: #6d8bd5;
}

.source-dot.gmail { background: #d85b52; }
.source-dot.marketing { background: #b57b29; }

.recent-section { margin-top: 14px; padding: 19px; }
.link-button { min-height: 36px; padding: 0; background: transparent; color: var(--teal); font-size: 12px; }
.mini-lead-list { display: grid; gap: 8px; margin-top: 15px; }

.mini-lead-card,
.lead-card,
.call-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.mini-lead-card { align-items: center; padding: 12px; border-radius: 14px; }
.mini-lead-card:hover,
.lead-card:hover,
.call-card:hover { border-color: #bdd4c8; }
.mini-lead-card:active,
.lead-card:active,
.call-card:active { transform: translateY(1px); }

.source-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 13px;
  background: #e9effc;
  color: #4160a9;
  font-size: 14px;
  font-weight: 900;
}

.source-avatar.source-gmail { background: #fff0ee; color: #a83f37; }
.source-avatar.source-marketing { background: #fff3df; color: #8b5c16; }
.source-avatar.source-phone { background: var(--teal-soft); color: var(--teal); }

.record-copy { min-width: 0; }
.record-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.record-title-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 14px; white-space: nowrap; }
.record-meta { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.record-status,
.detail-language {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.record-status.status-follow-up { background: #fff2dc; color: #86570f; }
.record-status.status-booked { background: var(--teal-soft); color: var(--teal); }
.record-status.status-lost { background: #f0f2f0; color: #7c8783; }

.safety-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 15px 17px;
  background: #f8faf8;
}

.safety-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--teal);
  font-weight: 900;
}

.safety-strip strong { font-size: 12px; }
.safety-strip p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* Lists */
.section-heading { align-items: center; margin-bottom: 18px; }
.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--forest);
  font-size: 20px;
}
.icon-button:disabled { cursor: wait; opacity: 0.55; }

.heading-actions { display: flex; align-items: center; gap: 8px; }
.add-contact-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--forest);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}
.add-contact-button span:first-child { font-size: 18px; line-height: 1; }

.workspace-toolbar {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.search-field { position: relative; display: block; }
.search-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: #81908b; font-size: 20px; }
.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f6f3;
  color: var(--ink);
  font-size: 14px;
}

.filter-row {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-chip.active { border-color: #b8d9ca; background: var(--teal-soft); color: var(--teal); }

.list-meta {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.status-chip { min-height: 24px; padding: 0 8px; background: #ecefed; color: var(--muted); font-size: 10px; }
.status-chip.active { background: var(--teal-soft); color: var(--teal); }

.lead-list,
.call-list,
.contact-list { display: grid; gap: 10px; }

.lead-card,
.call-card {
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(20, 48, 44, 0.035);
}

.lead-card .record-copy p,
.call-card .record-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: #465651;
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-footer {
  display: block;
  margin-top: 11px;
  padding-top: 10px;
  overflow: hidden;
  border-top: 1px solid #edf1ee;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Outbound workbench */
.agent-work-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: 22px 26px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 18%, rgba(185, 243, 213, 0.2), transparent 11rem),
    var(--forest);
  color: #fff;
  box-shadow: 0 20px 44px rgba(16, 42, 42, 0.16);
}

.agent-visual {
  width: 170px;
  height: 170px;
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  isolation: isolate;
}

.agent-wave-orb {
  width: 124%;
  height: 124%;
  display: block;
  object-fit: contain;
  opacity: 0.74;
  transform: scale(0.92);
  transform-origin: center;
  filter: saturate(0.78) brightness(0.98) drop-shadow(0 0 10px rgba(99, 208, 255, 0.22));
  will-change: transform, filter, opacity;
}
.agent-work-card[data-agent-state="ready"] .agent-wave-orb,
.agent-work-card[data-agent-state="review"] .agent-wave-orb { opacity: 0.88; filter: saturate(0.9) brightness(1.02) drop-shadow(0 0 13px rgba(88, 207, 255, 0.3)); }
.agent-work-card[data-agent-state="calling"][data-call-phase="dialing"] .agent-wave-orb { opacity: 0.94; transform: scale(0.96); }
.agent-work-card[data-agent-state="calling"][data-call-phase="connected"] .agent-wave-orb {
  opacity: 1;
  animation: callWaveOrb 1.08s ease-in-out infinite;
}

.agent-copy h2 { margin: 10px 0 7px; font-size: clamp(22px, 3vw, 30px); }
.agent-copy > p { max-width: 620px; margin: 0; color: #b5c9c3; font-size: 13px; line-height: 1.6; }
.agent-state-row { display: flex; align-items: center; gap: 8px; color: #dff5eb; font-size: 11px; font-weight: 850; }
.agent-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #91aaa4; box-shadow: 0 0 0 4px rgba(145, 170, 164, 0.12); }
.agent-work-card[data-agent-state="calling"] .agent-live-dot { background: #54e3a6; box-shadow: 0 0 0 5px rgba(84, 227, 166, 0.16); animation: liveDot 1.4s ease-in-out infinite; }
.agent-work-card[data-agent-state="ready"] .agent-live-dot { background: #d7b35c; box-shadow: 0 0 0 4px rgba(215, 179, 92, 0.15); }
.agent-policy-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.agent-policy-row span { min-height: 27px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #bcd0ca; font-size: 9px; font-weight: 800; }
.agent-policy-row span:first-child { background: rgba(255, 218, 145, 0.12); color: #ffdda1; }

.live-monitor-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid #c8ddd3;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 242, 0.92));
  box-shadow: 0 12px 30px rgba(16, 62, 51, 0.06);
}
.live-monitor-visual { display: flex; align-items: center; gap: 10px; }
.live-monitor-headphones {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #b8d8c9;
  border-radius: 14px;
  background: #e9f7f0;
  color: var(--teal);
}
.live-monitor-headphones > .ph { font-size: 22px; line-height: 1; }
.live-monitor-wave { height: 28px; display: flex; align-items: center; gap: 3px; }
.live-monitor-wave i { width: 3px; height: 8px; border-radius: 999px; background: #99b7ad; }
.live-monitor-wave i:nth-child(2),
.live-monitor-wave i:nth-child(6) { height: 15px; }
.live-monitor-wave i:nth-child(3),
.live-monitor-wave i:nth-child(5) { height: 22px; }
.live-monitor-wave i:nth-child(4) { height: 28px; }
.live-monitor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-monitor-heading h2 { margin: 3px 0 0; font-size: 17px; }
.live-monitor-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #cbd9d3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #60736c;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}
.live-monitor-copy > p { margin: 8px 0 0; color: #576a63; font-size: 11px; line-height: 1.5; }
.live-monitor-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 9px; }
.live-monitor-meta > span { display: inline-flex; align-items: center; gap: 7px; color: var(--forest-2); font-size: 10px; }
.live-monitor-meta > span i { width: 7px; height: 7px; border-radius: 50%; background: #9bada7; }
.live-monitor-meta small { color: var(--muted); font-size: 9px; font-weight: 750; }
.live-monitor-button {
  min-width: 132px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: #dce7e2;
  color: #6b7b75;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
}
.live-monitor-button > .ph { font-size: 16px; line-height: 1; }
.live-monitor-button:disabled { cursor: not-allowed; opacity: 1; }
.live-monitor-card[data-monitor-state="ringing"] { border-color: #dbc98f; background: linear-gradient(145deg, #fffdf7, #f8f4e8); }
.live-monitor-card[data-monitor-state="ringing"] .live-monitor-badge { border-color: #e3d3a0; background: #fff8df; color: #85671f; }
.live-monitor-card[data-monitor-state="ringing"] .live-monitor-meta > span i { background: #d7b35c; }
.live-monitor-card[data-monitor-state="unavailable"] { border-color: #9fcfb9; }
.live-monitor-card[data-monitor-state="unavailable"] .live-monitor-badge { border-color: #acd9c4; background: #e9f8f0; color: var(--teal); }
.live-monitor-card[data-monitor-state="unavailable"] .live-monitor-meta > span i { background: #38b77b; box-shadow: 0 0 0 4px rgba(56, 183, 123, 0.12); }
.live-monitor-card[data-monitor-state="listening"] .live-monitor-wave i { background: #2fbd80; animation: monitorWave 900ms ease-in-out infinite alternate; }
.live-monitor-card[data-monitor-state="listening"] .live-monitor-wave i:nth-child(2n) { animation-delay: 160ms; }

@keyframes monitorWave { from { transform: scaleY(0.55); } to { transform: scaleY(1); } }

.workbench-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.workbench-metrics article { padding: 16px 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.workbench-metrics span,
.workbench-metrics small { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.workbench-metrics strong { display: block; margin: 9px 0 7px; font-size: 27px; line-height: 1; }

.usage-cost-card {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #cfe0d7;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbfdfb, #f1f7f4);
  box-shadow: 0 12px 30px rgba(16, 62, 51, 0.05);
}
.usage-cost-heading,
.usage-live-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.usage-cost-heading h2 { margin: 3px 0 0; font-size: 17px; }
.usage-estimate-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}
.usage-estimate-badge.active { border-color: #9ed4ba; background: var(--teal-soft); color: var(--teal); }
.usage-live-row {
  margin-top: 15px;
  padding: 14px 15px;
  border-radius: 15px;
  background: var(--forest);
  color: #fff;
}
.usage-live-row > div { min-width: 0; }
.usage-live-row > div:last-child { text-align: right; }
.usage-live-row span,
.usage-live-row small { display: block; color: #a9c0ba; font-size: 9px; font-weight: 750; }
.usage-live-row strong { display: block; margin: 5px 0 4px; font-size: 21px; letter-spacing: -0.02em; }
.usage-direction-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.usage-direction-grid article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.usage-direction-grid span,
.usage-direction-grid small { display: block; color: var(--muted); font-size: 9px; font-weight: 750; }
.usage-direction-grid strong { display: block; margin: 7px 0 5px; font-size: 18px; letter-spacing: -0.02em; }
.usage-direction-grid small { min-height: 26px; line-height: 1.45; }
.usage-direction-grid .usage-direction-total { border-color: #9fcdb7; background: #f0f8f4; }
.usage-direction-grid .usage-direction-total strong { color: var(--teal); }
.usage-net-summary { display: grid; grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.usage-net-summary article,
.usage-service-grid article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.usage-net-summary span,
.usage-net-summary small,
.usage-service-grid span,
.usage-service-grid small { display: block; color: var(--muted); font-size: 9px; font-weight: 750; }
.usage-net-summary strong,
.usage-service-grid strong { display: block; margin: 7px 0 5px; overflow: hidden; font-size: 18px; letter-spacing: -0.02em; text-overflow: ellipsis; }
.usage-net-summary small,
.usage-service-grid small { min-height: 26px; line-height: 1.45; }
.usage-net-summary .usage-net-total { border-color: #8fc8ac; background: #e7f6ee; }
.usage-net-summary .usage-net-total strong { color: var(--teal); font-size: 23px; }
.usage-net-summary .usage-free-offset { border-color: #c7dfd2; background: #f2f8f5; }
.usage-net-summary .usage-free-offset strong { color: #237454; }
.usage-service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.usage-service-grid article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.usage-disclaimer { margin: 10px 2px 0; color: #697a74; font-size: 9px; line-height: 1.55; }

.free-unit-section {
  margin-top: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.free-unit-list { display: grid; gap: 9px; margin-top: 14px; }
.free-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.9fr);
  align-items: center;
  gap: 18px;
  padding: 12px 13px;
  border: 1px solid #e2eae5;
  border-radius: 13px;
  background: #fafcfb;
}
.free-unit-row strong,
.free-unit-row span,
.free-unit-row b { display: block; }
.free-unit-row strong { font-size: 12px; }
.free-unit-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.free-unit-row b { margin-bottom: 7px; color: var(--forest-2); text-align: right; font-size: 10px; }
.free-unit-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4ebe7; }
.free-unit-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #4b8cf7, #62d9a7); transition: width 240ms ease; }
.free-unit-track i.low { background: linear-gradient(90deg, #ce7a3a, #e2b254); }
.free-unit-note { margin: 12px 2px 0; color: #697a74; font-size: 9px; line-height: 1.6; }
.service-cost-note { margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: #edf2ef; color: #53625d; }
.service-cost-note strong { display: block; color: var(--forest-2); font-size: 11px; }
.service-cost-note p { margin: 5px 0 0; font-size: 10px; line-height: 1.6; }

.batch-builder,
.outbound-history-section,
.inbound-archive {
  margin-top: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.batch-title-row > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.batch-counter { min-width: 54px; min-height: 31px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 900; }
.workbench-search { margin-top: 16px; }
.candidate-list { max-height: 460px; display: grid; gap: 8px; margin-top: 10px; overflow-y: auto; overscroll-behavior: contain; }
.candidate-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafcfa;
  cursor: pointer;
}
.candidate-card.selected { border-color: #96ceb4; background: #edf9f2; box-shadow: inset 0 0 0 1px rgba(22, 116, 95, 0.08); }
.candidate-card input { width: 19px; height: 19px; margin: 0; accent-color: var(--teal); }
.candidate-card-copy { min-width: 0; }
.candidate-card-copy strong,
.candidate-card-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-card-copy strong { font-size: 13px; }
.candidate-card-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.candidate-card-copy p { display: -webkit-box; margin: 7px 0 0; overflow: hidden; color: #4d5d58; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.candidate-language-control { display: grid; justify-items: end; gap: 4px; }
.candidate-language-select {
  min-height: 30px;
  max-width: 94px;
  padding: 0 24px 0 8px;
  border: 1px solid #b9d8cb;
  border-radius: 9px;
  background: #fff;
  color: var(--teal);
  font: inherit;
  font-size: 10px;
  font-weight: 850;
}
.candidate-language-select:disabled { border-color: var(--line); background: #edf1ef; color: var(--muted); opacity: 1; }
.candidate-language-status { color: var(--muted); font-size: 9px; font-weight: 800; }
.candidate-list .empty-state { min-height: 150px; }
.batch-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.secondary-button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f4f6f4; color: var(--ink); font-size: 11px; font-weight: 850; }
.secondary-button.accent { border-color: #b7ddca; background: var(--teal-soft); color: var(--teal); }
.secondary-button:disabled { cursor: not-allowed; opacity: 0.48; }
.primary-button.compact-action { width: auto; min-width: 156px; min-height: 44px; margin: 0; border-radius: 12px; box-shadow: none; }
.primary-button.launch-action { background: linear-gradient(135deg, #15745f, #0f5548); }
.primary-button.launch-action:disabled { cursor: not-allowed; opacity: 0.48; }
.batch-notice { margin: 11px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: right; }

.outbound-history-list { display: grid; gap: 8px; margin-top: 13px; }
.outbound-history-list .empty-state { min-height: 150px; }
.outbound-history-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfa; }
.outbound-history-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: 15px; }
.outbound-history-copy { min-width: 0; }
.outbound-history-copy strong,
.outbound-history-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outbound-history-copy strong { font-size: 12px; }
.outbound-history-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.outbound-result { min-height: 25px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: #edf1ef; color: var(--muted); font-size: 9px; font-weight: 850; white-space: nowrap; }
.outbound-result.active { background: var(--teal-soft); color: var(--teal); }
.outbound-history-statuses { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.outbound-service-status { min-height: 25px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; white-space: nowrap; }

.inbound-archive { padding: 0; overflow: hidden; }
.inbound-archive summary { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; cursor: pointer; list-style: none; }
.inbound-archive summary::-webkit-details-marker { display: none; }
.inbound-archive summary::after { content: "⌄"; color: var(--muted); font-size: 18px; }
.inbound-archive[open] summary::after { transform: rotate(180deg); }
.inbound-archive summary > span:first-child { flex: 1; }
.inbound-archive summary strong,
.inbound-archive summary small { display: block; }
.inbound-archive summary strong { font-size: 13px; }
.inbound-archive summary small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.inbound-archive summary > span:last-of-type { color: var(--muted); font-size: 10px; font-weight: 800; }
.archive-toolbar { margin: 0 15px; }
.inbound-archive > .list-meta,
.inbound-archive > .call-list { margin-right: 15px; margin-left: 15px; }
.inbound-archive > .call-list { margin-bottom: 15px; }

@keyframes callWaveOrb {
  0%, 100% { transform: scale(0.96); filter: saturate(0.98) brightness(1.02) drop-shadow(0 0 12px rgba(82, 205, 255, 0.38)); }
  42% { transform: scale(1.045, 1.015); filter: saturate(1.18) brightness(1.1) drop-shadow(0 0 22px rgba(83, 213, 255, 0.64)); }
  68% { transform: scale(0.985, 1.035); filter: saturate(1.06) brightness(1.06) drop-shadow(0 0 17px rgba(120, 134, 255, 0.5)); }
}
@keyframes liveDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Contacts */
.contact-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 7px 20px rgba(20, 48, 44, 0.035);
  text-align: left;
}
.contact-card:hover { border-color: #bdd4c8; }
.contact-card:active { transform: translateY(1px); }
.contact-avatar {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #dff3e8, #c8e6d6);
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.contact-avatar.large { width: 58px; height: 58px; font-size: 15px; }
.contact-activity { flex: none; color: #8b9793; font-size: 10px; font-weight: 750; }
.contact-counters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.contact-counters span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0f3f1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.contact-counters .saved-contact-label { background: var(--teal-soft); color: var(--teal); }
.contact-arrow { color: #97a49f; font-size: 24px; font-weight: 400; }

.empty-state {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  text-align: center;
}

.empty-state h2 { font-size: 16px; }
.empty-state p { max-width: 440px; font-size: 12px; }
.empty-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 24px;
}
.mini-lead-list .empty-state { min-height: 150px; }

/* Account */
.account-heading { margin-bottom: 18px; }
.account-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.account-card strong,
.account-card span { display: block; }
.account-card > div > span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.text-button { min-height: 38px; padding: 0 13px; border-radius: 11px; background: #eff2f0; color: var(--ink); }
.text-button.danger { background: #fff1f0; color: var(--red); }
.device-title { margin: 25px 2px 12px; }
.danger-text { color: var(--red); }

.device-list { display: grid; gap: 10px; }
.device-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.device-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--forest);
  font-size: 19px;
}

.device-card strong,
.device-card span { display: block; }
.device-card span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.current-label { color: var(--teal) !important; font-weight: 850; }
.revoke-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #eed1ce;
  border-radius: 10px;
  background: #fff5f4;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
}

.session-policy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 15px 17px;
  color: var(--muted);
  font-size: 11px;
}
.session-policy strong { color: var(--ink); }

/* Detail sheets */
.sheet-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 25, 23, 0.58);
  backdrop-filter: blur(8px);
}

.detail-sheet {
  width: min(700px, 100%);
  max-height: min(86vh, 880px);
  max-height: min(86dvh, 880px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(5, 24, 21, 0.34);
}

.sheet-handle { display: none; }
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-header h2 { margin: 4px 0 0; font-size: 22px; }
.sheet-header-actions { display: flex; align-items: center; gap: 8px; }
.sheet-edit {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
}
.sheet-edit:disabled { cursor: wait; opacity: 0.55; }
.sheet-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}
.sheet-body {
  max-height: calc(min(86vh, 880px) - 78px);
  max-height: calc(min(86dvh, 880px) - 78px);
  overflow-y: auto;
  padding: 18px 22px calc(26px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.detail-loading { margin: 30px 0; color: var(--muted); text-align: center; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 14px; }
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.detail-meta-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8; }
.detail-meta-grid dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.detail-meta-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 800; }
.detail-block { padding: 15px 0; border-top: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 7px; font-size: 12px; }
.detail-block p { margin: 0; color: #455650; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.transcript-block p { white-space: pre-wrap; }
.sheet-action {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 13px;
  background: var(--forest);
  color: #fff;
}

.contact-detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 3px 0 16px;
}
.contact-detail-hero strong,
.contact-detail-hero span { display: block; }
.contact-detail-hero strong { font-size: 20px; letter-spacing: -0.025em; }
.contact-detail-hero div > span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.contact-call-actions {
  padding: 14px;
  margin: 0 0 16px;
  border: 1px solid #cce1d8;
  border-radius: 17px;
  background: linear-gradient(145deg, #f4fbf7, #edf7f2);
}
.contact-language-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 1px 10px;
}
.contact-language-field > span { color: #50645d; font-size: 11px; font-weight: 850; }
.contact-language-field select {
  min-height: 38px;
  padding: 0 32px 0 11px;
  border: 1px solid #bad5ca;
  border-radius: 11px;
  background: #fff;
  color: var(--teal);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
}
.contact-ai-call,
.contact-workbench-button,
.contact-manual-call {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
.contact-ai-call {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, #15745f, #0f5548);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 85, 72, 0.16);
}
.contact-call-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 8px;
  margin-top: 8px;
}
.contact-workbench-button,
.contact-manual-call {
  border: 1px solid #bad5ca;
  background: #fff;
  color: var(--teal);
}
.contact-call-actions button:disabled,
.contact-manual-call.disabled { pointer-events: none; opacity: 0.48; }
.contact-call-actions > p { margin: 10px 2px 0; color: #60736c; font-size: 10px; line-height: 1.45; }
.contact-notes-block p { white-space: pre-wrap; }
.contact-timeline { padding-top: 16px; border-top: 1px solid var(--line); }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.timeline-heading h3 { margin: 0; font-size: 13px; }
.timeline-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.timeline-event {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 0;
  border: 0;
  border-top: 1px solid #edf1ee;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
button.timeline-event:hover .timeline-title-row strong { color: var(--teal); }
.timeline-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff3df;
  color: #8b5c16;
  font-size: 11px;
  font-weight: 900;
}
.event-call .timeline-marker { background: var(--teal-soft); color: var(--teal); }
.timeline-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.timeline-title-row strong { font-size: 12px; }
.timeline-title-row time { flex: none; color: #899591; font-size: 9px; }
.timeline-event div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.timeline-event p { margin: 7px 0 0; color: #4a5a55; font-size: 12px; line-height: 1.5; }
.timeline-arrow { align-self: center; color: #9aa6a1; font-size: 22px; }
.contact-timeline .empty-state { min-height: 150px; }
.contact-form { padding-top: 3px; }
.contact-form .field { margin-top: 14px; }
.contact-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-save-button { margin-bottom: 2px; }

/* Bottom navigation */
.bottom-nav {
  min-height: calc(70px + env(safe-area-inset-bottom));
  position: fixed;
  z-index: 20;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid rgba(211, 221, 215, 0.92);
  background: rgba(252, 253, 251, 0.95);
  backdrop-filter: blur(22px);
}

.bottom-nav-item {
  width: min(112px, 19vw);
  min-height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #75827e;
}
.bottom-nav-item > .ph { font-size: 21px; line-height: 1; }
.bottom-nav-item small { font-size: 10px; font-weight: 800; }
.bottom-nav-item.active { background: #e4f1ea; color: var(--teal); }

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 18px 40px rgba(12, 36, 32, 0.24);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.standalone .install-preview { display: none; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; gap: 36px; }
  .install-preview { max-width: 540px; margin: 0 auto; }
}

@media (max-width: 620px) {
  .login-shell {
    width: 100%;
    padding: max(20px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  }
  .login-card { padding: 24px 20px; border-radius: 22px; }
  .login-heading { margin: 34px 0 24px; }
  .login-heading h1 { font-size: 31px; }
  .install-preview { display: none; }

  .app-header {
    min-height: calc(64px + env(safe-area-inset-top));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .connection-pill { min-height: 26px; padding: 0 8px; font-size: 10px; }
  .app-main { width: calc(100% - 26px); padding: 22px 0 34px; }
  .welcome-row h1,
  .section-heading h1 { font-size: 29px; }

  .priority-card { align-items: flex-start; flex-direction: column; padding: 21px; }
  .priority-card .light-button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:last-child { grid-column: 1 / -1; min-height: 104px; }
  .metric-card { min-height: 116px; padding: 15px; }
  .metric-card strong { font-size: 31px; }

  .source-card,
  .recent-section { padding: 16px; }
  .source-grid { gap: 7px; }
  .source-grid > div { min-height: 67px; padding: 10px 8px; column-gap: 7px; }
  .source-grid strong { font-size: 20px; }
  .source-grid small { font-size: 10px; }

  .workspace-toolbar { margin: 0 -1px; }
  .filter-row { margin-right: -10px; padding-right: 10px; }
  .lead-card,
  .call-card { padding: 14px; }
  .contact-card { padding: 13px; }
  .source-avatar { width: 39px; height: 39px; border-radius: 12px; }

  .agent-work-card { min-height: 0; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
  .agent-visual { width: 105px; height: 123px; transform: scale(0.82); transform-origin: center; }
  .agent-copy h2 { font-size: 19px; }
  .agent-copy > p { font-size: 11px; }
  .agent-policy-row { margin-top: 12px; }
  .agent-policy-row span:last-child { display: none; }
  .live-monitor-card { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 15px; }
  .live-monitor-visual { align-self: flex-start; }
  .live-monitor-wave { display: none; }
  .live-monitor-button { width: 100%; grid-column: 1 / -1; }
  .workbench-metrics { gap: 7px; }
  .workbench-metrics article { padding: 13px 10px; }
  .workbench-metrics strong { font-size: 23px; }
  .workbench-metrics small { min-height: 25px; font-size: 9px; }
  .usage-cost-card { padding: 15px; }
  .usage-net-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-net-summary .usage-net-total { grid-column: 1 / -1; }
  .usage-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-service-grid article { padding: 11px; }
  .usage-service-grid strong { font-size: 17px; }
  .free-unit-section { padding: 15px; }
  .free-unit-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 0.85fr); gap: 10px; }
  .batch-builder,
  .outbound-history-section { padding: 15px; }
  .candidate-list { max-height: 420px; }
  .batch-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-actions .primary-button.compact-action { width: 100%; }
  .batch-actions .primary-button.compact-action:not(.launch-action) { grid-column: 1 / -1; }
  .batch-actions .primary-button.launch-action { grid-column: 1 / -1; }
  .batch-notice { text-align: left; }

  .account-card { grid-template-columns: auto 1fr; }
  .account-card .text-button { grid-column: 2; justify-self: start; }
  .device-card { grid-template-columns: auto 1fr; }
  .device-card .revoke-button { grid-column: 2; justify-self: start; }
  .session-policy { flex-direction: column; gap: 6px; }

  .sheet-backdrop { padding: 0; }
  .detail-sheet {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
  }
  .sheet-handle { width: 42px; height: 5px; display: block; margin: 9px auto 0; border-radius: 4px; background: #ced8d1; }
  .sheet-header { padding: 12px 16px 13px; }
  .sheet-header h2 { font-size: 20px; }
  .sheet-body { max-height: calc(92dvh - 77px); padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
  .contact-form-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 370px) {
  .login-card { padding: 21px 17px; }
  .header-brand .eyebrow { display: none; }
  .connection-pill { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card:last-child { grid-column: auto; }
  .source-grid { grid-template-columns: 1fr; }
  .add-contact-button span:last-child { display: none; }
  .add-contact-button { width: 42px; justify-content: center; padding: 0; }
  .source-grid > div { grid-template-columns: auto auto 1fr; }
  .source-grid small { grid-column: 3; grid-row: 1; margin-top: 0; }
  .bottom-nav { padding-left: 5px; padding-right: 5px; }
  .agent-work-card { grid-template-columns: 1fr; text-align: center; }
  .agent-visual { display: none; }
  .agent-state-row,
  .agent-policy-row { justify-content: center; }
  .live-monitor-card { grid-template-columns: 1fr; text-align: center; }
  .live-monitor-visual,
  .live-monitor-meta,
  .live-monitor-heading { justify-content: center; }
  .live-monitor-heading { flex-direction: column; }
  .live-monitor-button { grid-column: auto; }
  .workbench-metrics { grid-template-columns: 1fr; }
  .workbench-metrics article { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .workbench-metrics strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .usage-live-row { align-items: flex-start; flex-direction: column; }
  .usage-live-row > div:last-child { text-align: left; }
  .usage-net-summary,
  .usage-direction-grid,
  .usage-service-grid { grid-template-columns: 1fr; }
  .usage-net-summary .usage-net-total { grid-column: auto; }
  .free-unit-row { grid-template-columns: 1fr; }
  .free-unit-row b { text-align: left; }
  .batch-title-row { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Unified live-call command card */
.agent-work-card {
  min-height: 590px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 30px 26px 22px;
  text-align: center;
}
.agent-work-card > .live-monitor-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 17px;
}
.agent-work-card > .live-monitor-button > .ph { font-size: 25px; }
.agent-work-card > .live-monitor-button > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.agent-work-card > .live-monitor-button:not(:disabled) { cursor: pointer; }
.agent-work-card > .live-monitor-button:not(:disabled):active { transform: scale(0.95); }
.agent-work-card[data-monitor-state="listening"] > .live-monitor-button { color: #0b8e68; }
.agent-work-card .agent-visual {
  width: min(270px, 70vw);
  height: min(270px, 70vw);
  flex: none;
  margin: -6px auto 20px;
  transform: none;
}
.agent-work-card .agent-wave-orb { width: 112%; height: 112%; transform: scale(1); opacity: 0.95; }
.agent-work-card .agent-copy { width: 100%; position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.agent-work-card .agent-state-row { justify-content: center; font-size: 14px; }
.agent-work-card .agent-copy h2 { margin: 11px 0 2px; font-size: clamp(30px, 7vw, 44px); line-height: 1.08; }
.agent-call-timer { display: block; margin-top: 5px; color: #34c78d; font-size: clamp(28px, 6vw, 38px); font-variant-numeric: tabular-nums; line-height: 1; }
.agent-work-card .agent-copy > p { max-width: 470px; margin-top: 10px; font-size: 11px; }
.agent-work-card .agent-policy-row { justify-content: center; margin-top: 11px; }
.agent-work-card .live-monitor-message { min-height: 18px; margin: 7px 0 0; font-size: 9px; }
.call-progress-panel {
  width: 100%;
  margin-top: 17px;
  padding: 16px 17px 14px;
  border-radius: 20px;
}
.call-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #587a98; font-size: 13px; font-weight: 800; }
.call-progress-heading strong { color: #2aa87b; font-size: 17px; }
.call-terminal-status { padding: 5px 9px; border-radius: 999px; font-size: 9px; }
.call-phase-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; }
.call-phase-track > span { min-width: 0; position: relative; display: grid; justify-items: center; gap: 7px; color: #7790a4; font-size: 8px; font-weight: 800; }
.call-phase-track > span::before { content: ""; width: 100%; height: 3px; position: absolute; top: 11px; right: 50%; background: rgba(125, 167, 193, 0.26); }
.call-phase-track > span:first-child::before { display: none; }
.call-phase-track i { width: 24px; height: 24px; position: relative; z-index: 1; display: grid; place-items: center; border: 2px solid rgba(116, 158, 187, 0.44); border-radius: 50%; background: rgba(224, 241, 250, 0.94); }
.call-phase-track span.complete i,
.call-phase-track span.active i { border-color: #70dcb0; background: #dff9ed; box-shadow: 0 0 15px rgba(70, 225, 167, 0.4); }
.call-phase-track span.complete::before,
.call-phase-track span.active::before { background: #82deb7; }
.call-phase-track span.active { color: #23956e; }
.call-phase-track span.active i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #56d59f; box-shadow: 0 0 10px #58dfa6; }
.call-phase-track span.complete i::after { content: "✓"; color: #279d74; font-size: 12px; font-style: normal; }
.agent-next-call { margin: 15px 0 0; color: #7690a5; font-size: 11px; }
.agent-next-call strong { color: #456c8b; }

@media (max-width: 620px) {
  .agent-work-card { min-height: 570px; padding: 25px 15px 16px; border-radius: 22px; }
  .agent-work-card .agent-visual { width: min(245px, 69vw); height: min(245px, 69vw); display: grid; }
  .agent-work-card .agent-copy h2 { font-size: 31px; }
  .agent-work-card .agent-copy > p { font-size: 10px; }
  .agent-work-card .agent-policy-row span:last-child { display: inline-flex; }
  .call-progress-panel { padding: 15px 11px 13px; }
  .call-phase-track > span { font-size: 7px; }
}

@media (max-width: 370px) {
  .agent-work-card { min-height: 540px; }
  .agent-work-card .agent-visual { display: grid; width: 215px; height: 215px; }
  .agent-work-card .agent-state-row,
  .agent-work-card .agent-policy-row { justify-content: center; }
}
