:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2430;
  --card: #161b22;
  --line: #283040;
  --tx: #e6edf3;
  --tx2: #9aa7b4;
  --tx3: #6b7785;
  --accent: #d97757;
  --accent2: #e8916f;
  --blue: #4493f8;
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
  --purple: #a371f7;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Vazirmatn, Tahoma, sans-serif;
  color: var(--tx); font-size: 15px; line-height: 1.7;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue); text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }

.app { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- ورود ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.login .logo { width: 84px; height: 84px; }
.login h1 { font-size: 21px; margin: 0; font-weight: 700; }
.login p { color: var(--tx2); margin: 0; text-align: center; font-size: 14px; }
.login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }

.field { width: 100%; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; outline: none; transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
.field label { display: block; font-size: 13px; color: var(--tx2); margin: 0 4px 6px; }

.btn {
  background: var(--accent); color: #1a1208; font-weight: 700; border-radius: 12px;
  padding: 14px 18px; text-align: center; transition: transform .08s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.btn.ghost { background: var(--bg3); color: var(--tx); }
.btn.danger { background: #3a1d1d; color: var(--red); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }

/* ---------- هدر ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(13,17,23,.86);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-t) + 8px) 14px 8px;
  display: flex; align-items: center; gap: 10px;
}
.ws-switch {
  flex: 1; display: flex; align-items: center; gap: 9px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-width: 0;
}
.ws-switch:active { background: var(--bg3); }
.ws-switch .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tx3); flex: none; }
.ws-switch .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.ws-switch .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switch .chev { color: var(--tx2); flex: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex: none; color: var(--tx);
}
.icon-btn:active { background: var(--bg3); }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }

/* ---------- اعلان‌های موبایل (Web Push) ---------- */
.push-cfg { display: flex; flex-direction: column; gap: 10px; }
.push-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--tx2); font-weight: 600; font-size: 14px;
}
.push-status svg { width: 22px; height: 22px; flex: none; }
.push-status.on { color: var(--accent); border-color: var(--accent); }

/* ---------- چیپ‌های فیلتر ---------- */
.filters {
  position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 8px;
  scrollbar-width: none; transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.chip {
  white-space: nowrap; background: var(--bg2); border: 1px solid var(--line); color: var(--tx2);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; flex: none;
}
.chip.on { background: var(--accent); color: #1a1208; border-color: var(--accent); }
.chip .c { opacity: .7; margin-inline-start: 4px; }
/* نشانگرِ زیرِ تبِ فعال — هنگامِ سوایپ زنده حرکت می‌کند و نرم می‌نشیند */
.tab-ind {
  position: absolute; left: 0; bottom: 1px; height: 3px; width: 0; border-radius: 3px;
  background: var(--accent); pointer-events: none; will-change: transform, width;
  transition: transform .28s cubic-bezier(.22,.61,.36,1), width .28s cubic-bezier(.22,.61,.36,1);
}

/* ---------- فیلتر سایت/دسته‌بندی ---------- */
.subfilters { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 2px; scrollbar-width: none; }
.minisel {
  white-space: nowrap; background: var(--bg2); border: 1px solid var(--line); color: var(--tx2);
  padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; flex: none; max-width: 60%;
}
.minisel.active { border-color: var(--accent); color: var(--tx); }
.minisel.clear { color: var(--red); }
.minisel:active { background: var(--bg3); }

.cat-badge {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: none;
  background: var(--bg3); color: var(--tx2); border: 1px solid var(--line);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- فرم تکرار روتین ---------- */
.rec-form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- لیست تسک ---------- */
.list { flex: 1; padding: 8px 14px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 9px;
}
.card:active { border-color: #34405266; }
.card .row { display: flex; align-items: center; gap: 8px; }
.card .title { font-weight: 700; flex: 1; min-width: 0; word-break: break-word; }
.site-badge {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: none;
  color: #fff; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .prompt { color: var(--tx2); font-size: 13px; max-height: 42px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.status {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.status .pip { width: 7px; height: 7px; border-radius: 50%; }
.st-running { color: var(--blue); background: #4493f81a; }
.st-running .pip { background: var(--blue); animation: pulse 1.1s infinite; }
.st-queued, .st-scheduled { color: var(--amber); background: #d299221a; }
.st-queued .pip, .st-scheduled .pip { background: var(--amber); }
.st-defined { color: var(--tx2); background: #283040; }
.st-defined .pip { background: var(--tx3); }
.st-done { color: var(--green); background: #3fb9501a; }
.st-done .pip { background: var(--green); }
.st-failed, .st-canceled { color: var(--red); background: #f851491a; }
.st-failed .pip, .st-canceled .pip { background: var(--red); }
.st-suggested { color: var(--purple); background: #a371f71a; }
.st-suggested .pip { background: var(--purple); }
.st-routine { color: var(--accent2); background: #d977571a; }
.st-routine .pip { background: var(--accent2); }
.st-archived { color: var(--tx3); background: #6b778522; }
.st-archived .pip { background: var(--tx3); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.card .actions { display: flex; gap: 7px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 10px; background: var(--bg3); color: var(--tx);
}
.act:active { background: #222b38; }
.act.primary { background: var(--accent); color: #1a1208; }
.act.stop { background: #3a1d1d; color: var(--red); }
.act svg { width: 15px; height: 15px; }

.empty { text-align: center; color: var(--tx3); padding: 60px 24px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- سرتیتر دسته‌بندی ---------- */
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px 2px; margin-top: 6px;
}
.group-head:first-child { margin-top: 0; }
.group-head .gh-icon { font-size: 14px; }
.group-head .gh-label { font-size: 13px; font-weight: 800; color: var(--tx2); letter-spacing: .2px; }
.group-head .gh-count {
  font-size: 11.5px; font-weight: 700; color: var(--tx3); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.muted.sched { color: var(--amber); font-weight: 600; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; bottom: calc(18px + var(--safe-b)); inset-inline-start: 50%; transform: translateX(50%);
  max-width: 640px;
}
.fab-inner {
  position: absolute; bottom: 0; inset-inline-end: 14px;
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent);
  color: #1a1208; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px #d9775766; font-size: 30px; font-weight: 400;
}
.fab-inner:active { transform: scale(.93); }

/* ---------- شیت پایین ---------- */
.scrim { position: fixed; inset: 0; background: #000a; z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 51; background: var(--bg2);
  border-radius: 22px 22px 0 0; max-width: 640px; margin: 0 auto; max-height: 92dvh;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.32,.72,0,1);
  padding-bottom: var(--safe-b);
}
.sheet.show { transform: translateY(0); }

/* نمای جزئیات تسک به‌سبک «صفحه»: گذارِ افقیِ سبک + محوشدن، شبیه ناوبریِ بومیِ موبایل.
   ورود: از لبه به داخل می‌سُرد؛ بازگشت: همان مسیر برعکس. */
.sheet.sheet-page {
  top: 0; bottom: 0; height: 100dvh; max-height: none; border-radius: 0;
  transform: translateX(-7%); opacity: 0;
  transition: transform .28s cubic-bezier(.32,.72,0,1), opacity .2s ease;
}
.sheet.sheet-page.show { transform: translateX(0); opacity: 1; }
.sheet.sheet-page .grab { display: none; }

/* وقتی نمای جزئیات باز است، لیستِ پشت کمی عقب می‌نشیند و محو می‌شود (حس لایه‌بندیِ بومی) */
.app { transition: transform .28s cubic-bezier(.32,.72,0,1), opacity .28s ease; }
body.detail-open .app { transform: scale(.96); opacity: .4; }

@media (prefers-reduced-motion: reduce) {
  .sheet.sheet-page { transform: none; transition: opacity .15s ease; }
  .app { transition: opacity .15s ease; }
  body.detail-open .app { transform: none; opacity: .6; }
}

.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet .sheet-head { display: flex; align-items: center; padding: 6px 16px 10px; gap: 10px; }
.sheet .sheet-head h2 { font-size: 17px; margin: 0; flex: 1; }
.sheet .sheet-body { overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; }
.seg { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; color: var(--tx2); font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--accent); color: #1a1208; }

/* ---------- جزئیات تسک ---------- */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: var(--bg2); border: 1px solid var(--line); color: var(--tx2);
  border-radius: 10px; padding: 7px 12px 7px 14px; font-size: 13px; font-weight: 700;
}
.detail-back:active { background: var(--bg3); }
.detail-back svg { width: 16px; height: 16px; }
.detail-head { display: flex; flex-direction: column; gap: 10px; }
.detail-title { font-size: 18px; font-weight: 800; line-height: 1.5; word-break: break-word; margin: 0; }
.detail-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-section { display: flex; flex-direction: column; gap: 6px; }
.detail-label { font-size: 12px; font-weight: 700; color: var(--tx3); }
.detail-prompt {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; color: var(--tx); font-size: 14px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word;
}
.detail-meta { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-meta .dm-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--bg); font-size: 13px; }
.detail-meta .dm-row + .dm-row { border-top: 1px solid var(--line); }
.detail-meta .dm-k { color: var(--tx3); font-weight: 600; }
.detail-meta .dm-v { color: var(--tx); font-weight: 700; text-align: end; }
.detail-actions { margin-top: 2px; }
.detail-actions .act { padding: 10px 14px; font-size: 14px; }
.detail-actions .act.primary { flex: 1 1 100%; justify-content: center; }

/* ---------- منوی ورک‌اسپیس ---------- */
.ws-list { display: flex; flex-direction: column; gap: 8px; }
.ws-item {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-radius: 13px;
  background: var(--bg); border: 1px solid var(--line);
}
.ws-item.active { border-color: var(--accent); background: #d977570d; }
.ws-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tx3); flex: none; }
.ws-item .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.ws-item .meta { flex: 1; min-width: 0; }
.ws-item .meta .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item .meta .sub { font-size: 12px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item .badge-n { font-size: 12px; font-weight: 700; color: var(--blue); background: #4493f81a; padding: 3px 9px; border-radius: 999px; }

/* ---------- نمای چت ---------- */
.chat-view { position: fixed; inset: 0; z-index: 40; background: var(--bg); max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; }
.chat-head {
  position: sticky; top: 0; background: rgba(13,17,23,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: calc(var(--safe-t) + 8px) 12px 9px;
  display: flex; align-items: center; gap: 10px;
}
.chat-head .ttl { flex: 1; min-width: 0; }
.chat-head .ttl .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .ttl .s { font-size: 12px; color: var(--tx2); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.msg { max-width: 92%; border-radius: 14px; padding: 10px 13px; font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.msg.user { align-self: flex-start; background: var(--accent); color: #1a1208; border-bottom-right-radius: 4px; font-weight: 600; }
.msg.text { align-self: flex-end; background: var(--bg2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.tool { align-self: flex-end; background: #11203a; border: 1px solid #1d3357; color: #9cc4ff; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: left; }
.msg.result-line { align-self: flex-end; background: #12181f; border: 1px dashed var(--line); color: var(--tx2); font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: left; }
.msg.system, .msg.info { align-self: center; background: transparent; color: var(--tx3); font-size: 12.5px; padding: 2px; text-align: center; }
.msg.error { align-self: center; background: #3a1d1d; color: var(--red); font-size: 13px; }
.msg.done { align-self: center; background: #16261a; color: var(--green); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.msg.done.bad { background: #2a1818; color: var(--red); }

.typing { align-self: flex-end; display: flex; gap: 4px; padding: 12px 14px; background: var(--bg2); border-radius: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.chat-input {
  border-top: 1px solid var(--line); background: var(--bg2); padding: 10px 12px calc(10px + var(--safe-b));
  display: flex; gap: 9px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; background: var(--bg); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 11px 15px; resize: none; max-height: 120px; outline: none; line-height: 1.6;
}
.chat-input textarea:focus { border-color: var(--accent); }
.send-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #1a1208;
  display: flex; align-items: center; justify-content: center; flex: none; }
.send-btn:disabled { opacity: .4; }
.send-btn.stopping { background: #3a1d1d; color: var(--red); }

/* ---------- توست ---------- */
.toast {
  position: fixed; bottom: calc(86px + var(--safe-b)); inset-inline: 0; margin: 0 auto; width: max-content;
  max-width: 88%; background: #222b38; color: var(--tx); padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; z-index: 80; opacity: 0; transform: translateY(12px);
  transition: opacity .2s, transform .2s; pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: #3a1d1d; color: #ffb4ad; border-color: #5a2a2a; }

.spin { width: 18px; height: 18px; border: 2.5px solid #1a120833; border-top-color: #1a1208; border-radius: 50%; animation: rot .7s linear infinite; }
.spin.lg { width: 30px; height: 30px; border-width: 3px; border-color: #ffffff22; border-top-color: var(--accent); }
@keyframes rot { to { transform: rotate(360deg); } }
.center { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60dvh; }

.muted { color: var(--tx3); font-size: 12.5px; }
.hint { color: var(--tx3); font-size: 12px; line-height: 1.7; }
.offline-bar { background: #3a2a16; color: var(--amber); text-align: center; font-size: 12.5px; padding: 6px; font-weight: 600; }

/* ---- لاگ امنیتی ---- */
.sec-log { display: flex; flex-direction: column; gap: 8px; }
.sec-alert {
  display: flex; gap: 10px; align-items: center; background: #3a1d1d;
  border: 1px solid var(--red); border-radius: 12px; padding: 10px 12px;
}
.sec-alert .ic { font-size: 20px; flex: none; }
.sec-alert .a-ttl { color: var(--red); font-weight: 700; font-size: 13.5px; }
.sec-alert .a-sub { color: var(--tx2); font-size: 12px; margin-top: 2px; }
.sec-row {
  display: flex; gap: 10px; align-items: flex-start; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px;
  border-inline-start-width: 3px;
}
.sec-row.ok { border-inline-start-color: var(--green); }
.sec-row.bad { border-inline-start-color: var(--red); }
.sec-row.warn { border-inline-start-color: var(--amber); }
.sec-row.neutral { border-inline-start-color: var(--tx3); }
.sec-ic { font-size: 16px; flex: none; line-height: 1.4; }
.sec-meta { min-width: 0; flex: 1; }
.sec-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sec-ev { font-weight: 700; font-size: 13.5px; color: var(--tx); }
.sec-time { font-size: 11.5px; color: var(--tx3); white-space: nowrap; flex: none; }
.sec-sub { font-size: 12px; color: var(--tx2); margin-top: 2px; direction: ltr; text-align: right; }
.sec-ua { font-size: 11px; color: var(--tx3); margin-top: 2px; direction: ltr; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   کارت محدودیت مصرفِ Claude (مثل /usage)
   ========================================================= */
.usage-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 4px 0 0;
}
.usage-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.usage-head .uh-title { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--tx); }
.usage-head .uh-title svg { width: 18px; height: 18px; color: var(--accent); display: block; }
.uh-refresh {
  width: 32px; height: 32px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--line);
  color: var(--tx2); display: flex; align-items: center; justify-content: center; flex: none;
}
.uh-refresh svg { width: 16px; height: 16px; }
.uh-refresh.spinning svg { animation: rot .8s linear infinite; }
.usage-row { margin-top: 11px; }
.usage-row:first-of-type { margin-top: 0; }
.ur-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.ur-label { font-size: 13px; color: var(--tx2); }
.ur-pct { font-size: 13px; font-weight: 700; color: var(--tx); font-variant-numeric: tabular-nums; }
.ur-bar { height: 7px; border-radius: 999px; background: var(--bg3); overflow: hidden; }
.ur-fill { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .4s ease; }
.usage-row.warn .ur-fill { background: var(--amber); }
.usage-row.warn .ur-pct { color: var(--amber); }
.usage-row.severe .ur-fill { background: var(--red); }
.usage-row.severe .ur-pct { color: var(--red); }
.ur-reset { font-size: 11.5px; color: var(--tx3); margin-top: 4px; }
.usage-err { font-size: 12.5px; color: var(--tx3); line-height: 1.7; }
.usage-foot { font-size: 11px; color: var(--tx3); margin-top: 11px; text-align: end; }

/* =========================================================
   پیوست فایل/تصویر
   ========================================================= */
.chat-input-wrap { border-top: 1px solid var(--line); background: var(--bg2); }
.chat-input-wrap .chat-input { border-top: none; background: transparent; }
.att-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--bg3); border: 1px solid var(--line); color: var(--tx2);
  display: flex; align-items: center; justify-content: center;
}
.att-btn:active { background: var(--bg); }
.att-btn svg { width: 22px; height: 22px; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-input-wrap .att-chips { padding: 10px 12px 0; }
.att-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 6px 5px 11px; font-size: 12.5px; color: var(--tx);
}
.att-chip .ac-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip .ac-size { color: var(--tx3); font-size: 11px; flex: none; }
.att-chip .ac-x {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg); color: var(--tx2);
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none;
}
/* در شیت ساخت تسک: دکمه‌ی پیوست مستطیلی با برچسب */
.field .att-btn { width: auto; height: auto; border-radius: 12px; padding: 12px 16px; gap: 8px; color: var(--tx); }
.field .att-btn svg { width: 18px; height: 18px; }
.field .att-btn::after { content: 'افزودن فایل یا تصویر'; font-size: 13px; font-weight: 600; }
.field + .att-chips { margin-top: 8px; }
