:root{
  --bg:#F3F6F6;
  --surface:#FFFFFF;
  --border:#E1E7E6;
  --text:#12262A;
  --text-soft:#5C7175;
  --accent:#2F6F63;
  --accent-light:#E6EFEC;
  --accent-dark:#1D4B42;
  --clay:#C97B63;
  --clay-light:#F5E7E2;
  --alert:#B54A3F;
  --alert-light:#F6E6E3;
  --radius:14px;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:'Vazirmatn', Tahoma, sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
}
.mono{ font-family:'IBM Plex Mono', monospace; }

/* ===== صفحه ورود ===== */
.auth-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px;
}
.auth-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:32px; width:100%; max-width:400px;
}
.auth-logo{ display:flex; align-items:center; gap:10px; margin-bottom:24px; justify-content:center; }
.auth-logo .ring{ width:30px; height:30px; border-radius:50%; border:2.5px solid var(--accent-dark); border-left-color:var(--clay); }
.auth-logo .text{ font-weight:800; font-size:17px; }
.auth-logo .text span{ color:var(--clay); }
.auth-tabs{ display:flex; gap:6px; background:var(--bg); border-radius:10px; padding:4px; margin-bottom:20px; }
.auth-tab{ flex:1; text-align:center; padding:8px; border-radius:8px; font-size:12.5px; font-weight:700; cursor:pointer; color:var(--text-soft); }
.auth-tab.active{ background:var(--surface); color:var(--accent-dark); box-shadow:0 1px 2px rgba(0,0,0,0.06); }
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color:var(--text-soft); margin-bottom:5px; }
.field input, .field select{
  width:100%; border:1px solid var(--border); border-radius:9px; padding:10px 12px;
  font-family:inherit; font-size:13px; background:var(--bg);
}
.consent-row{ display:flex; align-items:flex-start; gap:8px; font-size:12.5px; color:var(--text-soft); margin-bottom:10px; line-height:1.6; }
.consent-row input{ margin-top:2px; accent-color:var(--accent); }
.btn-primary{
  width:100%; background:var(--accent); color:#fff; border:none; padding:12px;
  border-radius:10px; font-family:inherit; font-weight:700; font-size:13.5px; cursor:pointer; margin-top:6px;
}
.btn-primary:disabled{ opacity:0.6; cursor:not-allowed; }
.form-msg{ font-size:12px; margin-top:12px; padding:10px 12px; border-radius:8px; }
.form-msg.error{ background:var(--alert-light); color:var(--alert); }
.form-msg.success{ background:var(--accent-light); color:var(--accent-dark); }
.hidden{ display:none !important; }

/* ===== لایه‌بندی چت ===== */
body.chat-body{ display:flex; height:100vh; overflow:hidden; }
/* ═══ سایدبار: پنل ابزار بالینی ═══
   طرح قبلی هفت دکمه‌ی کاملاً یکسان بود؛ چشم نمی‌دانست کجا را نگاه کند.
   اینجا سلسله‌مراتب از گروه‌بندی و تایپوگرافی می‌آید، نه از رنگ‌آمیزی همه‌چیز.
   رنگ لهجه فقط یک جا خرج می‌شود: تنها اقدامی که تصمیم می‌خواهد. */
.sidebar{
  --sb-ink:#0D2723;
  --sb-line:rgba(255,255,255,0.08);
  --sb-text:#D9E6E3;
  --sb-dim:#7B9B95;
  width:262px; flex-shrink:0;
  background:linear-gradient(180deg, #133733 0%, var(--sb-ink) 62%, #0A201D 100%);
  color:var(--sb-text);
  display:flex; flex-direction:column;
  padding:20px 0 14px;
  border-left:1px solid rgba(0,0,0,0.2);
}

/* --- نشان --- */
.logo{ display:flex; align-items:center; gap:10px; padding:0 20px 18px; }
.logo-ring{
  width:28px; height:28px; border-radius:50%;
  border:2px solid rgba(255,255,255,0.28);
  border-top-color:var(--clay);
  position:relative;
}
/* نقطه‌ی کانونی — اشاره به عدسی درماتوسکوپ */
.logo-ring::after{
  content:''; position:absolute; inset:7px; border-radius:50%;
  background:rgba(255,255,255,0.16);
}
.logo-text{ font-weight:800; font-size:15px; letter-spacing:.2px; }
.logo-text span{ color:var(--clay); font-weight:700; }

/* --- کاربر --- */
.user-card{
  display:flex; align-items:center; gap:11px;
  padding:0 20px 16px; margin-bottom:16px;
  border-bottom:1px solid var(--sb-line);
}
.user-card::before{
  content:attr(data-initial);
  width:34px; height:34px; flex-shrink:0;
  border-radius:11px;
  background:rgba(255,255,255,0.09);
  border:1px solid var(--sb-line);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:700; color:#EAF4F1;
}
.user-card .name{ font-size:12.5px; font-weight:700; line-height:1.4; }
.user-card .role{ font-size:11.5px; color:var(--sb-dim); margin-top:1px; }

/* --- سنجه‌ی مصرف: عنصر اصلی سایدبار ---
   تنها داده‌ی زنده‌ای که پزشک روزانه نگاهش می‌کند، پس تنها چیزی است
   که اجازه دارد شلوغ باشد. خط‌های مدرج، ارجاع به ابزار اندازه‌گیری. */
.usage-box{ padding:0 20px 16px; margin-bottom:14px; border-bottom:1px solid var(--sb-line); }
.usage-box .label{
  font-size:11.5px; color:var(--sb-dim);
  display:flex; justify-content:space-between; align-items:baseline; margin-bottom:9px;
}
.usage-track{
  position:relative; height:22px;
  background:rgba(0,0,0,0.22);
  border:1px solid var(--sb-line);
  border-radius:6px; overflow:hidden;
}
/* خطوط مدرج پس‌زمینه */
.usage-track::before{
  content:''; position:absolute; inset:0;
  background:repeating-linear-gradient(to left,
    transparent 0 calc(10% - 1px), var(--sb-line) calc(10% - 1px) 10%);
}
.usage-fill{
  position:relative; height:100%;
  background:linear-gradient(180deg, #4FA08D, #2F6F63);
  border-left:2px solid #7FD3BE;
  transition:width .5s cubic-bezier(.2,.7,.3,1);
}
.usage-fill.is-high{ background:linear-gradient(180deg, #D9906F, var(--clay)); border-left-color:#F0B99C; }
.usage-box .num{ font-size:13.5px; font-weight:800; margin-top:8px; color:#EAF4F1; }
.usage-box .sub{ font-size:11.5px; color:var(--sb-dim); margin-top:3px; line-height:1.7; }

/* --- ناوبری --- */
.sb-nav{ flex:1; overflow-y:auto; padding:0 12px; }
.sb-nav::-webkit-scrollbar{ width:4px; }
.sb-nav::-webkit-scrollbar-thumb{ background:var(--sb-line); border-radius:4px; }

.sb-group{ margin-bottom:16px; }
.sb-group-label{
  display:block; font-size:11.5px; color:var(--sb-dim);
  padding:0 8px 6px; font-weight:600;
}

.sb-item{
  display:flex; align-items:center; gap:10px;
  padding:9px 8px; border-radius:9px;
  font-size:12.5px; font-weight:600; color:var(--sb-text);
  text-decoration:none; border:none; background:none; width:100%;
  font-family:inherit; text-align:right; cursor:pointer;
  position:relative;
  transition:background .15s ease;
}
.sb-item svg{ width:16px; height:16px; flex-shrink:0; opacity:.66; }
.sb-item:hover{ background:rgba(255,255,255,0.07); }
.sb-item:hover svg{ opacity:1; }
.sb-item:focus-visible{ outline:2px solid #7FD3BE; outline-offset:1px; }

/* حالت فعال: ریل تمام‌قد، نه پر کردن کل دکمه */
.sb-item.is-active{ background:rgba(255,255,255,0.09); color:#fff; }
.sb-item.is-active svg{ opacity:1; }
.sb-item.is-active::before{
  content:''; position:absolute; right:-12px; top:6px; bottom:6px;
  width:3px; border-radius:0 3px 3px 0; background:var(--clay);
}

/* تنها اقدامی که تصمیم می‌خواهد — پس تنها جایی که رنگ خرج می‌شود */
.sb-item.is-cta{
  background:var(--clay); color:#fff; margin-bottom:2px;
  box-shadow:0 1px 0 rgba(0,0,0,0.18);
}
.sb-item.is-cta svg{ opacity:1; }
.sb-item.is-cta:hover{ background:#B96C55; }

.sb-item .tag{
  margin-right:auto; font-size:11px; font-weight:700;
  color:var(--sb-dim); border:1px solid var(--sb-line);
  border-radius:5px; padding:2px 6px;
}

.sb-foot{ padding:12px 20px 0; border-top:1px solid var(--sb-line); }
.logout-btn{
  font-size:12.5px; color:var(--sb-dim); cursor:pointer;
  display:flex; align-items:center; gap:8px;
}
.logout-btn:hover{ color:var(--sb-text); }
.logout-btn svg{ width:14px; height:14px; }

@media (prefers-reduced-motion: reduce){
  .usage-fill, .sb-item{ transition:none; }
}

.main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar{ height:56px; display:flex; align-items:center; justify-content:center; border-bottom:1px solid var(--border); background:var(--surface); flex-shrink:0; }
.brand-pill{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; }
.brand-ring{ width:20px; height:20px; border-radius:50%; border:2px solid var(--accent-dark); border-left-color:var(--clay); }
.brand-pill span{ color:var(--clay); }

.chat-scroll{ flex:1; overflow-y:auto; padding:24px 0; }
.chat-col{ max-width:700px; margin:0 auto; padding:0 24px; display:flex; flex-direction:column; gap:18px; }

.msg-row{ display:flex; gap:10px; }
.msg-row.user{ flex-direction:row-reverse; }
.msg-avatar{ width:28px; height:28px; border-radius:50%; flex-shrink:0; }
.msg-avatar.ai{ background:var(--accent-dark); }
.msg-avatar.user{ background:var(--clay); }
.bubble{ border-radius:14px; padding:11px 15px; font-size:13px; line-height:1.75; max-width:78%; }
.bubble.user{ background:#EDF2F1; border-top-left-radius:4px; }
.bubble.ai{ background:var(--surface); border:1px solid var(--border); border-top-right-radius:4px; }
.img-attach{ display:flex; align-items:center; gap:8px; background:#EDF2F1; border-radius:11px; padding:7px 9px; margin-bottom:7px; font-size:12.5px; color:var(--text-soft); }
.img-thumb{ width:34px; height:34px; border-radius:7px; object-fit:cover; }

.typing{ display:flex; gap:4px; padding:2px 0; }
.dot{ width:6px; height:6px; border-radius:50%; background:var(--text-soft); opacity:.5; animation:blink 1.2s infinite; }
.dot:nth-child(2){ animation-delay:.2s; } .dot:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,80%,100%{opacity:.3} 40%{opacity:1} }

.report-card{ background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; max-width:92%; }
.rc-header{ background:var(--accent-dark); color:#fff; padding:14px 16px; display:flex; justify-content:space-between; align-items:center; }
.rc-header .rc-title{ font-size:12.5px; font-weight:700; }
.rc-header .rc-sub{ font-size:11.5px; color:#B9D3CC; margin-top:2px; }
.rc-logo{ font-size:11.5px; font-weight:800; }
.rc-body{ padding:16px; }
.rc-img{ width:100%; max-height:180px; object-fit:cover; border-radius:10px; margin-bottom:14px; }
.rc-section-title{ font-size:12.5px; font-weight:800; color:var(--accent-dark); margin-bottom:9px; }
.rc-findings{ display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:16px; }
.rc-find{ display:flex; justify-content:space-between; align-items:center; border:1px solid var(--border); border-radius:9px; padding:8px 11px; font-size:12.5px; }
.rc-sev{ font-size:11px; font-weight:700; padding:2px 7px; border-radius:20px; }
.rc-sev.high{ background:var(--alert-light); color:var(--alert); }
.rc-sev.mid{ background:var(--clay-light); color:#8A4A36; }
.rc-sev.low{ background:var(--accent-light); color:var(--accent-dark); }
.rc-diag{ border:1px solid var(--border); border-radius:9px; padding:10px 12px; margin-bottom:7px; }
.rc-diag-top{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:700; margin-bottom:3px; }
.rc-diag-top .conf{ font-size:11px; color:var(--accent-dark); }
.rc-diag p{ font-size:11.5px; color:var(--text-soft); line-height:1.65; }
.rc-score-row{ display:flex; align-items:center; gap:11px; background:var(--bg); border-radius:10px; padding:11px 13px; margin:16px 0; }
.rc-ring{ width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rc-ring span{ width:31px; height:31px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:800; }
.rc-score-text b{ display:block; font-size:12.5px; margin-bottom:2px; }
.rc-score-text{ font-size:11.5px; color:var(--text-soft); }
.rc-disclaimer{ font-size:11.5px; color:var(--text-soft); line-height:1.75; background:var(--bg); border-radius:9px; padding:11px 13px; margin-top:4px; }
.rc-disclaimer b{ color:var(--text); }
.rc-actions{ display:flex; gap:8px; padding:0 16px 16px; flex-wrap:wrap; }
.rc-btn{ flex:1; min-width:90px; border-radius:9px; padding:9px; font-family:inherit; font-weight:700; font-size:12.5px; cursor:pointer; border:1px solid var(--border); background:var(--surface); }
.rc-btn.fill{ background:var(--accent); color:#fff; border:none; }
.fb-required-hint{ width:100%; font-size:11.5px; color:var(--text-soft); margin-top:4px; text-align:center; }
.rc-btn.reject{ background:var(--alert-light); color:var(--alert); border:none; }
.rc-btn.done{ opacity:0.55; cursor:default; }

.input-area{ padding:14px 24px 18px; border-top:1px solid var(--border); background:var(--surface); flex-shrink:0; }
.input-col{ max-width:700px; margin:0 auto; }
.input-box{ display:flex; align-items:center; gap:9px; background:var(--bg); border:1px solid var(--border); border-radius:15px; padding:7px 7px 7px 13px; }
.attach-btn{ width:32px; height:32px; border-radius:50%; background:var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:14px; color:var(--text-soft); cursor:pointer; flex-shrink:0; }
.input-box input[type=text]{ flex:1; border:none; background:transparent; font-family:inherit; font-size:12.5px; outline:none; }
.send-btn{ width:32px; height:32px; border-radius:50%; background:var(--accent); border:none; color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; font-size:13px; }
.send-btn:disabled{ opacity:0.5; cursor:not-allowed; }
.file-name-tag{ font-size:11.5px; color:var(--accent-dark); background:var(--accent-light); padding:3px 9px; border-radius:20px; margin-inline-end:6px; }
.consent-inline{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--text-soft); margin-top:8px; justify-content:center; }
.consent-inline input{ accent-color:var(--accent); }
.patient-name-input{
  width:100%; max-width:280px; padding:7px 10px; font-size:12px;
  border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text);
}
.patient-name-input:focus{ outline:none; border-color:var(--accent); }

/* ===== واکنش‌گرا برای موبایل و تبلت ===== */
.menu-toggle-btn{ display:none; width:32px; height:32px; border-radius:50%; border:1px solid var(--border); background:var(--surface); align-items:center; justify-content:center; cursor:pointer; font-size:16px; flex-shrink:0; }
.sidebar-overlay{ display:none; position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:40; }
.sidebar-overlay.show{ display:block; }

@media (max-width: 768px) {
  body.chat-body, body.admin-body { flex-direction: column; }
  .sidebar, .admin-sidebar {
    position: fixed; top:0; right:0; bottom:0; z-index:50;
    transform: translateX(100%);
    transition: transform .25s ease;
    width: 78vw; max-width: 300px;
  }
  .sidebar.open, .admin-sidebar.open { transform: translateX(0); }
  .main, .admin-main{ width: 100%; }
  .topbar{ justify-content: space-between; padding: 0 14px; }
  .menu-toggle-btn{ display:flex; }
  .bubble{ max-width: 88%; }
  .report-card{ max-width: 100% !important; }
  .chat-col{ padding: 0 12px; }
  .input-area{ padding: 12px 14px 16px; }
  .stat-grid{ grid-template-columns: 1fr 1fr; }
}



/* ===== صفحات ساده (پشتیبانی، FAQ، حساب کاربری، اعتبار) ===== */
.page-wrap{ max-width:820px; margin:0 auto; padding:36px 20px 80px; }
.page-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:26px; }
.page-top h1{ font-size:19px; }
.page-top .sub{ font-size:12px; color:var(--text-soft); margin-top:3px; }
.back-link{ font-size:12px; color:var(--accent); text-decoration:none; font-weight:700; }
.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; margin-bottom:18px; }
.panel h2{ font-size:14px; margin-bottom:4px; }
.panel .hint{ font-size:12.5px; color:var(--text-soft); line-height:1.9; margin-bottom:14px; }
.field{ margin-bottom:13px; }
.field label{ display:block; font-size:12.5px; font-weight:700; margin-bottom:5px; }
.field input, .field select, .field textarea{
  width:100%; padding:10px 13px; border:1px solid var(--border); border-radius:10px;
  font-family:inherit; font-size:12.5px; background:var(--bg); color:var(--text); box-sizing:border-box;
}
.field textarea{ min-height:130px; resize:vertical; line-height:1.9; }
.btn-primary{ background:var(--accent); color:#fff; border:none; padding:11px 26px; border-radius:22px;
  font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.btn-primary:disabled{ opacity:0.55; cursor:not-allowed; }
.btn-danger{ background:var(--alert); color:#fff; border:none; padding:10px 22px; border-radius:22px;
  font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.btn-ghost{ background:transparent; color:var(--accent); border:1px solid var(--accent); padding:9px 20px;
  border-radius:22px; font-family:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.form-msg{ font-size:12px; margin-top:12px; min-height:18px; }
.form-msg.error{ color:var(--alert); }
.form-msg.success{ color:var(--accent); }

/* FAQ */
.faq-cat{ font-size:12px; font-weight:800; color:var(--accent-dark); margin:22px 0 8px; }
.faq-item{ border-bottom:1px solid var(--border); }
.faq-q{ padding:13px 0; font-size:12.5px; font-weight:700; cursor:pointer; display:flex;
  justify-content:space-between; gap:12px; align-items:flex-start; }
.faq-q .chev{ color:var(--text-soft); flex-shrink:0; font-size:12.5px; }
.faq-a{ display:none; padding:0 0 15px; font-size:12px; color:var(--text-soft); line-height:2.1; }
.faq-item.open .faq-a{ display:block; }

/* تیکت */
.ticket-row{ display:flex; justify-content:space-between; align-items:center; padding:12px 0;
  border-bottom:1px solid var(--border); cursor:pointer; gap:12px; }
.ticket-row:hover{ background:var(--bg); }
.ticket-row .t-sub{ font-size:12.5px; font-weight:700; }
.ticket-row .t-meta{ font-size:11.5px; color:var(--text-soft); margin-top:2px; }
.badge{ font-size:11.5px; font-weight:800; padding:3px 10px; border-radius:12px; white-space:nowrap; }
.badge.open{ background:var(--clay-light); color:var(--clay); }
.badge.answered{ background:var(--accent-light); color:var(--accent-dark); }
.badge.closed{ background:var(--bg); color:var(--text-soft); }
.msg-bubble{ border-radius:10px; padding:11px 14px; margin-bottom:10px; font-size:12px; line-height:2; white-space:pre-wrap; }
.msg-bubble.user{ background:var(--accent-light); }
.msg-bubble.admin{ background:var(--bg); border-right:3px solid var(--accent); }
.msg-bubble .who{ font-size:11.5px; font-weight:800; color:var(--text-soft); margin-bottom:4px; }

/* بسته‌های اعتبار */
.pack-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:14px; }
.pack{ border:1px solid var(--border); border-radius:12px; padding:18px; text-align:center; }
.pack.best{ border-color:var(--accent); border-width:2px; }
.pack .n{ font-size:26px; font-weight:800; color:var(--accent-dark); }
.pack .lbl{ font-size:12.5px; color:var(--text-soft); margin-bottom:10px; }
.pack .price{ font-size:14px; font-weight:800; margin-bottom:3px; }
.pack .unit{ font-size:11.5px; color:var(--text-soft); margin-bottom:12px; }
.pack .off{ font-size:11.5px; font-weight:800; color:var(--clay); margin-bottom:8px; }
.empty-note{ text-align:center; padding:26px; font-size:12px; color:var(--text-soft); }

@media (max-width: 640px){
  .page-wrap{ padding:22px 14px 60px; }
  .page-top{ flex-direction:column; align-items:flex-start; gap:10px; }
}

.consent-link{
  color:var(--accent); font-weight:700; text-decoration:underline;
  text-underline-offset:2px;
}
.consent-link:hover{ color:var(--accent-dark); }

/* حفاظ: اگر این فایل به هر دلیلی دیر لود شود، آیکون‌ها نباید غول‌پیکر شوند */
.sidebar svg, .sb-item svg, .logout-btn svg { max-width: 18px; max-height: 18px; }
.sidebar a { color: inherit; }

/* ═══════════════════════════════════════════════
   بازبینی موبایل
   مشکل قبلی: استایل سایدبار داخل خود chat.html بود و بعد از این فایل
   می‌آمد، پس media queryهای زیر را بازنویسی می‌کرد. حالا همه یک‌جاست.
   ═══════════════════════════════════════════════ */

/* واحد dvh ارتفاع واقعی را می‌دهد. با vh، نوار آدرس مرورگر موبایل
   روی ورودی چت می‌افتد و کاربر نمی‌تواند تایپ کند. */
@supports (height: 100dvh) {
  body.chat-body, .main { min-height: 100dvh; }
}

@media (max-width: 768px) {
  /* سایدبار از راست می‌آید و کل صفحه را نمی‌گیرد */
  .sidebar, .admin-sidebar {
    width: 82vw;
    max-width: 320px;
    box-shadow: -8px 0 24px rgba(0,0,0,0.25);
  }

  .main { min-width: 0; }

  /* نوار بالا: دکمه‌ی منو همیشه دیده شود */
  .topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    min-height: 52px;
  }
  .menu-toggle-btn { display: flex !important; }

  /* ناحیه‌ی ورودی به پایین بچسبد و زیر نوار مرورگر نرود */
  .input-area {
    position: sticky; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .input-row { gap: 6px; }
  .text-input { font-size: 16px; } /* زیر ۱۶ پیکسل، iOS خودکار زوم می‌کند */

  /* تیک رضایت: در یک خط جا نمی‌شد و بیرون می‌زد */
  .consent-row {
    align-items: flex-start;
    gap: 8px;
    line-height: 1.8;
    flex-wrap: nowrap;
  }
  .consent-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
  .consent-row label { font-size: 12.5px; }

  /* کارت گزارش: جدول‌ها و متن‌های بلند بیرون نزنند */
  .report-card { border-radius: 12px; }
  .rc-body { padding: 14px 13px; }
  .rc-diag p, .rc-find { font-size: 12.5px; }
  .rc-find { flex-wrap: wrap; gap: 4px; }
  .rc-actions { flex-wrap: wrap; }
  .rc-actions .rc-btn { flex: 1 1 auto; min-width: 108px; }

  .msg-row { gap: 8px; }
  .msg-avatar { width: 26px; height: 26px; }
  .bubble { font-size: 12.5px; }

  /* هر چیزی که ممکن است بیرون بزند */
  pre, .stack, .caption { overflow-x: auto; }
  img, svg, table { max-width: 100%; }
}

@media (max-width: 480px) {
  .page-wrap { padding: 16px 12px 70px; }
  .page-top h1 { font-size: 17px; }
  .panel { padding: 16px 14px; border-radius: 12px; }
  .rc-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .rc-logo { font-size: 11.5px; }
  .sidebar, .admin-sidebar { width: 88vw; }
  .plan-grid, .pack-grid { grid-template-columns: 1fr; }
}

/* روی صفحه‌های لمسی، hover معنا ندارد و باعث «چسبیدن» حالت می‌شود */
@media (hover: none) {
  .sb-item:hover, .admin-nav-item:hover, .ticket-row:hover { background: none; }
  .sb-item:active, .admin-nav-item:active { background: rgba(255,255,255,0.1); }
}

/* ═══ پروتکل درمانی و منابع ═══ */
.proto-note{ font-size:11.5px; color:var(--text-soft); line-height:1.9; background:var(--bg);
  border-radius:8px; padding:8px 11px; margin-bottom:9px; }
.proto-warn{ font-size:12.5px; color:var(--clay); background:var(--clay-light);
  border:1px solid var(--clay); border-radius:9px; padding:10px 13px; margin:12px 0; line-height:1.9; }

.ref-chips{ display:inline-flex; gap:4px; margin-right:5px; flex-wrap:wrap; }
.ref-chip{ font-size:11px; font-family:'IBM Plex Mono',monospace; background:var(--accent-light);
  color:var(--accent-dark); border-radius:5px; padding:1px 6px; text-decoration:none; }
.ref-chip:hover{ background:var(--accent); color:#fff; }

.refs-list{ display:flex; flex-direction:column; gap:6px; }
.ref-row{ display:flex; gap:9px; align-items:flex-start; font-size:12.5px; line-height:1.8;
  color:var(--text); text-decoration:none; padding:7px 9px; background:var(--bg); border-radius:8px; }
.ref-row:hover{ background:var(--accent-light); }
.ref-pmid{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--accent-dark);
  flex-shrink:0; padding-top:2px; }
.ref-row i{ display:block; color:var(--text-soft); font-size:11.5px; font-style:normal; margin-top:2px; }

/* ═══ پرونده ═══ */
.case-banner{ display:flex; justify-content:space-between; align-items:center; gap:12px;
  background:var(--accent-light); border:1px solid var(--accent); border-radius:12px;
  padding:12px 15px; margin-bottom:14px; flex-wrap:wrap; }
.case-banner b{ font-size:12.5px; color:var(--accent-dark); }
.case-banner div div{ font-size:12.5px; color:var(--text-soft); margin-top:3px; }
.case-actions{ display:flex; gap:7px; flex-wrap:wrap; }

/* ═══ آزمایش ═══ */
.lab-item{ border:1px solid var(--border); border-radius:10px; padding:11px 13px; margin-bottom:9px; }
.lab-item.unconfirmed{ border-color:var(--clay); background:var(--clay-light); }
.lab-top{ display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:7px; }
.lab-top span{ color:var(--text-soft); font-size:11.5px; }
.lab-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.lab-table td{ padding:4px 6px; border-bottom:1px solid var(--border); }
.lab-table tr:last-child td{ border-bottom:none; }
.lab-table .flag{ color:var(--alert); font-weight:800; }
.lab-text{ font-size:12.5px; line-height:1.9; white-space:pre-wrap; }
.lab-warn{ font-size:11.5px; color:var(--clay); margin-top:7px; line-height:1.8; }

/* ═══ پنجره ═══ */
.modal-back{ position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:100;
  display:flex; align-items:center; justify-content:center; padding:16px; }
.modal{ background:var(--surface); border-radius:16px; padding:20px; width:100%; max-width:460px;
  /* واحد vh در اندروید موقع باز شدن کیبورد درست رفتار نمی‌کند و صفحه به‌هم
     می‌ریزد؛ dvh ارتفاع واقعی و زنده‌ی صفحه را در نظر می‌گیرد. مرورگرهای
     قدیمی‌تر که dvh را نمی‌شناسند، همان مقدار vh را نگه می‌دارند. */
  max-height:88vh; max-height:88dvh; overflow-y:auto; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.modal-head b{ font-size:14px; }
.modal-hint{ font-size:12.5px; color:var(--text-soft); line-height:2; margin-bottom:12px; }
.modal textarea{ width:100%; min-height:110px; padding:10px 13px; border:1px solid var(--border);
  border-radius:9px; font-family:inherit; font-size:12.5px; line-height:1.9;
  box-sizing:border-box; background:var(--bg); color:var(--text); resize:vertical; }
.modal-file{ display:flex; align-items:center; gap:10px; margin-top:10px; font-size:12.5px; color:var(--text-soft); }
.modal-msg{ font-size:12.5px; margin-top:10px; min-height:16px; }
.modal-msg.error{ color:var(--alert); }

/* ═══ اطلاعات بیمار ═══ */
.ctx-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(150px,1fr)); gap:10px; }
.ctx-field label{ display:block; font-size:12.5px; font-weight:700; margin-bottom:4px; }
.ctx-field input{ width:100%; padding:8px 11px; border:1px solid var(--border); border-radius:8px;
  font-family:inherit; font-size:12px; background:var(--bg); color:var(--text); box-sizing:border-box; }
.ctx-field.highlight label{ color:var(--clay); }
.ctx-field.highlight input{ border-color:var(--clay); }
.ctx-wanted{ font-size:12.5px; color:var(--clay); background:var(--clay-light);
  border-radius:8px; padding:9px 12px; margin-bottom:12px; line-height:1.9; }
.kv-mini{ display:flex; justify-content:space-between; gap:10px; padding:6px 0;
  border-bottom:1px solid var(--border); font-size:12px; }
.kv-mini:last-of-type{ border-bottom:none; }
.kv-mini span{ color:var(--text-soft); }

/* ═══ تجویز ═══ */
.pres-content{ background:var(--bg); border-radius:9px; padding:11px 13px;
  font-size:12.5px; line-height:2; white-space:pre-wrap; margin-bottom:12px; }

.drug-cards{ display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.drug-card{ border:1.5px solid var(--border); border-radius:12px; padding:12px 14px; cursor:pointer; transition:border-color .15s; }
.drug-card:hover{ border-color:var(--accent); }
.drug-card.selected{ border-color:var(--accent); background:var(--accent-light); }
.drug-card-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.drug-priority{ font-size:11.5px; font-weight:700; color:var(--accent); background:var(--accent-light); padding:2px 8px; border-radius:999px; }
.drug-card.selected .drug-priority{ background:var(--surface); }
.drug-name{ font-size:13px; font-weight:800; }
.drug-rationale{ font-size:12.5px; color:var(--text-soft); line-height:1.9; margin-bottom:6px; }
.drug-caution{ font-size:12.5px; color:var(--alert); margin-bottom:8px; }
.drug-dose-input{ width:100%; padding:7px 10px; font-size:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.drug-card textarea{ width:100%; min-height:60px; margin-top:6px; padding:8px 10px; font-size:12px; border:1px solid var(--border); border-radius:8px; font-family:inherit; }

/* ═══ مقایسه ═══ */
.trend-badge{ font-size:13px; font-weight:800; margin-bottom:10px; }
.cmp-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.cmp-table th{ background:var(--bg); padding:7px 8px; text-align:right;
  font-size:11.5px; color:var(--text-soft); font-weight:700; }
.cmp-table td{ padding:7px 8px; border-bottom:1px solid var(--border); }
.cmp-table tr:last-child td{ border-bottom:none; }
.artifact{ color:var(--clay); font-weight:800; cursor:help; }

/* ═══ دکمه‌ی معرفی محصول در سایدبار ═══ */
.sb-promo{
  display:flex; align-items:center; gap:11px;
  margin:8px 12px 10px; padding:11px 13px;
  background:rgba(201,123,99,.14);
  border:1px solid rgba(201,123,99,.4);
  border-radius:11px; text-decoration:none; color:inherit;
  transition:background .15s ease;
}
.sb-promo:hover{ background:rgba(201,123,99,.24); }
.sb-promo svg{ color:var(--clay); flex-shrink:0; }
.sb-promo b{ display:block; font-size:12px; font-weight:700; color:#fff; }
.sb-promo span{ display:block; font-size:11.5px; color:#9DB8B2; margin-top:2px; line-height:1.6; }

/* ═══ انتخاب منبع تصویر ═══ */
.src-grid{ display:flex; flex-direction:column; gap:9px; margin-top:6px; }
.src-btn{
  display:flex; align-items:center; gap:11px; width:100%;
  padding:14px 16px; border:1px solid var(--border); border-radius:11px;
  background:var(--bg); color:var(--text);
  font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; text-align:right;
}
.src-btn:hover{ background:var(--accent-light); border-color:var(--accent); }
.src-btn svg{ width:21px; height:21px; color:var(--accent); flex-shrink:0; }

button.attach-btn{
  border:none; background:none; cursor:pointer; color:var(--text-soft);
  display:flex; align-items:center; justify-content:center;
}
button.attach-btn:hover{ color:var(--accent); }

/* ═══ دکمه‌های پایین سایدبار ═══ */
.sb-promo.alt{ background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.14); }
.sb-promo.alt:hover{ background:rgba(255,255,255,.12); }
.sb-promo.alt svg{ color:#9DB8B2; }

/* دکمه‌ی رفت‌وبرگشت بین فضای کاری و پنل */
.sb-switch{
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin:0 12px 10px; padding:11px 13px;
  background:rgba(47,111,99,.3); border:1px solid rgba(157,196,186,.4);
  border-radius:11px; text-decoration:none; color:#fff;
  font-size:12.5px; font-weight:700;
}
.sb-switch:hover{ background:rgba(47,111,99,.45); }
/* display:flex بالا ویژگی hidden را خنثی می‌کرد و برای همه یک دکمه‌ی خالی نمایش داده می‌شد */
.sb-switch[hidden], .sb-item[hidden]{ display:none; }

/* ═══ تیم و دسترسی مشترک ═══ */
.sb-badge{ background:var(--clay); color:#fff; font-size:11px; font-weight:800;
  min-width:17px; height:17px; border-radius:9px; display:flex; align-items:center;
  justify-content:center; padding:0 5px; margin-right:auto; }

/* اطلاع‌رسانی دسترسی مشترک — همیشه دیده می‌شود تا هر دو طرف بدانند */
.sb-shared{
  margin:0 12px 10px; padding:10px 12px;
  background:rgba(201,123,99,.16); border:1px solid rgba(201,123,99,.4);
  border-radius:10px; font-size:11.5px; line-height:1.9; color:#E8D5CE;
}
.sb-shared b{ color:#fff; }

/* ═══ انتخاب موتور تحلیل ═══ */
.engine-row{
  display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  margin-top:9px; padding:0 2px;
}
.engine-lab{ font-size:11.5px; color:var(--text-soft); font-weight:700; }
.engine-opts{ display:flex; gap:6px; flex-wrap:wrap; flex:1; }

.engine-opt{
  display:flex; align-items:center; gap:6px;
  background:var(--surface); border:1.5px solid var(--border);
  border-radius:10px; padding:8px 13px; min-height:38px;
  font-family:inherit; font-size:12.5px; font-weight:700;
  color:var(--text); cursor:pointer; transition:all .14s;
}
.engine-opt:hover{ border-color:var(--accent); }
.engine-opt.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
.engine-opt .cost{
  font-size:11px; font-weight:800; background:var(--bg); color:var(--text-soft);
  border-radius:8px; padding:1px 6px;
}
.engine-opt.on .cost{ background:rgba(255,255,255,.22); color:#fff; }

/* دایره‌ی راهنما */
.engine-info{
  border:none; background:none; padding:4px 2px;
  color:var(--accent); font-family:inherit; font-size:12.5px; font-weight:700;
  text-decoration:underline; text-underline-offset:3px;
  cursor:pointer; flex-shrink:0;
}
.engine-info:hover{ border-color:var(--accent); color:var(--accent); }

/* ═══ دکمه‌ی شروع تحلیل ═══ */
.cta-start{
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:13px;
  background:var(--accent); color:#fff; border:none; border-radius:11px;
  font-family:inherit; font-size:13.5px; font-weight:800; cursor:pointer;
  transition:background .15s;
}
.cta-start:hover{ background:var(--accent-dark); }
.cta-start svg{ flex-shrink:0; }

/* ═══ جدول مقایسه‌ی موتورها ═══ */
.eng-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
  gap:11px; margin-bottom:6px; }
.eng-cards > *{ min-width:0; }
.eng-card{ border:1.5px solid var(--border); border-radius:12px; padding:14px; }
.eng-card.pro{ border-color:var(--accent); background:var(--accent-light); }
.eng-name{ font-size:14px; font-weight:800; display:flex; align-items:center;
  justify-content:space-between; gap:8px; flex-wrap:wrap; }
.eng-cost{ font-size:11.5px; font-weight:800; background:var(--clay); color:#fff;
  border-radius:9px; padding:2px 8px; }
.eng-tag{ font-size:12.5px; color:var(--clay); font-weight:700; margin-top:4px; }
.eng-desc{ font-size:12.5px; color:var(--text-soft); line-height:2; margin-top:7px; }

/* ═══ دکمه‌های انتخاب دوگزینه‌ای ═══
   قبلاً استایلی نداشتند و شبیه متن ساده بودند؛ حالت انتخاب‌شده هم
   هیچ نشانه‌ای نداشت. */
.toggle-group{ display:flex; gap:7px; }
.toggle-btn{
  flex:1; padding:10px 14px;
  background:var(--surface); border:1.5px solid var(--border); border-radius:10px;
  font-family:inherit; font-size:13px; font-weight:700; color:var(--text);
  cursor:pointer; transition:all .14s; position:relative;
}
.toggle-btn:hover{ border-color:var(--accent); background:var(--accent-light); }
.toggle-btn.on{
  background:var(--accent); border-color:var(--accent); color:#fff;
  box-shadow:0 2px 8px rgba(47,111,99,.28);
}
/* تیک، تا انتخاب فقط با رنگ منتقل نشود */
.toggle-btn.on::after{
  content:'✓'; margin-right:6px; font-size:12px; font-weight:900;
}

/* ═══ دکمه‌ی شناور ورود/ثبت‌نام ═══
   در صفحاتی که بدون لاگین باز می‌شوند (معرفی، آموزش، پلن‌ها) و ممکن است
   کاربر مستقیم به آن‌ها برسد، نه فقط از صفحه‌ی اول. */
.float-auth{
  position:fixed; bottom:20px; left:20px; z-index:200;
  display:flex; align-items:center; gap:8px;
  background:linear-gradient(135deg,#C97B63,#B96C55);
  color:#fff; text-decoration:none;
  padding:12px 18px; border-radius:30px;
  font-family:'Vazirmatn',Tahoma,sans-serif; font-size:12.5px; font-weight:800;
  box-shadow:0 6px 18px rgba(185,108,85,.4);
  transition:transform .15s ease;
}
.float-auth:hover{ transform:translateY(-2px); }
.float-auth svg{ flex-shrink:0; }

@media (max-width:480px){
  .float-auth{ bottom:14px; left:14px; padding:10px 15px; font-size:12.5px; }
}

/* راهنمای بازدیدکننده‌ی بدون حساب در صفحه‌ی قیمت‌ها */
.guest-note{
  background:var(--clay-light); border:1px solid var(--clay);
  border-radius:11px; padding:11px 15px; margin-bottom:16px;
  font-size:12.5px; color:var(--text); line-height:1.9;
}

/* ═══ دکمه‌ی «درخواست‌های دستیار» — قبل از دعوت اولین دستیار کم‌رنگ است ═══
   خودِ دکمه در سایدبار محو نمی‌شود، فقط حالت غیرفعال دارد تا کاربر بداند
   چرا کار نمی‌کند، و کلیک روی آن راهنما نشان می‌دهد نه صفحه‌ی خالی. */
button#reqLink{
  width:100%; text-align:right; background:none; border:none;
  cursor:pointer; opacity:.5; font-family:inherit;
}
button#reqLink.active{ opacity:1; }
button#reqLink:hover{ background:rgba(255,255,255,0.07); }

/* ═══ بنر وضعیت پرداخت کارت‌به‌کارت ═══ */
.mp-banner{
  margin:12px 16px 0; padding:12px 16px; border-radius:11px;
  font-size:12.5px; line-height:1.9; display:flex; justify-content:space-between;
  align-items:center; gap:10px; flex-wrap:wrap;
}
.mp-banner.ok{ background:var(--accent-light); color:var(--accent-dark); border:1px solid var(--accent); }
.mp-banner.bad{ background:var(--clay-light); color:var(--clay); border:1px solid var(--clay); }
.mp-banner button{ background:#fff; border:1px solid currentColor; color:inherit;
  padding:6px 13px; border-radius:8px; font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; flex-shrink:0; }

/* ═══ پیشنهاد ارتقا ═══ */
.upgrade-hint{
  background:var(--clay-light); border:1px solid var(--clay);
  border-radius:11px; padding:12px 15px; margin-top:14px;
}
.uh-head{ display:flex; align-items:center; gap:7px; font-size:12.5px;
  font-weight:800; color:var(--clay); }
.upgrade-hint p{ font-size:12px; line-height:2; margin-top:6px; color:var(--text); }
.uh-reasons{ margin:8px 0 0; padding-right:18px; }
.uh-reasons li{ font-size:12.5px; color:var(--text-soft); line-height:1.9; }

/* ═══ تصمیم نهایی ═══ */
.dec-section{ margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.dec-section:first-of-type{ border-top:none; padding-top:0; }
.dec-title{ font-size:13px; font-weight:800; margin-bottom:9px; }

.dec-opt{
  display:flex; gap:10px; align-items:flex-start;
  border:1.5px solid var(--border); border-radius:11px;
  padding:11px 13px; margin-bottom:8px; cursor:pointer; transition:all .14s;
}
.dec-opt:hover{ border-color:var(--accent); }
.dec-opt.on{ border-color:var(--accent); background:var(--accent-light); }
.dec-opt input{ margin-top:3px; flex-shrink:0; }
.dec-pri{
  width:21px; height:21px; border-radius:50%; background:var(--bg);
  color:var(--text-soft); font-size:12.5px; font-weight:800; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
.dec-opt.on .dec-pri{ background:var(--accent); color:#fff; }
.dec-body{ flex:1; min-width:0; }
.dec-body b{ font-size:12.5px; display:block; }
.dec-reason{ display:block; font-size:12.5px; color:var(--text-soft); line-height:1.9; margin-top:3px; }
.dec-caution{ display:block; font-size:11.5px; color:var(--clay); line-height:1.8; margin-top:3px; }
.dec-free{
  width:100%; margin-top:6px; padding:7px 10px;
  border:1px solid var(--border); border-radius:8px;
  font-family:inherit; font-size:12px; box-sizing:border-box;
  background:var(--surface); color:var(--text);
}
.dec-withheld{
  background:var(--bg); border:1px dashed var(--border); border-radius:9px;
  padding:11px 13px; font-size:12.5px; color:var(--text-soft); line-height:1.9;
  margin-bottom:9px;
}

/* ═══ پنجره‌ی علت ═══ */
.reason-list{ display:flex; flex-direction:column; gap:7px; }
.reason-opt{
  display:flex; align-items:center; gap:8px; font-size:12.5px;
  border:1px solid var(--border); border-radius:9px; padding:9px 12px; cursor:pointer;
}
.reason-opt:hover{ border-color:var(--accent); }
.reason-note{
  font-size:11.5px; color:var(--text-soft); line-height:1.9; margin-top:10px;
  background:var(--bg); border-radius:8px; padding:9px 11px;
}

/* ═══ سابقه ═══ */
.hist-row{ border-bottom:1px solid var(--border); padding:10px 0; }
.hist-row:last-child{ border-bottom:none; }
.hist-meta{ font-size:12.5px; color:var(--text-soft); line-height:1.9; margin-top:4px; }

/* ═══ جدول مقایسه‌ی موتور در چت ═══ */
.eng-table{ width:100%; border-collapse:collapse; margin-top:14px; font-size:12px; }
.eng-table th{ background:var(--bg); padding:9px 10px; text-align:center; font-weight:800; }
.eng-table th:first-child{ text-align:right; }
.eng-table td{ padding:8px 10px; border-bottom:1px solid var(--border); text-align:center; }
.eng-table td:first-child{ text-align:right; color:var(--text-soft); }
.eng-table td.y{ color:var(--accent-dark); font-weight:800; }
.eng-table td.n{ color:var(--border); }
.eng-table td.dim{ color:var(--text-soft); font-size:12.5px; }
.eng-table tr.hl td{ background:var(--accent-light); }
.eng-table tr:last-child td{ border-bottom:none; }

/* ═══ مدارک قبلی بیمار ═══ */
#priorDocsBox{ border-top:1px solid var(--border); margin-top:12px; padding-top:12px; }
.prior-t{ font-size:12px; font-weight:800; margin-bottom:7px; }
.prior-t span{ font-weight:400; color:var(--text-soft); font-size:11.5px; }
.prior-note{ font-size:11.5px; color:var(--text-soft); line-height:1.9; margin-top:7px;
  background:var(--bg); border-radius:8px; padding:8px 11px; }
.prior-note.active{ background:var(--accent-light); color:var(--accent-dark); }

/* ═══ قدم بعدی در گزارش ═══ */
.rc-step{ margin:0 16px 12px; padding:14px; border-radius:12px; background:var(--accent-light); border:1px solid rgba(47,111,99,.25); }
.rc-step-title{ font-size:14px; font-weight:800; color:var(--accent-dark); }
.rc-step-sub{ font-size:12.5px; color:var(--text-soft); margin:2px 0 10px; }
.rc-step-btns{ display:flex; gap:8px; flex-wrap:wrap; }
.rc-step-btns .rc-btn{ font-size:13px; padding:10px; }
.rc-step-done{ font-size:13.5px; font-weight:700; color:var(--accent-dark); margin-bottom:10px; }
.rc-step .rc-pdf{ width:100%; font-size:14px; padding:12px; }
.rc-tools{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; padding:0 16px 16px; }
.rc-tools-label{ font-size:12px; color:var(--text-soft); width:100%; }
.rc-tools .rc-btn{ flex:0 1 auto; font-size:12px; padding:8px 12px; min-width:0; }
.rc-btn[hidden]{ display:none; }
.rc-legal{ margin-top:10px; padding-top:8px; border-top:1px solid var(--border); font-size:12px; color:var(--text-soft); }
.rc-legal summary{ cursor:pointer; text-align:center; }
.rc-legal div{ margin-top:6px; line-height:1.9; font-size:12.5px; }

/* فرم پروفایل (حساب کاربری) */
.pf-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; margin-top:12px; }
.pf-field label{ display:block; font-size:12.5px; font-weight:700; margin-bottom:5px; }
.pf-field input, .pf-field select{ width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid var(--border);
  border-radius:9px; font-family:inherit; font-size:14px; background:var(--bg); color:inherit; }
.pf-field input:disabled{ opacity:.7; }
.pf-field.empty input{ border-color:var(--clay,#C08A5B); }
.pf-hint{ font-size:12px; color:var(--text-soft); margin-top:5px; line-height:1.8; }
#profile, #license{ scroll-margin-top:16px; }
#license:target, #profile:target{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.lic-state{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:8px 0 12px; }
.lic-badge{ display:inline-flex; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:800; background:var(--bg); color:var(--text-soft); }
.lic-badge.ok{ background:var(--accent-light); color:var(--accent-dark); }
.lic-badge.wait{ background:var(--clay-light,#FAEDE8); color:var(--clay-dark,#B96C55); }
.lic-badge.bad{ background:#F8E3DF; color:var(--alert); }
.sb-badge[hidden]{ display:none; }

/* لوگوی اسکینوب به‌جای دایره: روی پس‌زمینه‌ی تیره سفید، روی روشن سبز */
.sidebar .logo-ring{ border:none !important; border-radius:0 !important; width:32px !important; height:32px !important;
  background:url(brand/mark-white.png) center/contain no-repeat; }
.sidebar .logo-ring::after{ display:none !important; }
.auth-logo .ring{ border:none; border-radius:0; width:34px; height:34px; background:url(brand/mark-green.png) center/contain no-repeat; }
.engine-opt.is-short{ opacity:.45; cursor:not-allowed; }

/* انتخاب «همین بیمار / بیماری جدید / بیمار دیگر» برای عکس داخل پرونده */
.cc-opts{ display:flex; flex-direction:column; gap:8px; margin:6px 0 10px; }
.cc-opt{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:right; padding:12px 14px;
  border:1.5px solid var(--border); border-radius:12px; background:var(--bg); cursor:pointer; font-family:inherit; color:inherit; }
.cc-opt b{ font-size:14px; } .cc-opt span{ font-size:12.5px; color:var(--text-soft); }
.cc-opt:hover, .cc-opt.on{ border-color:var(--accent); background:var(--accent-light); }
.cc-label{ display:block; font-size:13px; font-weight:700; margin:6px 0 5px; }
.cc-note{ width:100%; box-sizing:border-box; border:1px solid var(--border); border-radius:10px; padding:10px 12px;
  font-family:inherit; font-size:13.5px; background:var(--bg); color:inherit; resize:vertical; }

/* ═══ تجویز چنددارویی ═══ */
.rx-modal{ max-width:600px; }
.rx-sugg{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:4px 0 10px; font-size:12.5px; color:var(--text-soft); }
.rx-chip{ border:1px dashed var(--accent); background:var(--accent-light); color:var(--accent-dark); border-radius:16px;
  padding:4px 10px; font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.rx-chip:hover{ background:#fff; }
.rx-row{ display:grid; grid-template-columns:22px 1.1fr 1.4fr 26px; gap:6px; align-items:center; margin-bottom:6px; }
.rx-n{ font-size:12px; color:var(--text-soft); text-align:center; }
.rx-row input, .rx-visit input{ width:100%; box-sizing:border-box; border:1px solid var(--border); border-radius:9px; padding:9px 10px;
  font-family:inherit; font-size:13.5px; background:var(--bg); color:inherit; }
.rx-x{ border:none; background:none; font-size:20px; color:var(--alert); cursor:pointer; }
.rx-visit{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.rx-visit input{ width:auto; min-width:150px; }
.rx-list{ margin:4px 18px 8px 0; padding:0; font-size:13.5px; line-height:2; }
.rx-hist{ margin-top:12px; font-size:12px; color:var(--text-soft); }
.rx-hist pre{ white-space:pre-wrap; font-family:inherit; background:var(--bg); border-radius:8px; padding:6px 8px; margin:4px 0 8px; }
@media (max-width:560px){ .rx-row{ grid-template-columns:18px 1fr 26px; } .rx-dose{ grid-column:2 / 3; } }
.cc-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; z-index:9999; padding:16px; }
.cc-box{ background:var(--surface, #fff); border-radius:16px; padding:20px; width:100%; max-width:380px; }
.cc-box h3{ margin:0; font-size:15px; }

/* آواتار پیام‌ها: لوگوی اسکینوب برای هوش مصنوعی؛ آیکون نقش برای کاربر */
.msg-avatar.ai{ background:var(--accent-dark) url(brand/mark-white.png) center/62% no-repeat; }
.msg-avatar.user{ background:var(--clay) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7.5' r='3.5'/%3E%3Cpath d='M5 21c0-4 3-6.5 7-6.5s7 2.5 7 6.5'/%3E%3Cpath d='M12 15v3.5M10.3 16.8h3.4'/%3E%3C/svg%3E") center/64% no-repeat; }
body[data-avatar="assistant"] .msg-avatar.user{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='3.3'/%3E%3Cpath d='M3.5 20.5c0-3.6 2.8-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Cpath d='M16.5 10.5l1.8 1.8 3.4-3.6'/%3E%3C/svg%3E"); }
body[data-avatar="clinic"] .msg-avatar.user{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 21V9.5L12 4.5l8.5 5V21z'/%3E%3Cpath d='M10 21v-4.5h4V21M12 8.5v4M10 10.5h4'/%3E%3C/svg%3E"); }
/* حلقه‌ی قدیمی بالای چت و صفحه‌ها → لوگو */
.brand-ring{ border:none !important; border-radius:0 !important; background:url(brand/mark-green.png) center/contain no-repeat !important; }
.brand-ring::after{ display:none !important; }
.logo-ring{ border:none !important; border-radius:0 !important; background:url(brand/mark-green.png) center/contain no-repeat !important; }
.sidebar .logo-ring, .admin-sidebar .logo-ring{ background-image:url(brand/mark-white.png) !important; }
.logo-ring::after{ display:none !important; }
/* نوار اعلان (لایسنس، پروفایل) — جمع‌وجور، در همه‌ی صفحه‌ها */
.notice{ display:flex; align-items:center; gap:8px 10px; flex-wrap:wrap; margin:8px 0 0; padding:7px 10px 7px 12px; border-radius:10px;
  background:var(--surface,#fff); border:1px solid var(--border,#E1E7E6); border-inline-start:3px solid var(--clay,#C97B63);
  font-size:12.5px; line-height:1.65; box-shadow:0 1px 3px rgba(18,38,42,.05); }
.notice > span{ flex:1 1 200px; min-width:0; }
.notice a.go{ background:var(--accent,#2F6F63); color:#fff; text-decoration:none; padding:4px 11px; border-radius:999px; font-weight:700; font-size:12px; white-space:nowrap; }
.notice.ok{ border-inline-start-color:var(--accent,#2F6F63); }
#licenseNotice .notice{ margin-bottom:6px; }

/* انتخاب موتور در گوشی: دو دکمه کنار هم در یک خط، راهنما یک «؟» کوچک */
.engine-info .ei-q{ display:none; }
@media (max-width:560px){
  .engine-row{ flex-wrap:nowrap; gap:6px; }
  .engine-lab{ display:none; }
  .engine-opts{ flex-wrap:nowrap; gap:5px; min-width:0; }
  .engine-opt{ flex:1 1 0; min-width:0; justify-content:center; padding:7px 8px; min-height:36px; font-size:12px; gap:4px; white-space:nowrap; }
  .engine-opt .cost{ font-size:10px; padding:1px 5px; }
  .engine-info{ flex:0 0 auto; text-decoration:none; padding:0; }
  .engine-info .ei-t{ display:none; }
  .engine-info .ei-q{ display:grid; place-items:center; width:26px; height:26px; border-radius:50%; border:1.5px solid var(--accent); font-size:14px; line-height:1; }
}
/* پنل لایسنس */
.lic-sub{ font-weight:400; font-size:12px; color:var(--text-soft); }
.lic-form{ display:grid; grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr)); gap:12px 14px; background:var(--bg); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:14px; align-items:end; }
.lic-form label{ display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:700; color:var(--text-soft); margin:0; }
.lic-form label.chk{ flex-direction:row; align-items:center; gap:7px; font-weight:600; color:var(--text); padding-bottom:9px; }
.lic-form label.chk input{ width:auto; }
.lic-form input:not([type=checkbox]), .lic-form select{ width:100%; box-sizing:border-box; font:inherit; font-size:13px; padding:9px 11px; height:40px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); }
.lic-form input:focus, .lic-form select:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.lic-form .wide{ grid-column:1 / -1; }
.lic-form .row-btns{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.lic-msg{ font-size:12.5px; font-weight:700; }
.lic-new{ background:var(--accent-light); border-radius:12px; padding:12px 14px; margin-bottom:12px; font-size:13px; }
.lic-new textarea{ width:100%; box-sizing:border-box; margin-top:6px; font-family:'IBM Plex Mono',monospace; font-size:13px; border:1px solid var(--border); border-radius:8px; padding:8px; }

/* ترتیب گزارش: محتمل‌ترین، یافته‌ها، تشخیص‌ها، قدم بعدی، درمان */
.rc-lead{ display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; background:var(--accent-dark); color:#fff; border-radius:10px; padding:9px 12px; margin:0 0 12px; }
.rc-lead span{ font-size:11.5px; color:#9DCFC2; } .rc-lead b{ font-size:15px; }
.rc-no{ display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--accent-dark); color:#fff; font-size:11px; margin-left:7px; vertical-align:1px; }
.rc-rank{ color:var(--text-soft); font-weight:800; margin-left:6px; font-size:12px; }
.rc-diag.rc-top{ border-right-color:var(--clay); background:#FCF8F5; }
.rc-fdesc{ font-weight:400; color:var(--text-soft); font-size:12px; }
.rc-more{ margin-top:12px; font-size:12.5px; } .rc-more summary{ cursor:pointer; color:var(--text-soft); font-weight:700; }
.rc-sub-title{ font-size:12px; font-weight:800; color:var(--text-soft); margin:8px 0 2px; }
.rc-pdf-full{ font-size:12px; background:none; border:none; color:var(--text-soft); text-decoration:underline; padding:6px 4px; }

/* سربرگ نسخه در حساب کاربری */
.lh-opts{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; margin:12px 0; }
.lh-opt{ display:grid; gap:2px; border:1.5px solid var(--border); border-radius:12px; padding:10px 12px; cursor:pointer; }
.lh-opt input{ display:none; } .lh-opt.on{ border-color:var(--accent); background:var(--accent-light); }
.lh-opt span{ font-size:12px; color:var(--text-soft); }
.lh-prev{ font-size:12.5px; background:var(--bg); border-radius:10px; padding:9px 12px; color:var(--text-soft); }
.lh-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; } .lh-wide{ grid-column:1/-1; }
@media (max-width:600px){ .lh-grid{ grid-template-columns:1fr; } }
.lh-grid input, .lh-grid textarea{ width:100%; box-sizing:border-box; font:inherit; padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--bg); }
.lh-img{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lh-img img{ max-height:56px; max-width:140px; border-radius:8px; border:1px solid var(--border); background:#fff; object-fit:contain; }
.lh-up{ cursor:pointer; display:inline-block; padding:7px 14px; font-size:13px; }
.lh-chk{ display:flex; align-items:center; gap:6px; font-size:13px; margin-top:6px; }
.rx-tpl{ display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 10px; } .rx-tpl select{ flex:1; min-width:160px; font:inherit; padding:8px 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }

/* ═══ گزارش تحلیل — v2.16 ═══ */
.rc-img{ width:100%; max-height:260px; object-fit:contain; background:#EEF2F1; border-radius:10px; margin-bottom:14px; }
.rc-sev.ev-strong{ background:var(--accent-dark); color:#fff; }
.rc-sev.ev-mid{ background:var(--accent-light); color:var(--accent-dark); }
.rc-sev.ev-weak{ background:#EEF0F0; color:var(--text-soft); }
.rc-en{ display:block; font-size:11px; font-weight:500; color:var(--text-soft); margin-top:1px; text-align:right; unicode-bidi:plaintext; }
.rc-lead i{ font-style:normal; font-size:11.5px; color:#B9D3CC; }
.rc-lead em{ font-style:normal; font-size:10.5px; background:rgba(255,255,255,.14); color:#E6F2EF; padding:2px 8px; border-radius:20px; margin-inline-start:auto; }
.rc-head-end{ display:flex; align-items:center; gap:8px; }
.rc-engine{ font-size:11px; font-weight:800; padding:4px 10px; border-radius:20px; white-space:nowrap; direction:ltr; }
.rc-engine.lens{ background:rgba(255,255,255,.14); color:#E6F2EF; }
.rc-engine.derma{ background:var(--clay); color:#fff; }
.rx-opt{ display:flex; gap:10px; border:1px solid var(--border); border-radius:10px; padding:10px 12px; margin-bottom:8px; background:var(--surface); }
.rx-opt.first{ border-color:var(--clay); background:#FCF8F5; }
.rx-num{ flex:0 0 24px; height:24px; border-radius:50%; background:var(--accent-dark); color:#fff; font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.rx-opt.first .rx-num{ background:var(--clay); }
.rx-body{ flex:1; min-width:0; }
.rx-drug{ font-size:13px; font-weight:800; color:var(--text); unicode-bidi:plaintext; text-align:right; }
.rx-for{ font-size:11px; color:var(--accent-dark); font-weight:700; margin-top:2px; }
.rx-body p{ font-size:12.5px; line-height:1.9; margin-top:4px; color:var(--text); }
.rx-caution{ color:var(--alert) !important; }
.rx-withheld{ border:1px dashed var(--clay); background:#FCF8F5; border-radius:10px; padding:10px 12px; margin:6px 0 10px; }
.rx-withheld b{ font-size:12.5px; color:#8A4A36; }
.rx-withheld p{ font-size:12px; line-height:1.9; margin-top:4px; }
@media (max-width:560px){
  .rc-findings{ grid-template-columns:1fr; }
  .msg-row.ai .msg-avatar{ display:none; }
  .msg-row.ai > div[style*="max-width:92%"]{ max-width:100% !important; }
}

/* ═══ محصولات همکار ═══ */
.partner-slot:empty{ display:none; }
.partner-slot{ margin:14px 0 6px; padding-top:12px; border-top:1px dashed var(--border); }
.pp-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.pp-tag{ font-size:10.5px; font-weight:700; color:#8A4A36; background:var(--clay-light); border-radius:20px; padding:2px 9px; white-space:nowrap; }
.pp-intro{ font-size:11.5px; line-height:1.95; color:var(--text-soft); margin-bottom:9px; }
.pp-card{ display:flex; gap:11px; border:1px solid var(--border); border-radius:11px; padding:11px 12px; margin-bottom:8px; background:var(--surface); }
.pp-img{ width:64px; height:64px; flex-shrink:0; border-radius:9px; object-fit:contain; background:#F4F6F5; border:1px solid var(--border); }
.pp-body{ flex:1; min-width:0; }
.pp-top{ display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; }
.pp-top b{ font-size:13px; } .pp-brand{ font-size:11.5px; color:var(--text-soft); font-weight:700; }
.pp-cat{ font-size:10.5px; color:var(--accent-dark); font-weight:700; margin-top:1px; }
.pp-body p{ font-size:12px; line-height:1.9; margin:4px 0 0; color:var(--text); }
.pp-meta{ margin-top:5px; font-size:11.5px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pp-rate b{ color:#B9852F; } .pp-rate em{ font-style:normal; font-size:10.5px; font-weight:700; background:var(--accent-light); color:var(--accent-dark); border-radius:20px; padding:1px 8px; margin-inline-start:6px; }
.pp-rate-none{ color:var(--text-soft); } .pp-thanks{ color:var(--accent); font-weight:700; }
.pp-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }
.pp-actions .rc-btn{ padding:6px 12px; font-size:12px; }
.pp-myrate{ font-size:11.5px; color:var(--text-soft); display:flex; align-items:center; gap:4px; }
.pp-stars{ display:inline-flex; direction:ltr; }
.pp-star{ border:0; background:none; cursor:pointer; font-size:17px; line-height:1; padding:0 1px; color:#D8DCDB; }
.pp-star.on{ color:#E0A63A; } .pp-star:hover{ transform:scale(1.15); }
.rx-sugg.rx-partner{ background:#FCF8F5; border:1px dashed var(--clay); border-radius:9px; padding:7px 9px; }
.rx-chip.partner{ border-color:var(--clay); color:#8A4A36; }
