:root {
  --bg: #f4f5f9; --surface: #fff; --text: #1c2233; --muted: #6b7286; --faint: #9aa0b1; --line: #e6e8f0;
  --primary: #4f46e5; --primary-2: #4338ca; --primary-soft: #eef0ff; --ok: #0f9d58; --ok-soft: #e7f6ee;
  --warn: #b45309; --warn-soft: #fff4e0; --bad: #d93025; --bad-soft: #fdecea; --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 4px 16px rgba(20, 24, 40, .05);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; flex: none; vertical-align: middle; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 20px 14px; position: sticky;
  top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center; color: #fff; }
.brand .logo svg { width: 20px; height: 20px; }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.on { background: var(--primary-soft); color: var(--primary); }
.nav .badge { margin-inline-start: auto; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); }
.side .me b { color: var(--text); font-weight: 600; }
.side .me button { margin-inline-start: auto; }
main { padding: 28px 32px 80px; max-width: 1180px; width: 100%; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.head .sp { flex: 1; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.stat .l { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat .d { font-size: 12px; color: var(--ok); }
.stat.link { cursor: pointer; transition: transform .1s; }
.stat.link:hover { transform: translateY(-1px); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none;
  color: var(--text); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.big { padding: 12px 20px; font-size: 16px; border-radius: 12px; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], input[type=tel], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; width: 100%;
  color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { appearance: none; width: 36px; height: 21px; border-radius: 20px; background: #d5d8e3; position: relative;
  cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2.5px; inset-inline-start: 2.5px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { inset-inline-start: 17.5px; }
.search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-inline-start: 34px; }
details.adv { margin-top: 6px; }
details.adv > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: inline-flex;
  align-items: center; gap: 6px; user-select: none; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "›"; display: inline-block; transform: rotate(90deg); transition: transform .15s; }
details.adv[open] > summary::before { transform: rotate(-90deg); }
details.adv > .in { margin-top: 12px; padding: 14px; background: var(--bg); border-radius: 12px; }

/* chips, badges */
.chips { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.chips button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--muted);
  font-weight: 500; font-size: 14px; }
.chips button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 20px;
  background: var(--bg); color: var(--muted); font-weight: 500; white-space: nowrap; }
.badge.p { background: var(--primary-soft); color: var(--primary); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }

/* info tip */
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: var(--faint);
  cursor: help; position: relative; vertical-align: middle; }
.tip svg { width: 16px; height: 16px; }
.tip:hover, .tip:focus { color: var(--primary); outline: none; }
.tip .tt { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 50%; transform: translateX(50%);
  background: #1f2433; color: #fff; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 400;
  line-height: 1.55; width: max-content; max-width: 280px; white-space: normal; opacity: 0; pointer-events: none;
  transition: opacity .12s; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.18); text-align: start; }
.tip:hover .tt, .tip:focus .tt { opacity: 1; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbfe; }
.tbl tr.off td { color: var(--faint); }
.tbl .w { width: 1%; white-space: nowrap; }
.tblwrap { overflow: auto; max-height: calc(100vh - 250px); margin: -6px -8px; padding: 0 8px; }
.ed { border-radius: 7px; padding: 2px 6px; margin: -2px -6px; cursor: text; min-height: 24px; display: inline-block;
  min-width: 60px; }
.ed:hover { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.ed.empty { color: var(--faint); }
.ed input { padding: 3px 7px; border-radius: 7px; min-width: 140px; }
.empty-state { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }

/* play */
.play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary);
  display: inline-grid; place-items: center; cursor: pointer; position: relative; flex: none; padding: 0; }
.play svg { width: 15px; height: 15px; }
.play:hover { background: #e1e4ff; }
.play.on { background: var(--primary); color: #fff; }
.play .ring { position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; }
.play.sm { width: 28px; height: 28px; }
.play.sm svg { width: 13px; height: 13px; }

/* list items */
.items { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.item .text { margin-top: 6px; color: var(--text); font-size: 14px; background: var(--bg); padding: 8px 12px;
  border-radius: 10px; white-space: pre-wrap; }
.item.new .title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* composer */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: -4px -4px 16px; padding: 0 4px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.voices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.voice { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center;
  gap: 10px; cursor: pointer; background: #fff; }
.voice:hover { border-color: #c9cdf8; }
.voice.on { border-color: var(--primary); background: var(--primary-soft); }
.voice b { display: block; font-size: 14px; }
.voice span { display: block; font-size: 12px; color: var(--muted); }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 30px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .12s, background .12s; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.drop svg { width: 30px; height: 30px; display: block; margin: 0 auto 8px; }
.rec { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 0; }
.recbtn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(217, 48, 37, .3); }
.recbtn svg { width: 30px; height: 30px; }
.recbtn.on { animation: pulse 1.3s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,48,37,.45); } 70% { box-shadow: 0 0 0 16px rgba(217,48,37,0); } 100% { box-shadow: 0 0 0 0 rgba(217,48,37,0); } }
.meter { width: 220px; height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .06s; }
.timer { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
audio.native { width: 100%; max-width: 420px; height: 38px; }
.said { white-space: pre-wrap; line-height: 1.9; font-size: 16px; }
.warnbox { background: var(--warn-soft); color: #7a4a06; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.warnbox ul { margin: 4px 0 0; padding-inline-start: 18px; }
.errbox { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.spin { width: 16px; height: 16px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%;
  animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 30px; background: linear-gradient(#818cf8, #6366f1); border-radius: 6px 6px 3px 3px;
  min-height: 2px; }
.bars .b span { font-size: 11px; color: var(--faint); }
.bars .b em { font-style: normal; font-size: 11px; color: var(--muted); }
.hbar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.hbar .n { width: 92px; flex: none; }
.hbar .t { flex: 1; height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: #818cf8; border-radius: 6px; }
.hbar .c { width: 34px; text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; }

/* modal, drawer, toast */
.veil { position: fixed; inset: 0; background: rgba(20, 24, 40, .35); display: grid; place-items: center; z-index: 100;
  padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal.wide { width: min(820px, 100%); }
.modal h3 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(460px, 100%); background: #fff; z-index: 100;
  box-shadow: 0 0 40px rgba(0,0,0,.15); padding: 22px; overflow: auto; animation: slide .15s; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.drawer h3 { margin: 0; font-size: 20px; }
.drawer section { margin-top: 18px; }
.drawer section h4 { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.toasts { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: flex;
  flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1f2433; color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  font-size: 14px; animation: fade .15s; max-width: 90vw; }
.toast.bad { background: var(--bad); }
.toast.ok { background: #136f43; }

/* sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 70% 10%, #e6e8ff, transparent 50%), var(--bg); }
.login .card { width: min(380px, 100%); padding: 30px; }
.login h1 { font-size: 22px; margin: 14px 0 4px; }
.login .logo { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center; color: #fff; }
.login .logo svg { width: 26px; height: 26px; }

/* send */
.target { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  cursor: pointer; }
.target.on { border-color: var(--primary); background: var(--primary-soft); }
.target input[type=radio] { accent-color: var(--primary); width: 17px; height: 17px; margin: 0; }
.target .grow { flex: 1; }
.target b { display: block; }
.costline { display: flex; gap: 22px; padding: 14px 0 4px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.costline b { color: var(--text); font-size: 18px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; height: auto; width: 100%; flex-direction: row; padding: 6px; z-index: 90;
    border-inline-end: 0; border-top: 1px solid var(--line); justify-content: space-around; }
  .brand, .side .me { display: none; }
  .nav { display: contents; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 2px; flex: 1 1 0; min-width: 0; text-align: center;
    line-height: 1.15; position: relative; }
  .nav a span { overflow-wrap: anywhere; }
  .nav .badge { position: absolute; top: 0; inset-inline-end: 8px; font-size: 10px; padding: 0 5px; }
  main { padding: 18px 14px 100px; }
  .head { flex-wrap: wrap; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .tbl .hide-m { display: none; }
}
