/* MedVet Pop — PacketFusion brand palette
   Navy #003B5C (primary) · Green #17C662 (accent) · Blue #63C1EA (secondary) · Grey #D9E1E2 */
:root {
  --navy: #003B5C;
  --green: #17C662;
  --blue: #63C1EA;
  --grey: #D9E1E2;
  --ink: #1c2b33;
  --muted: #5b7180;
  --card: #ffffff;
  --radius: 12px;
  font-family: "Avenir Next", "Avenir", "Futura", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: linear-gradient(160deg, #eef3f4, var(--grey));
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 10px 60px;
}

.panel {
  width: 440px;
  max-width: 100%;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 59, 92, .22);
  overflow: hidden;
  animation: popIn .45s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- incoming call header ---------- */
.callbar {
  background: linear-gradient(135deg, var(--navy), #00567f);
  color: #fff;
  padding: 16px 18px 14px;
}
.callbar .row { display: flex; align-items: center; gap: 12px; }
.ring {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(23,198,98,.18);
  display: grid; place-items: center;
  position: relative; flex: none;
}
.ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--green);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: .9; }
  100% { transform: scale(1.7); opacity: 0; }
}
.ring svg { width: 20px; height: 20px; fill: var(--green); }
.callnum { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.callmeta { font-size: 12px; opacity: .75; margin-top: 2px; }
.matchcount {
  margin-left: auto; flex: none;
  background: var(--green); color: #00351c;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.demo-reason { font-size: 10px; opacity: .65; margin-top: 7px; line-height: 1.4; }

/* ---------- status screens (loading / error / no-match) ---------- */
.status { text-align: center; padding: 34px 20px 30px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--grey); border-top-color: var(--green);
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status .big { font-size: 15px; font-weight: 700; color: var(--navy); }
.status .small { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.status.error .big { color: #b3402f; }
.status .btn { margin-top: 14px; padding: 8px 20px; }
.status .diag {
  margin: 12px auto 0; max-width: 100%; text-align: left;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px;
  line-height: 1.55; color: var(--muted);
  background: #f2f6f7; border: 1px solid var(--grey); border-radius: 8px;
  padding: 9px 11px; white-space: pre-wrap; word-break: break-word;
}

/* ---------- match picker (multiple Salesforce matches) ---------- */
.matchpicker { position: relative; background: #f2f6f7; border-bottom: 1px solid var(--grey); }
.mp-current {
  width: 100%; display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 18px; font: inherit; text-align: left;
}
.mp-current:hover { background: #eaf1f3; }
.mp-current .mp-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.mp-current .mp-type { font-size: 11.5px; color: var(--muted); }
.mp-current .mp-caret { margin-left: auto; color: var(--navy); font-size: 12px; }
.matchlist {
  position: absolute; z-index: 20; left: 10px; right: 10px; top: calc(100% - 2px);
  background: #fff; border: 1.5px solid var(--grey); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,59,92,.18); overflow: hidden;
}
.mopt {
  width: 100%; display: block; border: 0; background: transparent; cursor: pointer;
  text-align: left; font: inherit; padding: 10px 14px;
  border-bottom: 1px solid #eef3f4;
}
.mopt:last-child { border-bottom: 0; }
.mopt:hover { background: #f2f9fd; }
.mopt.active { background: #e9f9f0; }
.mopt .mo-name {
  font-size: 13px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 7px;
}
.mopt .mo-type {
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: #eef6fb; color: #2a7ba8;
}
.mopt .mo-type.client { background: #e9f9f0; color: #0b7a3e; }
.mopt .mo-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* inline chooser — ambiguous duplicates, the agent must pick */
.chooser { padding: 14px 18px 18px; }
.chooser .prompt { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.chooser .mopt { border: 1.5px solid #e7edee; border-radius: 10px; margin-bottom: 8px; }
.chooser .mopt:hover { border-color: var(--blue); }

/* ---------- contact card ---------- */
.contact { padding: 14px 18px 4px; }
.contact .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--navy); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}
.who h2 { font-size: 16px; color: var(--navy); }
.rectype { font-size: 11px; font-weight: 600; margin-top: 2px; color: #0b7a3e; }
.rectype.partner { color: #2a7ba8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.chip {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  background: #eef6fb; color: var(--navy);
  border: 1px solid #cde4f0;
}
.chip.loc { background: #e9f9f0; border-color: #bfeed4; color: #0b7a3e; }
.contactlines { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.contactlines a { color: #2a7ba8; text-decoration: none; }

.actions { display: flex; gap: 8px; padding: 10px 18px 14px; }
.btn {
  flex: 1; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 9px 6px;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--grey); }
.btn:hover { filter: brightness(1.12); }

/* ---------- patients ---------- */
.patients { border-top: 1px solid var(--grey); padding: 12px 18px 16px; }
.patients .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.patients h3 { font-size: 13px; color: var(--navy); text-transform: uppercase; letter-spacing: .6px; }
.patients .count {
  background: var(--blue); color: #06344a;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.patients input {
  margin-left: auto; width: 130px;
  font: inherit; font-size: 12px;
  padding: 5px 9px; border-radius: 8px;
  border: 1.5px solid var(--grey); outline-color: var(--blue);
}
.pet {
  border: 1.5px solid #e7edee; border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.pet:hover { border-color: var(--blue); }
.pet.open { border-color: var(--green); box-shadow: 0 4px 14px rgba(23,198,98,.15); }
.pet .top { display: flex; align-items: center; gap: 10px; }
.pet .icon {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: #eef6fb; display: grid; place-items: center; font-size: 17px;
}
.pet .name { font-weight: 700; font-size: 14px; color: var(--navy); }
.pet .breed { font-size: 11.5px; color: var(--muted); }
.pet .last { margin-left: auto; text-align: right; flex: none; }
.pet .ago { font-size: 12px; font-weight: 600; color: var(--navy); }
.pet .dept { font-size: 11px; color: var(--muted); }
.pet .never { font-size: 11.5px; color: #9fb2bc; font-style: italic; }
.pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.pill.Departed { background: #eef6fb; color: #2a7ba8; }
.pill.Complete { background: #e9f9f0; color: #0b7a3e; }
.pill.other    { background: var(--grey);  color: var(--muted); }
.pill.er { background: #ffe9e6; color: #b3402f; }
.history { display: none; margin-top: 10px; border-top: 1px dashed var(--grey); padding-top: 8px; }
.pet.open .history { display: block; }
.history .visit {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 4px 0;
}
.history .visit .d { font-weight: 600; color: var(--ink); min-width: 118px; }
.history .none { font-size: 12px; color: #9fb2bc; font-style: italic; }
.nextappt { margin-top: 8px; font-size: 12px; }
.nextappt.none { color: #9fb2bc; }
.nextappt.set { color: #0b7a3e; font-weight: 600; }

.empty { text-align: center; color: #9fb2bc; font-size: 12.5px; padding: 14px 0 6px; font-style: italic; }

/* ---------- call summary ---------- */
.summary {
  margin: 12px 18px 0;
  border: 1.5px solid #bfeed4; background: #f2fbf6;
  border-radius: var(--radius); padding: 12px 14px;
}
.summary h3 {
  font-size: 12.5px; color: #0b7a3e;
  text-transform: uppercase; letter-spacing: .6px;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px;
}
.summary .tag {
  font-size: 9.5px; background: var(--blue); color: #06344a;
  border-radius: 999px; padding: 2px 7px; letter-spacing: .4px;
}
.summary .body { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; color: var(--ink); }
.sum-actions { margin-top: 10px; display: flex; gap: 8px; }
.sum-actions .btn { padding: 8px 10px; font-size: 12px; }
.summary.working { border-color: var(--grey); background: #f6f8f9; }
.summary.working h3 { color: var(--muted); }
.summary.working .body { color: var(--muted); font-style: italic; }

/* ---------- live transcript ---------- */
.transcript { border-top: 1px solid var(--grey); margin-top: 12px; padding: 12px 18px 14px; }
.transcript .head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.transcript h3 { font-size: 12.5px; color: var(--navy); text-transform: uppercase; letter-spacing: .6px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: #9fb2bc; }
.livedot.live { background: #e0442e; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.lines { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.tline { font-size: 12.5px; line-height: 1.45; animation: lineIn .25s ease; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } }
.tline .who {
  font-weight: 700; font-size: 10.5px; margin-right: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}
.tline.agent .who { color: #2a7ba8; }
.tline.consumer .who { color: #0b7a3e; }

/* ---------- footer / replay ---------- */
footer {
  text-align: center; font-size: 10.5px; color: var(--muted);
  padding: 12px 0 14px; border-top: 1px solid var(--grey); margin-top: 12px;
}
footer b { color: var(--navy); }
footer .bp { color: #0b7a3e; }
.replay {
  position: fixed; right: 18px; bottom: 18px;
  background: var(--green); color: #00351c; border: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(23,198,98,.4);
}
