:root {
  --ink: #0c2340;
  --ink-2: #3a4566;
  --muted: #6b7591;
  --line: #e2e6f0;
  --bg: #f3f5fa;
  --card: #ffffff;
  --brand: #1b75bb;      /* Unison blue */
  --brand-2: #145a91;
  --brand-soft: #e6f1fa;
  --teal: #8bc53f;       /* Unison green */
  --hot: #e5484d;
  --warm: #f59e0b;
  --cold: #3b82f6;
  --ok: #0f9f6e;
  --warn: #b45309;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.err { color: var(--hot); min-height: 1.2em; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 12px 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform .08s ease, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 8px; }
.btn.huge {
  width: 100%; padding: 22px; font-size: 19px; border-radius: 20px; flex-direction: column; gap: 8px;
  box-shadow: 0 10px 30px -12px rgba(27, 117, 187, .7);
}
.btn.huge svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.ai { width: 100%; margin-top: 10px; background: linear-gradient(90deg, #e6f1fa, #eef7e2); border-color: #cfe3f3; color: var(--brand-2); }
.btn:disabled { opacity: .7; }
.link { background: none; border: 0; color: var(--brand); padding: 6px 0; cursor: pointer; font-weight: 600; }
.link.danger { color: var(--hot); }
.icon-btn { background: none; border: 0; font-size: 24px; color: #fff; padding: 4px 10px 4px 0; cursor: pointer; }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 0 auto; padding: calc(48px + var(--safe-t)) 20px 40px; text-align: center; }
.login h1 { margin: 22px 0 2px; font-size: 28px; letter-spacing: -.02em; }
.login .card { text-align: left; margin-top: 24px; }
.login-logo { width: 220px; max-width: 70%; height: auto; display: block; margin: 0 auto; }
.top-logo { height: 26px; width: auto; display: block; margin-bottom: 6px; }
.top.slim .top-logo { height: 22px; margin: 0; }

/* ---------- layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; font-size: 16px; background: #fbfcfe;
  outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
textarea { resize: vertical; min-height: 64px; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: calc(14px + var(--safe-t)) 18px 18px;
}
.top.slim { padding-bottom: 14px; }
.top .who { font-size: 20px; font-weight: 700; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #93a2d6; }
.net { font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 99px; white-space: nowrap; }
.net.on { background: rgba(139, 197, 63, .2); color: #a9dc66; }
.net.off { background: rgba(245, 158, 11, .2); color: #fbbf24; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink); color: #fff; padding: 0 12px 22px; }
.stats div { text-align: center; }
.stats b { display: block; font-size: 28px; letter-spacing: -.02em; }
.stats span { font-size: 11px; color: #93a2d6; }

.actions { padding: 0 16px; margin-top: -10px; display: grid; gap: 10px; }
.banner {
  margin: 14px 16px 0; padding: 12px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #fde3a7;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px;
}
.list { padding: 18px 16px 8px; }
.list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.list-head h2 { font-size: 17px; margin: 0; white-space: nowrap; }
.list-head input { padding: 9px 12px; font-size: 15px; }
.lead-row {
  width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin-bottom: 8px;
}
.lead-row:disabled { opacity: .85; cursor: default; }
.lr-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lr-main b { font-size: 16px; }
.lr-main span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.lr-meta small { color: var(--muted); font-size: 12px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-2); }
.pill.amber { background: #fff3d6; color: var(--warn); }
.heat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; color: #fff; }
.heat.hot { background: var(--hot); } .heat.warm { background: var(--warm); } .heat.cold { background: var(--cold); }
.foot { text-align: center; padding: 10px 0 calc(30px + var(--safe-b)); font-size: 14px; }

/* ---------- capture ---------- */
.capture { padding: 14px 14px 0; max-width: 640px; margin: 0 auto; }
.sec-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.sec-title.sm { margin-top: 16px; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.thumb {
  position: relative; aspect-ratio: 1.6; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: #f6f7fb; cursor: pointer; padding: 0; display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; bottom: 0; left: 0; right: 0; font-size: 12px; font-weight: 600; padding: 5px; background: rgba(11, 21, 48, .65); color: #fff; }
.thumb.empty { border: 2px dashed #c9d1e6; }
.thumb.empty span { position: static; background: none; color: var(--brand); font-size: 15px; }
.status-line { min-height: 22px; margin-top: 10px; font-size: 14px; }
#contactBox .field.more { display: none; }
#contactBox.show-more .field.more { display: block; }
#contactBox.busy input { background: linear-gradient(90deg, #f3f5fa 25%, #e8edff 50%, #f3f5fa 75%); background-size: 200% 100%; animation: sweep 1.2s linear infinite; }
.field span { display: block; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.seg button {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; font-weight: 700; text-transform: capitalize; cursor: pointer;
}
.seg button.hot.on { background: var(--hot); border-color: var(--hot); color: #fff; }
.seg button.warm.on { background: var(--warm); border-color: var(--warm); color: #fff; }
.seg button.cold.on { background: var(--cold); border-color: var(--cold); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 13px; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.voice { display: flex; align-items: center; gap: 16px; margin: 10px 0 6px; }
.rec-btn {
  width: 74px; height: 74px; flex-shrink: 0; border-radius: 50%; border: 4px solid #ffd6d8; background: var(--hot);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 22px -8px rgba(229, 72, 77, .8);
}
.rec-btn span { width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: all .2s; }
.rec-btn.on { animation: pulse 1.4s ease-in-out infinite; }
.rec-btn.on span { border-radius: 5px; width: 22px; height: 22px; }
.voice-side { flex: 1; min-width: 0; font-size: 14px; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--hot); margin-right: 4px; animation: blink 1s infinite; }
.lang { display: inline-flex; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang button { border: 0; background: #fff; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.lang button.on { background: var(--ink); color: #fff; }
.audio-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
audio { width: 100%; height: 40px; margin-top: 6px; }
.ai-box { margin-top: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.spacer { height: calc(96px + var(--safe-b)); }
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 10px;
  padding: 12px 14px calc(12px + var(--safe-b)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.savebar .btn { flex: 1; padding: 15px; font-size: 17px; }
.savebar .btn.primary { flex: 2; }

.shimmer {
  background: linear-gradient(90deg, var(--brand) 20%, var(--teal) 40%, var(--brand) 60%); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sweep 1.6s linear infinite; font-weight: 700;
}

#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); width: max-content; transition: all .25s; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: var(--ok); }
#toast.warn { background: #92400e; }

@keyframes sweep { to { background-position: -200% center; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 50% { box-shadow: 0 0 0 14px rgba(229, 72, 77, 0); } }
@keyframes blink { 50% { opacity: .2; } }

.powered { font-size: 12px; color: var(--muted); margin-top: 18px; }
.powered a { color: var(--brand); text-decoration: none; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.foot .link { font-size: 14px; text-decoration: none; }
.foot > div { margin: 4px 0; }

.card-md { white-space: pre-wrap; font-size: 13px; background: #f4f6fa; padding: 10px; border-radius: 10px; margin: 6px 0 0; max-height: 240px; overflow: auto; }
