/* Tara portal: one stylesheet for /admin and /login. Works offline (no web fonts); light and dark. */
:root {
  --bg: #f8fafc; --card: #ffffff; --ink: #0f172a; --ink-2: #334155; --mute: #64748b; --line: #e2e8f0; --line-2: #cbd5e1;
  --acc: #2563eb; --acc-2: #1d4ed8; --acc-soft: #eff6ff; --acc-ink: #ffffff;
  --side: #0f172a; --side-2: #1e293b; --side-ink: #94a3b8; --side-mute: #64748b; --side-on: #e2e8f0;
  --red: #b91c1c; --red-bg: #fef2f2; --amb: #b45309; --amb-bg: #fffbeb; --ok: #15803d; --ok-bg: #f0fdf4;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);
  --radius: 6px; --field: 40px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1119; --card: #131b26; --ink: #e8eef5; --ink-2: #c4cfdb; --mute: #8b9aab; --line: #223042; --line-2: #2c3c50;
    --acc: #4c8dff; --acc-2: #6aa0ff; --acc-soft: #16243a; --acc-ink: #ffffff;
    --side: #080d14; --side-2: #111b28; --side-ink: #c2cedb; --side-mute: #6d8098; --side-on: #ffffff;
    --red: #ff8f73; --red-bg: #3a1a12; --amb: #ffc861; --amb-bg: #33270e; --ok: #5fd39a; --ok-bg: #0f2e21;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box }
html, body { margin: 0 }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/vendor/inter-latin-var.woff2) format('woff2'); }
body { background: var(--bg); color: var(--ink); font: 13px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased }
a { color: var(--acc) }
h1, h2, h3 { letter-spacing: -.01em }

/* ---------- top bar ---------- */
header { position: sticky; top: 0; z-index: 3; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--card); border-bottom: 1px solid var(--line) }
header h1 { margin: 0 auto 0 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px }
header h1::before { content: "T"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
  color: #fff; background: linear-gradient(135deg, var(--acc), #7a5cff) }
header #me { font-size: 13px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px }
header a.mute { font-size: 13px; text-decoration: none; color: var(--mute) } header a.mute:hover { color: var(--ink) }

/* ---------- layout ---------- */
.app { display: flex; min-height: calc(100vh - 56px) }
main { max-width: 1080px; margin: 0 auto; padding: 24px }
.app main { flex: 1; min-width: 0; max-width: 1180px; margin: 0 auto }

/* ---------- sidebar ---------- */
nav.side { width: 248px; flex: none; background: var(--side); color: var(--side-ink); padding: 14px 10px 24px; position: sticky; top: 56px;
  height: calc(100vh - 56px); overflow-y: auto }
nav.side .h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--side-mute); margin: 18px 12px 6px }
nav.side .h:first-child { margin-top: 4px }
nav.side button, nav.side a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 8px; padding: 8px 10px; margin: 1px 0; font: inherit; font-size: 14px; color: var(--side-ink); cursor: pointer; text-decoration: none }
nav.side button:hover, nav.side a:hover { background: var(--side-2); color: var(--side-on) }
nav.side button.on { background: var(--acc); color: #fff; font-weight: 600 }
nav.side .n { margin-left: auto; font-size: 12px; color: var(--side-mute); font-variant-numeric: tabular-nums }
nav.side .n:not(:empty) { background: var(--side-2); padding: 0 7px; border-radius: 999px; line-height: 20px }
nav.side button.on .n { color: #fff; background: rgba(255, 255, 255, .18) }
/* icons (no image files: CSS masks) */
nav.side button::before, nav.side a::before { content: ""; width: 18px; height: 18px; flex: none; background: currentColor; opacity: .85;
  -webkit-mask: var(--i) center / 18px no-repeat; mask: var(--i) center / 18px no-repeat }
nav.side [data-v="work"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3 8-8'/%3E%3Cpath d='M20 12v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h9'/%3E%3C/svg%3E") }
nav.side [data-v="clients"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E") }
nav.side [data-v="live"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M6.3 6.3a8 8 0 0 0 0 11.4M17.7 6.3a8 8 0 0 1 0 11.4'/%3E%3C/svg%3E") }
nav.side [data-f] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") }
nav.side [data-f="flagged"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E") }
nav.side [data-v="teach"], nav.side [data-v="practice"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M22 10L12 5 2 10l10 5 10-5z'/%3E%3Cpath d='M6 12v5c3 2 9 2 12 0v-5'/%3E%3C/svg%3E") }
nav.side [data-v="phrases"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") }
nav.side [data-v="gaps"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3M12 17h.01'/%3E%3C/svg%3E") }
nav.side [data-v="buyers"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='3'/%3E%3Ccircle cx='5' cy='9' r='2.3'/%3E%3Ccircle cx='19' cy='9' r='2.3'/%3E%3Cpath d='M7 20v-1.5A5 5 0 0 1 12 14a5 5 0 0 1 5 4.5V20M1.5 19v-1a3.5 3.5 0 0 1 4-3.4M22.5 19v-1a3.5 3.5 0 0 0-4-3.4'/%3E%3C/svg%3E") }
nav.side [data-v="company"][data-part="services"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E") }
nav.side [data-v="company"][data-part="prices"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7' cy='7' r='1.5'/%3E%3C/svg%3E") }
nav.side [data-v="company"][data-part="catalogue"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5 9 5 9-5z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8M12 13v8'/%3E%3C/svg%3E") }
nav.side [data-v="sources"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E") }
nav.side [data-v="teachers"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a4 4 0 0 1 4 4v1a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4zM4 22v-2a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v2'/%3E%3C/svg%3E") }
nav.side [data-v="calendar"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") }
nav.side [data-v="credits"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20M6 15h4'/%3E%3C/svg%3E") }
nav.side [data-v="channels"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v12H8l-4 4z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E") }
nav.side [data-v="aianswers"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 4.6L18.5 9l-4.6 1.9L12 15.5l-1.9-4.6L5.5 9l4.6-1.4z'/%3E%3Cpath d='M19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z'/%3E%3C/svg%3E") }
nav.side [data-v="voice"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E") }
nav.side [data-v="places"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") }
nav.side [data-v="words"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7V4h16v3M9 20h6M12 4v16'/%3E%3C/svg%3E") }
nav.side [data-v="staff"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E") }
nav.side [data-v="account"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") }
nav.side [data-v="pbx"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E") }
nav.side [data-v="company"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14M9 9h1M14 9h1M9 13h1M14 13h1M9 17h1M14 17h1'/%3E%3C/svg%3E") }
nav.side a[href="/voice"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v4'/%3E%3C/svg%3E") }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow) }
.card > b:first-child, .card > h2:first-child { display: block; font-size: 17px; font-weight: 700; margin-bottom: 4px }
.call { cursor: pointer; transition: border-color .15s, box-shadow .15s } .call:hover { border-color: var(--acc); box-shadow: var(--shadow-lg) }
.live { border-left: 4px solid var(--ok) }
.empty { text-align: center; color: var(--mute); padding: 48px 16px; background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius) }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px } @media (max-width: 640px) { .grid { grid-template-columns: 1fr } }
.mute { color: var(--mute); font-size: 13px }
.said { margin: 8px 0 } .said b { display: inline-block; min-width: 64px; color: var(--mute); font-weight: 600; font-size: 13px }
.notes { font-size: 16px; margin: 6px 0 10px; color: var(--ink) }
.ai { font-size: 11px; font-weight: 700; color: var(--acc); text-transform: uppercase; letter-spacing: .08em }

/* ---------- badges, flags, chips ---------- */
.badge, .flag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 18px }
.b-red, .flag.bad { background: var(--red-bg); color: var(--red) } .b-amb, .flag { background: var(--amb-bg); color: var(--amb) } .b-ok { background: var(--ok-bg); color: var(--ok) }
.flag { margin: 0 4px 4px 0 }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; margin: 0 6px 8px 0;
  font-size: 14px; cursor: pointer; background: var(--card) }
.chip.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok) } .chip input { margin: 0 }
.region { margin-bottom: 12px } .region h3 { font-size: 15px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: var(--field); font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft) }
textarea { min-height: 84px; resize: vertical; line-height: 1.5 }
.chk { display: flex; gap: 8px; align-items: center; margin-top: 14px; color: var(--ink); font-size: 15px }
.chk input { width: 18px; height: 18px; min-height: 0 }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px }
.filters label { margin: 0 0 6px } .filters input, .filters select { width: auto; min-width: 160px }

/* ---------- buttons ---------- */
button { font: inherit }
button.main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--field); background: var(--acc); color: var(--acc-ink);
  border: 0; border-radius: 9px; padding: 9px 18px; font-weight: 600; cursor: pointer; margin-top: 14px; box-shadow: var(--shadow); transition: background .15s }
button.main:hover { background: var(--acc-2) } button.main:disabled { opacity: .55; cursor: default }
.act, button.mic, .tab { display: inline-flex; vertical-align: middle; align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; margin: 0 6px 6px 0; transition: border-color .15s, background .15s }
.act:hover, button.mic:hover, .tab:hover { border-color: var(--acc); color: var(--acc) }
.act.del { color: var(--red) } .act.del:hover { border-color: var(--red); background: var(--red-bg) }
button.mic.rec { background: var(--red-bg); color: var(--red); border-color: var(--red) }
.tab { border-radius: 999px } .tab.on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc) }
.back { background: none; border: 0; color: var(--acc); font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px }
.saved { color: var(--ok); font-weight: 600; margin-left: 10px }
body.staff .act.del { display: none }

/* ---------- tables ---------- */
table.calls { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow) }
table.calls th, table.calls td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px }
table.calls th { font-size: 11px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; background: var(--bg) }
table.calls tbody tr { cursor: pointer } table.calls tbody tr:hover td { background: var(--acc-soft) }
table.calls tr:last-child td { border-bottom: 0 }

/* ---------- Admin > Company: upload area and sections that fold ---------- */
.drop { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--line); border-radius: 14px; padding: 18px 16px; cursor: pointer;
  background: var(--bg); color: var(--ink); transition: border-color .15s, background .15s }
.drop:hover, .drop.over { border-color: var(--acc); background: var(--acc-soft) }
.drop svg { width: 34px; height: 34px; color: var(--acc); flex: none }
.drop b { display: block; font-size: 16px } .drop .mute { display: block; font-size: 14px; font-weight: 400; margin-top: 2px }
details.sec > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; min-height: 44px }
details.sec > summary::-webkit-details-marker { display: none }
details.sec > summary .sub { display: block; font-weight: 400; color: var(--mute); font-size: 14px; margin-top: 3px }
details.sec .chev { width: 10px; height: 10px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: rotate(45deg);
  transition: transform .15s; flex: none; margin: 0 6px 4px 0 }
details.sec[open] .chev { transform: rotate(-135deg); margin-bottom: -4px }
details.sec[open] > summary { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line) }

/* ---------- a call, turn by turn: caller (recording + words), Tara (reply + better answer), routing folded away ---------- */
.turn { padding: 0; overflow: hidden }
.card.turn { padding: 0 }
.turn .turn-n { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 12px 18px 0 }
.turn .part { padding: 12px 18px 14px; border-top: 1px solid var(--line) } .turn .turn-n + .part { border-top: 0 }
.turn h4, .tara-only h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--acc) }
.turn audio { display: block; width: 100%; height: 40px; margin: 0 0 10px }
.turn textarea.short { min-height: 52px !important; overflow: hidden; resize: none }
.turn .reply, .tara-only .reply { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 4px; line-height: 1.45 }
.turn .small, .tara-only .small { font-size: 13px; margin-top: 4px }
.turn details.fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; cursor: pointer; flex-wrap: wrap }
.turn details.fold > summary::-webkit-details-marker { display: none }
.turn details.fold > summary h4 { margin: 0 } .turn details.fold > summary::after { content: "Show"; margin-left: auto; color: var(--acc); font-size: 14px; font-weight: 600 }
.turn details.fold[open] > summary::after { content: "Hide" } .turn details.fold[open] > summary { margin-bottom: 10px }
.turn .turn-save { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.turn .turn-save .main { margin: 0 }
.tara-only { padding: 12px 18px }

/* ---------- dialogs ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 14, 22, .55); display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 14px; overflow: auto; z-index: 50 }
.modal .box { background: var(--bg); border-radius: 16px; width: min(860px, 100%); padding: 22px; position: relative; box-shadow: var(--shadow-lg) }
/* close: a round button that stays at the top right while the dialog scrolls, never on top of the text */
.modal .x { position: sticky; top: 0; z-index: 3; width: 40px; height: 40px; margin: -6px -6px 8px auto; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow) }
.modal .x:hover { border-color: var(--acc); color: var(--acc) }
.wrow { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap } .wrow input { flex: 1; min-width: 140px }

/* ---------- browser phone ---------- */
#phone { position: fixed; right: 18px; bottom: 18px; width: 310px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); z-index: 6; font-size: 14px }
#phone .ph-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600 }
#phone .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mute) } #phone .dot.on { background: var(--ok) } #phone .dot.bad { background: var(--red) }
#phone .ph-body { padding: 0 14px 14px } #phone.min .ph-body { display: none }
#phone input { width: 100%; font-size: 20px; letter-spacing: .04em; text-align: center }
#phone .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 }
#phone .keys button, #phone .pbtn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 0; font-size: 17px; cursor: pointer }
#phone .keys button:hover { border-color: var(--acc) }
#phone .row2 { display: flex; gap: 8px } #phone .row2 .pbtn { flex: 1; font-weight: 600 }
#phone .call { background: var(--ok); color: #fff; border-color: var(--ok) } #phone .end { background: var(--red); color: #fff; border-color: var(--red) }
#phone .ring { background: var(--amb-bg); border: 1px solid var(--amb); border-radius: 10px; padding: 10px; margin-bottom: 10px }
#phone .ring .who { font-weight: 700; font-size: 15px } #phone .ring .notes { font-size: 13px; margin: 4px 0 }

/* ---------- sign-in page ---------- */
body.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr }
.login .brand { background: radial-gradient(1200px 600px at -10% -10%, #2a5cff 0%, transparent 55%), linear-gradient(160deg, #0b1a2c, #111f35 60%, #1a1145);
  color: #dbe6f5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between }
.login .brand .logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; color: #fff }
.login .brand .logo::before { content: "T"; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #4c8dff, #8a6bff) }
.login .brand h2 { font-size: 34px; line-height: 1.15; color: #fff; margin: 0 0 12px; max-width: 460px }
.login .brand p { max-width: 440px; color: #b7c6da; margin: 0 }
.login .brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: #cbd7e7 }
.login .brand li::before { content: "✓"; color: #6fe0a8; font-weight: 700; margin-right: 10px }
.login .side-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg) }
.login form.card { width: min(420px, 100%); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line) }
.login form h1 { font-size: 24px; margin: 0 0 4px }
.login form button.main { width: 100%; margin-top: 22px; min-height: 46px; font-size: 16px }
.login .pw-wrap { position: relative } .login .pw-wrap input { padding-right: 70px }
.login .pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--acc); font-weight: 600; cursor: pointer; padding: 6px 8px }
.err { color: var(--red); background: var(--red-bg); border-radius: 9px; padding: 10px 12px; font-weight: 600; font-size: 14px; display: none }
@media (max-width: 860px) { body.login { grid-template-columns: 1fr } .login .brand { display: none } }

/* ---------- small screens (phones): drawer menu, bottom tabs, 44px targets, 16px text (no iOS zoom), flat cards ---------- */
.menu-btn, .tabbar, .scrim { display: none }
@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: calc(68px + env(safe-area-inset-bottom)) }
  header { padding: 0 12px; height: 56px; gap: 10px }
  header h1 { font-size: 17px } header h1 span.mute { display: none }
  header #me { display: none }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -6px; border: 0; background: none; color: var(--ink);
    border-radius: 12px; cursor: pointer }
  .menu-btn svg { width: 24px; height: 24px }
  main { padding: 14px 12px 20px }
  .app { display: block }
  /* the menu: a full-height drawer, big rows, grouped */
  nav.side { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); height: 100%; overflow-y: auto; padding: 18px 12px 28px;
    transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); display: block; white-space: normal;
    padding-top: calc(18px + env(safe-area-inset-top)) }
  body.drawer nav.side { transform: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .35) }
  nav.side .h { display: block; font-size: 12px; margin: 20px 12px 6px }
  nav.side button, nav.side a { width: 100%; min-height: 48px; font-size: 16px; padding: 10px 12px; border-radius: 12px }
  nav.side button::before, nav.side a::before { width: 20px; height: 20px }
  .scrim { position: fixed; inset: 0; z-index: 19; background: rgba(8, 14, 22, .45) }
  body.drawer .scrim { display: block }
  /* bottom tab bar: the four things used most */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line) }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0;
    background: none; color: var(--mute); font: inherit; font-size: 12px; font-weight: 600; border-radius: 12px; cursor: pointer }
  .tabbar button svg { width: 24px; height: 24px }
  .tabbar button.on { color: var(--acc); background: var(--acc-soft) }
  /* controls: big enough for a thumb, text big enough that the phone never zooms */
  input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=date], input:not([type]), select, textarea {
    font-size: 16px; min-height: 48px; border-radius: 12px }
  button.main { min-height: 48px; font-size: 16px; border-radius: 12px; width: 100%; box-shadow: none }
  .act, button.mic, .tab { min-height: 44px; font-size: 15px; padding: 8px 14px; border-radius: 12px }
  .card { padding: 16px; border-radius: 16px; box-shadow: none }
  .grid { grid-template-columns: 1fr }
  .wrow input { min-width: 0 }
  /* tables become stacked cards */
  table.calls, table.calls tbody, table.calls tr, table.calls td { display: block; width: 100% }
  table.calls { border: 0; background: none; box-shadow: none }
  table.calls thead { display: none }
  table.calls tr { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px }
  table.calls td { border: 0; padding: 4px 0; font-size: 15px }
  table.calls .hide-s { display: none }
  /* stacked rows say what each value is: <td data-label="Calls"> */
  table.calls td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--mute); font-size: 13px; font-weight: 600 }
  table.calls tbody tr:hover td { background: none }
  .modal { padding: 0; align-items: flex-start } .modal .box { border-radius: 0; min-height: 100%; padding: 10px 12px 40px }
  .modal .x { top: 8px; width: 44px; height: 44px; margin: 0 0 8px auto }
  .card.turn { padding: 0 } .card.tara-only { padding: 12px 14px } .turn .part, .turn .turn-save { padding-left: 14px; padding-right: 14px } .turn .turn-n { padding-left: 14px }
  textarea { min-height: 130px !important }
  /* the softphone: a small round button above the tabs; tapped open it is a full-width sheet */
  #phone { left: auto; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: 999px }
  #phone.min .ph-head { padding: 10px 14px } #phone.min #ph-status, #phone.min #ph-toggle { display: none }
  #phone:not(.min) { left: 8px; right: 8px; border-radius: 18px }
}
}

/* usage meter (Credits & usage) */
.meter{height:8px;border-radius:4px;background:var(--line,#ddd);overflow:hidden;margin:4px 0;max-width:220px}
.meter i{display:block;height:100%}
/* two-column form (Phone lines); one column on a phone */
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:8px 0}
.grid2 label{display:flex;flex-direction:column;gap:4px}
@media (max-width:640px){.grid2{grid-template-columns:1fr}}
