:root {
  --ink: #14171C;          /* rail, deepest graphite */
  --ink-2: #252A32;
  --ink-text: #A3ACB9;
  --paper: #1A1E24;        /* app background */
  --surface: #22262D;      /* panels, cards */
  --raised: #2A2F37;
  --text: #F1F3F6;
  --muted: #98A1AE;
  --line: #323842;
  --soft: #2B3038;
  --lime: #E0FA11;         /* the brand colour: actions and what needs you */
  --lime-dark: #CBE30C;
  --lime-soft: rgba(224, 250, 17, .12);
  --on-lime: #141A00;
  --out-bubble: #33402A;
  --amber: #E9B44C;
  --amber-soft: #3A3122;
  --amber-text: #F1D49A;
  --red: #FF7A7A;
  --red-soft: #3B2427;
  --green: #3FBF7F;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.amber { color: var(--amber-text); }
.grow { flex: 1; min-width: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--raised); }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.btn-primary:hover { background: var(--lime-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.linkish { border: 0; background: none; padding: 0; color: var(--lime); font-weight: 600; text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 10px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; flex: 1; min-width: 140px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
textarea.input.tall { min-height: 140px; }
.input.narrow { max-width: 130px; }
.input.input-inline { width: auto; height: 34px; flex: none; }
.input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.input[disabled] { opacity: .7; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between, .row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.bottom { align-items: flex-end; }
.row.bottom .btn { margin-bottom: 14px; }
.row > .field { margin-bottom: 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch input { width: 40px; height: 22px; accent-color: var(--lime); flex: none; }
.form-error { color: var(--red); font-size: 13.5px; min-height: 20px; margin: 4px 0 10px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--surface); }
.days input { accent-color: var(--lime); }
.radio-group { display: grid; gap: 10px; margin-top: 12px; }
.radio-group label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.radio-group input { accent-color: var(--lime); margin-top: 3px; }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--amber-soft); color: var(--amber-text); font-size: 14px; margin-bottom: 18px; }
.notice.slim { padding: 8px 12px; margin: 0 0 8px; font-size: 13px; }
.readonly .input { pointer-events: none; }

/* ---------- Tags, chips, badges ---------- */
.tag { padding: 2px 10px; border-radius: 999px; background: var(--lime-soft); color: var(--lime); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tag-lime { background: var(--lime); color: var(--on-lime); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-amber { background: var(--amber-soft); color: var(--amber-text); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips-row { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: transparent; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ink); }
.chip-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: 11px; display: inline-grid; place-items: center; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); color: var(--text); display: grid; place-items: center; font-weight: 700; font-family: var(--display); font-size: 15px; flex: none; }
.avatar.lg { width: 60px; height: 60px; font-size: 21px; }
.avatar svg { width: 18px; height: 18px; }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.presence { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: var(--green); }
.presence.away { background: var(--amber); }
.presence.dnd { background: var(--red); }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art { background: var(--ink); border-right: 1px solid var(--line); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .lines { position: absolute; right: -40px; bottom: -40px; width: 520px; opacity: .9; z-index: 0; }
.auth-art > *:not(.lines) { position: relative; z-index: 1; }
.auth-art h1 { font-size: clamp(32px, 4vw, 52px); max-width: 12ch; line-height: 1.02; }
.auth-art p { color: var(--ink-text); max-width: 40ch; }
.auth-art .brand-mark { width: 56px; height: 56px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h2 { margin-bottom: 6px; }
.auth-switch { margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch button { border: 0; background: none; color: var(--lime); font-weight: 600; padding: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.brand small { display: block; font-family: var(--body); font-weight: 500; font-size: 11.5px; letter-spacing: .04em; color: var(--lime); margin-top: 1px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; flex: none; }

/* ---------- Shell & rail ---------- */
.shell { display: grid; grid-template-columns: 84px 360px minmax(0, 1fr) 320px; height: 100vh; height: 100dvh; }
.shell.no-panel { grid-template-columns: 84px 360px minmax(0, 1fr); }
.shell.wide { grid-template-columns: 84px minmax(0, 1fr); }
.rail { background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px; border-right: 1px solid var(--line); }
.rail .brand-mark { margin-bottom: 12px; }
.rail-btn { position: relative; width: 64px; padding: 8px 0 6px; border-radius: 14px; border: 0; background: transparent; color: var(--ink-text); display: grid; justify-items: center; gap: 3px; }
.rail-btn svg { width: 22px; height: 22px; }
.rail-label { font-size: 10.5px; font-weight: 600; }
.rail-btn:hover { background: var(--ink-2); color: #fff; }
.rail-btn[aria-current="page"] { background: var(--ink-2); color: var(--lime); }
.rail-btn .dot { position: absolute; top: 7px; right: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.rail-btn .nbadge { position: absolute; top: 3px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.rail-call { background: var(--lime); color: var(--on-lime); }
.rail-call:hover { background: var(--lime-dark); color: var(--on-lime); }
.rail-extra { padding: 10px 0; }
.rail-extra .rail-label { display: none; }
.rail-spacer { flex: 1; }
.tip::after { content: attr(data-tip); position: absolute; left: 70px; top: 50%; transform: translateY(-50%); background: var(--raised); color: var(--text); padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 30; }
.rail-extra.tip:hover::after { opacity: 1; }

/* ---------- Home list ---------- */
.list-col { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; position: relative; }
.list-head { padding: 14px 14px 4px; display: grid; gap: 12px; }
.home-top { display: flex; align-items: center; gap: 6px; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.inbox-switch { border: 0; background: none; text-align: left; display: grid; padding: 2px 6px; border-radius: 10px; }
.inbox-switch:hover { background: var(--raised); }
.inbox-switch strong { font-family: var(--display); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 34px; background: var(--raised); border-color: transparent; }
.page-search { max-width: 460px; margin-bottom: 16px; }
.sumcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sumcard { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-m); padding: 10px; text-align: left; display: grid; gap: 1px; color: var(--muted); }
.sumcard svg { width: 18px; height: 18px; margin-bottom: 4px; }
.sumcard strong { color: var(--text); font-size: 14px; }
.sumcard span { font-size: 12px; }
.sumcard[aria-pressed="true"] { border-color: var(--lime); background: var(--lime-soft); color: var(--text); }
.sumcard[aria-pressed="true"] svg { color: var(--lime); }
.list { overflow-y: auto; flex: 1; padding-bottom: 80px; }
.list-empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.conv { width: 100%; text-align: left; border: 0; background: transparent; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--soft); }
.conv:hover { background: var(--raised); }
.conv[aria-current="true"] { background: var(--lime-soft); box-shadow: inset 3px 0 0 var(--lime); }
.conv .name, .conv .preview { display: block; }
.conv .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .preview { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .name, .conv.unread .preview { color: var(--text); font-weight: 600; }
.conv .meta { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }
.line-tag { font-size: 11px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; vertical-align: -2px; }
.status svg { width: 15px; height: 15px; }
.status.missed { color: var(--red); }
.status.vm { color: var(--amber-text); }
.status.ai { color: var(--lime); }
.fab { position: absolute; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 18px; border: 0; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(0,0,0,.7); }
.fab svg { width: 22px; height: 22px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--soft); }
.task.compact { padding: 8px 0; border: 0; }
.task-title { font-weight: 600; }
.task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task [data-conv] { cursor: pointer; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; padding: 0; flex: none; margin-top: 1px; }
.check.on { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.check svg { width: 14px; height: 14px; }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(8,10,13,.55); z-index: 44; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); background: var(--surface); border-right: 1px solid var(--line); z-index: 45; overflow-y: auto; padding: 22px 14px 30px; box-shadow: 20px 0 50px -20px rgba(0,0,0,.7); animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-me { display: flex; align-items: center; gap: 12px; padding: 0 6px 14px; }
.drawer-me h2 { font-size: 19px; }
.status-form { padding: 0 6px 10px; }
.status-form .input { background: var(--raised); border-color: transparent; }
.drawer-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.drawer-row:hover, .drawer-row[aria-current="true"] { background: var(--raised); }
.drawer-row svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.drawer-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.drawer-label { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mini-switch { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; }
.mini-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.mini-switch.on { background: var(--lime); }
.mini-switch.on::after { transform: translateX(14px); background: var(--on-lime); }
.inbox-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 8px; border: 0; background: none; border-radius: 10px; text-align: left; }
.inbox-row:hover { background: var(--raised); }
.inbox-row[aria-current="true"] { background: var(--lime-soft); }
.inbox-row .grow { display: grid; }
.inbox-name { font-weight: 600; }
.inbox-emoji { width: 34px; height: 34px; border-radius: 10px; background: var(--raised); display: grid; place-items: center; font-size: 16px; flex: none; }
.inbox-emoji.big { width: 44px; height: 44px; font-size: 20px; }

/* ---------- Thread ---------- */
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-head { height: 64px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; background: var(--surface); }
.thread-head .title { flex: 1; min-width: 0; }
.thread-head .title h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head .title .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-body { flex: 1; overflow-y: auto; padding: 20px clamp(16px, 4vw, 40px); display: flex; flex-direction: column; gap: 6px; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.bubble { max-width: min(520px, 78%); padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: var(--out-bubble); border-bottom-right-radius: 5px; }
.bubble.failed { background: var(--red-soft); color: var(--red); }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin: 0 4px 6px; }
.bubble-meta.out { align-self: flex-end; }
.bubble img { display: block; max-width: 240px; border-radius: 10px; margin-bottom: 4px; }
.event { align-self: center; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; margin: 6px 0; max-width: 100%; }
.event svg { width: 16px; height: 16px; }
.event.missed { color: var(--red); border-color: #5A3236; }
.event.ai { border-color: rgba(224,250,17,.35); }
.event.ai > svg { color: var(--lime); }
.event audio { height: 32px; max-width: 240px; }
.ai-summary { align-self: center; display: flex; gap: 10px; max-width: 560px; width: 100%; background: var(--lime-soft); border-radius: var(--radius-m); padding: 10px 14px; font-size: 14px; }
.ai-summary svg { width: 18px; height: 18px; color: var(--lime); flex: none; margin-top: 2px; }
.ai-summary p { margin: 0; }
.note { align-self: stretch; max-width: 620px; margin: 6px auto; background: var(--amber-soft); border-left: 3px solid var(--amber); padding: 10px 14px; border-radius: 0 var(--radius-s) var(--radius-s) 0; white-space: pre-wrap; width: 100%; }
.note .who { font-size: 12px; color: var(--amber-text); font-weight: 600; margin-bottom: 2px; display: flex; justify-content: space-between; }
.note .who button { border: 0; background: none; color: var(--amber-text); font-size: 12px; }
.note.note-ai { background: var(--lime-soft); border-left-color: var(--lime); }
.note.note-ai .who, .note.note-ai .who button { color: var(--lime); }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 16px 14px; }
.composer.note-mode { background: var(--amber-soft); }
.composer-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.composer form { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; border-radius: var(--radius-m); padding: 11px 14px; border: 1px solid var(--line); background: var(--paper); }
.composer textarea:focus { outline: none; border-color: var(--lime); }
.composer .btn { height: 44px; }
.composer .count { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.empty-state { margin: auto; text-align: center; max-width: 360px; padding: 24px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }
.empty-logo { width: 64px; height: 64px; margin-bottom: 14px; opacity: .9; }

/* ---------- Contact panel ---------- */
.panel { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 24px 20px; position: relative; }
.panel-close { position: absolute; top: 10px; right: 10px; display: none; }
.panel-top { display: grid; justify-items: center; text-align: center; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.panel-top .actions { display: flex; gap: 8px; margin-top: 6px; }
.panel-sec { border-top: 1px solid var(--line); padding: 14px 0; margin-top: 4px; }
.panel-sec h3 { font-size: 14px; margin-bottom: 8px; }
.kv { display: grid; gap: 2px; margin: 0 0 14px; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.mini-card { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.mini-card svg { width: 18px; height: 18px; color: var(--lime); }

/* ---------- Pages ---------- */
.page { overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px) 60px; }
.page-center { display: grid; place-items: start center; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { margin: 6px 0 0; max-width: 62ch; }
.page-narrow { max-width: 680px; }
.page-narrow.wide { max-width: 920px; }
.page-tabs { padding: 0; margin: 4px 0 16px; }
.sec-title { margin: 26px 0 10px; }
.section { padding: 20px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section > h3 { margin-bottom: 4px; }
.section > p.muted { margin: 0 0 14px; }
.card-list { display: grid; gap: 8px; max-width: 920px; }
.crow, .person { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.crow[role=button] { cursor: pointer; }
.crow[role=button]:hover { background: var(--raised); }
.person.pending { border-style: dashed; }
.check-list { display: grid; gap: 6px; margin: 8px 0 16px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.check-row input { accent-color: var(--lime); width: 18px; height: 18px; }
.copy-box { display: flex; gap: 8px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--ink); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.number-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 10px; flex-wrap: wrap; }
.number-card .num, .result .num { font-family: var(--display); font-weight: 700; font-size: 19px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.result { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); display: grid; gap: 8px; }
.keypad-page { width: 100%; max-width: 360px; }
.kp-from { text-align: center; }

/* ---------- My Team AI ---------- */
.ai-title { display: inline-flex; align-items: center; gap: 10px; }
.ai-title svg { width: 26px; height: 26px; color: var(--lime); }
.ai-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--raised); font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.ai-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ai-state.on { color: var(--lime); background: var(--lime-soft); }
.ai-state.on::before { background: var(--lime); }
.live-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--lime); background: var(--lime-soft); color: var(--text); padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255,122,122,.6); animation: pulse 1.4s infinite; flex: none; display: inline-block; }
.live-dot.off { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,122,122,.6); } 70% { box-shadow: 0 0 0 8px rgba(255,122,122,0); } 100% { box-shadow: 0 0 0 0 rgba(255,122,122,0); } }
.leads { display: grid; gap: 10px; max-width: 920px; }
.lead { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); padding: 14px 16px; display: grid; gap: 8px; }
.lead.new { border-left: 3px solid var(--lime); }
.lead-top { display: flex; gap: 12px; align-items: center; }
.lead-service { font-weight: 600; }
.lead-summary { margin: 0; color: var(--text); }
.lead-facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lead-facts span { display: inline-flex; align-items: center; gap: 6px; }
.lead-facts svg { width: 15px; height: 15px; color: var(--lime); }
.appts { display: grid; gap: 8px; max-width: 760px; }
.day-head { font-weight: 700; font-family: var(--display); margin: 12px 0 2px; }
.appt { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.appt-time { font-family: var(--display); font-weight: 700; color: var(--lime); min-width: 76px; }
.setup { max-width: 760px; }
.sticky-save { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 30%); }

/* ---------- Settings & Trust center ---------- */
.settings { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; max-width: 1100px; }
.settings-nav { display: grid; }
.settings-main { max-width: 720px; min-width: 0; }
.back-inline { margin-bottom: 14px; }
.trust-hero { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.trust-hero > svg { width: 34px; height: 34px; color: var(--muted); flex: none; }
.trust-hero.approved { border-color: rgba(224,250,17,.4); }
.trust-hero.approved > svg { color: var(--lime); }
.trust-hero.submitted > svg { color: var(--amber); }
.trust-hero h2 { font-size: 19px; margin-bottom: 4px; }
.trust-hero p { margin: 0; color: var(--muted); }
.trust-hero > div { flex: 1; }
.trust-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tcard { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.learn { margin: 6px 0 18px; color: var(--muted); }
.learn summary { cursor: pointer; color: var(--text); font-weight: 600; }
.docs { display: grid; gap: 6px; margin-bottom: 12px; }
.doc { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.doc svg { width: 18px; height: 18px; color: var(--muted); }
.doc a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-btn { cursor: pointer; }
.review { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); padding: 18px; margin-bottom: 14px; max-width: 920px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin: 14px 0; }
.review-grid div { min-width: 0; }
.review-grid .span { grid-column: 1 / -1; }
.review-grid dt { font-size: 12px; color: var(--muted); }
.review-grid dd { margin: 0; word-break: break-word; }

/* ---------- Snippets & transcript ---------- */
.snip-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.snip { text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.snip span { color: var(--muted); font-size: 13.5px; }
.snip:hover { border-color: var(--lime); }
.transcript { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; }
.lline { padding: 8px 12px; border-radius: 12px; background: var(--raised); font-size: 14px; max-width: 88%; }
.lline span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 1px; }
.lline.ai { background: var(--lime-soft); justify-self: end; }
.lline.ai span { color: var(--lime); }
.lline.cust { justify-self: start; }

/* ---------- Call bar ---------- */
.callbar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 999px; min-width: 360px; max-width: calc(100vw - 24px); box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); }
.callbar .who { flex: 1; min-width: 0; }
.callbar .who strong { display: block; font-family: var(--display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callbar .who span { font-size: 12.5px; color: var(--ink-text); }
.callbar.ringing { background: var(--lime); color: var(--on-lime); border-color: var(--lime); animation: ring 1.6s ease-in-out infinite; }
.callbar.ringing .who span { color: #3B4A16; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,250,17,.55), 0 18px 40px -12px rgba(0,0,0,.6); } 50% { box-shadow: 0 0 0 14px rgba(224,250,17,0), 0 18px 40px -12px rgba(0,0,0,.6); } }
.cb-btn { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: rgba(255,255,255,.1); color: inherit; font-weight: 700; }
.cb-btn svg { width: 20px; height: 20px; }
.cb-btn:hover { filter: brightness(1.1); }
.cb-btn.on { background: var(--lime); color: var(--on-lime); }
.cb-btn.accept { background: var(--on-lime); color: var(--lime); }
.cb-btn.hang { background: #E5484D; color: #fff; }
.cb-btn.ai { background: var(--ink); color: var(--lime); }
.callbar:not(.ringing) .cb-btn.accept { background: var(--green); color: #fff; }
.callbar .pad { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); }

/* ---------- Live AI call window ---------- */
.livewin { position: fixed; right: 20px; bottom: 20px; width: 380px; max-height: min(620px, calc(100vh - 100px)); z-index: 48; display: flex; flex-direction: column; background: var(--surface); border: 1px solid rgba(224,250,17,.45); border-radius: var(--radius-l); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); overflow: hidden; }
.livewin.ended { border-color: var(--line); }
.live-head { display: flex; gap: 12px; align-items: center; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.live-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; }
.live-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: grid; gap: 8px; align-content: start; min-height: 160px; }
.live-summary { background: var(--lime-soft); border-radius: var(--radius-m); padding: 10px 12px; }
.live-summary p { margin: 4px 0 0; font-size: 14px; }
.live-foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- Modal & dialer ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 10, 13, .66); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dial-display { width: 100%; border: 0; text-align: center; font-family: var(--display); font-size: 28px; font-weight: 700; padding: 8px 0 12px; background: transparent; }
.dial-display:focus { outline: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 16px; }
.key { height: 60px; border-radius: 18px; border: 1px solid var(--line); background: var(--raised); display: grid; place-items: center; line-height: 1.05; }
.key:hover { background: var(--soft); }
.key b { font-family: var(--display); font-size: 22px; font-weight: 700; }
.key small { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.keypad.dark .key { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.pad-pop { background: var(--ink); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius-l); width: 260px; }
.dial-actions { display: flex; gap: 14px; justify-content: center; }
.dial-actions .btn { width: 64px; height: 64px; padding: 0; border-radius: 50%; }
.dial-actions .btn svg { width: 24px; height: 24px; }
.dial-call { background: var(--green) !important; border-color: var(--green) !important; color: #fff !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--lime); color: var(--on-lime); font-weight: 600; padding: 10px 16px; border-radius: 999px; z-index: 70; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.error { background: var(--red); color: #2A0D0D; }

/* ---------- Responsive ---------- */
.back-btn { display: none; }
@media (max-width: 1200px) {
  .shell { grid-template-columns: 84px 330px minmax(0, 1fr); }
  .shell .panel { display: none; }
  .shell.panel-open .panel { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100vw); z-index: 35; box-shadow: -20px 0 40px -20px rgba(0,0,0,.6); }
  .panel-close { display: inline-grid; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .shell, .shell.no-panel, .shell.wide { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand-mark, .rail-spacer, .rail-extra { display: none; }
  .rail-btn { width: auto; flex: 1; padding: 6px 0 4px; }
  .rail-call { background: transparent; color: var(--ink-text); }
  .rail-call svg { color: var(--lime); }
  .rail-btn .dot { right: calc(50% - 16px); }
  .rail-btn .nbadge { right: calc(50% - 22px); }
  .tip::after { display: none; }
  .shell.has-thread .list-col { display: none; }
  .shell:not(.has-thread) .thread { display: none; }
  .list-col { border-right: 0; }
  .back-btn { display: inline-grid; }
  .thread-head { padding-left: 4px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: 230px; }
  .auth-art .lines { width: 360px; }
  .callbar { top: 8px; min-width: 0; width: calc(100vw - 16px); }
  .livewin { left: 8px; right: 8px; bottom: 76px; width: auto; max-height: 70vh; }
  .settings { grid-template-columns: 1fr; gap: 0; }
  .trust-cards { grid-template-columns: 1fr; }
  .table .hide-sm { display: none; }
  .page { padding-top: 20px; }
  .fab { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.page .chips-row:not(.page-tabs) { padding: 0 0 12px; }

/* ---------- Blinking red dot: new lead / appointment ---------- */
.blink-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #FF3B3B; box-shadow: 0 0 0 0 rgba(255,59,59,.7); animation: blink 1.2s ease-in-out infinite; flex: none; margin-inline-start: 6px; }
.blink-dot.static { animation: pulse 1.6s infinite; margin: 0; }
.rail-blink { position: absolute; top: 6px; inset-inline-end: 14px; margin: 0; }
@keyframes blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,59,59,.7); } 50% { opacity: .35; box-shadow: 0 0 0 6px rgba(255,59,59,0); } }

/* ---------- TEAM transfer menu ---------- */
.cb-btn.team { background: var(--ink); color: var(--lime); letter-spacing: .06em; font-size: 13px; padding: 0 16px; }
.callbar:not(.ringing) .cb-btn.team { background: rgba(224,250,17,.14); }
.cb-btn.team.on { background: var(--on-lime); color: var(--lime); box-shadow: inset 0 0 0 2px var(--lime); }
.team-menu { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 8px; box-shadow: 0 24px 50px -16px rgba(0,0,0,.8); text-align: start; }
.tm-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; }
.tm-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: none; border-radius: 12px; text-align: start; color: var(--text); }
.tm-row:hover { background: var(--raised); }
.tm-row > svg { width: 22px; height: 22px; color: var(--muted); flex: none; margin: 0 9px; }
.tm-row .grow { display: grid; }
.tm-row small { color: var(--muted); font-size: 12px; }
.tm-ai { background: var(--lime-soft); margin-bottom: 4px; }
.tm-ai > svg { color: var(--lime); }
.tm-row .avatar { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Settings: per-number AI switch ---------- */
.big-switch { position: relative; width: 52px; height: 30px; flex: none; }
.big-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.big-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.big-switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.big-switch input:checked + span { background: var(--lime); }
.big-switch input:checked + span::after { transform: translateX(22px); background: var(--on-lime); }
.big-switch input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.big-switch input:disabled + span { opacity: .5; }

/* ---------- Lead details ---------- */
.lead-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-s); }
.lead-details dt { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lead-details dt svg { width: 14px; height: 14px; color: var(--lime); }
.lead-details dd { margin: 0; word-break: break-word; }
.lead-details .span { grid-column: 1 / -1; }

.auth-lang { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--muted); }
.auth-lang svg { width: 18px; height: 18px; }

/* ---------- Right-to-left languages (Hebrew, Arabic) ---------- */
[dir="rtl"] body { font-family: 'Instrument Sans', 'Segoe UI', 'Arial Hebrew', 'Noto Sans Hebrew', 'Noto Sans Arabic', system-ui, sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: 'Bricolage Grotesque', 'Noto Sans Hebrew', 'Noto Sans Arabic', system-ui, sans-serif; }
[dir="rtl"] .rail { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .list-col { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .panel { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .auth-art { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .auth-art .lines { right: auto; left: -40px; transform: scaleX(-1); }
[dir="rtl"] .drawer { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); box-shadow: -20px 0 50px -20px rgba(0,0,0,.7); }
@keyframes slidein-rtl { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
[dir="rtl"] .drawer { animation-name: slidein-rtl; }
[dir="rtl"] .conv, [dir="rtl"] .inbox-switch, [dir="rtl"] .drawer-row, [dir="rtl"] .inbox-row, [dir="rtl"] .sumcard, [dir="rtl"] .snip, [dir="rtl"] .table th { text-align: right; }
[dir="rtl"] .conv[aria-current="true"] { box-shadow: inset -3px 0 0 var(--lime); }
[dir="rtl"] .note { border-left: 0; border-right: 3px solid var(--amber); border-radius: var(--radius-s) 0 0 var(--radius-s); }
[dir="rtl"] .note.note-ai { border-right-color: var(--lime); }
[dir="rtl"] .lead.new { border-left: 1px solid var(--line); border-right: 3px solid var(--lime); }
[dir="rtl"] .fab { right: auto; left: 18px; }
[dir="rtl"] .livewin { right: auto; left: 20px; }
[dir="rtl"] .panel-close { right: auto; left: 10px; }
[dir="rtl"] .bubble.in { border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
[dir="rtl"] .bubble.out { border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }
[dir="rtl"] .chev svg, [dir="rtl"] .back-btn svg, [dir="rtl"] .back-inline svg { transform: scaleX(-1); }
[dir="rtl"] .big-switch input:checked + span::after { transform: translateX(-22px); }
[dir="rtl"] .rail-btn .dot { right: auto; left: 17px; }
[dir="rtl"] .rail-btn .nbadge { right: auto; left: 10px; }
[dir="rtl"] .presence { right: auto; left: 0; }
[dir="rtl"] .search svg { left: auto; right: 11px; }
[dir="rtl"] .search .input { padding-left: 12px; padding-right: 34px; }
[dir="rtl"] .tip::after { left: auto; right: 70px; }
[dir="rtl"] .auth-lang { justify-content: flex-start; }
[dir="rtl"] .callbar { padding: 10px 18px 10px 10px; }
.chev { display: inline-flex; }
.chev svg { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 1200px) {
  [dir="rtl"] .shell.panel-open .panel { right: auto; left: 0; box-shadow: 20px 0 40px -20px rgba(0,0,0,.6); }
}
@media (max-width: 760px) {
  [dir="rtl"] .rail { border-left: 0; }
  [dir="rtl"] .livewin { left: 8px; right: 8px; }
  [dir="rtl"] .list-col { border-left: 0; }
  [dir="rtl"] .rail-btn .dot { left: calc(50% - 16px); }
  [dir="rtl"] .rail-btn .nbadge { left: calc(50% - 22px); }
}

/* Phones with a notch or status bar (the iPhone/Android apps draw under it): keep content clear of it. */
.shell, .auth { padding-top: env(safe-area-inset-top, 0px); }
.callbar { top: calc(16px + env(safe-area-inset-top, 0px)); }
.drawer { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
@media (max-width: 1100px) { .shell.panel-open .panel { padding-top: env(safe-area-inset-top, 0px); } }

/* ======================= Phone keypad (New call) ======================= */
.phone-dialer { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 330px; margin: 0 auto; }
.dial-from { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 14px; border-radius: 999px; background: var(--raised); font-size: 13px; color: var(--muted); cursor: pointer; max-width: 100%; }
.dial-from select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; max-width: 190px; text-overflow: ellipsis; padding: 0; }
.dial-from select:focus { outline: none; }
.dial-from:focus-within { box-shadow: 0 0 0 2px var(--lime); }
.dial-from svg { width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.dial-from.single { cursor: default; padding-right: 14px; }
.dial-from.single select { pointer-events: none; }
.dial-screen { width: 100%; min-height: 92px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; }
.phone-dialer .dial-display { font-family: var(--body); font-size: 34px; font-weight: 500; letter-spacing: .02em; padding: 6px 0 0; color: var(--text); font-variant-numeric: tabular-nums; }
.phone-dialer .dial-display::placeholder { color: var(--muted); font-size: 18px; letter-spacing: 0; font-weight: 400; }
.dial-match { min-height: 24px; font-size: 14px; }
.dial-match .dm-name { color: var(--lime); font-weight: 600; }
.dial-match .linkish { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.dial-match .linkish svg { width: 16px; height: 16px; }
.phone-dialer .notice { width: 100%; margin: 0 0 6px; }
.phone-dialer .keypad { grid-template-columns: repeat(3, 76px); gap: 14px 24px; justify-content: center; margin: 4px 0 16px; }
.phone-dialer .key { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--raised); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: background .12s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.phone-dialer .key:hover { background: #343A44; }
.phone-dialer .key:active { background: #47505C; }
.phone-dialer .key b { font-family: var(--body); font-size: 31px; font-weight: 400; line-height: 1; }
.phone-dialer .key small { font-size: 9.5px; font-weight: 700; letter-spacing: .2em; color: var(--muted); line-height: 1.2; }
.phone-dialer .dial-actions { display: grid; grid-template-columns: repeat(3, 76px); gap: 24px; justify-content: center; align-items: center; }
.phone-dialer .dial-call { width: 76px; height: 76px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; background: var(--green) !important; color: #fff !important; box-shadow: 0 10px 24px -10px rgba(63,191,127,.7); }
.phone-dialer .dial-call:disabled { opacity: .45; cursor: not-allowed; }
.phone-dialer .dial-call svg { width: 32px; height: 32px; fill: currentColor; stroke: none; }
.dial-side { width: 76px; height: 60px; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; cursor: pointer; border-radius: 16px; }
.dial-side:hover { color: var(--text); }
.dial-side svg { width: 26px; height: 26px; }
.dial-back.is-empty { visibility: hidden; }
.keypad-page .phone-dialer { padding-top: 10px; }
@media (max-width: 380px) {
  .phone-dialer .keypad, .phone-dialer .dial-actions { grid-template-columns: repeat(3, 68px); gap: 12px 20px; }
  .phone-dialer .key, .phone-dialer .dial-call { width: 68px; height: 68px; }
  .dial-side { width: 68px; }
}

/* ======================= "+ New" button ======================= */
.fab { width: auto; min-width: 54px; padding: 0 18px 0 14px; gap: 6px; display: inline-flex; align-items: center; font-weight: 700; font-size: 15px; border-radius: 16px; }
.fab svg { width: 20px; height: 20px; stroke-width: 2.4; }
.new-menu { position: absolute; right: 18px; bottom: 84px; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: 0 24px 50px -16px rgba(0,0,0,.8); z-index: 20; animation: popup .14s ease-out; }
[dir="rtl"] .new-menu { right: auto; left: 18px; }
.new-menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: none; border-radius: 12px; color: var(--text); text-align: start; cursor: pointer; }
.new-menu button:hover { background: var(--raised); }
.new-menu span { display: grid; }
.new-menu small { color: var(--muted); font-size: 12px; }
.nm-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--raised); display: grid; place-items: center; flex: none; }
.nm-ic svg { width: 19px; height: 19px; }
.nm-ic.call { background: var(--green); color: #fff; }
@keyframes popup { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ======================= Call bar (computer) ======================= */
.callbar { left: auto; right: 20px; transform: none; border-radius: 20px; padding: 10px 10px 10px 16px; min-width: 340px; }
[dir="rtl"] .callbar { right: auto; left: 20px; }
.cb-btn { border-radius: 14px; }
.callbar.ringing { background: var(--surface); color: var(--text); border: 1.5px solid var(--lime); }
.callbar.ringing .who span { color: var(--lime); }
.callbar.ringing .cb-btn.accept { background: var(--green); color: #fff; }
.callbar.ringing .cb-btn.team, .callbar .cb-btn.team { background: var(--lime); color: var(--on-lime); letter-spacing: .04em; }
.callbar .team-menu { left: auto; right: 0; transform: none; }
[dir="rtl"] .callbar .team-menu { right: auto; left: 0; }
.callbar .pad { left: auto; right: 0; transform: none; }
@media (max-width: 760px) {
  .callbar:not(.callscreen) { right: 12px; left: 12px; min-width: 0; max-width: none; }
  .callbar .who[data-phone="expand"] { cursor: pointer; }
}

/* ======================= Call screen (phones) ======================= */
.callbar.callscreen { position: fixed; inset: 0; top: 0; left: 0; right: 0; transform: none; min-width: 0; max-width: none; border: 0; border-radius: 0; z-index: 55; padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 0; background: radial-gradient(120% 60% at 50% 0%, #2E3540 0%, #1A1E24 55%, #121418 100%); color: #fff; animation: none; box-shadow: none; }
.cs-fold { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; }
[dir="rtl"] .cs-fold { left: auto; right: 14px; }
.cs-fold svg { width: 22px; height: 22px; }
.cs-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-top: 6vh; width: 100%; }
.cs-line { font-size: 13px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); padding: 5px 12px; border-radius: 999px; }
.cs-avatar { width: 96px; height: 96px; border-radius: 50%; background: #3A414C; display: grid; place-items: center; font-family: var(--display); font-size: 34px; font-weight: 700; margin: 18px 0 8px; color: #fff; }
.cs-avatar svg { width: 44px; height: 44px; }
.is-ringing .cs-avatar { animation: csring 1.6s ease-out infinite; }
@keyframes csring { 0% { box-shadow: 0 0 0 0 rgba(224,250,17,.45); } 70% { box-shadow: 0 0 0 26px rgba(224,250,17,0); } 100% { box-shadow: 0 0 0 0 rgba(224,250,17,0); } }
.cs-name { font-family: var(--body); font-size: 30px; font-weight: 500; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.cs-number { font-size: 16px; color: rgba(255,255,255,.65); }
.cs-status { font-size: 16px; color: rgba(255,255,255,.75); min-height: 22px; font-variant-numeric: tabular-nums; }
.cs-key { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; color: #fff; font-size: 13px; cursor: pointer; padding: 0; }
.cs-key b { width: 74px; height: 74px; border-radius: 50%; background: rgba(255,255,255,.13); display: grid; place-items: center; transition: background .12s; }
.cs-key:hover b { background: rgba(255,255,255,.2); }
.cs-key b svg { width: 28px; height: 28px; }
.cs-key em { font-style: normal; font-weight: 800; font-size: 14px; letter-spacing: .06em; }
.cs-key.on b { background: #fff; color: #14171C; }
.cs-key.team b { background: var(--lime); color: var(--on-lime); }
.cs-key.team.on b { box-shadow: 0 0 0 4px rgba(224,250,17,.35); }
.cs-key.red b { background: #E5484D; }
.cs-key.green b { background: var(--green); }
.cs-key.green b svg, .cs-key.red b svg { width: 32px; height: 32px; }
.cs-key:disabled { opacity: .4; cursor: default; }
.cs-ring { margin-top: auto; width: 100%; max-width: 360px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 6px 10px; }
.cs-ring .cs-key b { width: 78px; height: 78px; }
.cs-ring .green b { animation: csring2 1.4s infinite; }
@keyframes csring2 { 0% { box-shadow: 0 0 0 0 rgba(63,191,127,.6); } 70% { box-shadow: 0 0 0 18px rgba(63,191,127,0); } 100% { box-shadow: 0 0 0 0 rgba(63,191,127,0); } }
.cs-grid { margin-top: auto; display: grid; grid-template-columns: repeat(3, 74px); gap: 24px 34px; justify-content: center; }
.cs-pad { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cs-pad .keypad { grid-template-columns: repeat(3, 72px); gap: 12px 22px; margin: 0; }
.cs-pad .key { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.13); border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cs-pad .key b { font-family: var(--body); font-weight: 400; font-size: 28px; }
.cs-pad .linkish { color: #fff; }
.cs-end { margin-top: 30px; display: flex; justify-content: center; }
.cs-end .cs-key b { width: 78px; height: 78px; }
.cs-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.callscreen .team-menu { position: absolute; top: auto; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-height: 70vh; border-radius: 22px; padding: 10px; animation: popup .16s ease-out; }
@media (prefers-reduced-motion: reduce) { .is-ringing .cs-avatar, .cs-ring .green b, .new-menu, .callscreen .team-menu { animation: none; } }
@media (max-height: 640px) { .cs-avatar { width: 72px; height: 72px; margin: 10px 0 4px; } .cs-head { margin-top: 2vh; } .cs-grid { gap: 16px 30px; } }

/* ======================= Team: numbers & permissions ======================= */
.team-steps { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; }
.team-steps span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px; }
.team-steps b { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; font-size: 12px; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.person-actions .btn svg { width: 15px; height: 15px; }
.tag em { font-style: normal; color: var(--muted); }
.tag-dim { background: var(--raised); }
.access-list { display: grid; gap: 8px; margin: 8px 0 10px; }
.access-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); flex-wrap: wrap; }
.access-row.on { border-color: rgba(224,250,17,.35); }
.access-line { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; cursor: pointer; }
.access-line input { accent-color: var(--lime); width: 18px; height: 18px; flex: none; }
.access-line .grow { display: grid; min-width: 0; }
.access-line small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.access-line .avatar { width: 34px; height: 34px; font-size: 12px; }
.input-sm { height: 36px; padding: 0 30px 0 10px; font-size: 13.5px; width: auto; min-width: 140px; }
.access-row select:disabled { opacity: .45; }
.role-help { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.role-help summary { cursor: pointer; color: var(--text); }
.role-help ul { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.send-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 8px; }
.send-opt { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.send-opt:has(input:checked) { border-color: var(--lime); background: var(--lime-soft); }
.send-opt input { accent-color: var(--lime); width: 18px; height: 18px; }
.send-opt svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.send-opt span { display: grid; font-weight: 600; font-size: 14px; }
.send-opt small { font-weight: 400; color: var(--muted); font-size: 12px; }
.send-opt.off { opacity: .55; cursor: default; }
.ok-line { display: flex; align-items: center; gap: 8px; }
.ok-line svg { width: 20px; height: 20px; color: var(--green); flex: none; }
.btn-block { width: 100%; justify-content: center; }
.add-to-line { margin: 4px 0 14px; border-style: dashed; }
@media (max-width: 520px) { .send-opts { grid-template-columns: 1fr; } .access-row select { width: 100%; } }
.cs-key.green b svg, .cs-key.red b svg { fill: currentColor; stroke: none; }
.composer-locked { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; text-align: center; }
.person { flex-wrap: wrap; }
.person > .grow { min-width: 0; }
@media (max-width: 640px) {
  .person-actions { width: 100%; justify-content: flex-start; padding-inline-start: 52px; }
}

/* ======================= Leads & appointments: full details ======================= */
.is-clickable { cursor: pointer; transition: border-color .12s, background .12s; }
.is-clickable:hover { border-color: rgba(224,250,17,.45); }
.is-clickable:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.appt-no { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--lime-soft); color: var(--lime); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.appt-no.big { min-width: 40px; height: 28px; font-size: 14px; border-radius: 8px; background: var(--lime); color: var(--on-lime); flex: none; }
.appt-total { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.appt-total b { font-family: var(--display); font-size: 28px; color: var(--lime); line-height: 1; font-variant-numeric: tabular-nums; }
.appt-total span { color: var(--muted); font-size: 13.5px; }
.detail-sheet { display: grid; gap: 14px; }
.detail-sheet .lead-details { margin: 0; }
.detail-sheet .sec-title { margin: 6px 0 0; }
.row.wrap { flex-wrap: wrap; }
.appt-hero { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-m); background: var(--paper); border: 1px solid var(--line); }
.appt-hero-time { display: flex; gap: 12px; align-items: center; }
.appt-hero-time svg { width: 26px; height: 26px; color: var(--lime); }
.appt-hero-time strong { display: block; font-size: 17px; }
.modal-head h2 .tag, .modal-head h2 .appt-no { vertical-align: middle; margin-inline-start: 6px; }
.conv-audio { width: 100%; margin-bottom: 6px; }
.conv-meta { margin-bottom: 8px; }
.convo { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 12px; border-radius: var(--radius-m); background: var(--paper); border: 1px solid var(--line); }
.cv { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.cv-who { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); padding: 0 4px; }
.cv-text { padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.cv.sys { align-self: flex-start; }
.cv.sys .cv-who { color: var(--lime); }
.cv.sys .cv-text { background: var(--lime-soft); border: 1px solid rgba(224,250,17,.25); border-start-start-radius: 4px; }
.cv.cust, .cv.team { align-self: flex-end; align-items: flex-end; }
.cv.cust .cv-text { background: var(--raised); border-start-end-radius: 4px; }
.cv.team .cv-text { background: var(--out-bubble); border-start-end-radius: 4px; }
.appt .appt-no.big { margin-inline-end: 4px; }
@media (max-width: 520px) {
  .cv { max-width: 92%; }
  .appt { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 10px; align-items: center; }
  .appt .grow { grid-column: 1 / -1; grid-row: 2; }
  .appt-time { min-width: 0; }
}

/* ======================= Welcome / sign-in (phone-app style) ======================= */
.welcome, .auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; }
.welcome .auth-lang, .auth-form form .auth-lang { margin-bottom: 8px; }
.welcome-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 18px 0 10px; }
.welcome-mark { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 30px -12px rgba(224,250,17,.45); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -0.035em; line-height: 1; color: var(--text); }
.auth-form form .welcome-brand { margin: 4px 0 18px; }
.auth-form form .wordmark { font-size: 30px; }
.auth-form form .welcome-mark { width: 48px; height: 48px; border-radius: 12px; }
.welcome-title { text-align: center; font-family: var(--display); font-size: 27px; line-height: 1.15; letter-spacing: -0.02em; margin: 6px auto 26px; max-width: 16ch; text-wrap: balance; }
.sso { display: flex; flex-direction: column; gap: 10px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 15px var(--body); text-decoration: none; cursor: pointer; transition: border-color .12s, background .12s; position: relative; }
.sso-btn:hover { border-color: #4a5361; background: var(--raised); }
.sso-btn svg { width: 20px; height: 20px; position: absolute; inset-inline-start: 18px; }
.sso-or { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--muted); font-size: 13px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.welcome .auth-switch { text-align: center; margin-top: 22px; }
.auth-terms { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; line-height: 1.5; }
.auth-terms a { color: var(--muted); text-decoration: underline; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font: 500 14px var(--body); padding: 4px 0; cursor: pointer; }
.back-link svg { width: 18px; height: 18px; }
[dir="rtl"] .back-link svg { transform: scaleX(-1); }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-form form h2 { text-align: center; }
.auth-form form > p.muted { text-align: center; }
/* Phones: just the welcome screen, like the app */
@media (max-width: 760px) {
  .auth-art { display: none; }
  .auth-form { min-height: 100dvh; align-items: start; padding-top: 28px; }
}
/* Splash while the app loads */
.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--paper, #14171C); }
.splash .wordmark { font-size: 48px; color: #fff; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.18); border-top-color: var(--lime, #E0FA11); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
