/* فونت وزیرمتن: اگر فایل داخل پوشه fonts باشد از همان (بدون نیاز به اینترنت) استفاده می‌شود،
   وگرنه از Google Fonts که در index.html لینک شده. */
@font-face {
  font-family: "VazirLocal";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #061226;
  --panel: #0a1d37;
  --card: #0c2442;
  --card-2: #0f2b4d;
  --border: #173a63;
  --text: #e9f1fc;
  --muted: #7f9abb;
  --accent: #2f80ed;
  --accent-2: #1b5fc4;
  --shadow: 0 6px 18px rgba(0, 0, 0, .3);
  --radius: 12px;
}
:root[data-theme="light"] {
  --bg: #eaf1fb;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f3f7fd;
  --border: #d5e1f2;
  --text: #0e2342;
  --muted: #5f7897;
  --shadow: 0 6px 18px rgba(30, 70, 130, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "VazirLocal", "Vazirmatn", "Vazir", "IRANSansX", "IRANSans", "Shabnam", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, strong, b { font-weight: 700; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 218px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, #3b8cff, #1546a8);
  box-shadow: 0 0 0 2px rgba(47,128,237,.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; }
.brand-text strong { font-size: 13.5px; }
.brand-text span { font-size: 10.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-title { font-size: 10.5px; color: var(--muted); margin: 10px 8px 3px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 11px;
  text-align: right; color: var(--text);
  transition: background .2s;
  position: relative;
}
.nav-item:hover { background: var(--card-2); }
.nav-item.active { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.active::after {
  content: ""; position: absolute; left: -10px; top: 24%; bottom: 24%;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.nav-item > span:nth-child(2) { flex: 1; }
.badge {
  font-style: normal; font-size: 10.5px; min-width: 22px; text-align: center;
  padding: 0 7px; border-radius: 999px;
  background: rgba(47,128,237,.18); color: #8dbbff;
}
:root[data-theme="light"] .badge { color: var(--accent-2); }

/* colored icon squares */
.ico {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; flex-shrink: 0;
}
.ico svg { width: 14px; height: 14px; }
.ico.blue   { background: rgba(47,128,237,.18);  color: #5aa2ff; }
.ico.purple { background: rgba(139,92,246,.18);  color: #a98bff; }
.ico.red    { background: rgba(239,68,68,.18);   color: #ff7b7b; }
.ico.green  { background: rgba(34,197,94,.18);   color: #4be08a; }
.ico.yellow { background: rgba(250,204,21,.18);  color: #ffd84d; }
.ico.orange { background: rgba(249,115,22,.18);  color: #ff9a55; }
.ico.cyan   { background: rgba(34,211,238,.18);  color: #4de3f5; }

.user-card {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 13px;
  background: var(--card-2); border: 1px solid var(--border);
  text-align: right; transition: border-color .2s;
}
.user-card:hover { border-color: var(--accent); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2f80ed, #1a4fa8);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.user-info { display: flex; flex-direction: column; line-height: 1.3; }
.user-info strong { font-size: 12px; }
.user-info span { font-size: 10.5px; color: var(--muted); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; padding: 12px 16px 30px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  box-shadow: var(--shadow);
}
.top-left { display: flex; align-items: center; gap: 10px; }
.crumbs span { font-size: 10.5px; color: var(--muted); }
.crumbs span i { font-style: normal; margin: 0 3px; }
.crumbs h1 { font-size: 14.5px; line-height: 1.3; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 14px;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.small { width: 28px; height: 28px; font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 14px; border-radius: 10px; font-weight: 600;
  transition: transform .15s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #3b8cff, #1f62cf); color: #fff; box-shadow: 0 4px 12px rgba(47,128,237,.35); }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(47,128,237,.5); }
.btn.ghost { background: var(--card-2); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--accent); }

.content { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px;
}
.stat small { color: var(--muted); font-size: 10.5px; display: block; line-height: 1.3; }
.stat b { font-size: 16px; line-height: 1.2; }

.stats.three { grid-template-columns: repeat(3, 1fr); }
.view { display: flex; flex-direction: column; gap: 10px; }
.view[hidden], .field[hidden] { display: none; }

/* بخش پرداخت */
.day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 8px 2px 0; padding: 0 2px; color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.day-head span:first-child { color: var(--text); }
.tag.amount { font-size: 11.5px; padding: 1px 10px; direction: ltr; unicode-bidi: isolate; }

/* خلاصه آخر صفحه: تعداد راب و مجموع مبلغ */
.summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.sum-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.sum-item small { color: var(--muted); font-size: 10.5px; display: block; line-height: 1.3; }
.sum-item b { font-size: 17px; line-height: 1.25; direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* دکمه کپی گزارش پرداخت */
.pay-report { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pay-report .btn[hidden] { display: none; }
.period-empty { text-align: center; color: var(--muted); padding: 14px 10px; }

/* دسته‌های قبلی (هر حساب بسته‌شده یک دسته) */
.old-section {
  margin-top: 10px; padding: 6px 8px 8px;
  border: 1px dashed var(--border); border-radius: 12px;
  background: rgba(127,154,187,.07);
}
.old-head { display: flex; align-items: center; gap: 8px; }
.old-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; text-align: right; color: var(--text);
}
.old-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.old-meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.old-arrow { color: var(--muted); transition: transform .2s; }
.old-section:not(.open) .old-arrow { transform: rotate(90deg); }
.old-actions { display: flex; gap: 5px; }
.old-actions .icon-btn { width: 27px; height: 27px; border-radius: 8px; }
.old-actions .icon-btn svg { width: 13px; height: 13px; }
.old-actions .icon-btn.del:hover { border-color: #ef4444; color: #ff7b7b; }
.old-range { color: var(--muted); font-size: 11px; padding: 0 4px 6px; }
.old-range bdi { color: var(--text); }
.period-title { margin: 4px 2px 0; font-weight: 700; font-size: 13.5px; }
.period-title small { font-weight: 500; color: var(--muted); font-size: 11px; margin-right: 6px; }
.old-body { display: flex; flex-direction: column; gap: 6px; }
.old-section:not(.open) .old-body,
.old-section:not(.open) .old-range { display: none; }
.btn.gold-btn {
  background: linear-gradient(135deg, #ffd84d, #f5a50b);
  border: 1px solid #f5b301; color: #4a2e00; padding: 9px 20px;
}
.btn.gold-btn:hover { border-color: #fff1b0; box-shadow: 0 0 10px rgba(245,165,11,.55); }

/* toolbar */
.toolbar { display: flex; gap: 8px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 11px; padding: 0 11px; color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; background: none; border: none; outline: none; padding: 8px 0; color: var(--text); }
.select, .field input {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; outline: none; width: 100%;
}
.select:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,128,237,.2); }
.select option { background: var(--panel); color: var(--text); }
.field input.clickable { cursor: pointer; }
.field textarea {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; outline: none; width: 100%;
  resize: vertical; min-height: 72px; line-height: 1.6;
}
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,128,237,.2); }
.field input[type="date"] { color-scheme: dark; direction: ltr; text-align: left; }
:root[data-theme="light"] .field input[type="date"] { color-scheme: light; }

/* ---------- لاگ ساعتی ---------- */
.hour-remind {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 11px;
  background: rgba(250,204,21,.14); border: 1px solid rgba(250,204,21,.6);
}
.hour-remind[hidden] { display: none; }
.hs-text { flex: 1; min-width: 160px; font-weight: 600; font-size: 13px; }
.hs-text small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.hlog { flex-wrap: wrap; }
.hlog .log-date { color: var(--text); font-weight: 700; font-size: 13px; }
.log-sum {
  flex: 1 1 100%; color: var(--muted); font-size: 12px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext;
}

/* ---------- log rows ---------- */
.list { display: flex; flex-direction: column; gap: 6px; }
.log {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 11px; padding: 7px 11px;
  transition: border-color .2s, background .2s;
  animation: pop .2s ease;
}
.log:hover { border-color: #2a5b95; }
.log.st-done   { background: rgba(34,197,94,.14);  border-color: rgba(34,197,94,.55); }
.log.st-failed { background: rgba(239,68,68,.14);  border-color: rgba(239,68,68,.55); }
.log.st-today  { background: rgba(250,204,21,.14); border-color: rgba(250,204,21,.6); }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* تاریخ سمت راست */
.log-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.log-date { color: var(--muted); font-size: 12px; }

/* دکمه‌های ویرایش / حذف / کپی: سمت راست بعد از تاریخ */
.log-actions { display: flex; gap: 5px; margin-right: 6px; }

/* اسم، وضعیت و رنک سمت چپ */
.log-left { margin-right: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.log-name { font-weight: 600; direction: ltr; unicode-bidi: plaintext; }

/* انتخاب وضعیت: یک دکمه، با کلیک تیک و ضربدر باز می‌شود */
.status { display: flex; align-items: center; gap: 5px; }
.st-choices { display: none; gap: 5px; }
.status.open .st-choices { display: flex; animation: pop .15s ease; }
.status.open .st.cur { display: none; }
.st {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--card-2); color: var(--muted);
  display: grid; place-items: center; transition: all .15s;
}
.st.cur { border-style: dashed; }
.st.cur:hover { border-color: var(--accent); color: var(--text); }
.st.cur.done   { background: #22c55e; border: 1.5px solid #22c55e; color: #fff; }
.st.cur.failed { background: #ef4444; border: 1.5px solid #ef4444; color: #fff; }
.st svg { width: 13px; height: 13px; stroke-width: 2.6; }
.st.ok:hover { border-color: #22c55e; color: #4be08a; }
.st.no:hover { border-color: #ef4444; color: #ff7b7b; }
.st.ok.on { background: #22c55e; border-color: #22c55e; color: #fff; }
.st.no.on { background: #ef4444; border-color: #ef4444; color: #fff; }

.tag { font-size: 10.5px; padding: 0 8px; border-radius: 999px; direction: ltr; font-weight: 600; }
.tag.blue   { background: rgba(47,128,237,.18);  color: #7db4ff; }
.tag.yellow { background: rgba(250,204,21,.18);  color: #ffd84d; }
.tag.green  { background: rgba(34,197,94,.18);   color: #5be391; }
:root[data-theme="light"] .tag { filter: saturate(1.3) brightness(.7); }

.when { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.when.overdue { color: #ff7b7b; }
.when.today { color: #ffd84d; }
.when.soon { color: #5aa2ff; }
:root[data-theme="light"] .when.today { color: #9a6d00; }

.log-actions .icon-btn { width: 27px; height: 27px; border-radius: 8px; }
.log-actions .icon-btn svg { width: 13px; height: 13px; }
.log-actions .icon-btn.del:hover { border-color: #ef4444; color: #ff7b7b; }
/* تنها دکمه طلایی */
.icon-btn.gold {
  background: linear-gradient(135deg, #ffd84d, #f5a50b);
  border-color: #f5b301; color: #4a2e00;
}
.icon-btn.gold:hover { border-color: #fff1b0; box-shadow: 0 0 10px rgba(245,165,11,.55); }

/* empty */
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }
.empty-ico { width: 50px; height: 50px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); }
.empty-ico svg { width: 22px; height: 22px; }
.empty p { font-size: 14px; color: var(--text); }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(2,8,20,.7); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; z-index: 50;
}
.modal[hidden] { display: none; }
.dialog {
  width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 11px;
  animation: pop .2s ease;
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { font-size: 14.5px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field > span { font-size: 11.5px; color: var(--muted); }
.hint { color: var(--accent); font-size: 11px; min-height: 16px; }
.row { display: flex; gap: 10px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 2px; }

/* تقویم شمسی */
.cal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.cal[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-wd { font-size: 10.5px; color: var(--muted); padding: 3px 0; }
.cal-day {
  height: 30px; border-radius: 8px; font-size: 12px;
  transition: background .15s;
}
.cal-day:hover { background: var(--card-2); }
.cal-day.fri { color: #ff7b7b; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.sel { background: var(--accent); color: #fff; }
.cal-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.cal-foot .btn { padding: 4px 12px; }

/* کادر پیش‌نمایش متن کپی‌شده */
.copy-pop {
  position: fixed; bottom: 68px; left: 50%; transform: translate(-50%, 14px);
  width: min(92vw, 380px);
  background: var(--panel); border: 1px solid #f5b301;
  border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 79;
}
.copy-pop.show { opacity: 1; transform: translate(-50%, 0); }
.copy-pop-title { font-size: 10.5px; color: #ffd84d; margin-bottom: 4px; }
:root[data-theme="light"] .copy-pop-title { color: #9a6d00; }
.copy-pop-text {
  direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-word;
  font-family: Consolas, "Courier New", monospace; font-size: 11.5px; line-height: 1.5;
  color: var(--text); max-height: 220px; overflow-y: auto;
}

/* toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 30px);
  background: var(--card-2); border: 1px solid var(--accent);
  padding: 8px 16px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.overlay { display: none; }
.only-mobile { display: none; }

/* scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* responsive */
@media (max-width: 860px) {
  .only-mobile { display: grid; }
  .sidebar { position: fixed; right: 0; top: 0; transform: translateX(105%); transition: transform .3s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; }
  .main { padding: 10px; }
  .nav-item.active::after { display: none; }
}
@media (max-width: 700px) {
  .log { flex-wrap: wrap; }
  .log-left { margin-right: 0; width: 100%; flex-shrink: 1; flex-wrap: wrap; }
  .log-actions { margin-right: 0; }
  .log-when { margin-right: auto; }
}
@media (max-width: 560px) {
  .summary { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .btn.primary { padding: 7px 10px; }
}


/* ورود با رمز */
.nav-item[hidden] { display: none; }
.login-dialog { max-width: 340px; }
.login-err { color: #ff7b7b; }

/* ---------- ورود / ثبت‌نام / نقش‌ها ---------- */
.ico.purple { background: rgba(168,85,247,.18); color: #c58cff; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--card-2); padding: 4px; border-radius: 12px; }
.auth-tab { flex: 1; padding: 9px 0; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; cursor: pointer; opacity: .7; }
.auth-tab.active { background: var(--accent); color: #fff; opacity: 1; }
.center-dialog { text-align: center; }
.center-dialog .empty-ico { margin: 0 auto 10px; }
.center-dialog .dialog-actions { justify-content: center; }
.users-note { opacity: .75; font-size: 13px; line-height: 1.9; margin: 0 0 14px; }
.role-pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--card-2); margin-top: 3px; }
.role-owner { background: rgba(250,204,21,.18); color: #ffd84d; }
.role-admin { background: rgba(47,128,237,.18); color: #5aa2ff; }
.role-read  { background: rgba(34,197,94,.18);  color: #4be08a; }
.role-none  { background: rgba(239,68,68,.18);  color: #ff7b7b; }
.user-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; }
.user-row .u-name { flex: 1; min-width: 120px; font-weight: 600; }
.user-row .u-name small { display: block; font-weight: 400; opacity: .6; font-size: 11px; }
.user-row select { min-width: 130px; }
/* نقش Read: فقط دیدن */
body.ro #addBtn, body.ro #importBtn, body.ro #newPeriodBtn,
body.ro [data-act="edit"], body.ro [data-act="del"], body.ro [data-act="logNow"],
body.ro [data-act="renameCat"], body.ro [data-act="mergeCat"] { display: none !important; }
body.ro .status { pointer-events: none; }
body.nouser #addBtn { display: none !important; }
.toolbar[hidden] { display: none !important; }
.user-row .select { width: auto; flex: 0 0 150px; }

/* ---------- چت ---------- */
.chat-box { display: flex; flex-direction: column; gap: 8px; height: min(62vh, 560px); overflow-y: auto; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.chat-empty { margin: auto; opacity: .6; font-size: 13px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: var(--card-2); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(47,128,237,.22); }
.msg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 3px; flex-wrap: wrap; }
.msg-head b { font-weight: 700; }
.msg-head .role-pill { margin-top: 0; }
.msg-time { opacity: .5; font-size: 10.5px; margin-inline-start: auto; }
.msg-del { border: 0; background: none; color: #ff7b7b; cursor: pointer; font-size: 12px; padding: 0 2px; }
.msg-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.8; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: inherit; font: inherit; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }
body.ro .chat-form { display: none; }
