/* VI1 Call prototype - same family look as VI1 Chat 3.0 (vi1.ai palette, KivSans, wing gradient, rounded cards, glass tab bar). */
@font-face { font-family: KivSans; src: url('fonts/kivsans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: KivSans; src: url('fonts/kivsans-Bold.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }
:root { --font: KivSans, "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --anim: 180ms;
  --brand: #436990; --brand2: #355779; --on-brand: #fff; --accent-soft: #6a82ab; --violet: #7d6bd0; --bg: #f6f7f5; --panel: #fff; --panel2: #f2f6fb;
  --line: #dce6f3; --ink: #293a53; --muted: #5d6e84; --danger: #c93a4a; --ok: #2f8f63; --warn: #9a5b00; --radius: 20px;
  --wing: linear-gradient(115deg, #64c9e8, #81d1eb 33%, #8eafec 67%, #ac95e7); --control: linear-gradient(115deg, #edf7ff, #f3f0fc); --control-line: #d5e3f3;
  --shadow: 0 1px 2px #293a530d, 0 4px 16px #293a5314; --shadow-lg: 0 14px 44px #293a5329; --hover: #eaf2fc; --glass: color-mix(in srgb, var(--panel) 84%, transparent); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 17px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 14px; padding: .5em 1.1em; min-height: 44px; background: var(--brand); color: var(--on-brand); font-weight: 600; transition: transform var(--anim), background var(--anim); -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.97); }
button.ghost { background: var(--control); color: var(--brand2); box-shadow: inset 0 0 0 1px var(--control-line); }
button.ghost:hover { background: var(--hover); }
button.danger { background: var(--danger); color: #fff; }
button.okb { background: var(--ok); color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }
input, select, textarea { width: 100%; padding: .55em .85em; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel2); min-height: 46px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: var(--panel); outline: none; }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
label { display: block; font-weight: 600; font-size: .88em; margin: .9em 0 .35em; }
.muted { color: var(--muted); } .small { font-size: .85em; } .xs { font-size: .76em; }
svg.i { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; color: var(--ink); }
.logo img { height: 34px; width: auto; }
.logo b { font-size: 1.55em; font-weight: 700; letter-spacing: -.03em; background: linear-gradient(115deg, #4f9fcf, #5a88d8 55%, #7d6bd0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted); text-decoration: none; font-weight: 600; transition: background var(--anim), color var(--anim); position: relative; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--control); color: var(--brand2); box-shadow: inset 0 0 0 1px var(--control-line); }
.nav .badge { margin-left: auto; }
.badge { background: var(--brand); color: #fff; border-radius: 999px; font-size: .74em; padding: 1px 8px; font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--panel2); }
.labnote { font-size: .78em; color: var(--muted); padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--control-line); line-height: 1.4; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 28px; min-height: 72px; position: sticky; top: 0; z-index: 5; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 1.45em; letter-spacing: -.02em; flex: 1; font-weight: 700; }
.top .mbrand { display: none; } .show-m { display: none; }
.mbrand { align-items: center; gap: 6px; text-decoration: none; padding-right: 10px; border-right: 1px solid var(--line); }
.mbrand b { font-size: 1.25em; font-weight: 700; letter-spacing: -.03em; background: linear-gradient(115deg, #4f9fcf, #5a88d8 55%, #7d6bd0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8em; font-weight: 600; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok { color: var(--ok); } .pill.ok .dot { background: var(--ok); }
.pill.warn { color: var(--warn); } .pill.warn .dot { background: #e0a030; }
.pill.ai { color: var(--violet); } .pill.ai .dot { background: var(--violet); }
.pill.danger { color: var(--danger); } .pill.danger .dot { background: var(--danger); }
.src { font-size: .68em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.src.real { background: #e3f4ea; color: #23734e; } .src.sample { background: #fff0d9; color: #8a5200; }
.page { padding: 24px 28px 40px; display: grid; gap: 20px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 1.05em; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card h2 .sp { flex: 1; }
.grid { display: grid; gap: 20px; }
.g-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.g-central { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 1.9em; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { font-size: .82em; color: var(--muted); font-weight: 600; }
.hero { background: var(--wing); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 200px; height: 200px; border-radius: 50%; background: #ffffff26; }
.hero .l { color: #ffffffd9; }

.row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); min-width: 0; }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: .84em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9em; flex: none; background: var(--control); color: var(--brand2); box-shadow: inset 0 0 0 1px var(--control-line); }
.av.ai { background: var(--wing); color: #fff; box-shadow: none; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand2); }
.mini { min-height: 36px; padding: 4px 12px; font-size: .85em; border-radius: 12px; }
.acts { display: flex; gap: 6px; }
.agent { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.agent + .agent { border-top: 1px solid var(--line); }
.numcard { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--control); box-shadow: inset 0 0 0 1px var(--control-line); }
.numcard .big { white-space: nowrap; font-size: 1.25em; font-weight: 700; letter-spacing: -.01em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .88em; margin-top: 10px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.aibox { display: flex; gap: 14px; align-items: center; }
.aibox .ring { width: 58px; height: 58px; border-radius: 50%; background: var(--wing); display: grid; place-items: center; color: #fff; position: relative; flex: none; }
.aibox .ring::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #8eafec; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(.95); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.aistats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.aistats div { background: var(--panel2); border-radius: 12px; padding: 8px 4px; } .aistats b { display: block; font-size: 1.2em; }
.aistats span { font-size: .72em; color: var(--muted); font-weight: 600; }

/* dialer */
.g-dialer { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
.dial { text-align: center; padding: 24px; }
.dial .display { font-size: 2em; font-weight: 700; letter-spacing: .02em; min-height: 1.5em; font-variant-numeric: tabular-nums; word-break: break-all; }
.dial .hint { min-height: 1.4em; font-size: .85em; color: var(--muted); margin-bottom: 10px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.key { aspect-ratio: 1.25; min-height: 64px; border-radius: 22px; background: var(--panel2); color: var(--ink); display: grid; place-content: center; box-shadow: inset 0 0 0 1px var(--line); padding: 0; }
.key:hover { background: var(--hover); }
.key b { font-size: 1.6em; font-weight: 600; line-height: 1; } .key i { font-style: normal; font-size: .62em; letter-spacing: .15em; color: var(--muted); font-weight: 700; }
.dialrow { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }
.callbtn { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); padding: 0; display: grid; place-items: center; box-shadow: 0 8px 24px #2f8f6355; }
.callbtn svg { width: 30px; height: 30px; }
.endbtn { background: var(--danger); box-shadow: 0 8px 24px #c93a4a55; }
.round { width: 52px; height: 52px; border-radius: 50%; padding: 0; display: grid; place-items: center; }
.from { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 8px; font-size: .85em; }
.from select { width: auto; min-height: 36px; padding: 2px 10px; font-size: .95em; }
.incall { text-align: center; padding: 28px 22px; background: linear-gradient(180deg, #eef7ff, #f5f1fd); }
.incall .who { font-size: 1.5em; font-weight: 700; margin-top: 10px; }
.ctrls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 330px; margin: 22px auto 16px; }
.ctrl { display: grid; justify-items: center; gap: 4px; background: none; color: var(--ink); padding: 0; font-size: .78em; font-weight: 600; min-height: 0; }
.ctrl span.c { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); box-shadow: inset 0 0 0 1px var(--control-line), var(--shadow); }
.ctrl.on span.c { background: var(--brand); color: #fff; }
.bigav { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2em; font-weight: 700; background: var(--wing); color: #fff; box-shadow: 0 0 0 8px #ffffffaa, var(--shadow-lg); }
.contact { cursor: pointer; border-radius: 14px; }
.contact:hover { background: var(--hover); }

/* incoming */
.incoming { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #1b2638b3; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 20px; }
.incoming .sheet { width: min(440px, 100%); border-radius: 32px; overflow: hidden; background: radial-gradient(90% 60% at 20% 0%, #dff3ff, transparent 70%), radial-gradient(90% 60% at 100% 100%, #ece5ff, transparent 70%), var(--panel); box-shadow: var(--shadow-lg); text-align: center; padding: 34px 26px 28px; }
.incoming .bigav { width: 116px; height: 116px; font-size: 2.4em; position: relative; }
.incoming .bigav::before, .incoming .bigav::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid #8eafec; animation: pulse 1.8s infinite; }
.incoming .bigav::after { animation-delay: .9s; }
.incoming h3 { font-size: 1.7em; margin: 22px 0 2px; letter-spacing: -.02em; }
.incoming .ctx { display: grid; gap: 8px; margin: 18px 0 24px; text-align: left; }
.incoming .ctx div { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; font-size: .88em; }
.answerrow { display: flex; justify-content: space-around; align-items: flex-start; }
.answerrow .opt { display: grid; justify-items: center; gap: 8px; font-size: .8em; font-weight: 600; color: var(--muted); }
.answerrow button.callbtn { width: 76px; height: 76px; }
.answerrow .opt button.round { width: 76px; height: 76px; }

/* history */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { min-height: 36px; padding: 4px 14px; border-radius: 999px; background: var(--panel2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-size: .86em; }
.chip.on { background: var(--brand); color: #fff; box-shadow: none; }
.dirico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--panel2); }
.r-missed .dirico, .r-blocked .dirico { color: var(--danger); background: #fdeef0; }
.r-ai .dirico { color: var(--violet); background: #f1eefc; }
.r-answered .dirico { color: var(--ok); background: #e8f5ee; }
.r-voicemail .dirico { color: var(--warn); background: #fff4e3; }
.r-missed .t { color: var(--danger); }
.dur { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85em; min-width: 3.2em; text-align: right; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92em; }
.tbl th { text-align: left; font-size: .78em; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); }

/* voicemail */
.g-vm { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; }
.vmitem { cursor: pointer; border-radius: 16px; padding: 12px; border-top: 0; margin-bottom: 4px; }
.vmitem:hover { background: var(--hover); }
.vmitem.on { background: var(--control); box-shadow: inset 0 0 0 1px var(--control-line); }
.unread { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
.player { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--control); box-shadow: inset 0 0 0 1px var(--control-line); margin: 14px 0; }
.wave { flex: 1; height: 38px; display: flex; align-items: center; gap: 3px; }
.wave i { flex: 1; border-radius: 3px; background: #b9cbe6; }
.wave i.p { background: linear-gradient(#64c9e8, #8eafec); }
.transcript { font-size: 1.05em; line-height: 1.65; background: var(--panel2); border-radius: 16px; padding: 16px 18px; margin: 0; }
.summary { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #f1eefc; color: #4b3d99; font-size: .92em; margin-top: 12px; }

/* routing */
.g-routing { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.flow { display: grid; gap: 0; }
.fnode { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); }
.fnode.brandn { background: var(--wing); color: #fff; border: 0; }
.fline { width: 2px; height: 16px; background: var(--control-line); margin-left: 32px; }
.opt-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.digit { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--control); color: var(--brand2); box-shadow: inset 0 0 0 1px var(--control-line); }
.opt-row select { min-height: 40px; padding: 4px 10px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c9d4e3; transition: background var(--anim); cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform var(--anim); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(22px); }
.setrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.setrow .grow { flex: 1; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: .8em; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .9em; opacity: 0; transition: all var(--anim); z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* phone tab bar */
.tabbar { display: none; }
@media (max-width: 1100px) { .g-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-central, .g-routing, .g-vm, .g-dialer { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 10px 16px; min-height: 60px; padding-top: max(10px, env(safe-area-inset-top)); }
  .top .mbrand { display: flex; } .top .mlogo { height: 24px; width: auto; } .top h1 .show-m { display: inline; } .show-m { display: block; }
  .top h1 { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .hide-m { display: none; }
  .page { padding: 14px 12px 120px; gap: 14px; }
  .card { padding: 14px; border-radius: 18px; }
  .g-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g-stats .stat:first-child { grid-column: 1 / -1; }
  .grid { gap: 14px; }
  .hide-m { display: none !important; }
  .dial { padding: 14px 8px; }
  .keys { gap: 10px; max-width: 300px; }
  .key { aspect-ratio: 1.45; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 5px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); z-index: 20; }
  .tab { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 58px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .68em; font-weight: 700; position: relative; }
  .tab.on { color: var(--brand2); background: var(--control); box-shadow: inset 0 0 0 1px var(--control-line); }
  .tab .badge { position: absolute; top: 4px; left: 56%; font-size: .9em; padding: 0 6px; }
  .opt-row { grid-template-columns: 40px minmax(0, 1fr); }
  .opt-row .pill { grid-column: 2; justify-self: start; }
  .incoming { padding: 0; }
  .incoming .sheet { border-radius: 0; height: 100%; width: 100%; display: flex; flex-direction: column; justify-content: center; padding-top: max(34px, env(safe-area-inset-top)); }
  .toast { bottom: 96px; }
}
.player .timer { white-space: nowrap; }
.wave { min-width: 0; overflow: hidden; }
.wave i { min-width: 1px; }
@media (max-width: 760px) { .wave { gap: 2px; } .player { gap: 10px; padding: 12px; } }
