/* ══════════════════════════════════════════════════════════
   DosTime — Charts (نمودارها و ویژوال‌های داده)
   - تقویم ماهانه: حلقه پیشرفت + آمار ماه
   - مرکز سلامت: نمودارهای اینلاین آب/کالری/خلق
   - سازگار با تم روشن/تیره و RTL
   ══════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   تقویم ماهانه — نقشه ۳۵ روزه
   - حلقه پیشرفت پایبندی دور هر روز
   - پس‌زمینه لطیف هم‌رنگ وضعیت
   - نوار آمار ماه + هایلایت جمعه
   ════════════════════════════════════════════════════════════ */

.cal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.cal-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.cal-stat b {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.cal-stat span {
  font-size: 10px;
  color: var(--text-tertiary);
}

.cal-grid {
  gap: 6px;
}

.cal-head.weekend {
  color: var(--coral);
  font-weight: 800;
}

.cal-day {
  height: 48px;
  max-width: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  gap: 0;
}

.cal-day:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* پس‌زمینه لطیف هم‌رنگ وضعیت (بعد از hover تا روی هاور هم بماند) */
.cal-day.st-complete {
  background: var(--success-bg);
}

.cal-day.st-partial {
  background: var(--warning-bg);
}

.cal-day.st-missed {
  background: var(--danger-bg);
}

.cal-day.st-none {
  opacity: 0.55;
}

.cal-num {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.cal-day.fri .cal-num {
  color: var(--coral);
}

/* حلقه پیشرفت دور عدد روز */
.cal-ring {
  position: absolute;
  width: 38px;
  height: 38px;
}

.cal-ring circle {
  fill: none;
  stroke-width: 2.6;
}

.cal-ring-bg {
  stroke: var(--border);
}

.cal-ring-fg {
  stroke-linecap: round;
  transition: stroke-dasharray 500ms ease;
}

.st-complete .cal-ring-fg {
  stroke: var(--success);
}

.st-complete .cal-num {
  color: var(--success);
}

.st-partial .cal-ring-fg {
  stroke: var(--warning);
}

.st-missed .cal-ring-fg {
  stroke: var(--danger);
}

html[data-theme='dark'] .st-complete .cal-num {
  color: #34d399;
}

/* امروز: گرادیان برند با درخشش */
.cal-day.today {
  background: var(--grad-primary);
  box-shadow: var(--shadow-primary);
}

.cal-day.today .cal-num {
  color: #fff;
}

.cal-day.today .cal-ring-bg {
  stroke: rgb(255 255 255 / 0.35);
}

.cal-day.today .cal-ring-fg {
  stroke: #fff;
}

.cal-day.selected {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.cal-day.today.selected {
  outline-color: #fff;
}

.cal-day.out-month {
  opacity: 0.45;
}

.cal-day:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* نشان فعالیت سرویس — گوشه سلول تقویم */
.cal-act {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 2px var(--bg-card);
  z-index: 1;
}

/* ─── موبایل کوچک ─── */
@media (max-width: 380px) {
  .cal-day {
    height: 44px;
    border-radius: 12px;
  }

  .cal-ring {
    width: 33px;
    height: 33px;
  }

  .cal-stat b {
    font-size: 14px;
  }
}

/* ════════════════════════════════════════════════════════════
   مرکز سلامت — نمودارهای اینلاین تغذیه و روان
   ════════════════════════════════════════════════════════════ */

/* ─── میله‌های ۷ روزه آب ─── */
.hh-water-chart {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.hh-wcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.hh-wval {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
}

.hh-wtrack {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 30px;
  height: 74px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hh-wfill {
  width: 100%;
  min-height: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7dd3fc 0%, #0284c7 100%);
  transition: height 400ms ease;
}

.hh-wfill.full {
  background: linear-gradient(180deg, #34d399 0%, #0ea472 100%);
  box-shadow: 0 -2px 8px rgb(16 185 129 / 0.45);
}

.hh-wtarget {
  position: absolute;
  left: 3px;
  right: 3px;
  border-top: 1.5px dashed var(--primary);
  opacity: 0.7;
  pointer-events: none;
}

.hh-wday {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.hh-wcol.today .hh-wday {
  color: var(--primary);
  font-weight: 800;
}

/* ─── SVGهای سلامت ─── */
.hh-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
}

.hh-svg text {
  font-family: var(--font-sans);
}

.hh-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.hh-ylab,
.hh-xlab {
  font-size: 9px;
  fill: var(--text-tertiary);
}

.hh-vlab {
  font-size: 10px;
  font-weight: 800;
  fill: var(--text-secondary);
}

.hh-area {
  fill: #f59e0b;
  opacity: 0.18;
}

.hh-line {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hh-avg {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  opacity: 0.7;
}

.hh-avg-lab {
  font-size: 8.5px;
  fill: var(--text-tertiary);
}

.hh-dot {
  fill: #fff;
  stroke: #f59e0b;
  stroke-width: 2.5;
}

/* ─── دونات درشت‌مغذی ─── */
.hh-donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.hh-donut-svg {
  flex-shrink: 0;
  width: 104px;
  height: 104px;
}

.hh-donut-seg {
  fill: none;
  stroke-width: 7;
  stroke-linecap: butt;
}

.hh-donut-empty {
  fill: none;
  stroke: var(--border);
  stroke-width: 7;
}

.hh-donut-num {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 900;
  fill: var(--text-primary);
}

.hh-donut-unit {
  font-family: var(--font-sans);
  font-size: 5.5px;
  fill: var(--text-tertiary);
}

.hh-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hh-donut-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hh-donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.hh-donut-legend b {
  margin-inline-start: auto;
  padding-inline-start: 10px;
}

/* ─── نمودار خلق و استرس ─── */
.hh-mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hh-chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.hh-chip b {
  color: var(--text-primary);
}

.hh-mood-line {
  fill: none;
  stroke: #8b5cf6;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hh-stress-line {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 2;
  stroke-dasharray: 5 3;
  stroke-linecap: round;
  opacity: 0.9;
}

.hh-mdot {
  fill: #fff;
  stroke: #8b5cf6;
  stroke-width: 2.5;
}

.hh-sdot {
  fill: #fff;
  stroke: #f59e0b;
  stroke-width: 2;
}

.hh-mood-legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.hh-mood-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hh-mood-legend .ln {
  width: 18px;
  height: 0;
  border-top: 2.5px solid #8b5cf6;
  border-radius: 2px;
}

.hh-mood-legend .ln.stress {
  border-top: 2px dashed #f59e0b;
}

.hh-chart-empty {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
}

/* ═══════════════ کارت نمودار ۷ روزه داشبورد + پاپاپ‌ها ═══════════════ */
.dose-week-card {
  position: relative;
  overflow: hidden;
}
.dose-week-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(to left, var(--success), var(--accent), var(--teal));
}
.dw-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.dw-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.dw-bar:hover {
  background: var(--bg-soft);
}
.dw-bar:active {
  transform: scale(0.95);
}
.dw-bar.today {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.dw-track {
  display: flex;
  align-items: flex-end;
  height: 64px;
  width: 100%;
  max-width: 30px;
  border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden;
}
.dw-fill {
  width: 100%;
  border-radius: 8px;
  transition: height 0.4s ease;
}
.dw-fill.good { background: linear-gradient(to top, var(--success), #6ee7b7); }
.dw-fill.mid { background: linear-gradient(to top, var(--warning), #fcd34d); }
.dw-fill.low { background: linear-gradient(to top, var(--danger), #fca5a5); }
.dw-fill.empty { background: var(--neutral-200); }
.dw-val {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dw-day {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.dw-bar.today .dw-day {
  color: var(--accent);
}
.dw-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* پاپاپ نمودار/روز */
.modal.dose-pop {
  max-width: 420px;
  width: calc(100vw - 32px);
}
.dp-sum {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 10px;
}
.dp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}
.dp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.dp-ico {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.dp-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dp-info b {
  font-size: 13px;
  color: var(--text-primary);
}
.dp-info span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.dp-chip {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.dp-chip.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.dp-chip.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.dp-chip.wait { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.dp-chip.mute { background: var(--bg-soft); color: var(--text-tertiary); }

/* سرفصل دسترسی سریع */
.dqa-sec-head {
  margin: 14px 0 8px;
}

/* پولیش ملایم هیرو داشبورد — همان استایل، کمی درخشان‌تر */
.dash-hero {
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -70px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
  pointer-events: none;
}
.dash-hero-next {
  transition: transform 0.15s ease, filter 0.15s ease;
}
.dash-hero-next:hover {
  filter: brightness(1.04);
}
.dash-hero-next:active {
  transform: scale(0.98);
}

/* ═══════════════ صفحه داروها: خلاصه امروز + تایم‌لاین ═══════════════ */
.med-today-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.med-today-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(to left, var(--success), var(--accent), var(--teal));
}
.mth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mth-eyebrow {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0 0 2px;
}
.mth-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.mth-ring {
  position: relative;
  flex: 0 0 auto;
}
.mth-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}
.med-today-hero .xp-track {
  margin-top: 10px;
}
.mth-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-primary);
}
.mth-done {
  margin: 10px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--success);
  text-align: center;
}
.med-timeline {
  margin-bottom: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #6c63d9 0%, #8b7fe0 42%, #5bc4b7 100%);
  border: none;
  box-shadow: 0 12px 32px rgb(124 111 217 / 0.35);
}
.med-timeline.card-pad {
  padding: 0;
}
.mth-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.mth-sec-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.mth-sec-head h3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}
.mth-sec-head .text-faint {
  color: rgba(255, 255, 255, 0.88) !important;
}
.mtl-list {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.07);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mtl-list::-webkit-scrollbar {
  display: none;
}
.mtl-row {
  flex: 0 0 auto;
  min-width: 128px;
  max-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-snap-align: start;
  background: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 10px;
  margin: 0;
  box-shadow: none;
}
.mtl-time {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: linear-gradient(135deg, #6c63d9, #5bc4b7);
  border: none;
  border-radius: 10px;
  padding: 6px 4px;
  align-self: stretch;
}
.mtl-items {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mtl-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 10px;
}
.mtl-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.mtl-item.taken i { background: var(--success); }
.mtl-item.pending i { background: var(--warning); }
.mtl-item.missed i { background: var(--danger); }
.mtl-row .mtl-item {
  display: flex;
}
.med-timeline .mtl-item {
  background: rgba(255, 255, 255, 0.96);
  border: none;
  color: #2d2842;
  box-shadow: 0 2px 8px rgba(20, 15, 60, 0.18);
}
.mtl-item.taken { opacity: 0.75; }
.mtl-mark {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--success);
  border-radius: 999px;
  padding: 3px 10px;
}
.mtl-mark:active {
  transform: scale(0.94);
}

/* نوار نقاط امروز روی کارت دارو + هشدار موجودی */
.med-day-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px 8px;
}
.mdot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neutral-200);
}
.mdot.taken { background: var(--success); }
.mdot.pending { background: var(--warning); }
.mdot.missed { background: var(--danger); }
.med-day-lbl {
  font-size: 9.5px;
  color: var(--text-tertiary);
  margin-inline-start: 2px;
}
.low-stock-card {
  border-color: var(--warning) !important;
  box-shadow: 0 0 0 1px var(--warning);
}
.med-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.med-title-row h1 {
  font-size: 17px;
  margin: 0;
}
.shop-title-btn {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 6px 12px;
  gap: 6px;
}
.shop-title-btn.warn {
  color: var(--warning);
  border-color: var(--warning);
}
.med-list-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 10px;
}
.mlt {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 2px;
}
.mlt.on {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ═══════════════ کارت خلاقانه دارو ═══════════════ */
.hu-card.med-card {
  position: relative;
  overflow: hidden;
}
.hu-card.med-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(to left, var(--accent), var(--teal));
}
.hu-card.med-card.paused-card::before {
  background: var(--neutral-200);
}
.med-glyph-wrap.pro {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 9px;
}
.med-glyph-wrap.pro.sm {
  padding: 6px;
  border-radius: 13px;
}
.med-status-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.med-status-pill.on {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.med-status-pill.off {
  color: var(--text-tertiary);
  background: var(--bg-soft);
}
.med-card .med-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-top: 8px;
  scrollbar-width: none;
}
.med-card .med-actions::-webkit-scrollbar {
  display: none;
}
.med-card .med-actions .btn {
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
  flex: 1 1 0;
}
.med-card .med-actions .med-del-icon {
  flex: 0 0 auto;
}
.med-card .med-actions .med-del-icon {
  padding: 6px 8px;
}
.med-big-time {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.stock-track.pulse {
  animation: stockPulse 1.8s ease-in-out infinite;
}
@keyframes stockPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 35%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .stock-track.pulse { animation: none; }
}
.warn-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border: 1px solid var(--border);
}
.warn-banner .flex-1 {
  flex: 1 1 auto;
}
.warn-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

/* ═══════════════ ثبت علائم آسان تصویری — کم‌سواد/بی‌سواد (۱-۲ حرکت) ═══════════════ */
.sym-easy-step {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 10px 0 6px;
}
.sym-easy-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.sym-face-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sym-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 68px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sym-face-e { font-size: 30px; line-height: 1; }
.sym-face.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: var(--shadow-sm);
}
.sym-face.sym-fine.on {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.sym-pic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sym-pic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.sym-pic-e { font-size: 30px; line-height: 1; }
.sym-pic.on {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  box-shadow: var(--shadow-sm);
}
.sym-more {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.sym-more summary {
  cursor: pointer;
  font-weight: 800;
  padding: 8px 4px;
  min-height: 44px;
}
@media (max-width: 380px) {
  .sym-pic-grid { grid-template-columns: repeat(3, 1fr); }
  .sym-pic-e, .sym-face-e { font-size: 28px; }
}

/* ─── دکمه حرف بزن — بزرگ و چشمگیر ─── */
.sym-voice-btn {
  flex: 2;
  min-width: 150px;
  min-height: 56px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #10b981, #14b8a6);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  animation: micRing 2s infinite;
}
.sym-voice-mic { font-size: 28px; line-height: 1; }
.sym-voice-btn small { display: block; font-size: 10px; font-weight: 600; opacity: 0.92; }
.sym-voice-btn.rec {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  animation: micRingRec 1.1s infinite;
}
.sym-voice-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  flex: 0 0 auto;
  animation: blinkDot 1s infinite;
}
@keyframes micRing {
  0% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0.45); }
  70% { box-shadow: 0 0 0 14px rgb(16 185 129 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0); }
}
@keyframes micRingRec {
  0% { box-shadow: 0 0 0 0 rgb(225 29 72 / 0.5); }
  70% { box-shadow: 0 0 0 14px rgb(225 29 72 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(225 29 72 / 0); }
}
@keyframes blinkDot { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .sym-voice-btn, .sym-voice-dot { animation: none; }
}

/* ─── باکس بزرگ پرونده پزشکی در پروفایل (ورودی تب پرونده) ─── */
.prof-rec-link {
  position: relative;
  overflow: hidden;
  width: 100%;
  font: inherit;
  text-align: right;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgb(255 255 255 / 0.25), transparent 46%),
    radial-gradient(circle at 6% 95%, rgb(0 0 0 / 0.2), transparent 52%),
    linear-gradient(135deg, #0d9488 0%, #14b8a6 48%, #7c6fd9 135%);
  box-shadow: 0 12px 30px rgb(13 148 136 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.prof-rec-link::before {
  content: '';
  position: absolute;
  left: -34px;
  bottom: -46px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 14px solid rgb(255 255 255 / 0.12);
  pointer-events: none;
}
.prof-rec-link::after {
  content: '';
  position: absolute;
  right: -22px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  pointer-events: none;
}
.prof-rec-link.on {
  box-shadow: 0 0 0 2px var(--accent), 0 12px 30px rgb(13 148 136 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.prof-rec-ico {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.2);
  border: 1px solid rgb(255 255 255 / 0.4);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3);
}
.prof-rec-txt { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prof-rec-txt b { font-size: 14.5px; font-weight: 800; }
.prof-rec-txt small { font-size: 11px; opacity: 0.92; }
.prof-rec-count {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #0d9488;
  background: rgb(255 255 255 / 0.95);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
}
.prof-rec-go { position: relative; z-index: 1; flex: 0 0 auto; opacity: 0.95; display: grid; place-items: center; }

/* ─── تیک گوشه دکمه ثبت ─── */
.sym-submit-btn { position: relative; }
.sym-submit-tick {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.25);
  line-height: 1;
}

/* ─── باکس ثبت‌های امروز ─── */
.sym-saved {
  margin-bottom: 10px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}
.sym-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sym-saved-head p { font-size: 13px; font-weight: 800; color: var(--text-primary); margin: 0; }
.sym-saved-head span { font-size: 11px; font-weight: 700; color: var(--success); }
.sym-saved-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 8px;
}
.sym-saved-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sym-saved-top b { font-size: 12.5px; color: var(--text-primary); }
.sym-sev-badge { font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.sym-sev-badge.s0 { background: #dcfce7; color: #15803d; }
.sym-sev-badge.s1 { background: #fef9c3; color: #a16207; }
.sym-sev-badge.s2 { background: #fee2e2; color: #b91c1c; }
.sym-saved-time { font-size: 10px; color: var(--text-tertiary); margin-inline-start: auto; }
.sym-saved-voice { font-size: 10px; font-weight: 800; color: var(--accent-dark); }
.sym-saved-syms { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sym-saved-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.sym-saved-note { font-size: 11.5px; color: var(--text-secondary); margin: 6px 0 0; line-height: 1.7; }
.sym-saved-empty {
  margin-bottom: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-style: dashed;
}

/* ─── حذف/ویرایش تکی ثبت‌های علائم ─── */
.sym-saved-actions{margin-inline-start:auto;display:inline-flex;gap:6px;align-items:center}
.sym-saved-actions button{border:1px solid var(--border);background:var(--bg-card);border-radius:10px;font-size:12px;line-height:1;padding:5px 8px;cursor:pointer}
.sym-saved-actions button:active{transform:scale(.95)}
.sym-saved-chip{display:inline-flex;align-items:center;gap:4px}
.sym-chip-x{border:0;background:transparent;color:var(--text-tertiary);font-size:14px;font-weight:800;line-height:1;cursor:pointer;padding:0 2px}
.sym-chip-x:hover{color:#e11d48}
