:root {
  --bg: #f7f5f0;
  --bg-soft: #e8efe9;
  --fg: #1a2e28;
  --muted: #5a6f66;
  --primary: #1b5e4b;
  --primary-dark: #134437;
  --accent: #c4783a;
  --card: #fff;
  --line: #d5e0da;
  --danger: #b33a3a;
  --success: #1f7a4d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Vazirmatn, Tahoma, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
#particle-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.site-layer { position: relative; z-index: 1; }
.container-page { width: min(1200px, calc(100% - 2rem)); margin-inline: auto; }
.container-page-wide { width: min(1240px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid rgba(213,224,218,.7);
  background: rgba(247,245,240,.88);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 64px;
}
.brand { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.nav-links { display: none; gap: 1.5rem; font-size: .9rem; color: var(--muted); }
.nav-links a:hover { color: var(--primary); }
.header-actions { display: flex; gap: .5rem; align-items: center; }
.user-name { font-size: .85rem; color: var(--muted); display: none; }
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .user-name { display: inline; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: .65rem; padding: .7rem 1.25rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }

.input, textarea, select {
  width: 100%; border: 1px solid var(--line); background: #fff;
  border-radius: .65rem; padding: .7rem .9rem; font-family: inherit; font-size: 1rem;
}
.input-rtl {
  direction: rtl;
  text-align: right;
}
.input-rtl::placeholder {
  text-align: right;
  direction: rtl;
}
select.input,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-left: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23334155' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.95rem center;
  background-size: 0.7rem;
  cursor: pointer;
}
.label { display: block; margin-bottom: .35rem; font-size: .9rem; color: var(--muted); }
.label-ltr {
  direction: ltr;
  text-align: left;
}
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1.25rem;
}
.badge {
  display: inline-flex; border-radius: 999px; padding: .2rem .7rem;
  font-size: .8rem; background: var(--bg-soft); color: var(--primary-dark);
}
.media-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.media-stat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .75rem;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.media-stat-video { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.media-stat-audio { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.media-stat-empty { background: var(--bg-soft); color: var(--muted); }
.media-stat-icon { font-size: .7rem; opacity: .85; }
.media-stat-num { font-weight: 700; }
.media-stat-label { font-size: .72rem; }
.muted { color: var(--muted); }
.grid-3 { display: grid; gap: 1.25rem; }
.grid-2 { display: grid; gap: 1.25rem; }
.articles-showcase {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
  grid-template-columns: 1fr;
}
.doctors-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: .85rem;
  width: 100%;
}
@media (min-width: 768px) {
  .articles-showcase {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .doctors-showcase .doctor-card {
    /* عرض هر کاشی ≈ ۲/۳ ستون قبلی؛ گروه از وسط چیده می‌شود */
    flex: 0 1 calc((66.666% - 1.7rem) / 3);
    width: calc((66.666% - 1.7rem) / 3);
    max-width: calc((66.666% - 1.7rem) / 3);
  }
}
.article-card {
  height: 100%;
  min-height: 17.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.doctor-card {
  height: 100%;
  min-height: 11.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: .85rem;
}
.doctor-card .avatar {
  width: 38px;
  height: 38px;
  margin-bottom: .65rem;
  font-size: .9rem;
}
.doctor-card-name {
  margin: .5rem 0 0;
  font-size: .95rem;
  line-height: 1.45;
  height: calc(1.45em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doctor-card-specialty {
  color: var(--primary);
  margin: .25rem 0 0;
  font-size: .8rem;
  line-height: 1.45;
  height: 1.45em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doctor-card-bio {
  margin-top: .5rem;
  margin-bottom: 0;
  font-size: .8rem;
  line-height: 1.7;
  height: calc(1.7em * 2);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-title {
  margin: .75rem 0 0;
  line-height: 1.7;
  height: calc(1.7em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-excerpt {
  margin-top: .75rem;
  margin-bottom: 0;
  font-size: .9rem;
  line-height: 1.8;
  height: calc(1.8em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 0 0 auto;
}
.articles-footer-link {
  margin-top: 1rem;
  text-align: left;
}
.articles-all-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  padding-inline: .25rem;
}
.articles-all-link:hover {
  text-decoration: underline;
}
.home-tests-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}
.home-test-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: .7rem .85rem;
}
.home-test-chip-title {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.45;
}
.home-main-grid {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}
.home-content-col {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  min-width: 0;
}
.home-tests-col {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.home-tests-head {
  flex-shrink: 0;
}
.home-tests-head .muted {
  font-size: .85rem;
  line-height: 1.6;
}
@media (min-width: 900px) {
  .home-main-grid {
    grid-template-columns: 1fr auto;
    gap: 1.5rem 2.25rem;
  }
  .home-tests-col {
    width: 13.5rem;
    justify-self: start;
  }
  .home-tests-head .muted {
    white-space: nowrap;
    font-size: .8rem;
  }
  .home-tests-grid {
    grid-template-rows: repeat(10, minmax(0, 1fr));
  }
}
@media (max-width: 899px) {
  .home-main-grid {
    grid-template-columns: 1fr;
  }
  .home-tests-col {
    order: 2;
  }
}
.home-test-chip-tip {
  position: absolute;
  z-index: 20;
  left: 50%;
  right: auto;
  bottom: calc(100% + .65rem);
  transform: translateX(-50%) translateY(.35rem);
  width: max-content;
  max-width: 16rem;
  padding: .7rem .85rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.6;
  white-space: normal;
  text-align: center;
  box-shadow: 0 10px 28px rgba(26, 46, 40, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.home-test-chip:hover .home-test-chip-tip,
.home-test-chip:focus-visible .home-test-chip-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.hero-surface {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: #134437;
}
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s ease, transform 6s ease;
  will-change: opacity, transform;
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(rgba(15,40,34,.62), rgba(15,40,34,.42));
  pointer-events: none;
}
.hero-surface h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.3; max-width: 36rem; margin: 0; }
.hero-surface .eyebrow { letter-spacing: .2em; font-size: .85rem; opacity: .85; margin-bottom: .75rem; }
.hero-inner {
  position: relative;
  z-index: 3;
  padding: 7rem 0 4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  gap: .45rem;
  align-items: center;
}
.hero-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.7);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background .2s ease, width .2s ease;
}
.hero-dot.is-active {
  background: #fff;
  width: 1.35rem;
}
.btn-ghost { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff; }

.section { margin-top: 4rem; margin-bottom: 2rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; font-size: 1.6rem; }

.home-assistant-tile {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-top: 2.75rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1.25rem;
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(circle at 12% 20%, rgba(126, 214, 181, .35), transparent 42%),
    linear-gradient(135deg, #f3fbf7 0%, #e4f3ec 55%, #d7ebe2 100%);
  border: 1px solid rgba(26, 92, 74, .14);
  box-shadow: 0 14px 36px rgba(26, 46, 40, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.home-assistant-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(26, 46, 40, .12);
}
.home-assistant-icon {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  display: grid;
  place-items: center;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(26, 92, 74, .1);
}
.home-assistant-copy {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.home-assistant-eyebrow {
  font-size: .78rem;
  color: var(--primary);
  font-weight: 600;
}
.home-assistant-title {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.55;
  color: #14352c;
}
.home-assistant-cta {
  margin-top: .2rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--primary);
}
@media (max-width: 560px) {
  .home-assistant-tile {
    align-items: flex-start;
    padding: 1.15rem 1.1rem;
  }
  .home-assistant-icon {
    width: 3.6rem;
    height: 3.6rem;
  }
  .home-assistant-icon svg {
    width: 44px;
    height: 44px;
  }
}

.card-link { transition: transform .15s ease; display: block; }
.card-link:hover { transform: translateY(-4px); }
.avatar {
  width: 56px; height: 56px; border-radius: 999px; background: var(--bg-soft);
  display: grid; place-items: center; font-weight: 700; color: var(--primary); margin-bottom: 1rem;
}
.line-clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); background: #eef4f0; }
.footer-grid { display: grid; gap: 2rem; padding: 3rem 0; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-title { font-weight: 700; margin-bottom: .75rem; }
.footer-grid a { display: block; color: var(--muted); margin-bottom: .4rem; font-size: .9rem; }
.footer-contact {
  line-height: 1.9;
  margin: .55rem 0 0;
  font-size: .88rem;
}
.footer-contact a {
  display: inline;
  color: var(--primary);
  font-weight: 600;
  margin: 0;
}
.footer-social {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .7rem;
}
.footer-social-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 !important;
  border-radius: .65rem;
  color: #fff !important;
  transition: transform .15s ease, opacity .15s ease;
}
.footer-social-link:hover {
  transform: translateY(-1px);
  opacity: .92;
}
.footer-social-whatsapp { background: #25d366; }
.footer-social-telegram { background: #2aabee; }
.footer-social-instagram {
  background: linear-gradient(45deg, #f58529, #dd2a7b 50%, #8134af);
}
.footer-address {
  line-height: 1.85;
  margin: .65rem 0 0;
  font-size: .88rem;
}
.footer-map {
  display: block;
  margin: 0;
  border-radius: .85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  max-width: 16rem;
}
.footer-map iframe {
  display: block;
  width: 100%;
  height: 9.5rem;
  border: 0;
  pointer-events: none;
}
.footer-copy {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 1rem 1rem 1.25rem;
  font-size: .75rem;
  color: var(--muted);
}
.footer-tagline {
  margin: .45rem 0 0;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--muted);
}

.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 3rem 0; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { margin-top: 0; }
.account-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.account-type-option {
  display: grid;
  place-items: center;
  padding: .85rem .75rem;
  border: 2px solid var(--line);
  border-radius: .9rem;
  text-align: center;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.account-type-option:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.account-type-option.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
  font-weight: 700;
}
.form-stack { display: grid; gap: 1rem; }
.flash { border-radius: .75rem; padding: .85rem 1rem; margin-bottom: 1rem; }
.flash-success { background: #e8f6ee; color: var(--success); border: 1px solid #b7e0c6; }
.flash-error { background: #fbeaea; color: var(--danger); border: 1px solid #f0c2c2; }
.flash-info { background: #eef4f0; color: var(--primary-dark); border: 1px solid var(--line); }

.panel-layout { display: grid; gap: 1.5rem; padding: 2.5rem 0; }
@media (min-width: 768px) { .panel-layout { grid-template-columns: 240px 1fr; } }
.panel-layout > div:last-child,
.panel-layout > .panel-main { overflow: visible; position: relative; min-width: 0; }
.patient-panel-inner { padding: 0; }
.side-nav { height: fit-content; position: sticky; top: 88px; }
.side-nav-title { font-weight: 700; color: var(--primary); margin: 0 0 1rem; font-size: 1.1rem; }
.side-nav nav { display: grid; gap: .35rem; }
.side-nav a { padding: .55rem .75rem; border-radius: .65rem; color: var(--muted); font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.side-nav a:hover { background: var(--bg-soft); color: var(--primary); }
.side-nav a.is-active { background: var(--bg-soft); color: var(--primary); font-weight: 700; }
.side-nav-group {
  margin: .85rem 0 .25rem;
  padding: 0 .75rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  opacity: .85;
}
.side-nav-group:first-child { margin-top: 0; }
.side-nav-badge {
  min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}

.panel-back {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 .85rem;
}
.panel-back + h1 { margin-top: 0; }
.intake-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}
.intake-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .7rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: 1rem;
  background: #fff;
}
.intake-item-meta { margin: .35rem 0 0; font-size: .85rem; }
.intake-item-summary { margin: .5rem 0 0; line-height: 1.7; }
.intake-item-btn {
  align-self: flex-end;
  margin-top: auto;
}
.intake-item.is-unread {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}

.panel-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1rem 0 0;
}
.panel-subtab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .85rem;
  border-radius: .65rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
  background: #fff;
}
.panel-subtab:hover { border-color: var(--primary); color: var(--primary); }
.panel-subtab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.panel-subtab-count {
  min-width: 1.2rem;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, #fff);
  color: var(--primary-dark);
  text-align: center;
}
.panel-subtab.is-active .panel-subtab-count {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* پنل دکتر — یک کاشی با تب */
.doctor-dash-head {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.doctor-dash-head h1 { margin: 0; font-size: 1.45rem; }
.doctor-dash-head .muted { margin: .35rem 0 0; }
.doctor-dash-badge { align-self: center; }
.doctor-dash-tile {
  padding: 0;
  overflow: hidden;
}
.doctor-dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .45rem .55rem 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.doctor-dash-tab {
  appearance: none;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: .75rem .75rem 0 0;
  padding: .7rem 1.05rem;
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
}
.doctor-dash-tab:hover { color: var(--primary-dark); }
.doctor-dash-tab.is-active {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--line);
  position: relative;
  z-index: 1;
}
.doctor-dash-tab-count {
  display: inline-flex;
  min-width: 1.2rem;
  margin-right: .35rem;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, #fff);
  color: var(--primary-dark);
}
.doctor-dash-tab.is-active .doctor-dash-tab-count {
  background: var(--bg-soft);
}
.doctor-dash-panels { padding: 1.25rem; }
.doctor-dash-panel { display: none; }
.doctor-dash-panel.is-active { display: block; }
.doctor-dash-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.doctor-dash-card-head-actions,
.doctor-dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.doctor-dash-card-head h2 {
  margin: .15rem 0 0;
  font-size: 1.15rem;
}
.doctor-dash-kicker {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  color: var(--primary);
}
.doctor-dash-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .85rem;
}
.doctor-dash-stat {
  background: var(--bg-soft);
  border-radius: .75rem;
  padding: .7rem .8rem;
}
a.doctor-dash-stat {
  color: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
a.doctor-dash-stat:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--bg-soft));
}
.doctor-dash-stat strong,
.doctor-dash-stat > a {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
}
.doctor-dash-stat span {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--muted);
}
.doctor-dash-sub {
  margin: .5rem 0 .55rem;
  font-size: .92rem;
  color: var(--primary-dark);
}
.doctor-dash-empty { margin: 0; font-size: .9rem; }
.doctor-dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.doctor-dash-list > li {
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fff;
}
.doctor-dash-list > li.is-unread {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}
.doctor-dash-list a,
.doctor-dash-list > li > div {
  display: block;
  padding: .7rem .8rem;
  color: inherit;
  text-decoration: none;
}
.doctor-dash-list strong { display: block; font-size: .95rem; }
.doctor-dash-list .muted { display: block; font-size: .78rem; margin-top: .15rem; }
.doctor-dash-list p {
  margin: .35rem 0 0;
  font-size: .86rem;
  line-height: 1.65;
  color: var(--muted);
}
.doctor-dash-list--compact a,
.doctor-dash-list--compact > li > div {
  padding: .55rem .7rem;
}
.doctor-dash-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .8rem;
}
.doctor-dash-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.doctor-dash-other {
  margin-top: 1rem;
  border-top: 1px dashed var(--line);
  padding-top: .75rem;
}
.doctor-dash-other summary {
  cursor: pointer;
  font-size: .88rem;
  color: var(--muted);
  user-select: none;
}
.doctor-dash-other[open] summary { margin-bottom: .55rem; color: var(--primary-dark); }

.slots { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot-btn {
  border: 1px solid var(--line); background: #fff; border-radius: .65rem;
  padding: .5rem .75rem; cursor: pointer; font-family: inherit;
}
.slot-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.hour-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(2.5rem, 1fr));
  gap: .45rem;
  max-width: 22rem;
}
@media (min-width: 480px) {
  .hour-picker { grid-template-columns: repeat(8, minmax(2.35rem, 1fr)); max-width: none; }
}
.hour-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.35rem; padding: .4rem .65rem; border-radius: .65rem;
  border: 1px solid var(--line); background: #fff; font-size: .9rem;
  cursor: pointer; user-select: none; position: relative;
}
.hour-chip input { position: absolute; opacity: 0; pointer-events: none; }
.hour-chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.hour-picker-readonly .hour-chip { cursor: default; }
.hour-picker-readonly .hour-chip.is-active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }
.hour-picker-readonly .hour-chip.is-off { opacity: .35; }

.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.date-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: .65rem;
  padding: .65rem .9rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  color: var(--fg);
  line-height: 1.4;
}
.date-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.date-chip:hover { border-color: var(--primary); }

/* تقویم شمسی jalaliDatepicker */
jdp-container, .jdp-container, [class*="jdp"] {
  font-family: Vazirmatn, Tahoma, sans-serif !important;
  z-index: 100000 !important;
}
.workshop-map-panel {
  width: 100%;
  min-height: 12rem;
  height: clamp(12rem, 40vh, 18rem);
  border-radius: .75rem;
  border: 1px solid var(--line);
  z-index: 1;
}

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .75rem 1rem; border-top: 1px solid var(--line); text-align: right; }
.table thead { background: var(--bg-soft); color: var(--muted); }

.whitespace-pre { white-space: pre-wrap; }
.stack { display: grid; gap: .75rem; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: start; }

.workshop-card-row {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
}
.workshop-card-main {
  min-width: 0;
}
.workshop-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-start;
  align-items: center;
}
.workshop-card-actions form {
  display: contents;
}
.workshop-card-actions .btn,
.workshop-card-actions a.btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
  margin: 0;
  padding: .35rem .55rem;
  font-size: .78rem;
}

.binder-tile {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.binder-tile--nested {
  margin-top: .35rem;
}
.binder-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  position: relative;
  z-index: 2;
  margin: 0 0 -1px;
  background: transparent;
  border: none;
  box-shadow: none;
  list-style: none;
}
.binder-tab {
  appearance: none;
  font-family: inherit;
  font-weight: 700;
  font-size: .86rem;
  line-height: 1.2;
  height: 39px;
  padding: 10px 20px;
  margin-inline-start: -1px;
  border: 1px solid #9b9b9b;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  color: #002f51;
  white-space: nowrap;
  background: #eeeeee;
  background-image: none;
  opacity: 1;
  filter: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  position: relative;
  z-index: 1;
}
.binder-tab:first-child {
  margin-inline-start: 0;
}
.binder-tab:hover {
  filter: brightness(1.03);
}
.binder-tab.is-active {
  background: #fff;
  background-image: none;
  color: #6b6b6b;
  z-index: 3;
  border-color: #c0c0c0;
  box-shadow: none;
  transform: none;
  opacity: 1;
  filter: none;
}
.binder-tab-in-person { background-color: #c5e4f7; color: #16352c; }
.binder-tab-online { background-color: #bfecea; color: #16352c; }
.binder-tab-offline { background-color: #f8e59a; color: #16352c; }
.binder-tab-new { background-color: #f5b3d6; color: #5a1240; }
.binder-tab-archive { background-color: #f5c49a; color: #5a2e10; }
.binder-tab-appts { background-color: #bfe8cc; color: #0f3d28; }
.binder-tab-workshops { background-color: #c5e4f7; color: #16352c; }
.binder-tab-in-person.is-active { color: #2a7ab8; }
.binder-tab-online.is-active { color: #1a8f8a; }
.binder-tab-offline.is-active { color: #b08910; }
.binder-tab-new.is-active { color: #c43a86; }
.binder-tab-archive.is-active { color: #c45f12; }
.binder-tab-appts.is-active { color: #2e9a5c; }
.binder-tab-workshops.is-active { color: #2a7ab8; }
.binder-tab-count {
  display: inline-flex;
  min-width: 1.15rem;
  margin-right: .28rem;
  padding: 0 .28rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(255,255,255,.7);
  color: #134437;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, .06);
}
.patient-dash-panel-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.patient-dash-panel-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .4rem;
}
.binder-tile--patient-dash {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "outer actions"
    "inner inner"
    "main main";
  align-items: end;
  column-gap: .4rem;
}
.binder-tile--patient-dash > .binder-tabs {
  grid-area: outer;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
}
.binder-tile--patient-dash > .binder-body {
  display: contents;
}
.binder-tile--patient-dash > .binder-body > .binder-panel {
  display: none;
}
.binder-tile--patient-dash > .binder-body > .binder-panel.is-active {
  display: contents;
}
.binder-tile--patient-dash .patient-dash-panel-head {
  display: contents;
}
.binder-tile--patient-dash .patient-dash-panel-actions {
  grid-area: actions;
  padding-bottom: .35rem;
}
.binder-tile--patient-dash [data-patient-courses] {
  display: contents;
}
.binder-tile--patient-dash .binder-tile--nested {
  display: contents;
  margin: 0;
}
.binder-tile--patient-dash .binder-tile--nested > .binder-tabs {
  grid-area: inner;
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: flex-start;
  margin: 0 0 -1px;
  padding: 0;
  z-index: 3;
}
.binder-tile--patient-dash .binder-tile--nested > .binder-body {
  grid-area: main;
}
@media (max-width: 760px) {
  .binder-tile--patient-dash {
    grid-template-columns: 1fr;
    grid-template-areas:
      "outer"
      "actions"
      "inner"
      "main";
    align-items: stretch;
  }
  .binder-tile--patient-dash .binder-tabs {
    flex-wrap: wrap;
  }
}
.patient-appt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  border: 1px solid rgba(26, 46, 40, .08);
  border-radius: .85rem;
  padding: .85rem 1rem;
  background: #fff;
}
.patient-appt-row--manage {
  align-items: flex-start;
}
.patient-appt-row-actions {
  text-align: left;
  font-size: .85rem;
  flex: 0 0 auto;
}
.binder-body {
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 10px 0 10px 10px;
  padding: 1.05rem 1.15rem 1.2rem;
  position: relative;
  z-index: 1;
}
html[dir="ltr"] .binder-body {
  border-radius: 0 10px 10px 10px;
}
.binder-panel > .binder-tile--nested {
  margin-top: 0;
}
.binder-panel { display: none; }
.binder-panel.is-active { display: block; }
.binder-tile--patient-dash > .binder-body > .binder-panel.is-active {
  display: contents;
}
.binder-tile--patient-dash > .binder-body > .binder-panel[hidden] {
  display: none !important;
}
.binder-empty { margin: 0; }
.binder-sub {
  margin: 1.25rem 0 .35rem;
  font-size: .95rem;
  color: var(--primary-dark);
}
.workshop-binder-card {
  border: 1px solid rgba(26, 46, 40, .08);
  border-radius: .85rem;
  padding: 1rem;
  background: #fff;
}
.workshop-binder-card.is-archived {
  background: #fffdf8;
}
.workshop-binder-card--peer {
  font-size: .9rem;
}

.course-flash {
  font-size: .9rem;
  padding: .65rem .85rem;
  border-radius: .65rem;
  border: 1px solid var(--line);
  margin-top: .75rem;
}
.course-flash.ok { color: var(--success); border-color: var(--success); background: #f0fdf4; }
.course-flash.err { color: var(--danger); border-color: var(--danger); background: #fef2f2; }
.enrollment-card {
  border: 1px solid rgba(26, 46, 40, .08);
  border-radius: .85rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: #fff;
}
.enrollment-card-main { min-width: 0; width: 100%; }
.enrollment-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: 0;
  border: none;
}
.enrollment-card-actions .btn,
.enrollment-card-actions a.btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.enrollment-wallet-label {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  font-size: .8rem;
  flex-wrap: nowrap;
  margin: 0;
}
.enrollment-refund-note {
  font-size: .75rem;
  margin: 0;
  line-height: 1.4;
}
.enrollment-location {
  margin-top: .5rem;
  font-size: .85rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
}
.enrollment-address {
  line-height: 1.65;
  word-break: break-word;
}
.enrollment-label {
  font-weight: 600;
  margin-left: .25rem;
}
.enrollment-nav-btn {
  width: auto;
  max-width: 100%;
}

/* ادیتور شرح حال */
.clinical-board {
  display: grid;
  gap: 1rem;
}
.clinical-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  padding: .65rem .75rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: .75rem;
}
.clinical-toolbar .tool-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: .5rem;
  padding: .35rem .65rem;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  color: var(--fg);
}
.clinical-toolbar .tool-btn:hover,
.clinical-toolbar .tool-btn.active {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.clinical-toolbar .tool-btn.bold { font-weight: 700; }
.clinical-toolbar .swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: .35rem;
  border: 1px solid rgba(0,0,0,.12);
  cursor: pointer;
  padding: 0;
}
.clinical-toolbar .swatch.yellow { background: #ffe566; }
.clinical-toolbar .swatch.green { background: #8fd6a8; }
.clinical-toolbar .swatch.pink { background: #f5a3c0; }
.clinical-toolbar .swatch.blue { background: #8eb7e8; }
.clinical-toolbar .tool-sep {
  width: 1px;
  height: 1.4rem;
  background: var(--line);
  margin-inline: .15rem;
}
.clinical-editor {
  min-height: 220px;
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: 1rem 1.1rem;
  background: #fff;
  line-height: 1.9;
  outline: none;
}
.clinical-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,94,75,.12);
}
.clinical-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.clinical-editor mark,
.clinical-editor span[data-hl] {
  border-radius: .2rem;
  padding: 0 .1rem;
}
.clinical-sessions-label {
  font-size: .9rem;
  font-weight: 600;
  margin: .25rem 0 0;
}
.clinical-session-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.session-note-box {
  position: relative;
  width: min(100%, 11.5rem);
}
.session-note-toggle {
  width: 100%;
  text-align: right;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: .75rem;
  padding: .65rem .75rem;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow .2s ease, transform .15s ease, border-color .15s ease;
}
.session-note-toggle:hover {
  border-color: var(--primary);
}
.session-note-toggle .sn-date {
  display: block;
  font-weight: 700;
  font-size: .88rem;
}
.session-note-toggle .sn-meta {
  display: block;
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--muted);
}
.session-note-box.open .session-note-toggle {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(26,46,40,.18);
  transform: translateY(-1px);
  background: #fbfffc;
}
.session-note-panel {
  display: none;
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  z-index: 20;
  width: min(22rem, calc(100vw - 3rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: .9rem;
  box-shadow: 0 16px 40px rgba(26,46,40,.22);
}
.session-note-box.open .session-note-panel {
  display: block;
}
.session-note-box.has-note .session-note-toggle {
  background: linear-gradient(180deg, #fff 0%, #f3faf6 100%);
}

.article-body mark,
.article-body span[style*="background"] {
  border-radius: .2rem;
  padding: 0 .1rem;
}

/* دستیار گفتگو — با من حرف بزن */
.assistant-page { max-width: 44rem; }
.assistant-head { margin-bottom: 1.25rem; }
.assistant-head h1 { margin: 0; }
.assistant-head .muted { margin: .4rem 0 0; }
.assistant-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.15rem 1.25rem;
}
.assistant-messages {
  min-height: 14rem;
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .25rem .15rem;
}
.assistant-msg { display: flex; }
.assistant-msg--bot { justify-content: flex-start; }
.assistant-msg--user { justify-content: flex-end; }
.assistant-bubble {
  max-width: min(92%, 28rem);
  padding: .7rem .95rem;
  border-radius: 1rem;
  line-height: 1.8;
  font-size: .95rem;
  background: #f3f7f5;
  border: 1px solid var(--line);
}
.assistant-msg--user .assistant-bubble {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.assistant-step { margin: 0 0 .5rem; font-size: .85rem; }
.assistant-options {
  display: grid;
  gap: .55rem;
}
@media (min-width: 640px) {
  .assistant-options { grid-template-columns: 1fr 1fr; }
}
.assistant-option {
  text-align: right;
  font-family: inherit;
  font-size: .92rem;
  line-height: 1.6;
  padding: .7rem .85rem;
  border-radius: .85rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.assistant-option:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(26, 46, 40, .08);
}
.assistant-text { width: 100%; resize: vertical; min-height: 4.5rem; }
.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.assistant-disclaimer {
  margin: 0;
  font-size: .78rem;
  line-height: 1.75;
  border-top: 1px solid var(--line);
  padding-top: .85rem;
}
.assistant-doctor-list {
  display: grid;
  gap: .55rem;
}
.assistant-doctor-card {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  cursor: pointer;
  background: #fff;
}
.assistant-doctor-card:has(input:checked) {
  border-color: var(--primary);
  background: #f7fcf9;
}
.assistant-doctor-card input { margin-top: .35rem; }
.assistant-workshop-list {
  margin: 0;
  padding-inline-start: 1.2rem;
  line-height: 1.85;
}
.assistant-match h2 {
  margin: 0 0 .65rem;
  font-size: 1.05rem;
}
.assistant-composer { display: flex; flex-direction: column; gap: .65rem; }
