  :root {
    --radius: 0.65rem;
    --background: #ffffff;        --foreground: #0a0a0a;
    --card-bg: #ffffff;           --card-foreground: #0a0a0a;
    --popover: #ffffff;           --popover-foreground: #0a0a0a;
    --primary: #2563eb;           --primary-foreground: #f8fafc;
    --secondary: #f4f4f5;         --secondary-foreground: #171717;
    --muted-surface: #f4f4f5;     --muted-foreground: #71717a;
    --accent: #eff4ff;            --accent-foreground: #1d4ed8;
    --ring: #2563eb;
    /* حباب‌های گفت‌وگو: «من» با اکسنتِ ملایمِ سبز، طرفِ مقابل روی سطحِ کارت */
    --bubble-mine: #dcf3e4;       --bubble-theirs: #ffffff;
    --chat-bg: #f4f5f7;           --tick-seen: #2563eb;
    --border-c: #e4e4e7;          --input-c: #e4e4e7;
    --danger: #dc2626;            --ok: #16a34a;            --warn: #d97706;
    --success-bg: #f0fdf4;  --success-fg: #15803d;  --success-bd: #bbf7d0;
    --warn-bg:    #fffbeb;  --warn-fg:    #b45309;  --warn-bd:    #fde68a;
    --danger-bg:  #fef2f2;  --danger-fg2: #b91c1c;  --danger-bd:  #fecaca;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow:    0 1px 3px 0 rgba(0,0,0,.07), 0 1px 2px -1px rgba(0,0,0,.07);
    --shadow-lg: 0 12px 32px -10px rgba(0,0,0,.28);
    /* legacy aliases used throughout the markup */
    --bg: var(--background);      --fg: var(--foreground);
    --muted: var(--muted-foreground);   --link: #2563eb;
    --btn: var(--primary);        --btn-fg: var(--primary-foreground);
    --card: var(--card-bg);       --border: var(--border-c);
  }
  html.dark {
    --background: #0a0a0a;        --foreground: #fafafa;
    --card-bg: #161618;           --card-foreground: #fafafa;
    --popover: #1c1c1f;           --popover-foreground: #fafafa;
    --primary: #3b82f6;           --primary-foreground: #f8fafc;
    --secondary: #27272a;         --secondary-foreground: #fafafa;
    --muted-surface: #1f1f22;     --muted-foreground: #a1a1aa;
    --accent: #1e293b;            --accent-foreground: #bfdbfe;
    --ring: #3b82f6;
    --bubble-mine: #17372b;       --bubble-theirs: #1c1c1f;
    --chat-bg: #101013;           --tick-seen: #60a5fa;
    --border-c: rgba(255,255,255,.10);  --input-c: rgba(255,255,255,.14);
    --danger: #ef4444;            --ok: #22c55e;            --warn: #f59e0b;
    --link: #60a5fa;
    --success-bg: rgba(34,197,94,.13);  --success-fg: #4ade80;  --success-bd: rgba(34,197,94,.30);
    --warn-bg:    rgba(245,158,11,.13); --warn-fg:    #fbbf24;  --warn-bd:    rgba(245,158,11,.30);
    --danger-bg:  rgba(239,68,68,.13);  --danger-fg2: #f87171;  --danger-bd:  rgba(239,68,68,.30);
    --shadow-lg: 0 12px 32px -10px rgba(0,0,0,.6);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "IRANSans", "Tahoma", sans-serif;
    font-size: 15px; line-height: 1.6; }
  .wrap { max-width: 680px; margin: 0 auto; padding: 12px; padding-bottom: 90px; }
  h1 { font-size: 17px; margin: 4px 0 10px; }
  h2 { font-size: 15px; margin: 16px 0 8px; }
  .tabbar { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px;
    -webkit-overflow-scrolling: touch; position: sticky; top: 0; background: var(--bg); z-index: 5; }
  .tab { white-space: nowrap; padding: 7px 13px; border-radius: 999px; cursor: pointer;
    background: var(--card); border: 1px solid var(--border); color: var(--fg); font-size: 14px; }
  .tab.active { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
  /* بجِ عددیِ تب (درخواست‌های بلاتکلیفِ جلسه) — تسک ۱۰۰، کامنتِ ۵۴۳ */
  .tab-badge { display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 6px;
    border-radius: 999px; background: #ef4444; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
  .tab.active .tab-badge { background: var(--btn-fg); color: var(--btn); }
  /* صفِ زمان‌بندی فقط برای دستیار؛ رنگِ مستقل باعث می‌شود با صفِ تأیید اشتباه نشود. */
  .tab-badge.tab-badge-schedule { background: #7c3aed; color: #fff; }
  .tab.active .tab-badge.tab-badge-schedule { background: #c4b5fd; color: #2e1065; }
  .card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 13px; margin-bottom: 10px; }
  .drop { border: 2px dashed var(--border); border-radius: 14px; padding: 24px 14px;
    text-align: center; background: var(--card); cursor: pointer; }
  .drop.drag { border-color: var(--btn); }
  .drop .big { font-size: 32px; }
  input[type=file] { display: none; }
  button { background: var(--btn); color: var(--btn-fg); border: 0; border-radius: 10px;
    padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
  button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
  button.danger { background: var(--danger); }
  button.ok { background: var(--ok); }
  button.warn { background: var(--warn); }
  button.sm { padding: 6px 10px; font-size: 13px; }
  button:disabled { opacity: .5; cursor: not-allowed; }
  .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .pill { display: inline-block; padding: 1px 8px; border-radius: 999px;
    background: rgba(0,0,0,0.06); color: var(--muted); font-size: 12px; }
  .pill.red { background: #fde2e0; color: #b3261e; }
  .pill.green { background: #def3e4; color: #1c7c3f; }
  .pill.amber { background: #fdebc8; color: #8a5a00; }
  .pill.blue { background: #dce9fd; color: #1a4fa0; }
  .pill.gray { background: rgba(0,0,0,0.06); color: var(--muted); }
  .item { padding: 11px 0; border-bottom: 1px solid var(--border); }
  .item:last-child { border-bottom: 0; }
  .item .title { font-weight: 600; }
  .item .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
  input.f, textarea.f, select.f { width: 100%; border: 1px solid var(--border); border-radius: 9px;
    padding: 9px 10px; background: var(--bg); color: var(--fg); font: inherit; margin-top: 6px; }
  textarea.f { resize: vertical; min-height: 56px; }
  .progress { height: 4px; background: rgba(0,0,0,0.08); border-radius: 999px; overflow: hidden; margin-top: 12px; }
  .progress > div { height: 100%; background: var(--btn); width: 0%; transition: width .15s; }
  .progress.indeterminate { background: linear-gradient(90deg, rgba(0,0,0,0.06) 0%, var(--btn) 50%, rgba(0,0,0,0.06) 100%);
    background-size: 200% 100%; animation: indet 1.2s linear infinite; }
  .progress.indeterminate > div { display: none; }
  @keyframes indet { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  /* نوارِ پیشرفتِ ضمیمهٔ چت روی حبابِ رنگیِ کاربر: رنگِ پیش‌فرضِ نوار (accent) روی حبابِ
     accent نامرئی می‌شود؛ پس فِیل/شِمِر را به رنگِ متنِ حباب (روشن) می‌بریم. */
  .bubble.user .progress { background: rgba(255,255,255,.28); margin-top: 8px; }
  .bubble.user .progress > div { background: var(--primary-foreground); }
  .bubble.user .progress.indeterminate {
    background: linear-gradient(90deg, rgba(255,255,255,.18) 0%, var(--primary-foreground) 50%, rgba(255,255,255,.18) 100%);
    background-size: 200% 100%;
  }
  .bubble.user .attach-prog-cancel { color: var(--primary-foreground); border-color: rgba(255,255,255,.4); }
  .muted { color: var(--muted); font-size: 13px; }
  .err { color: var(--danger); }
  .ok-t { color: var(--ok); }
  .hidden { display: none !important; }
  pre.transcript { background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px; max-height: 180px; overflow: auto; font-family: inherit; white-space: pre-wrap;
    font-size: 13px; color: var(--muted); }
  details > summary { cursor: pointer; color: var(--link); font-size: 13px; }
  /* چت */
  .chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 4px; }
  .bubble { max-width: 84%; padding: 8px 11px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
  .bubble.user { align-self: flex-start; background: var(--btn); color: var(--btn-fg); border-bottom-right-radius: 4px; }
  .bubble.bot { align-self: flex-end; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
  /* رندرِ Markdownِ پاسخِ ربات */
  .bubble .md { white-space: normal; }
  .bubble .md > :first-child { margin-top: 0; }
  .bubble .md > :last-child { margin-bottom: 0; }
  .bubble .md p { margin: 6px 0; }
  .bubble .md h3 { font-size: 15px; font-weight: 700; margin: 10px 0 6px; }
  .bubble .md h4 { font-size: 14px; font-weight: 700; margin: 9px 0 5px; }
  .bubble .md h5 { font-size: 13px; font-weight: 700; margin: 8px 0 4px; }
  .bubble .md ul, .bubble .md ol { margin: 6px 0; padding-inline-start: 20px; }
  .bubble .md li { margin: 2px 0; }
  .bubble .md strong { font-weight: 700; }
  .bubble .md code { background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 5px;
    font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; }
  .bubble .md pre { background: rgba(127,127,127,.14); padding: 8px 10px; border-radius: 8px;
    overflow-x: auto; margin: 6px 0; }
  .bubble .md pre code { background: none; padding: 0; }
  .bubble .md blockquote { margin: 6px 0; padding: 2px 10px; border-inline-start: 3px solid var(--border); color: var(--muted); }
  .bubble .md a { color: var(--link); }
  .bubble .md hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
  .bubble .md table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
  .bubble .md th, .bubble .md td { border: 1px solid var(--border); padding: 3px 8px; }
  .chat-input { display: flex; gap: 6px; margin-top: 10px; }
  .chat-input textarea { flex: 1; min-height: 40px; max-height: 120px; }
  /* گانت */
  .gantt-row { display: grid; grid-template-columns: 110px 1fr; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
  .gantt-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gantt-track { position: relative; height: 16px; background: rgba(0,0,0,0.05); border-radius: 6px; }
  .gantt-bar { position: absolute; top: 2px; height: 12px; border-radius: 6px; background: var(--btn); }
  .gantt-bar.done { background: var(--ok); }
  .gantt-bar.over { background: var(--danger); }
  .toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: #111; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 50; max-width: 90%; }

  /* تقویمِ شمسی (date picker) */
  .jdp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 60;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px
      max(16px, env(safe-area-inset-bottom, 0px)); }
  .jdp-modal { background: var(--card, #fff); color: inherit; border-radius: 16px; padding: 14px;
    width: 320px; max-width: 100%; max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
  .jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .jdp-title { font-weight: 600; }
  .jdp-week, .jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .jdp-week > div { text-align: center; font-size: 11px; color: var(--muted-foreground, #888); padding: 4px 0; }
  .jdp-grid > button { aspect-ratio: 1; border: 0; background: transparent; color: inherit;
    border-radius: 8px; font-size: 13px; cursor: pointer; padding: 0; }
  .jdp-grid > button:hover { background: rgba(0,0,0,0.06); }
  .jdp-grid > button.sel { background: var(--btn, #2563eb); color: #fff; }
  .jdp-grid > button.today { outline: 1px solid var(--btn, #2563eb); }
  .jdp-grid > button.empty { visibility: hidden; cursor: default; }
  .jdp-time { display: block; margin: 12px 2px 4px; font-size: 13px; }
  .jdp-allday-wrap { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
    color: var(--muted-foreground); cursor: pointer; }
  /* چیپ‌های ساعتِ آماده */
  .jdp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
  .jdp-chip { padding: 6px 11px; border-radius: calc(var(--radius) - 3px);
    border: 1px solid var(--border-c); background: var(--background); color: var(--foreground);
    font-size: 12.5px; cursor: pointer; box-shadow: var(--shadow-sm);
    font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s, color .15s; }
  .jdp-chip:hover { background: var(--accent); }
  .jdp-chip.sel { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
  /* استپرِ ساعت/دقیقه — دکمه‌های ریزِ + و − بالا و پایینِ مقدار.
     direction: ltr تا ساعت سمتِ چپ و دقیقه سمتِ راست بیفتد (مثلِ ۰۹:۳۰). */
  .jdp-steppers { display: flex; direction: ltr; align-items: center; justify-content: center; gap: 14px; }
  .jdp-stepper { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .jdp-stepper-lbl { font-size: 11px; color: var(--muted-foreground); }
  .jdp-stepper-row { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .jdp-step { width: 30px; height: 22px; padding: 0; border-radius: 8px; font-size: 16px;
    font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .jdp-stepper-val { min-width: 40px; text-align: center; font-size: 22px; font-weight: 600;
    font-variant-numeric: tabular-nums; letter-spacing: .02em; }
  .jdp-actions { display: flex; gap: 8px; margin-top: 12px; }
  .jdp-actions > button { flex: 1; }
  /* مودالِ زمان‌بندی بلند است: فقط بدنه اسکرول می‌شود و دکمه‌های ثبت/انصراف
     همیشه در پایینِ کارت در دسترس می‌مانند. */
  .sch-modal-card { display: flex; flex-direction: column; overflow: hidden; }
  .sch-modal-scroll { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; padding-inline: 2px; }
  .sch-modal-card > .jdp-actions { flex: none; padding-top: 12px; margin-top: 0;
    border-top: 1px solid var(--border); background: var(--card); }
  .sch-time-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: -4px 0 12px; }
  .sch-exact-panel { width: 100%; padding: 10px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--secondary); }
  .sch-exact-panel .jdp-steppers { margin-bottom: 10px; }
  .dark .jdp-modal { background: var(--card, #1c1c1e); }
  .dark .jdp-grid > button:hover { background: rgba(255,255,255,0.08); }

  /* ============================================================ */
  /* ShadCN-style refinements (latest "new-york" neutral aesthetic) */
  /* ============================================================ */
  html, body { background: var(--background); color: var(--foreground);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; letter-spacing: -0.006em; }
  .wrap { padding: 14px 14px 96px; }
  h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.021em; margin: 6px 0 14px; }
  h2 { font-size: 13px; font-weight: 600; color: var(--muted-foreground);
    letter-spacing: 0.01em; margin: 20px 0 8px; }

  /* segmented tab bar */
  .tabbar { gap: 6px; padding: 8px 0 12px; margin: 0 -2px;
    background: color-mix(in srgb, var(--background) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
  .tab { padding: 8px 14px; border-radius: calc(var(--radius) + 2px); font-size: 13.5px; font-weight: 500;
    background: var(--secondary); border: 1px solid transparent; color: var(--secondary-foreground);
    box-shadow: none; transition: background .15s, color .15s, box-shadow .15s, transform .05s; }
  .tab:hover { background: var(--accent); }
  .tab:active { transform: scale(.97); }
  .tab.active { background: var(--primary); color: var(--primary-foreground);
    border-color: var(--primary); box-shadow: var(--shadow-sm); }
  .tab-badge { background: var(--destructive, #ef4444); color: #fff; box-shadow: var(--shadow-sm); }
  .tab.active .tab-badge { background: var(--primary-foreground); color: var(--primary); }
  .tab-badge.tab-badge-schedule { background: #7c3aed; color: #fff; }
  .tab.active .tab-badge.tab-badge-schedule { background: #c4b5fd; color: #2e1065; }

  /* cards */
  .card { background: var(--card-bg); color: var(--card-foreground);
    border: 1px solid var(--border-c); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); position: relative; }

  /* buttons */
  button { background: var(--primary); color: var(--primary-foreground);
    border: 1px solid transparent; border-radius: calc(var(--radius) - 2px);
    padding: 9px 16px; font-size: 13.5px; font-weight: 500; line-height: 1.25;
    box-shadow: var(--shadow-sm);
    transition: transform .05s, filter .15s, background .15s, box-shadow .15s, border-color .15s; }
  button:hover { filter: brightness(1.08); }
  button:active { transform: translateY(.5px) scale(.985); }
  button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
  button.ghost { background: transparent; color: var(--foreground);
    border: 1px solid var(--border-c); box-shadow: none; }
  button.ghost:hover { background: var(--accent); filter: none; }
  button.danger { background: var(--danger); color: #fff; }
  button.ok { background: var(--ok); color: #fff; }
  button.warn { background: var(--warn); color: #fff; }
  button.sm { padding: 6px 11px; font-size: 12.5px; border-radius: calc(var(--radius) - 3px); }
  button:disabled { opacity: .5; }
  /* ردیفِ دکمه‌های اکشن: همه هم‌اندازه، در یک ردیفِ مرتب */
  .actions { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
  .actions > button { flex: 1 1 0; min-width: 0; text-align: center; }
  .actions > .pill { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; }

  /* form controls */
  input.f, textarea.f, select.f { border: 1px solid var(--input-c);
    border-radius: calc(var(--radius) - 2px); padding: 9px 11px;
    background: var(--background); color: var(--foreground);
    box-shadow: var(--shadow-sm); margin-top: 8px;
    transition: border-color .15s, box-shadow .15s; }
  input.f:focus, textarea.f:focus, select.f:focus { outline: none; border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 32%, transparent); }
  input.f::placeholder, textarea.f::placeholder { color: var(--muted-foreground); }

  /* badges / pills */
  .pill { padding: 2px 9px; border-radius: calc(var(--radius) - 2px); font-size: 11.5px; font-weight: 500;
    background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border-c); }
  .pill.red { background: var(--danger-bg); color: var(--danger-fg2); border-color: var(--danger-bd); }
  .pill.green { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
  .pill.amber { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
  .pill.blue { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  .pill.gray { background: var(--secondary); color: var(--muted); border-color: var(--border-c); }
  /* نمونه‌رنگ‌های انتخابِ رنگِ بخشِ پروژه (آینه‌ی SECTION_PALETTE در projects.js) */
  .secswatch { display: inline-flex; align-items: center; border-radius: 999px; border: none;
    width: 26px; height: 26px; cursor: pointer; }
  .sc-blue   { background: #3b82f6; } .sc-green  { background: #16a34a; }
  .sc-amber  { background: #d97706; } .sc-red    { background: #dc2626; }
  .sc-violet { background: #7c3aed; } .sc-teal   { background: #0d9488; }
  .sc-pink   { background: #db2777; } .sc-gray   { background: #64748b; }

  /* ====== تسک ۱۹۸: بخش‌های آکاردئونیِ پروژه ====== */
  .sections-wrap { margin-top: 6px; }
  .sec { border: 1px solid var(--border-c); border-radius: var(--radius); background: var(--card-bg);
    box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; position: relative;
    border-inline-start: 3px solid var(--accent-strip, var(--border-c)); }
  .sec-head { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; cursor: pointer; user-select: none; }
  .sec-head:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); }
  .sec .chev { flex: 0 0 auto; margin-top: 3px; color: var(--muted-foreground); transition: transform .2s; display: inline-flex; }
  .sec.open .chev { transform: rotate(180deg); }
  .sec-hd-main { flex: 1 1 auto; min-width: 0; }
  .sec-hd-top { display: flex; align-items: center; gap: 8px; }
  /* عنوانِ بلند باید به خطِ بعد بیفتد (نه سه‌نقطه)؛ overflow-wrap برای واژه‌های بلندِ بی‌فاصله. */
  .sec-title { font-weight: 600; font-size: 14.5px; flex: 1 1 auto; min-width: 0;
    overflow-wrap: anywhere; line-height: 1.4; }
  .sec-count { flex: 0 0 auto; color: var(--muted-foreground); font-size: 11px; display: inline-flex; align-items: center; gap: 3px; }
  .sec-due { margin-top: 4px; font-size: 11px; color: var(--muted-foreground); display: flex; align-items: center; gap: 4px; }
  .sec-due.missing, .project-deadline-summary .missing { color: var(--danger); }
  .project-deadline-summary { margin: 4px 0 10px; padding: 8px 10px; border-radius: 9px;
    background: var(--secondary); font-size: 11.5px; color: var(--muted-foreground); }
  .sec-mini { width: 74px; }
  /* آکاردئونِ نرم: ترفندِ grid-template-rows 0fr↔1fr (بدونِ ارتفاعِ ثابت، بی‌پرش).
     محتوا در .sec-body-inner است که overflow:hidden دارد تا هنگامِ جمع‌شدن بریده شود. */
  .sec-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
  .sec.open .sec-body { grid-template-rows: 1fr; }
  .sec-body-inner { overflow: hidden; min-height: 0; padding: 0 14px; transition: padding .28s ease; }
  .sec.open .sec-body-inner { padding: 4px 14px 14px; border-top: 1px solid var(--border-c); }
  @media (prefers-reduced-motion: reduce) {
    .sec-body, .sec-body-inner, .sec .chev { transition: none; }
  }
  .sec-tools { flex: 0 0 auto; display: flex; gap: 3px; margin-inline-start: 2px; }
  .sec.pinned { background: color-mix(in srgb, var(--accent) 34%, var(--card-bg)); }
  .sec-pin { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
    padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; white-space: nowrap; }
  /* تب‌های سگمنتیِ داخلِ هر بخش */
  .subpanel { display: none; }
  .subpanel.on { display: block; }
  .newsec { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 12px; }
  .newsec input { flex: 1 1 auto; margin-top: 0; }
  /* دکمه‌ی «+ بخش» هم‌ارتفاعِ فیلدِ کنارش (کششی) و محتوایش وسط‌چین. */
  .newsec .sm { display: inline-flex; align-items: center; justify-content: center; }
  .badge-proj { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 9px;
    border-radius: 999px; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; white-space: nowrap; vertical-align: middle; }
  /* نشانِ «پروژه» در فهرست‌ها/گزارش‌ها: دوشاخه‌ی بنفشِ کوچک کنارِ عنوان. */
  .proj-mark { color: #7c3aed; }
  html.dark .proj-mark { color: #a78bfa; }
  .proj-mark .ic { width: 13px; height: 13px; vertical-align: -1px; }
  /* کارتِ بالای «جزئیاتِ کار»: عنوان بولد و بزرگ‌تر؛ بقیه‌ی اطلاعات (مسئول/ددلاین/…) کمرنگ‌تر. */
  .dt-title { font-size: 17px; font-weight: 700; line-height: 1.55; letter-spacing: -0.015em; }
  .dt-sub { opacity: .72; }

  /* نوارِ فیلترِ کارها: جست‌وجو + (برای کسی که کار می‌سپارد) مسئول و درخواست‌دهنده */
  .fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 12px; }
  .fbar .f { margin-top: 0; }
  .fchip { cursor: pointer; user-select: none; }
  .fchip.sel { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }

  /* list items — فشرده و ریز تا کارهای پیش‌رو در یک نگاه دیده شوند */
  .item { padding: 6px 0; border-bottom: 1px solid var(--border-c); }
  .item .title { font-weight: 600; letter-spacing: -0.011em; font-size: 12px; line-height: 1.45; }
  .item .meta { color: var(--muted-foreground); font-size: 10px; margin-top: 1px; line-height: 1.55; }
  .item .actions { margin-top: 6px; }
  .item-hd { display: flex; align-items: flex-start; gap: 6px; }
  .item-hd > .title { flex: 1; min-width: 0; }
  .item-tools { display: flex; gap: 3px; flex-shrink: 0; padding-top: 1px; opacity: 0.45; transition: opacity .18s; }
  .item:hover .item-tools { opacity: 1; }
  .card-tools { position: absolute; top: 14px; inset-inline-end: 14px; display: flex; gap: 4px; opacity: 0.45; transition: opacity .18s; }
  .card:hover .card-tools { opacity: 1; }
  button.btn-icon { padding: 0; width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; }
  /* تسکِ «در انتظار بررسی مدیر» — لبهٔ کهربایی برای تفکیکِ یک‌نگاهی در فهرست */
  .item.review { border-inline-start: 2px solid var(--warn); padding-inline-start: 8px; }

  /* فهرستِ کارت‌های مجزا (کارها / گزارش) — هم‌زبانِ فهرستِ جلسات (.mr-record-list):
     هر کار یک کارتِ مستقل با فاصله، به‌جای ردیف‌های چسبیده با خطِ جداساز. اندازه‌ی
     متن دست نمی‌خورد تا فشردگیِ فعلیِ فهرست حفظ شود؛ فقط قاب عوض می‌شود. */
  .cardlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .cardlist > .item { background: var(--card-bg); color: var(--card-foreground);
    border: 1px solid var(--border-c); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 11px 13px;
    transition: border-color .15s, box-shadow .15s; }
  .cardlist > .item:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border-c));
    box-shadow: var(--shadow); }
  /* لبه‌ی کهرباییِ «در انتظار بررسی مدیر» باید هم‌قدِ کارت و چسبیده به لبه‌اش باشد،
     نه یک خطِ شناور وسطِ padding. */
  .cardlist > .item.review { border-inline-start: 2px solid var(--warn); padding-inline-start: 12px; }
  /* متنِ گزارش در فهرستِ «در انتظار تأیید» — جعبه‌ی نقل‌قول، نه کارتِ تودرتو */
  .quotebox { margin-top: 6px; padding: 7px 9px; border-radius: 9px;
    background: var(--secondary); border-inline-start: 2px solid var(--border-c);
    font-size: 11.5px; line-height: 1.75; color: var(--foreground);
    white-space: pre-wrap; overflow-wrap: anywhere; }

  /* متنِ کاربر در جزئیاتِ کار (کامنت/گزارش/توضیحات): توکنِ بلندِ بی‌فاصله مثلِ
     لینکِ طولانی باید بشکند تا از عرضِ صفحه بیرون نزند و اسکرولِ افقی نسازد.
     overflow-wrap ارث‌بری می‌شود، پس یک قانون روی کلِ بدنه کافی‌ست. */
  #d-body { overflow-wrap: anywhere; word-break: break-word; }

  /* پراگرس‌بارِ مهلت: سهمِ سپری‌شده از بازه‌ی «ایجاد → سررسید» */
  .dlbar { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
  .dlbar .track { flex: 1 1 auto; height: 4px; border-radius: 999px; background: var(--secondary); position: relative; direction: ltr; }
  .dlbar .track .elapsed { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
  .dlbar.warn .track .elapsed { background: var(--warn); }
  .dlbar.over .track .elapsed { background: var(--danger); }
  .dlbar .track .review-tail { position: absolute; top: 0; height: 100%; border-radius: 999px;
    background: color-mix(in srgb, #7c3aed 55%, var(--secondary)); }
  .dlbar .report-marker { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%;
    background: #7c3aed; border: 2px solid var(--card-bg); box-shadow: 0 0 0 1px #7c3aed;
    transform: translate(-50%, -50%); }
  .dlbar .lbl { font-size: 9px; color: var(--muted-foreground); white-space: nowrap; flex: none;
    font-variant-numeric: tabular-nums; }
  .dlbar.over .lbl { color: var(--danger); }
  .dl-report-note { margin-top: 5px; font-size: 10px; line-height: 1.65; color: #6d28d9; }

  /* ردیفِ فرد: آواتار + متن (تبِ افراد) */
  .prow { display: flex; align-items: center; gap: 11px; }
  .prow .pinfo { flex: 1 1 auto; min-width: 0; }
  /* نام/نقش آزادانه می‌شکنند (تا نشانِ ادمین پنهان نشود)؛ خطِ متا یک‌خطی با … */
  .prow .pinfo .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* آواتار: عکسِ پروفایلِ تلگرام یا حروفِ اول روی دایره‌ی رنگی (fallback) */
  .avatar { width: 40px; height: 40px; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; color: #fff; line-height: 1;
    background-color: var(--muted-surface); background-size: cover; background-position: center;
    overflow: hidden; user-select: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
  .avatar.has-img { color: transparent; }

  /* dropzone */
  .drop { border: 1.5px dashed var(--border-c); border-radius: var(--radius);
    padding: 28px 16px; background: var(--muted-surface);
    transition: border-color .15s, background .15s; }
  .drop:hover, .drop.drag { border-color: var(--ring); background: var(--accent); }
  .drop .big { font-size: 30px; opacity: .85; }

  /* progress */
  .progress { height: 6px; background: var(--secondary); }
  .progress > div { background: var(--primary); }

  .muted { color: var(--muted-foreground); }
  pre.transcript { background: var(--muted-surface); border: 1px solid var(--border-c);
    border-radius: calc(var(--radius) - 2px); color: var(--muted-foreground); }
  details > summary { color: var(--muted-foreground); font-weight: 500; }
  details > summary:hover { color: var(--foreground); }

  /* chat bubbles */
  .bubble { padding: 9px 13px; border-radius: 16px; font-size: 14px; box-shadow: var(--shadow-sm); }
  .bubble.user { background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 5px; }
  .bubble.bot { background: var(--card-bg); color: var(--card-foreground);
    border: 1px solid var(--border-c); border-bottom-left-radius: 5px; }

  /* کارتِ یک یادداشت/یادآور (قفسه‌ی شخصی + فهرستِ یادآورهای ادیتورِ کار) */
  .note-item { background: var(--card-bg); border: 1px solid var(--border-c);
    border-inline-start: 3px solid var(--border-c); border-radius: calc(var(--radius) - 2px);
    padding: 9px 11px; margin-top: 8px; box-shadow: var(--shadow-sm); }
  .note-item .note-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.65; word-break: break-word; }
  .note-item .note-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
  .note-item .note-foot .when { flex: 1 1 auto; min-width: 0; color: var(--muted-foreground);
    font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }

  /* تسک‌های ۲۳۲/۲۷۷/۲۷۹: قفسه‌ی شخصی — سه تبِ کوچکِ داخلی (الگوی تب‌های «گزارش»). */
  #pv-tabs { gap: 6px; flex-wrap: wrap; }
  #pv-tabs > button { display: inline-flex; align-items: center; gap: 5px; }
  #pv-tabs > button.sel { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
  #pv-tabs > button.sel .pv-count { background: rgba(255,255,255,.22); color: inherit; }
  .pv-count { font-size: 11.5px; font-weight: 700; color: var(--accent-foreground);
    background: color-mix(in srgb, var(--accent-foreground) 14%, transparent);
    border-radius: 999px; padding: 0 7px; }
  .pv-composer { margin-bottom: 10px; }


  /* ====== گفت‌وگوی حبابی (سبکِ واتساپ) ======
     صفحه RTL است: در فلکسِ ردیفی flex-start = راست و flex-end = چپ. حبابِ «من»
     سمتِ راست می‌نشیند و حبابِ طرفِ مقابل سمتِ چپ — همان چیدمانِ واتساپِ فارسی.
     ترتیب زمانی است (قدیم بالا، جدید پایین) و فهرست خودش اسکرول می‌شود، پس
     کامپوزرِ زیرِ آن با اسکرولِ پیام‌ها تکان نمی‌خورد. */
  .chatpane { display: flex; flex-direction: column;
    height: 68vh; min-height: 340px; max-height: 78vh;
    border: 1px solid var(--border-c); border-radius: var(--radius);
    background: var(--chat-bg); overflow: hidden; box-shadow: var(--shadow-sm); }
  @supports (height: 68dvh) { .chatpane { height: 68dvh; max-height: 78dvh; } }
  .chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 10px 10px 4px; overscroll-behavior: contain;
    display: flex; flex-direction: column; }
  .cb-log { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
  .chat-empty { text-align: center; padding: 24px 12px; font-size: 13px; }
  .cb-row { display: flex; width: 100%; }
  .cb-row.mine   { justify-content: flex-start; }   /* RTL ⇒ راست */
  .cb-row.theirs { justify-content: flex-end; }     /* RTL ⇒ چپ  */
  .cb { max-width: min(84%, 520px); padding: 8px 11px 6px; border-radius: 14px;
    box-shadow: var(--shadow-sm); font-size: 13.5px; line-height: 1.7; word-break: break-word; }
  /* دُمِ حباب سمتِ خودِ فرستنده تیز می‌ماند: منِ راست ⇒ پایین-راست (end-start در RTL). */
  .cb-row.mine .cb { background: var(--bubble-mine); border-end-start-radius: 4px; }
  .cb-row.theirs .cb { background: var(--bubble-theirs); border: 1px solid var(--border-c);
    border-end-end-radius: 4px; }
  .cb.editing { max-width: 100%; width: 100%; }
  .cb-who { font-size: 11.5px; font-weight: 700; color: var(--accent-foreground); margin-bottom: 2px; }
  .cb-text { white-space: pre-wrap; }
  /* لینکِ داخلِ متنِ کاربر (کامنت/گزارش/توضیحات/گفت‌وگو/یادداشت) — چیپِ ظریفِ
     کلیک‌پذیر و تک‌خطی. متنِ آدرس هرگز وسطِ رشته نمی‌شکند؛ اگر جا نشد با «…» از
     ته بریده می‌شود (JS هم یک سقفِ نویسه دارد، این‌جا برشِ عرض‌محور). */
  .lnk { display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
    vertical-align: bottom; color: var(--link); text-decoration: none;
    background: rgba(127, 127, 127, .13); border-radius: 6px; padding: 0 6px; }
  .lnk:hover { background: rgba(127, 127, 127, .22); }
  .lnk > bdi { direction: ltr; unicode-bidi: isolate; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lnk:hover > bdi { text-decoration: underline; }
  .lnk .ic { width: 11px; height: 11px; flex: none; opacity: .6; }
  .cb-foot { display: flex; align-items: center; gap: 5px; margin-top: 3px;
    font-size: 10.5px; color: var(--muted-foreground); }
  .cb-time { flex: 1 1 auto; min-width: 0; }
  /* تیکِ رسید: یک تیک = ثبت شده ولی ندیده؛ دو تیکِ آبی = دیده. */
  .cb-ticks { flex: none; display: inline-flex; align-items: center; opacity: .55; }
  .cb-ticks .ic { width: 15px; height: 15px; stroke-width: 2.6; }
  .cb-ticks.seen { opacity: 1; color: var(--tick-seen); }
  .cb-foot .btn-icon { padding: 0 3px; min-height: 0; height: 18px; box-shadow: none;
    background: none; border: none; }
  /* رویدادهای لایف‌سایکل (گزارش/تأیید/رد/مرحله): نوارِ وسط‌چینِ سیستمی، نه حباب. */
  .cb-sys { align-self: center; max-width: 92%; text-align: center; font-size: 12px;
    color: var(--muted-foreground); background: var(--secondary); border-radius: 10px;
    padding: 6px 11px; }
  /* کامپوزر: کفِ پنلِ چت، جدا با یک خط، و همیشه دیده می‌شود. */
  .chatpane .composer { flex: 0 0 auto; margin: 0; border: none; border-radius: 0;
    border-top: 1px solid var(--border-c); box-shadow: none;
    background: var(--card-bg); padding: 8px 10px; max-height: 46%; overflow-y: auto; }
  .chatpane .composer textarea { min-height: 42px; }
  /* ردیفِ «یادآور پیگیری» زیرِ دکمه‌ی ارسال — یک خطِ کم‌ارتفاع تا کامپوزر شلوغ نشود. */
  .fu-row { display: flex; align-items: center; gap: 6px; margin-top: 8px;
    font-size: 12px; color: var(--muted-foreground); cursor: pointer; user-select: none; }
  .fu-row input { flex: none; width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
  .fu-row .ic { width: 14px; height: 14px; vertical-align: -2px; }
  .fu-when { margin-inline-start: auto; font-weight: 700; color: var(--accent-foreground);
    font-size: 11.5px; white-space: nowrap; }

  /* ====== پخش‌کننده‌ی صوتیِ سفارشی (waveform + سرعت + seek) ====== */
  .ap { --ap-on: var(--accent-foreground); --ap-off: rgba(127,127,127,.38);
    display: flex; align-items: center; gap: 9px; min-width: 200px; }
  .ap-play { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--btn); color: var(--btn-fg); border: none; box-shadow: var(--shadow-sm); }
  .ap-play .ic { width: 16px; height: 16px; }
  .ap-mid { flex: 1 1 auto; min-width: 0; }
  .ap-wave { height: 30px; cursor: pointer; touch-action: none; }
  .ap-wave canvas { display: block; width: 100%; height: 100%; }
  .ap-wave:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
  .ap-times { display: flex; justify-content: space-between; font-size: 10px;
    color: var(--muted-foreground); font-variant-numeric: tabular-nums; margin-top: 1px; }
  .ap-rate { flex: none; direction: ltr; min-width: 34px; height: 24px; padding: 0 7px; font-size: 11px;
    font-weight: 700; border-radius: 999px; background: var(--secondary);
    color: var(--secondary-foreground); border: 1px solid var(--border-c); box-shadow: none; }
  /* داخلِ حبابِ «من» رنگ‌ها باید روی زمینه‌ی سبز هم خوانا بمانند. */
  .cb-row.mine .ap { --ap-off: rgba(0,0,0,.20); }
  html.dark .cb-row.mine .ap { --ap-off: rgba(255,255,255,.22); }

  /* gantt */
  .gantt-track { background: var(--secondary); border-radius: 7px; height: 18px; }
  .gantt-div { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .6; pointer-events: none; }
  .gantt-body { position: relative; }
  .gantt-today { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; z-index: 2; }
  .gantt-today::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; border-radius: 2px; background: var(--warn); opacity: .4; }
  .gantt-today::after { content: ""; position: absolute; top: -4px; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--card); }
  .gantt-bar { background: var(--primary); border-radius: 7px; height: 14px; top: 2px; }
  .gantt-bar.done { background: var(--ok); }
  .gantt-bar.over { background: var(--danger); }

  /* dashboard overview */
  .ov-grid { display: grid; gap: 10px; }
  /* آیتم‌های گرید min-width:auto دارند؛ بدونِ این، عنوانِ بلندِ nowrap (مثلاً در
     «عقب‌افتاده‌ترین کارها») ترکِ گرید را گشاد می‌کند و کلِ داشبورد اسکرولِ افقی می‌گیرد. */
  .ov-grid > .card { min-width: 0; }
  .ov-h { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 5px; }
  .ov-h .ic { width: 14px; height: 14px; }
  /* روند هفتگی */
  .trend { display: flex; align-items: flex-end; gap: 6px; height: 78px; padding-top: 4px; }
  .trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
  .trend-bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
  .trend-bars span { width: 7px; border-radius: 3px 3px 0 0; min-height: 2px; }
  .trend-bars .op { background: var(--primary); opacity: .55; }
  .trend-bars .cl { background: var(--ok); }
  .trend-x { font-size: 10px; color: var(--muted); }
  .legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 6px; }
  .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 4px; vertical-align: -1px; }
  /* بارِ کاریِ افراد */
  .wl-row { margin: 9px 0; }
  .wl-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 4px; }
  .wl-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .wl-meta { color: var(--muted); font-size: 11px; flex-shrink: 0; padding-inline-start: 8px; }
  .wl-bar { height: 12px; border-radius: 6px; background: var(--secondary); overflow: hidden; display: flex; }
  .wl-bar span { height: 100%; }
  .wl-bar .over { background: var(--danger); }
  .wl-bar .open { background: var(--primary); opacity: .7; }
  .ov-od { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
  .ov-od:last-child { border-bottom: 0; }
  .ov-od b { color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* داشبوردِ شخصی (سه بخشِ بالای صفحه) */
  .dash-grid { display: grid; gap: 10px; }
  .dash-grid > .card { min-width: 0; }
  .dash-h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px;
    display: flex; align-items: center; gap: 6px; }
  .dash-h2 .ic { width: 15px; height: 15px; }
  .dash-main { display: flex; align-items: center; gap: 14px; }
  /* حلقه‌ی باز/عقب‌افتاده */
  .donut { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
  .donut svg { width: 80px; height: 80px; transform: rotate(-90deg); }
  .donut circle { fill: none; stroke-width: 9; }
  .donut .dn-open  { stroke: var(--primary); opacity: .7; }
  .donut .dn-over  { stroke: var(--danger); stroke-linecap: round; }
  .donut .dn-empty { stroke: var(--secondary); }
  .donut-c { position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px; }
  .donut-c b { font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
  .donut-c span { font-size: 10px; color: var(--muted); }
  /* سه عددِ کنارِ حلقه */
  .dash-stats { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
  .ds { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
  .ds b { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 22px; }
  .ds span { color: var(--muted); }
  .ds.red b { color: var(--danger); }
  .ds.green b { color: var(--ok); }
  .dash-note { font-size: 11.5px; color: var(--muted); margin-top: 10px;
    padding-top: 8px; border-top: 1px solid var(--border); line-height: 1.7; }
  .dash-people { margin-top: 8px; }
  .dash-spark { margin-top: 10px; }
  .dash-spark-h { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  .trend.sm { height: 46px; }
  .trend.sm .trend-bars span { width: 14px; }

  /* toast */
  .toast { background: var(--popover); color: var(--popover-foreground);
    border: 1px solid var(--border-c); box-shadow: var(--shadow-lg);
    border-radius: var(--radius); padding: 11px 16px; font-size: 13px; font-weight: 500; }

  /* lucide icons */
  /* pointer-events:none تا هدفِ کلیک همیشه خودِ دکمه/لینک باشد، نه آیکن. lucide آیکنِ
     <i> را با <svg> جایگزین می‌کند؛ اگر این جابه‌جایی بینِ press و release رخ دهد و آیکن
     هدفِ کلیک باشد، مرورگر کلیک را حذف می‌کند و دکمه «گاهی فریز می‌شود». با این قانون
     کلیک از روی آیکن به دکمه می‌رسد و این ریس به‌کلی از بین می‌رود (سراسری برای کلِ اپ). */
  .ic { width: 1.05em; height: 1.05em; stroke-width: 2; vertical-align: -0.16em;
    display: inline-block; flex: none; pointer-events: none; }
  h1 .ic { width: 1.1em; height: 1.1em; vertical-align: -0.12em; opacity: .9; }
  h2 .ic { width: 1em; height: 1em; vertical-align: -0.14em; }
  .tab .ic { width: 1em; height: 1em; vertical-align: -0.13em; margin-inline-end: 5px; }
  .item .title .ic, .item .meta .ic { vertical-align: -0.16em; }
  .card .title .ic { vertical-align: -0.15em; }
  .toast .ic { vertical-align: -0.18em; margin-inline-end: 4px; }
  .priodot { display: inline-block; width: 9px; height: 9px; border-radius: 999px;
    vertical-align: middle; margin-inline-end: 1px; }
  .priodot.high { background: var(--danger); }
  .priodot.normal { background: #3b82f6; }
  .priodot.low { background: #a1a1aa; }
  /* لودینگِ زیبا: اسپینرِ حلقه‌ای + اسکلتونِ shimmer */
  .loading { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 56px 16px; color: var(--muted); }
  .spinner { width: 38px; height: 38px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--primary);
    animation: spin .7s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-label { font-size: 13px; animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
  .rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger);
    flex: none; animation: pulse 1s ease-in-out infinite; }
  .skel-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; margin-bottom: 10px; }
  .skel { border-radius: 7px; background: var(--muted-surface); position: relative; overflow: hidden; }
  .skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
    animation: shimmer 1.3s infinite; }
  html.dark .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); }
  @keyframes shimmer { 100% { transform: translateX(100%); } }
  .skel.line { height: 12px; margin: 8px 0; }
  .skel.line.mid { width: 70%; }
  .skel.line.short { width: 42%; }
  /* ورود با کدِ یک‌بارمصرف (خارج از تلگرام) */
  .auth-header { display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 9px 12px; margin-bottom: 12px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
  .auth-header .who { display: inline-flex; align-items: center; gap: 8px; min-width: 0;
    font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-header .who-av { display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; flex: none; color: #fff;
    background: linear-gradient(135deg, var(--primary), #7c3aed); }
  .auth-header .who-av .ic { width: 15px; height: 15px; }

  .login-wrap { display: flex; align-items: center; justify-content: center;
    min-height: 78vh; padding: 16px 2px; }
  .login-card { width: 100%; max-width: 400px; padding: 30px 24px 24px;
    border-radius: 20px; box-shadow: var(--shadow-lg); text-align: center; }
  .login-badge { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    box-shadow: 0 10px 24px -8px rgba(59,130,246,.55); }
  .login-badge .ic { width: 29px; height: 29px; }
  .login-card h2 { margin: 0 0 7px; font-size: 19px; font-weight: 700; }
  .login-card .sub { margin: 0 0 20px; font-size: 12.5px; line-height: 1.75;
    color: var(--muted-foreground); }
  /* فیلدِ شناسه LTR است (یوزرنیم/شماره چپ‌چین، آیکون سمتِ چپ) */
  .field { position: relative; }
  .field .fic { position: absolute; top: 50%; transform: translateY(-50%);
    inset-inline-start: 13px; width: 18px; height: 18px;
    color: var(--muted-foreground); pointer-events: none; }
  .field input.f { padding-inline-start: 40px; height: 48px; border-radius: 13px; text-align: left; }
  .btn-main { width: 100%; height: 48px; border-radius: 13px; font-weight: 600;
    font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 14px; }
  .login-actions { display: flex; gap: 8px; margin-top: 10px; }
  .login-actions button { flex: 1; height: 40px; border-radius: 12px; font-size: 12.5px; }
  .otp-boxes { display: flex; gap: 9px; justify-content: center; direction: ltr; margin: 4px 0 2px; }
  .otp-boxes input { flex: 1 1 0; min-width: 0; max-width: 62px; height: 60px; text-align: center;
    font-size: 26px; font-weight: 700; border: 1.5px solid var(--input-c); border-radius: 14px;
    background: var(--card-bg); color: var(--foreground); caret-color: var(--primary);
    transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
  .otp-boxes input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(59,130,246,.28); }
  .otp-boxes input.filled { border-color: var(--primary); }
  .login-msg { margin-top: 16px; font-size: 13px; min-height: 20px; line-height: 1.6; border-radius: 11px; }
  .login-msg.info { color: var(--muted-foreground); }
  .login-msg.err { color: var(--danger-fg2); background: var(--danger-bg);
    border: 1px solid var(--danger-bd); padding: 10px 12px; }
  .login-msg.ok { color: var(--success-fg); background: var(--success-bg);
    border: 1px solid var(--success-bd); padding: 10px 12px; }
  /* دکمه‌ی شناورِ تغییرِ تم (فقط در مرورگر — خارج از اپِ تلگرام) */
  .theme-fab { position: fixed; bottom: 16px; left: 16px; z-index: 60; display: none;
    width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center;
    background: var(--card-bg); color: var(--foreground); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); cursor: pointer; padding: 0; }
  .theme-fab.show { display: inline-flex; }
  .theme-fab .ic { width: 20px; height: 20px; }

  /* ===== نقش‌ها و سطوح دسترسی (فاز ۲) ===== */
  /* سگمنتِ دامنه‌ی دید */
  .seg { display: flex; background: var(--secondary); border-radius: 10px; padding: 3px; gap: 3px; }
  .seg button { flex: 1; border: 0; background: transparent; color: var(--fg); font: inherit;
    font-size: 13px; font-weight: 600; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
  .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--primary);
    box-shadow: var(--shadow-sm); }
  /* سوییچِ مجوز */
  .sw { width: 38px; height: 22px; border-radius: 999px; border: 0; padding: 0; flex: none;
    cursor: pointer; background: rgba(0,0,0,.14); position: relative; transition: background .16s; }
  html.dark .sw { background: rgba(255,255,255,.18); }
  .sw::after { content: ""; position: absolute; top: 2.5px; right: 2.5px; width: 17px; height: 17px;
    border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .16s; }
  .sw[aria-checked="true"] { background: var(--primary); }
  .sw[aria-checked="true"]::after { transform: translateX(-16px); }
  .sw:disabled { opacity: .45; cursor: not-allowed; }
  /* ردیفِ مجوز — کنترل در انتهای ردیف، مثلِ .spread */
  .prow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0;
    border-bottom: 1px solid var(--border); }
  .prow:last-child { border-bottom: 0; }
  .prow > .txt { flex: 1 1 auto; min-width: 0; }
  .prow > .sw { margin-top: 2px; }
  .prow.child { padding-inline-start: 16px; border-inline-start: 2px solid var(--border);
    margin-inline-start: 4px; }
  .prow .lbl { font-size: 14px; font-weight: 600; display: flex; align-items: center;
    gap: 6px; flex-wrap: wrap; }
  .prow .dsc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
  .prow .dep { font-size: 12px; color: var(--warn); margin-top: 4px; display: none; }
  .prow.needs .dep { display: block; }
  /* آکاردئونِ گروهِ مجوزها */
  .pgrp { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
    overflow: hidden; background: var(--card); }
  .pgrp > summary { list-style: none; cursor: pointer; padding: 11px 13px; display: flex;
    align-items: center; gap: 9px; font-weight: 600; font-size: 14px; user-select: none; }
  .pgrp > summary::-webkit-details-marker { display: none; }
  .pgrp > summary .cnt { margin-inline-start: auto; font-size: 12px; color: var(--muted);
    font-variant-numeric: tabular-nums; }
  .pgrp > summary .chev { transition: transform .16s; }
  .pgrp[open] > summary .chev { transform: rotate(180deg); }
  .pgrp .pbody { padding: 0 13px 10px; }
  /* Voiceprintِ ثبت‌شده یک تنظیمِ کم‌تغییر است؛ پس در حالتِ عادی فقط وضعیتِ فشرده
     نشان داده می‌شود و کارهای حساسِ ضبط دوباره/حذف پشتِ آکاردئون می‌مانند. */
  .vp-card-ready { margin-bottom: 12px; background: var(--card-bg); color: var(--card-foreground);
    border: 1px solid var(--border-c); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
  .vp-card-ready > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex;
    align-items: center; gap: 8px; user-select: none; }
  .vp-card-ready > summary::-webkit-details-marker { display: none; }
  .vp-card-ready > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
  .vp-summary-title { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; }
  .vp-summary-state { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 7px;
    border-radius: 999px; background: var(--success-bg); color: var(--success-fg); font-size: 11.5px; font-weight: 600; }
  .vp-summary-state .ic { width: 13px; height: 13px; }
  .vp-chevron { color: var(--muted); transition: transform .16s ease; }
  .vp-card-ready[open] .vp-chevron { transform: rotate(180deg); }
  .vp-card-body { border-top: 1px solid var(--border-c); padding: 0 12px 12px; }
  /* تاریخچهٔ تحویلِ پیامک فقط در صورت نیاز باز می‌شود تا کارتِ تنظیمات کوتاه بماند. */
  .sms-log-details { margin-top: 12px; border-top: 1px solid var(--border-c); }
  .sms-log-details > summary { list-style: none; cursor: pointer; padding: 9px 0 3px; display: flex;
    align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; user-select: none; }
  .sms-log-details > summary::-webkit-details-marker { display: none; }
  .sms-log-details > summary > span { flex: 1 1 auto; }
  .sms-log-details > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
  .sms-log-chevron { color: var(--muted); transition: transform .16s ease; }
  .sms-log-details[open] .sms-log-chevron { transform: rotate(180deg); }
  .sms-log-details > #sms-log { padding-top: 5px; }
  /* پیش‌نمایشِ زنده */
  .pvbox { background: var(--muted-surface); border-radius: 12px; padding: 12px; margin-top: 10px; }
  .pvbox h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .06em; color: var(--muted);
    font-weight: 700; }
  .pvtabs { display: flex; gap: 6px; flex-wrap: wrap; }
  .pvtabs span { background: var(--card); border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 10px; font-size: 12.5px; }
  .pvkbd { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .pvkbd span { background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 7px 6px; font-size: 12.5px; text-align: center; }
  .pvkbd span.solo { grid-column: span 2; }
  .pvsum { font-size: 13px; color: var(--fg); line-height: 1.9; }
  .pvsum b { color: var(--primary); }
  /* نوارِ چسبانِ ذخیره */
  .savebar { position: sticky; bottom: 0; background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 11px 13px; margin-top: 10px; box-shadow: var(--shadow-lg); }
  /* دکمه‌ی شناورِ تم (فقط در مرورگر) روی نوارِ چسبانِ ذخیره می‌افتاد؛ بالاتر می‌رود. */
  body:has(.savebar) .theme-fab { bottom: 80px; }
  /* در صفحه‌ی گفت‌وگو، دکمه‌ی شناورِ تم (چپ-پایین) یا روی دکمه‌ی «ارسال کامنت» می‌افتد
     یا روی خودِ پیام‌ها — هر دو بد است و جای امنی هم نمانده. چون انتخابِ تم در
     localStorage می‌ماند و از هر صفحه‌ی دیگری قابلِ تغییر است، این‌جا پنهانش می‌کنیم. */
  body:has(.chatpane) .theme-fab { display: none; }
  /* رنگِ نقش */
  .swatch { width: 22px; height: 22px; border-radius: 999px; border: 2px solid transparent;
    cursor: pointer; padding: 0; }
  .swatch[aria-pressed="true"] { border-color: var(--fg); }
  .rolecolor { width: 10px; height: 10px; border-radius: 999px; display: inline-block;
    margin-inline-end: 5px; vertical-align: middle; }

  /* گفت‌وگو زیرِ درخواستِ جلسه (تسک ۱۰۰/ویسِ ۴۸۸) — مذاکره‌ی مدیر و درخواست‌دهنده
     قبل از تأیید. دو طرفه است، پس مثلِ چت پیامِ خودی و طرفِ مقابل تفکیک می‌شوند. */
  .mr-talk-list { display: flex; flex-direction: column; gap: 9px; }
  .mr-msg { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px;
    background: var(--bg); max-width: 92%; align-self: flex-end; }
  .mr-msg.mine { align-self: flex-start; background: var(--card);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
  .mr-msg-h { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
  .mr-msg-who { font-size: 12.5px; font-weight: 600; }
  .mr-msg-t { font-size: 11.5px; margin-inline-start: auto; }
  .mr-msg-b { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.85; }
  .mr-msg .mr-msg-del { padding: 2px 5px; line-height: 1; }
  .mr-talk-send { display: flex; gap: 7px; align-items: flex-end; margin-top: 10px; }
  .mr-talk-send textarea { flex: 1; min-width: 0; resize: vertical; margin-top: 0; min-height: 42px; }

  /* ===== درخواست جلسه (تسک ۱۰۰ — بازطراحیِ ۲۷ مرداد ۱۴۰۵) ===== */
  .mr-page-head { margin-bottom: 12px; align-items: flex-start; }
  .mr-page-head h1 { margin: 0; }
  .mr-page-head > div { min-width: 0; }
  .mr-manage-open { margin: 0 0 12px; }
  .mr-primary-wide { width: 100%; min-height: 46px; display: inline-flex; align-items: center;
    justify-content: center; gap: 7px; }
  .mr-empty { text-align: center; padding: 24px; color: var(--muted); }
  .mr-record-list { display: flex; flex-direction: column; gap: 8px; }
  button.mr-record { width: 100%; text-align: right; color: var(--fg); margin: 0;
    background: var(--card); padding: 12px 13px; }
  button.mr-record:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
    box-shadow: var(--shadow-sm); }
  .mr-record .title, .mr-record strong { min-width: 0; overflow-wrap: anywhere; }
  .mr-record-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px;
    color: var(--muted); font-size: 12.5px; margin-top: 7px; }
  .mr-record-meta > span { display: inline-flex; align-items: center; gap: 4px; }
  .mr-record-meta .mr-priority-meta { color: var(--fg); font-weight: 700; }
  .mr-record-note { font-size: 12.5px; margin-top: 6px; }
  /* ظرفِ بج‌های کنارِ عنوان — spread فرزندها را پخش می‌کند، پس باید یکی باشند. */
  .mr-badges { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
  /* جلسه‌ی «تأیید شده»ای که وقتش گذشته: کم‌رنگ، ولی نه آن‌قدر که ناخوانا شود.
     روی هاور کاملاً برمی‌گردد، چون هنوز قابلِ بازکردن است. */
  button.mr-record.is-past { opacity: 0.62; }
  button.mr-record.is-past:hover, button.mr-record.is-past:focus-visible { opacity: 1; }
  /* چهار دسته‌ی چرخه‌ی جلسه (منتظر تأیید / منتظر زمان‌بندی / تأیید شده / لغوشده) */
  .mr-bucket { margin-top: 18px; }
  .mr-bucket:first-of-type { margin-top: 12px; }
  .mr-bucket-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
    font-size: 13.5px; font-weight: 700; }
  .mr-bucket-head .ic { color: var(--primary); }
  .mr-bucket-head > span:first-of-type { margin-inline-end: 2px; }
  /* «نمایش بیشتر» هر دسته — صفحه‌بندیِ سمت‌سرورِ همان دسته */
  .mr-more { width: 100%; margin: 8px 0 0; display: inline-flex; align-items: center;
    justify-content: center; gap: 6px; font-size: 12.5px; }
  .mr-more .muted { font-size: 11.5px; }
  /* خطِ «ثبت: … · تأیید: …» زیرِ عنوانِ جلسه */
  .mr-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
    color: var(--muted); font-size: 11.5px; margin-top: 5px; }
  .mr-dates .ic { width: 13px; height: 13px; margin-inline-end: 2px; vertical-align: -2px; }
  .mr-dates-sep { opacity: .55; }
  .mr-det-head { padding: 13px; }
  .mr-det-head .title { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
  /* فرمِ مشترکِ ثبت/ویرایش */
  .mr-field { display: block; margin-bottom: 16px; }
  .mr-field > span { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 650; }
  .mr-field > label:not(.ghost) { display: flex; align-items: center; gap: 4px;
    font-size: 13.5px; font-weight: 650; }
  .mr-field > span b { color: var(--danger); }
  .mr-field > label:not(.ghost) b { color: var(--danger); }
  .mr-field small { display: block; color: var(--muted); margin-top: 4px; font-size: 11.5px; }
  /* راهنمای کوتاهِ زیرِ فیلد (زمان‌های پیشنهادی، وضعیتِ ایمیلِ حاضرین) */
  .mr-hint { margin-top: 4px; margin-bottom: 6px; font-size: 11.5px; line-height: 1.7; }
  .mr-field input:focus, .mr-field textarea:focus, .mr-field select:focus { outline: none;
    border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 20%, transparent); }
  .mr-form-card { padding: 15px; }
  .mr-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
  .mr-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
  .mr-priority-chips, .mr-duration-chips { margin: 7px 0 0; }
  .mr-att-options { max-height: 152px; overflow: auto; margin-top: 7px; }
  .mr-dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mr-dashboard-stats .card { margin: 0; text-align: center; padding: 10px 5px; }
  .mr-dashboard-stats strong { display: block; font-size: 21px; color: var(--primary); }
  .mr-dashboard-stats span { display: block; font-size: 10.5px; color: var(--muted); }
  /* نوارِ ضبط/پیش‌نمایشِ پیامِ صوتیِ گفت‌وگو */
  .mr-rec-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 9px;
    border: 1px solid var(--border); border-radius: 11px; background: var(--secondary); font-size: 12.5px; }
  .mr-rec-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--danger);
    flex: none; animation: mr-rec-pulse 1.1s ease-in-out infinite; }
  @keyframes mr-rec-pulse { 50% { opacity: .25; } }

  @media (max-width: 460px) {
    .mr-page-head .muted { font-size: 11.5px; }
    .mr-page-head > button { flex: none; }
    .mr-dashboard-stats { gap: 5px; }
    .mr-dashboard-stats strong { font-size: 18px; }
    .mr-rec-bar { flex-wrap: wrap; }
  }

  @media (prefers-reduced-motion: reduce) {
    .mr-rec-dot { animation: none; }
  }

  /* انتخابِ دامنه‌ی دید (ویسِ علوی): تا امروز هر سه گزینه تقریباً هم‌شکل بودند و
     این حس را می‌داد که نقش هر سه دسترسی را دارد. حالا انتخاب‌شده پُر و تیک‌دار
     است و دو تای دیگر آشکارا کم‌رنگ — «انتخاب‌شده» با «موجود» اشتباه نمی‌شود. */
  .seg.seg-pick button { display: flex; align-items: center; justify-content: center; gap: 5px;
    opacity: .5; font-weight: 500; }
  .seg.seg-pick button .seg-check { display: none; }
  .seg.seg-pick button .seg-check svg { width: 14px; height: 14px; }
  .seg.seg-pick button[aria-pressed="true"] { background: var(--primary);
    color: var(--primary-foreground); opacity: 1; font-weight: 800;
    box-shadow: var(--shadow-sm); }
  .seg.seg-pick button[aria-pressed="true"] .seg-check { display: inline-flex; }
  .seg.seg-pick button:hover { opacity: .85; }
  .seg.seg-pick button[aria-pressed="true"]:hover { opacity: 1; }
  .scope-now { margin-top: 9px; display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--fg); }
  .scope-now svg { width: 15px; height: 15px; color: var(--primary); }
  .scope-now b { color: var(--primary); }

/* ضبطِ مستقیمِ جلسه (meeting-recorder.js) — ظاهرِ رکوردرِ واقعی */
.mrec { margin-bottom: 14px; --mrec-red: #ef3b3b; --mrec-bar: var(--mrec-red); --mrec-idle: #a1a1aa; }
.mrec-deck { position: relative; text-align: center; padding: 10px 12px 10px; border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 0%, var(--accent) 0%, transparent 70%), var(--muted-surface, var(--card));
  border: 1px solid var(--border-c, var(--border)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.mrec-deck.is-live { border-color: rgba(239,59,59,.45); box-shadow: 0 0 0 4px rgba(239,59,59,.08); }
.mrec-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--card, var(--bg)); border: 1px solid var(--border-c, var(--border)); }
.is-live .mrec-status { color: var(--mrec-red); }
.mrec-clock { font-size: 30px; font-weight: 500; letter-spacing: 1px; line-height: 1.1; margin: 6px 0 2px;
  font-variant-numeric: tabular-nums; direction: ltr; }
.mrec-clock.dim { opacity: .35; }
.mrec-wave { display: block; width: 100%; height: 34px; margin: 2px 0 4px; }
.mrec-transport { display: flex; justify-content: center; align-items: flex-start; gap: 20px; margin: 6px 0 2px; }
.mrec-ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted-foreground, inherit); min-width: 54px; }
.mrec-btn { border-radius: 50%; padding: 0; display: grid; place-items: center; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease; }
.mrec-btn:active { transform: scale(.93); }
.mrec-btn.side { width: 40px; height: 40px; margin-top: 8px; background: var(--card, var(--bg)); color: var(--fg);
  border: 1px solid var(--border-c, var(--border)); box-shadow: var(--shadow-sm); }
.mrec-btn.side svg { width: 17px; height: 17px; }
.mrec-btn.main { width: 56px; height: 56px; background: var(--card, #fff); border: 3px solid var(--border-c, var(--border));
  box-shadow: var(--shadow); }
.mrec-btn.main.send, .mrec-btn.side.send { background: var(--btn); color: var(--btn-fg, #fff); border-color: transparent; }
.mrec-btn.main.send svg { width: 22px; height: 22px; }
.mrec-rd { width: 24px; height: 24px; border-radius: 50%; background: var(--mrec-red); display: block;
  box-shadow: 0 2px 10px rgba(239,59,59,.45); }
.mrec-btn.side .mrec-rd { width: 15px; height: 15px; }
.mrec-btn.rec { animation: mrec-breathe 2.4s ease-in-out infinite; }
.mrec-btn.stop { border-color: rgba(239,59,59,.35); animation: mrec-ring 1.6s ease-out infinite; }
.is-paused .mrec-btn.stop { animation: none; }
.mrec-sq { width: 19px; height: 19px; border-radius: 5px; background: var(--mrec-red); display: block; }
@keyframes mrec-breathe { 50% { box-shadow: 0 0 0 6px rgba(239,59,59,.12), var(--shadow); } }
@keyframes mrec-ring { 0% { box-shadow: 0 0 0 0 rgba(239,59,59,.35); } 100% { box-shadow: 0 0 0 9px rgba(239,59,59,0); } }
.mrec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mrec-red, #ef3b3b); display: inline-block;
  animation: mrec-blink 1.2s ease-in-out infinite; flex: none; }
.mrec-dot.paused { background: var(--warn); animation: none; }
@keyframes mrec-blink { 50% { opacity: .25; } }
.mrec-safe { font-size: 11px; color: var(--muted-foreground, inherit); opacity: .85; margin-top: 4px; line-height: 1.7; }
.mrec-safe svg { width: 13px; height: 13px; vertical-align: -2px; }
.mrec-note { margin: 4px auto 8px; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; background: var(--card, var(--bg));
  border: 1px solid var(--border-c, var(--border)); max-width: 420px; }
.mrec-warn { margin-top: 8px; font-size: 12.5px; color: var(--danger); }
.mrec-foot { font-size: 11px; color: var(--muted-foreground, inherit); margin-top: 4px; }
.mrec-link { background: none; border: 0; color: var(--danger); padding: 0 4px; font-size: 11.5px; cursor: pointer; box-shadow: none; }
.mrec-link svg { width: 12px; height: 12px; vertical-align: -2px; }
.mrec-pill { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.2)); }
