/* נוסי (#bot). משתמש במשתני הצבע של האפליקציה */
.bot{display:flex;flex-direction:column;gap:14px;width:100%;max-width:760px;margin-inline:auto;direction:rtl;min-height:calc(100vh - 32px);min-height:calc(100dvh - 32px)}
.bot [hidden]{display:none!important}
html.ui-bot main{padding-bottom:0}
.bot-head h1{margin:0 0 6px}
.bot-line{display:flex;flex-wrap:wrap;gap:10px;align-items:center;min-height:32px}
.bot-status{display:inline-flex;align-items:center;gap:8px;font-size:14px;color:var(--muted)}
.bot-status::before{content:"";width:9px;height:9px;border-radius:50%;background:#9AA3AF;flex:none}
.bot-status.ready::before{background:#2E8B57}
.bot-status.offline::before{background:#E8913A}
.bot-status.denied,.bot-status.error{color:var(--warn)}
.bot-status.denied::before,.bot-status.error::before{background:#B03A2E}
.bot-empty{padding:14px 16px;background:var(--card);border:1px solid var(--line);border-radius:8px;color:var(--muted);font-size:14px}
.bot-empty p{margin:0 0 10px}
.bot-tips{display:flex;flex-wrap:wrap;gap:8px}
.bot.has-msgs .bot-empty{display:none}
.bot-log{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;flex:1 0 auto}
.bot-msg{display:flex;flex-direction:column;gap:2px;max-width:85%;padding:9px 12px;border-radius:12px;border:1px solid var(--line);background:var(--card);scroll-margin-bottom:160px}
.bot-msg.me{align-self:flex-start;background:var(--accs);border-color:#E0CFA9}
.bot-msg.reply,.bot-msg.err{align-self:flex-end}
.bot-msg.err{background:var(--warns);border-color:#EBD3B3;color:var(--warn)}
.bot-msg.failed{opacity:.6}
.bot-msg.pending .bot-text{color:var(--muted)}
.bot-who{font-size:12px;color:var(--muted)}
.bot-text{white-space:pre-wrap;overflow-wrap:anywhere}
.bot-dock{position:sticky;bottom:0;display:flex;flex-direction:column;gap:8px;padding:8px 0 calc(10px + env(safe-area-inset-bottom,0px));background:var(--bg)}
.bot-form{display:flex;gap:8px;align-items:flex-end}
.bot-tools{display:flex;gap:8px}
.bot .bot-tools .btn{flex:1 1 0;justify-content:center;min-height:40px}
.bot .bot-tools .btn:disabled{opacity:.5;cursor:default}
.bot-rec{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 12px;border-radius:8px;background:var(--warns);color:var(--warn);font-weight:700}
.bot-thumb{display:block;max-width:160px;max-height:160px;border-radius:8px;border:1px solid var(--line);margin-top:4px}
.bot-input{flex:1 1 auto;min-width:0;box-sizing:border-box;min-height:46px;max-height:160px;resize:none;font:inherit;font-size:16px;line-height:1.45;padding:10px 12px;border:1px solid #CBBB9D;border-radius:8px;background:#fff;color:var(--ink)}
.bot-input:focus{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px var(--accs)}
.bot .bot-send{flex:none;min-height:46px;min-width:84px;justify-content:center}
.bot .bot-send:disabled{opacity:.5;cursor:default}
/* כפתור התרומה הצף וחיווי הסנכרון לא מכסים את תיבת הכתיבה */
html.ui-bot .fab,html.ui-bot #syncchip{display:none!important}
@media(max-width:820px){
  /* 80px = התפריט העליון והריווח שמעל המסך */
  .bot{min-height:calc(100vh - 80px);min-height:calc(100dvh - 80px)}
  .bot-msg{max-width:92%}
}
@media print{.bot-dock{display:none}}

/* תשובות ודוחות */
.bot-msg.report,.bot-msg.saved{align-self:stretch;max-width:100%;gap:8px}
.bot-msg.report{scroll-margin-top:90px}
.bot-body,.bot-sec{display:flex;flex-direction:column;gap:8px;min-width:0}
.bot-body{gap:16px}
.bot-sec h2{margin:0;font-size:15px;border-bottom:2px solid var(--line);padding-bottom:4px}
.bot-filter,.bot-note{margin:0;font-size:12.5px;color:var(--muted)}
.bot-sum,.bot-cards,.bot-facts{margin:0}
.bot-sum dt,.bot-cards dt,.bot-facts dt{font-size:12px;color:var(--muted)}
.bot-sum dd,.bot-cards dd,.bot-facts dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;text-align:right}
.bot-sum{display:flex;flex-wrap:wrap;gap:4px 18px}
.bot-sum dd{font-weight:700}
.bot-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}
.bot-cards>div{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--bg)}
.bot-cards dd{font-weight:700;font-size:17px}
.bot-facts>div{display:grid;grid-template-columns:minmax(90px,28%) 1fr;gap:8px;padding:4px 0;border-bottom:1px solid var(--line)}
.bot-chart{display:flex;flex-direction:column;gap:6px;font-size:13px}
.bot-bar{display:grid;grid-template-columns:minmax(70px,26%) 1fr auto;gap:8px;align-items:center}
.bot-bar>span{overflow-wrap:anywhere}
.bot-bar i{display:block;height:11px;background:var(--bg);border-radius:3px;overflow:hidden;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.bot-bar b{display:block;height:100%;background:var(--acc);-webkit-print-color-adjust:exact;print-color-adjust:exact}
.bot-table{overflow-x:auto}
.bot-table table{width:100%;border-collapse:collapse;font-size:13px}
.bot-table th,.bot-table td{border:1px solid var(--line);padding:5px 7px;text-align:right;vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere}
.bot-table th{background:var(--bg);font-size:12px}
.bot-items{margin:0;padding-inline-start:18px;display:flex;flex-direction:column;gap:4px;font-weight:600}
.bot-items li{overflow-wrap:anywhere}
.bot-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
@media screen and (max-width:600px){
  .bot-table thead{display:none}
  .bot-table table,.bot-table tbody,.bot-table tr,.bot-table td{display:block;width:auto}
  .bot-table tr{border:1px solid var(--line);border-radius:8px;margin-bottom:8px;padding:4px 10px}
  .bot-table td{border:0;padding:3px 0;display:grid;grid-template-columns:minmax(72px,30%) 1fr;gap:8px}
  .bot-table td::before{content:attr(data-label);color:var(--muted);font-size:12px}
  .bot-table td.none{display:none}
}
/* הדפסת תשובה: מוצג רק הגיליון. הכלל הכללי באפליקציה מסתיר הכל, ולכן מחזירים את הגיליון */
.bot-sheet{display:none}
@media print{
  html.bot-printing,html.bot-printing body{background:#fff!important;height:auto!important}
  html.bot-printing body>*:not(#botPrint){display:none!important}
  html.bot-printing #botPrint,html.bot-printing #botPrint *{visibility:visible!important}
  html.bot-printing #botPrint{display:flex;flex-direction:column;gap:12px;direction:rtl;color:#000;padding:0}
  #botPrint h1{margin:0;font-size:20px}
  #botPrint tr,#botPrint .bot-bar,#botPrint .bot-cards>div,#botPrint .bot-facts>div{break-inside:avoid}
  #botPrint h2{break-after:avoid}
  #botPrint .bot-table{overflow:visible}
  #botPrint .bot-table table{font-size:10.5px}
}
