/* ════════════════════════════════════════════════════════════
   DosTime Design System — نسخه WebApp
   مرجع: DosTime_WebApp_Design_Spec.md · پلن اجرا
   ════════════════════════════════════════════════════════════ */

/* ─── تم ۱: روشن (ویبرنت پریمیوم) ─── */
:root,
html[data-theme='light'] {
  /* ─── پالت لاواندر — بنفش ملایم و هماهنگ ─── */
  /* بنفش ملایم (Primary): آرام، خلاق، هویت هوشمند */
  --primary: #7c6fd9;
  --primary-dark: #6356c4;
  --primary-light: #edeafd;
  --primary-mid: #9d92e8;

  /* بنفش روشن (Secondary): پیشرفت، وضعیت مثبت */
  --accent: #8b7fe0;
  --accent-dark: #6c63d9;
  --accent-light: #eceafd;

  /* ─── رنگ‌های مکمل ─── */
  --teal: #5bc4b7;
  --teal-light: #e2f5f1;
  /* مرجانی نرم — تنها رنگ گرم، CTA و هشدار */
  --coral: #f2836b;
  --coral-light: #fdeae4;
  /* طلایی فقط برای استریک و جوایز */
  --amber: #d9a44a;
  --amber-light: #faf0da;
  /* بنفش عمیق‌تر — بخش‌های هوشمند/AI */
  --violet: #6c63d9;
  --violet-light: #eceafd;
  --network: #f2836b;
  --network-light: #fdeae4;

  /* ─── رنگ‌های وضعیت ─── */
  --success: #4cbfa8;
  --success-bg: #e2f5ee;
  --warning: #d9a44a;
  --warning-bg: #faf0da;
  --danger: #f2836b;
  --danger-bg: #fdeae4;
  --info: #8b7fe0;
  --info-bg: #eceafd;

  /* ─── خاکستری‌ها با ته‌مایه بنفش ─── */
  --neutral-50: #fcfbfe;
  --neutral-100: #f5f3fa;
  --neutral-200: #eae6f4;
  --neutral-300: #d8d2ec;
  --neutral-400: #a79fce;
  --neutral-500: #7b73a3;
  --neutral-600: #585078;
  --neutral-700: #403a58;
  --neutral-800: #2d2842;
  --neutral-900: #1f1b30;

  /* ─── بک‌گراندها — بنفش بسیار ملایم ─── */
  --bg-page: #f6f4fb;
  --bg-card: #ffffff;
  --bg-sidebar: #efecf9;
  --bg-topbar: rgba(246, 244, 251, 0.88);
  --bg-soft: #e8e4f6;
  --bg-elevated: #ffffff;

  /* ─── متن — بنفش تیره نرم ─── */
  --text-primary: #2d2842;
  --text-secondary: #575170;
  --text-tertiary: #948eb2;

  /* ─── بوردر ─── */
  --border: #e4dff2;
  --border-strong: #d1c9ea;
  --border-focus: #7c6fd9;

  /* ─── شل/ناو ─── */
  --nav-bg: rgba(246, 244, 251, 0.88);

  /* ─── فونت‌ها ─── */
  --font-sans: 'Vazirmatn', 'Inter', 'IRANSans', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;

  /* ─── شعاع گوشه ─── */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* ─── سایه — نرم و بنفش‌فام ─── */
  --shadow-xs: 0 1px 3px rgb(45 40 66 / 0.06);
  --shadow-sm: 0 4px 14px rgb(45 40 66 / 0.07), 0 1px 4px rgb(45 40 66 / 0.05);
  --shadow-md: 0 8px 24px rgb(45 40 66 / 0.09), 0 3px 8px rgb(45 40 66 / 0.06);
  --shadow-lg: 0 16px 40px rgb(45 40 66 / 0.11), 0 6px 16px rgb(45 40 66 / 0.07);
  --shadow-xl: 0 28px 64px rgb(45 40 66 / 0.14), 0 10px 28px rgb(45 40 66 / 0.09);
  --shadow-primary: 0 12px 32px rgb(124 111 217 / 0.28);
  --shadow-accent: 0 10px 26px rgb(139 127 224 / 0.24);

  /* ─── هاله‌ها (Glow) ─── */
  --glow-primary: 0 0 22px rgb(124 111 217 / 0.26);
  --glow-accent: 0 0 22px rgb(139 127 224 / 0.22);
  --glow-gold: 0 0 20px rgb(217 164 74 / 0.26);

  /* ─── گرادیان‌ها ─── */
  --grad-brand: linear-gradient(135deg, #7c6fd9 0%, #9d92e8 100%);
  --grad-primary: linear-gradient(135deg, #6c63d9 0%, #7c6fd9 55%, #9d92e8 100%);
  --grad-health: linear-gradient(135deg, #5bc4b7 0%, #7c6fd9 100%);
  --grad-calm: linear-gradient(135deg, #f2836b 0%, #7c6fd9 100%);
  --grad-gold: linear-gradient(135deg, #d9a44a 0%, #f2836b 100%);
  --grad-soft: linear-gradient(135deg, #edeafd 0%, #e2f5f1 55%, #faf0da 100%);

  /* ─── انتقال و انیمیشن ─── */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ─── ابعاد چیدمان ─── */
  --header-h: 60px;
  --nav-h: 56px;
}

/* ─── تم ۲: تیره (Royal Violet — بنفش/طلایی/فیروزه‌ای/مرجانی) ─── */
html[data-theme='dark'] {
  /* بنفش — Primary: هویت تکنولوژیک و مدرن */
  --primary: #8b74f2;
  --primary-dark: #7048e8;
  --primary-light: #1d1636;
  --primary-mid: #a08cf8;

  /* فیروزه‌ای — Secondary Accent: اعتماد و خدمات */
  --accent: #00c4c4;
  --accent-dark: #00a3a3;
  --accent-light: #0a2b2b;

  --teal: #00c4c4;
  --teal-light: #0a2b2b;
  /* قرمز مرجانی — Promotional / فوریت */
  --coral: #ec445b;
  --coral-light: #33121c;
  /* طلایی — CTA / ارزش / دستاورد */
  --amber: #f8b018;
  --amber-light: #332709;
  --violet: #a08cf8;
  --violet-light: #1d1636;
  --network: #ec445b;
  --network-light: #33121c;

  --success: #34d399;
  --success-bg: #0c2f24;
  --warning: #f8b018;
  --warning-bg: #332709;
  --danger: #ec445b;
  --danger-bg: #33121c;
  --info: #00c4c4;
  --info-bg: #0a2b2b;

  /* خاکستری‌های سرمه‌ای با ته‌مایه بنفش */
  --neutral-50: #0c0c14;
  --neutral-100: #101018;
  --neutral-200: #18181f;
  --neutral-300: #202030;
  --neutral-400: #33324a;
  --neutral-500: #565472;
  --neutral-600: #7d7a99;
  --neutral-700: #a5a2bd;
  --neutral-800: #cbc9dd;
  --neutral-900: #eeedf7;

  /* پس‌زمینه Royal — مشکی سرمه‌ای با ته‌رنگ آبی/بنفش (هرگز مشکی خالص) */
  --bg-page: #080810;
  --bg-card: linear-gradient(160deg, #18181f 0%, #1c1a2e 55%, #191927 100%);
  --bg-sidebar: linear-gradient(180deg, #101018 0%, #14131f 100%);
  --bg-topbar: rgba(8, 8, 16, 0.85);
  --bg-soft: #202030;
  --bg-elevated: linear-gradient(165deg, #1c1c26 0%, #232038 100%);

  --text-primary: #f0f0f0;
  --text-secondary: #c5c4bc;
  --text-tertiary: #989895;

  --border: #2a2845;
  --border-strong: #3a3760;
  --border-focus: #8b74f2;

  --nav-bg: rgba(8, 8, 16, 0.85);

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.45);
  --shadow-sm: 0 2px 12px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.35);
  --shadow-md: 0 8px 22px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.55), 0 6px 16px rgb(0 0 0 / 0.45);
  --shadow-xl: 0 26px 64px rgb(0 0 0 / 0.65), 0 10px 26px rgb(0 0 0 / 0.5);
  --shadow-primary: 0 10px 32px rgb(112 72 232 / 0.35);
  --shadow-accent: 0 10px 28px rgb(248 176 24 / 0.25);

  /* ─── هاله‌ها (Glow) ─── */
  --glow-primary: 0 0 26px rgb(112 72 232 / 0.42);
  --glow-accent: 0 0 26px rgb(0 184 184 / 0.32);
  --glow-gold: 0 0 22px rgb(248 176 24 / 0.38);

  /* ─── گرادیان‌ها ─── */
  --grad-brand: linear-gradient(135deg, #7048e8 0%, #a08cf8 100%);
  --grad-primary: linear-gradient(135deg, #7048e8 0%, #8b74f2 48%, #a08cf8 100%);
  --grad-health: linear-gradient(135deg, #00c4c4 0%, #34d399 100%);
  --grad-calm: linear-gradient(135deg, #ec445b 0%, #a08cf8 100%);
  --grad-gold: linear-gradient(135deg, #f8b018 0%, #ffc21c 100%);
  --grad-soft: linear-gradient(135deg, #1d1636 0%, #0a2b2b 55%, #332709 100%);

  color-scheme: dark;
}

/* ═══════════════ پایه ═══════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  overscroll-behavior: none; /* حذف pull-to-refresh و bounce */
}

body {
  margin: 0;
  overscroll-behavior-y: none; /* حذف pull-to-refresh */
  background-color: var(--neutral-300);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

html[data-theme='dark'] body {
  background-color: #080a12;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

*:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.dir-ltr {
  direction: ltr;
}

:is(input, textarea).dir-ltr {
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ═══════════════ انیمیشن‌ها ═══════════════ */

@keyframes dos-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dos-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes dos-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dos-animate-fade-in {
  animation: dos-fade-in var(--transition-normal) ease;
}

@keyframes dos-fade-slide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen {
  animation: dos-fade-slide 0.28s ease;
}

.dos-pulse {
  animation: dos-pulse 2s infinite;
}

/* ═══════════════ لایوت اپ — قاب موبایلی ═══════════════ */

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg-page);
  box-shadow: 0 0 80px rgb(0 0 0 / 0.08);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 5px;
  /* ارتفاع = هدر پایه + ناحیه امن بالای صفحه (ناچ/نوار وضعیت)؛
     محتوا دقیقاً وسط نوار قابل‌مشاهده قرار می‌گیرد */
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  min-height: var(--header-h);
  padding-inline: 14px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.topbar > * {
  flex-shrink: 0;
}

.topbar .topbar-spacer {
  flex: 1;
  min-width: 4px;
}

.topbar-title {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

.topbar-title-en {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.topbar-spacer {
  flex: 1;
}

#view {
  flex: 1;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  min-height: calc(100dvh - var(--header-h) - var(--nav-h));
  padding: 20px 14px calc(var(--nav-h) + 60px);
}

body.auth-mode #header {
  display: none;
}

body.auth-mode #view {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
  padding: 14px 14px calc(var(--nav-h) + 60px);
}

/* ─── هدر صفحه ─── */

.page-head {
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-head p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════ کامپوننت‌ها ═══════════════ */

/* ─── Card ─── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 14px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-top: 10px;
}

.card-pad-sm {
  padding: 10px;
}

.profile-page .text-lg {
  font-size: 15px;
}

.profile-page .text-base {
  font-size: 12.5px;
}

.profile-page .text-sm {
  font-size: 10px;
}

.profile-page .text-xs {
  font-size: 9.5px;
}

.profile-page .field-label {
  font-size: 11px;
}

.profile-page .input,
.profile-page .select {
  font-size: 11.5px;
}

.profile-page .btn {
  font-size: 11px;
}

.profile-page .btn-sm {
  font-size: 10px;
}

.card-hero {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.card-hero .text-muted {
  color: rgb(255 255 255 / 0.8);
}

.card-hero .text-faint {
  color: rgb(255 255 255 / 0.65);
}

/* ─── Button ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding-inline: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--neutral-100);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.btn-lg {
  height: 44px;
  padding-inline: 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.btn-link:hover {
  color: var(--primary-dark);
}

/* ─── Input / Select ─── */

.field {
  display: block;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.input,
.select {
  width: 100%;
  height: 40px;
  padding-inline: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input.has-error {
  border-color: var(--danger);
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
}

.field-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ─── Badge ─── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}

.badge-sm {
  font-size: 10px;
  padding: 3px 8px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-neutral { background: var(--neutral-100); color: var(--neutral-500); }
.badge-network { background: var(--network-light); color: var(--network); }

/* ─── Tabs / Filter chips ─── */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segmented button {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.segmented button:hover {
  background: var(--neutral-100);
}

.segmented button.active {
  background: var(--primary-light);
  color: var(--primary);
}

.segmented.services-tabs {
  display: flex;
  width: 100%;
}

.segmented.services-tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  font-size: 10px;
  line-height: 1.3;
}

.segmented.services-tabs .srv-tab-ic {
  display: flex;
}

/* ─── Tabs (خطی برای ورود) ─── */

.tabs-line {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tabs-line button {
  flex: 1;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tabs-line button:hover {
  color: var(--text-secondary);
}

.tabs-line button.active {
  border-color: var(--primary);
  color: var(--primary);
}

/* ═══════════════ لایوت‌های کاربردی ═══════════════ */

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.flex-1 { flex: 1; min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 10px; }
.gap-4 { gap: 14px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 10px; }
.mt-4 { margin-top: 14px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 14px; }
.pt-4 { padding-top: 14px; }
.py-10 { padding-block: 32px; }

/* ─── متن ─── */

.text-muted { color: var(--text-secondary); }
.text-faint { color: var(--text-tertiary); }
.text-primary-c { color: var(--primary); }
.text-accent-c { color: var(--accent); }
.text-success-c { color: var(--success); }
.text-warning-c { color: var(--warning); }
.text-danger-c { color: var(--danger); }
.text-network-c { color: var(--network); }
.bg-network-light { background: var(--network-light); }
.text-sm { font-size: 12.5px; }
.text-base { font-size: 15px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 21px; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════ Bottom Nav — ثابت و محدود به قاب ═══════════════ */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgb(0 0 0 / 0.04);
}

.bottom-nav a,
.bottom-nav button,
.bottom-nav span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a:hover:not(.active) {
  color: var(--text-secondary);
}

.bottom-nav [aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.45;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

@keyframes network-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(230 73 128 / 0.35); }
  50% { box-shadow: 0 0 0 6px rgb(230 73 128 / 0); }
}

.bottom-nav .nav-network.active svg {
  color: var(--network);
  animation: network-pulse 2s infinite;
}

.bottom-nav .nav-services.active svg {
  color: var(--primary);
}

/* ═══ بخش خدمات ═══ */

.srv-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, #6d5ee8 100%);
  color: #fff;
}

.srv-hero .badge {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

.srv-emergency {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--danger, #ef4444);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.srv-emergency:hover {
  opacity: 0.88;
}

/* بنر اورژانس در حالت غیرفعال (به‌زودی) */
.srv-emergency-off {
  cursor: default;
  opacity: 0.55;
  filter: grayscale(0.4);
}

.srv-emergency-off:hover {
  opacity: 0.55;
}

.srv-soon-badge {
  margin-inline-start: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 700;
}

.srv-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.srv-provider-card {
  padding: 10px 12px;
}

.srv-provider-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.srv-provider-top .srv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.srv-provider-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.srv-provider-meta .btn {
  margin-inline-start: auto;
}

.srv-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--primary);
}

.srv-avatar.emergency {
  background: var(--danger, #ef4444);
  color: #fff;
}

.srv-rating {
  color: #f59e0b;
  font-weight: 700;
}

/* ─── نقشه خدمات ─── */

.srv-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.srv-map-btn {
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.srv-map-overlay {
  align-items: flex-end;
  padding: 0;
}

.srv-map-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 92vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  animation: dos-fade-in var(--transition-normal) ease;
  overflow: hidden;
}

@media (min-width: 640px) {
  .srv-map-overlay {
    align-items: center;
    padding: 16px;
  }

  .srv-map-shell {
    height: 88vh;
    border-radius: var(--radius-xl);
  }
}

.srv-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.srv-map-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.srv-map-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.srv-map-tabs button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.srv-map-tabs button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.srv-map-canvas {
  flex: 1;
  min-height: 240px;
  background: var(--surface-2);
}

.srv-map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.srv-map-panel {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.srv-map-panel-empty {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 0;
}

.srv-map-pinfo {
  display: flex;
  flex-direction: column;
}

.srv-map-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--primary);
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.3));
}

.srv-map-marker.selected {
  color: var(--danger);
}

.srv-map-name {
  position: absolute;
  top: -14px;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.leaflet-container {
  font-family: inherit;
  border-radius: 0;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px 0;
}

.chat-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}

.chat-msg.me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.chat-msg.other {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.srv-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.srv-item-row .qty {
  width: 64px;
}

/* ═══ منوی AI — حباب گرادیانی برجسته ═══ */

.bottom-nav .nav-ai {
  position: relative;
  cursor: pointer;
}

.bottom-nav .nav-ai .ai-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b96bff 0%, #ff5c8a 55%, #ffc24b 125%);
  box-shadow:
    0 5px 14px rgb(185 107 255 / 0.5),
    inset 0 0 0 2px rgb(255 255 255 / 0.28);
  margin-top: -4px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: ai-bubble-glow 3s ease-in-out infinite;
}

.bottom-nav .nav-ai .ai-bubble svg {
  width: 17px;
  height: 17px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));
}

.bottom-nav .nav-ai .ai-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #b96bff, #ff5c8a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.bottom-nav .nav-ai:hover .ai-bubble,
.bottom-nav .nav-ai.active .ai-bubble {
  transform: scale(1.1);
}

.bottom-nav .nav-ai.active .ai-bubble {
  animation: none;
  box-shadow:
    0 6px 20px rgb(255 92 138 / 0.65),
    inset 0 0 0 2px rgb(255 255 255 / 0.35);
}

@keyframes ai-bubble-glow {
  0%,
  100% {
    box-shadow:
      0 5px 14px rgb(185 107 255 / 0.5),
      inset 0 0 0 2px rgb(255 255 255 / 0.28);
  }
  50% {
    box-shadow:
      0 5px 20px rgb(255 92 138 / 0.75),
      inset 0 0 0 2px rgb(255 255 255 / 0.28);
  }
}

/* ═══════════════ Header button (bell / avatar) ═══════════════ */

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.icon-btn:hover {
  background: var(--neutral-100);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--primary-soft-border, rgba(91, 79, 207, 0.28));
  background: linear-gradient(135deg, var(--primary-soft, rgba(91, 79, 207, 0.14)), rgba(91, 79, 207, 0.06));
  color: var(--primary);
  box-shadow: 0 2px 6px rgb(91 79 207 / 0.12);
}

.icon-box svg {
  width: 19px;
  height: 19px;
}

.icon-box .person-switcher-avatar,
.person-switcher.icon-box .person-switcher-avatar {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
}

.icon-box .person-switcher-avatar svg {
  width: 18px;
  height: 18px;
}

.person-switcher.icon-box .person-switcher-avatar svg {
  width: 18px;
  height: 18px;
}

.sound-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.notif-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text-primary, #fff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: 10px;
  font-weight: 700;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* ═══════════════ Toast ═══════════════ */

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--neutral-800);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal);
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast-success { background: var(--success); }
.toast-danger { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* ═══════════════ Modal ═══════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto;
  max-width: 480px;
  background: rgb(0 0 0 / 0.5);
  overscroll-behavior: contain;
}

.modal-overlay .modal {
  overscroll-behavior: contain;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  animation: dos-fade-in var(--transition-normal) ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }

  .modal {
    max-width: 480px;
    border-radius: var(--radius-xl);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
}

.modal-foot .btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════ Progress bar / ring ═══════════════ */

.progress-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 300ms ease;
}

.ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ring svg {
  transform: rotate(-90deg);
}

.ring-label {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
}

/* ═══════════════ OTP ═══════════════ */

.otp-box {
  display: flex;
  justify-content: center;
  gap: 8px;
  direction: ltr;
}

.otp-box input {
  width: 44px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.otp-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.otp-box input.filled {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══════════════ DrugCard ═══════════════ */

.drug-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-inline-end: 4px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast);
}

.drug-card.taken {
  border-inline-end-color: var(--success);
  background: var(--success-bg);
  border-color: var(--success);
}

.drug-card.missed {
  border-inline-end-color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}

.drug-card.pending {
  border-inline-end-color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning);
}

.drug-card.paused {
  border-inline-end-color: var(--neutral-300);
  background: var(--neutral-100);
  opacity: 0.6;
}

.drug-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 16px;
  box-shadow: var(--shadow-xs);
}

.drug-info {
  flex: 1;
  min-width: 0;
}

.drug-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.drug-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
  direction: ltr;
  text-align: right;
}

.drug-detail .fa {
  direction: rtl;
}

/* ═══════════════ Empty state ═══════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  text-align: center;
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--text-tertiary);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state-title {
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-desc {
  max-width: 300px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══════════════ Skeleton ═══════════════ */

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--neutral-100) 25%,
    var(--neutral-200) 50%,
    var(--neutral-100) 75%
  );
  background-size: 200% 100%;
  animation: dos-shimmer 1.4s infinite;
}

/* ═══════════════ Stock bar ═══════════════ */

.stock-track {
  height: 8px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.stock-fill.low {
  background: var(--warning);
}

.stock-fill.ok {
  background: var(--success);
}

/* ═══════════════ Calendar ═══════════════ */

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-head {
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 44px;
  height: 40px;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.cal-day:hover {
  background: var(--neutral-100);
}

.cal-day.out-month {
  color: var(--text-tertiary);
}

.cal-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.cal-day.selected {
  background: var(--primary-light);
  font-weight: 700;
  color: var(--primary);
}

.cal-dot {
  width: 6px;
  height: 6px;
  margin-top: 2px;
  border-radius: var(--radius-full);
}

.cal-dot.complete { background: var(--success); }
.cal-dot.partial { background: var(--warning); }
.cal-dot.missed { background: var(--danger); }
.cal-dot.neutral { background: var(--neutral-200); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ═══════════════ Adherence chart ═══════════════ */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
}

.chart-col {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
}

.chart-col.complete { background: var(--success); }
.chart-col.partial { background: var(--warning); }
.chart-col.missed { background: var(--danger); }
.chart-col.none { background: var(--neutral-200); }

/* ═══════════════ Quick actions (DQA — rebuilt) ═══════════════ */

.dqa-sec {
  width: 100%;
  padding-bottom: 22px;
}

.dqa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 10px;
}

.dqa-head h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.dqa-ver {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--neutral-100);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.dqa-grid > a {
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* ═══════════════ AI banner ═══════════════ */

.ai-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
}

.ai-banner svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--primary);
  margin-top: 2px;
}

.ai-banner p {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════ Warning banner (low stock) ═══════════════ */

.warn-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  margin-top: 10px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
}

.warn-banner > svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--warning);
}

/* ═══════════════ Medication card (list) ═══════════════ */

.med-card {
  padding: 12px;
}

.med-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.med-glyph-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.med-status-dot {
  position: absolute;
  bottom: -2px;
  inset-inline-end: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #fff);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
}

.med-status-dot.on {
  background: #22c55e;
}

.med-status-dot.off {
  background: #f59e0b;
}

.med-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.6;
}

.med-dose {
  font-size: 11px;
  color: var(--text-secondary);
}

.med-big-time {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}

.med-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.med-actions .btn {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding-inline: 4px;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
  border-radius: var(--radius-full);
}

.med-actions .btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.med-actions .btn.med-del-icon {
  flex: 0 0 auto;
  width: 34px;
  padding: 0;
  justify-content: center;
}

.med-card .drug-name {
  font-size: 11.5px;
}

.med-card .text-xs {
  font-size: 10px;
}

.med-card .med-actions .btn {
  font-size: 10px;
}

.med-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.med-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--warning);
}

.med-card.paused-card {
  opacity: 0.8;
}

/* ─── Wizard ─── */

.wizard-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.wizard-step-head .step-title {
  font-weight: 500;
  color: var(--text-primary);
}

.wizard-step-head .step-pct {
  color: var(--text-tertiary);
}

/* ─── Wizard Stepper (نسخه جدید) ─── */

.wiz-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 12px;
}

.wiz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  min-width: 72px;
}

.wiz-step-dot {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 2px solid var(--neutral-200);
  color: var(--text-tertiary);
  transition: all var(--transition-normal);
  z-index: 2;
}

.wiz-step.active .wiz-step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.wiz-step.done .wiz-step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.wiz-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.wiz-step.active .wiz-step-label {
  color: var(--primary);
}

.wiz-step-line {
  position: absolute;
  top: 16px;
  right: calc(50% + 20px);
  left: calc(-50% + 20px);
  height: 2px;
  background: var(--neutral-200);
}

.wiz-step-line.done {
  background: var(--success);
}

.wiz-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border: 1px solid var(--border);
  margin-bottom: 4px;
}

.wiz-preview-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-sm);
}

.wiz-preview-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.wiz-preview-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.chip:hover {
  background: var(--bg-soft);
}

.chip.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.chip-reminder.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.chip-reminder.selected svg {
  color: #fff;
}

.chip-reminder.selected:hover {
  background: var(--primary);
}

.chip .dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--neutral-300);
}

.chip.selected .dot {
  border-color: var(--primary);
  background: var(--primary);
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--neutral-50);
  font-size: 13px;
}

.time-chip svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.time-chip .remove {
  color: var(--text-tertiary);
  display: inline-flex;
}

.time-chip .remove:hover {
  color: var(--danger);
}

.time-chip .remove svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════ Notification center ═══════════════ */

.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  margin: 0 auto;
  max-width: 480px;
  background: rgb(15 23 42 / 0.4);
}

.notif-panel {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 81;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 32px);
  max-width: 480px;
  max-height: 75vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: dos-fade-in var(--transition-normal) ease;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.notif-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.notif-filter {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.notif-filter button {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.notif-filter button:hover {
  background: var(--neutral-100);
}

.notif-filter button.active {
  background: var(--primary-light);
  color: var(--primary);
}

.notif-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  transition: background var(--transition-fast);
}
.notif-list>.notif-item:not(.notif-pinned){padding:10px 14px}
.notif-list>.notif-item:not(.notif-pinned) .notif-icon{width:32px;height:32px}

.notif-item:hover {
  background: var(--neutral-50);
}

.notif-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.notif-icon svg {
  width: 18px;
  height: 18px;
}

.notif-icon.danger { background: var(--danger-bg); color: var(--danger); }
.notif-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notif-icon.success { background: var(--success-bg); color: var(--success); }

.notif-title {
  font-size: 13px;
  color: var(--text-primary);
}

.notif-title.unread {
  font-weight: 600;
}

.notif-title.read {
  color: var(--text-tertiary);
}

.notif-account {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-soft, rgba(91, 79, 207, 0.14));
  color: var(--primary, #5b4fcf);
  font-size: 11px;
  font-weight: 600;
}

.notif-account svg {
  width: 12px;
  height: 12px;
}

.notif-time .notif-account {
  margin-top: 0;
}

.notif-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.notif-cat {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  font-size: 10px;
}

.notif-empty {
  padding: 40px 16px;
  text-align: center;
}


/* ═══════════════ پاداش پایبندی — پیام ثابت (زنگوله) ═══════════════ */
.notif-pinned{position:relative;background:linear-gradient(135deg, rgba(16,185,129,0.10), rgba(99,102,241,0.10)),var(--bg-card);border:1px solid rgba(16,185,129,0.28);border-radius:14px;cursor:pointer}
.notif-pinned-wrap{position:sticky;top:0;z-index:5;display:flex;flex-direction:column;gap:10px;padding:12px 14px;margin:-12px -14px 0;background:var(--bg-card);border-bottom:1px solid var(--border)}
.notif-pinned:hover{background:linear-gradient(135deg, rgba(16,185,129,0.14), rgba(99,102,241,0.14)),var(--bg-card)}
.notif-pinned .notif-icon.reward{background:linear-gradient(135deg,#10b981,#6366f1);color:#fff}
.notif-pinned-arrow{display:flex;align-items:center;color:var(--text-tertiary);flex-shrink:0}
.notif-pinned .notif-title{color:var(--text-primary)}
/* پاپاپ پاداش — تم روشن/تیره هماهنگ با باکس‌های تقویم/پرونده */
.reward-modal-overlay{z-index:82;background:rgba(15,23,42,0.48);backdrop-filter:blur(12px)}
html[data-theme='light'] .reward-modal-overlay{background:rgba(45,40,66,0.32)}
.reward-modal{max-width:540px;width:calc(100vw - 24px);max-height:86vh;display:flex;flex-direction:column;border-radius:22px;overflow:hidden;background:var(--bg-card);border:1px solid var(--border);box-shadow:var(--shadow-xl)}
.reward-modal-creative{position:relative;background:var(--bg-card)}
.reward-close{position:absolute;top:12px;left:12px;z-index:3;width:34px;height:34px;border-radius:999px;border:1px solid var(--border);background:var(--bg-card);color:var(--text-primary);display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow-sm)}
.reward-close:hover{background:var(--neutral-100);border-color:var(--border-strong);transform:scale(1.05)}
.reward-close svg{width:16px;height:16px}
.reward-hero-creative{position:relative;padding:22px 20px 16px;text-align:center;overflow:hidden;background:linear-gradient(135deg,var(--primary-light),var(--accent-light),var(--bg-soft));border-bottom:1px solid var(--border)}
html[data-theme='dark'] .reward-hero-creative{background:linear-gradient(135deg,rgba(124,111,217,0.16),rgba(91,196,183,0.12),rgba(45,40,66,0.08));border-bottom-color:rgba(255,255,255,0.06)}
.reward-hero-creative.unlocked{background:linear-gradient(135deg,var(--amber-light),var(--primary-light)) !important}
html[data-theme='dark'] .reward-hero-creative.unlocked{background:linear-gradient(135deg,rgba(217,164,74,0.18),rgba(124,111,217,0.14)) !important}
.rhero-glow{position:absolute;inset:-30% -20% auto -20%;height:140px;background:radial-gradient(ellipse at 50% 0%, rgba(124,111,217,0.16), transparent 60%);pointer-events:none}
.rhero-icon{width:56px;height:56px;margin:0 auto 10px;border-radius:16px;display:grid;place-items:center;background:var(--grad-primary);color:#fff;box-shadow:var(--shadow-primary)}
.reward-hero-creative.unlocked .rhero-icon{background:linear-gradient(135deg,#f59e0b,#fbbf24);animation:rpop 0.6s ease}
@keyframes rpop{0%{transform:scale(0.7)} 40%{transform:scale(1.15)} 100%{transform:scale(1)}}
.reward-hero-creative h3{font-size:18px;font-weight:900;color:var(--text-primary);margin:0}
.rhero-sub{font-size:11px;color:var(--text-secondary);margin-top:4px}
.rhero-streak{display:inline-flex;align-items:baseline;gap:6px;margin-top:10px;background:var(--bg-card);border:1px solid var(--border);padding:6px 12px;border-radius:999px;box-shadow:var(--shadow-sm)}
.rhero-num{font-size:18px;font-weight:900;color:var(--text-primary)}
.rhero-of{font-size:11px;color:var(--text-tertiary)}
.rhero-pct{font-size:11px;font-weight:800;color:var(--success);background:var(--success-bg);padding:2px 8px;border-radius:999px;border:1px solid rgba(76,191,168,0.18)}
.rhero-track{height:8px;border-radius:999px;background:var(--neutral-100);border:1px solid var(--border);overflow:hidden;margin:12px 8px 0}
html[data-theme='dark'] .rhero-track{background:rgba(255,255,255,0.06);border-color:rgba(255,255,255,0.06)}
.rhero-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#7c6fd9,#8b7fe0,#5bc4b7);transition:width 0.8s ease}
.rsteps{display:flex;gap:4px;justify-content:center;margin-top:10px;flex-wrap:wrap}
.rstep{width:22px;height:22px;border-radius:999px;display:grid;place-items:center;font-size:9px;font-weight:700;background:var(--bg-card);color:var(--text-tertiary);border:1px solid var(--border)}
.rstep.done{background:var(--success);color:#fff;border-color:var(--success);box-shadow:0 2px 8px rgba(76,191,168,0.28)}
.rstep.current{background:var(--amber-light);color:var(--amber);border-color:var(--amber);animation:rpulse 1.6s infinite;box-shadow:var(--glow-gold)}
@keyframes rpulse{0%,100%{transform:scale(1)} 50%{transform:scale(1.08)}}
.rhero-msg{font-size:11px;color:var(--text-secondary);margin-top:10px;line-height:1.7;background:var(--primary-light);padding:8px 10px;border-radius:10px;border:1px dashed var(--border);font-weight:500}
html[data-theme='dark'] .rhero-msg{background:rgba(124,111,217,0.08);color:#cbd5e1}
.rinfo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 12px}
.rinfo{padding:10px;border-radius:12px;background:var(--bg-card);border:1px solid var(--border);text-align:center;box-shadow:var(--shadow-sm)}
.rinfo span{font-size:9px;color:var(--text-tertiary);display:block;font-weight:600}
.rinfo b{font-size:12px;color:var(--text-primary);display:block;margin-top:2px}
.rinfo small{font-size:9px;color:var(--text-tertiary)}
/* باکس‌های ویژگی — مطابق تم تقویم/پرونده (card) */
.reward-creative-list{display:grid;gap:8px;margin-top:4px}
.reward-creative-list .reward-rail-item{flex:unset !important}
.reward-creative-list .reward-item{display:flex;align-items:center;gap:10px;padding:12px;background:var(--bg-card);border:1px solid var(--border) !important;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);transition:transform 0.15s, box-shadow 0.15s}
.reward-creative-list .reward-item:hover{transform:translateY(-1px);box-shadow:var(--shadow-md);border-color:var(--border-strong) !important}
.reward-creative-list .reward-item.unlocked{background:linear-gradient(135deg,var(--bg-card),var(--primary-light));border-color:var(--primary) !important}
.reward-creative-list .reward-item .icon-tile{flex-shrink:0}
.reward-creative-list .reward-name{font-size:12px;font-weight:700;color:var(--text-primary)}
.reward-creative-list .text-faint{color:var(--text-tertiary)}
.rquote{margin-top:12px;padding:10px 12px;border-radius:12px;background:var(--bg-soft);border:1px solid var(--border);font-size:11px;color:var(--text-secondary);text-align:center;line-height:1.7;font-weight:500}
html[data-theme='dark'] .rquote{background:rgba(255,255,255,0.04);color:#cbd5e1}
.rconfetti{position:absolute;top:0;left:0;right:0;height:90px;pointer-events:none;overflow:hidden}
.rconfetti i{position:absolute;top:-10px;width:7px;height:14px;border-radius:2px;animation:rfall 1.8s ease-in forwards}
.rconfetti i:nth-child(1){left:12%;background:#34d399;animation-delay:0s;transform:rotate(15deg)}
.rconfetti i:nth-child(2){left:24%;background:#60a5fa;animation-delay:0.15s;transform:rotate(-10deg)}
.rconfetti i:nth-child(3){left:36%;background:#fbbf24;animation-delay:0.3s;transform:rotate(20deg)}
.rconfetti i:nth-child(4){left:48%;background:#f87171;animation-delay:0.1s;transform:rotate(-15deg)}
.rconfetti i:nth-child(5){left:60%;background:#a78bfa;animation-delay:0.25s;transform:rotate(10deg)}
.rconfetti i:nth-child(6){left:72%;background:#34d399;animation-delay:0.05s;transform:rotate(-20deg)}
.rconfetti i:nth-child(7){left:84%;background:#fbbf24;animation-delay:0.2s;transform:rotate(12deg)}
.rconfetti i:nth-child(8){left:92%;background:#60a5fa;animation-delay:0.35s;transform:rotate(-8deg)}
@keyframes rfall{0%{transform:translateY(-10px) rotate(0deg);opacity:1} 100%{transform:translateY(90px) rotate(180deg);opacity:0}}
.reward-modal .modal-body{padding:14px}
.reward-modal .modal-foot{display:flex;gap:8px;justify-content:flex-end;padding:12px;border-top:1px solid var(--border);background:var(--bg-soft)}


/* ═══════════════ Login page ═══════════════ */

.auth-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--bg-page), var(--primary-light));
}

.auth-center {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-logo {
  margin-bottom: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.auth-subtitle {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  font-weight: 600;
  color: var(--primary);
}

.auth-footer a:hover {
  color: var(--primary-dark);
}

.auth-note {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--accent-light);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-dark);
}

.test-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.resend-row {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.resend-row button {
  font-weight: 600;
  color: var(--accent);
}

.resend-row button:hover {
  color: var(--accent-dark);
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  /* فرم تحلیل BMI همیشه دو کادر در هر ردیف */
  .bmi-calc-grid.grid-2,
  .grid-2.bmi-calc-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* در تب اطلاعات فردی، همیشه دو ستونه بماند (نام/نام‌خانوادگی کنار هم) */
  .profile-page .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  /* در نمای کلی مرکز سلامت، همیشه دو باکس در هر ردیف (به‌جز گزارش ۷ و خلق‌وخو که تمام‌عرض‌اند) */
  .grid-2.hh-ov2 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .grid-2.hh-ov2 > * {
    min-width: 0;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .grid-3 .card-pad-sm {
    padding: 8px;
  }

  .grid-3 .row-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .grid-3 .ring svg {
    width: 44px;
    height: 44px;
  }

  .grid-3 .ring-label {
    font-size: 13px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #app {
    box-shadow: none;
    min-height: 100dvh;
  }
}

/* ═══════════════ یکسان‌سازی نمایش در همه موبایل‌ها ═══════════════
   طراحی بر پایه عرض ثابت قاب موبایلی (max-width: 480px) است؛
   در صفحه‌های بزرگ‌تر، #app وسط‌چین با همان عرض می‌ماند و
   در صفحه‌های کوچک‌تر، مقیاس‌بندی نرم فونت از طریق root انجام می‌شود.
   جلوگیری از بهم‌ریختگی layout در Samsung/Xiaomi/Huawei و تبلت‌ها */
html {
  font-size: clamp(14px, 4.2vw, 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#app {
  max-width: 480px;
  margin-inline: auto;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════ سازگاری با گوشی‌های باریک و متنوع ═══════════════
   زیر 360px: فاصله‌ها کم می‌شود و متن انگلیسی عنوان مخفی تا
   دکمه‌های هدر جابجا نشوند. منوی پایین هم فشرده‌تر می‌شود */
@media (max-width: 359px) {
  .topbar {
    gap: 4px;
    padding-inline: 10px;
  }

  .topbar-title-en {
    display: none;
  }

  .bottom-nav {
    width: calc(100% - 16px);
  }

  .bottom-nav a,
  .bottom-nav button,
  .bottom-nav span {
    font-size: 8px;
  }
}

/* ارتفاع کم (لنداسکیپ موبایل / تبلت افقی): ناوبری جمع‌وجور */
@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --header-h: 48px;
    --nav-h: 48px;
  }
}

/* ═══════════════ دستیار AI ═══════════════ */

.ai-suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.55;
}

.ai-suggest-ic {
  display: inline-flex;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-top: 1px;
}

.ai-suggest-ic svg {
  width: 13px;
  height: 13px;
}

.ai-chat-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100dvh - var(--header-h) - var(--nav-h) - 100px);
  min-height: calc(100dvh - var(--header-h) - var(--nav-h) - 100px);
}

@supports not (height: 100dvh) {
  .ai-chat-card {
    height: calc(100vh - var(--header-h) - var(--nav-h) - 100px);
    min-height: calc(100vh - var(--header-h) - var(--nav-h) - 100px);
  }
}

.ai-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-chat-head svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.ai-chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-msg.bot {
  align-self: flex-start;
  background: var(--bg-soft);
  border-start-start-radius: 4px;
  color: var(--text-primary);
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--primary);
  border-end-end-radius: 4px;
  color: #fff;
}

.ai-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.ai-chips::-webkit-scrollbar {
  display: none;
}

.ai-chips .chip {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11.5px;
  padding: 6px 10px;
}

.ai-input-row {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.ai-input-row .btn {
  flex-shrink: 0;
}

/* ═══════════════ شبکه خانوادگی ═══════════════ */

.net-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--primary), var(--network));
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-primary);
}

.net-hero-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.18);
}

.net-hero-ic svg {
  width: 22px;
  height: 22px;
}

.net-hero h2 {
  font-size: 16px;
  font-weight: 800;
}

.net-hero p {
  margin-top: 2px;
  font-size: 12px;
  color: rgb(255 255 255 / 0.85);
}

.net-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--network-light);
  border: 1px solid var(--network);
  border-radius: var(--radius-md);
  color: var(--network);
}

.net-alert > svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.net-member {
  position: relative;
}

.member-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

.online-dot {
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
  background: var(--success);
  border: 2px solid var(--bg-card);
}

.online-dot.offline {
  background: var(--neutral-300);
}

.net-meds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.net-med {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
}

.net-med.taken {
  background: var(--success-bg);
  color: var(--success);
}

.net-med.missed {
  background: var(--danger-bg);
  color: var(--danger);
}

.net-med.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.net-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.net-head-actions .badge {
  white-space: nowrap;
}

.net-head-actions .btn {
  height: 28px;
  padding-inline: 8px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
  border-radius: var(--radius-full);
}

.net-head-actions .btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.net-member .drug-name {
  font-size: 11.5px;
}

.net-member .drug-name span {
  margin-inline-start: 4px;
}

.net-member .text-xs {
  font-size: 10px;
}

.net-member .net-head-actions .btn {
  font-size: 10px;
}

.net-event {
  display: flex;
  align-items: center;
  gap: 10px;
}

.net-event-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.net-event-ic svg {
  width: 14px;
  height: 14px;
}

.net-event-ic.taken { background: var(--success-bg); color: var(--success); }
.net-event-ic.missed { background: var(--danger-bg); color: var(--danger); }
.net-event-ic.reminder_sent { background: var(--warning-bg); color: var(--warning); }
.net-event-ic.shopping { background: var(--primary-light); color: var(--primary); }

/* ═══════════════ Switch toggle ═══════════════ */

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--neutral-300);
  transition: background var(--transition-fast);
}

.switch .switch-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: inset-inline-start var(--transition-fast);
}

.switch.active {
  background: var(--primary);
}

.switch.active .switch-thumb {
  inset-inline-start: calc(100% - 23px);
}

/* ═══════════════ صفحه یادآور دارو ═══════════════ */

.rem-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rem-row .rem-time-input {
  flex: 1;
  min-width: 0;
  max-width: 130px;
}

.reminders-card.flash {
  animation: dos-flash 600ms ease;
}

@keyframes dos-flash {
  0%, 100% { box-shadow: var(--shadow-sm); border-color: var(--border); }
  50% { box-shadow: 0 0 0 4px var(--success-bg); border-color: var(--success); }
}

/* ═══════════════ مودال اطلاعات دارو ═══════════════ */

.drug-info-sec {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.drug-info-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.drug-info-ic svg {
  width: 15px;
  height: 15px;
}

.drug-info-ic.success { background: var(--success-bg); color: var(--success); }
.drug-info-ic.warning { background: var(--warning-bg); color: var(--warning); }
.drug-info-ic.danger { background: var(--danger-bg); color: var(--danger); }
.drug-info-ic.teal { background: var(--teal-light); color: var(--teal); }

.drug-info-title {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.drug-info-chip {
  font-size: 11.5px;
  padding: 5px 10px;
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.drug-info-modal .modal-body {
  font-size: 12px;
}

.drug-info-modal .modal-body > .font-bold {
  font-size: 13px;
}

.drug-info-modal .drug-info-sec {
  gap: 8px;
  margin-bottom: 9px;
}

.drug-info-modal .drug-info-sec p {
  font-size: 12px;
  line-height: 1.7;
}

.drug-info-modal .drug-info-chip {
  font-size: 11px;
  padding: 4px 8px;
}

.drug-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.drug-info-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 11px;
}

.drug-info-meta svg {
  width: 12px;
  height: 12px;
}

/* ═══════════════ مشاوره ═══════════════ */

textarea.input {
  height: auto;
  min-height: 84px;
  padding-block: 9px;
  resize: vertical;
  line-height: 1.7;
}

.consult-faq {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.consult-faq:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

/* ═══════════════ پرونده سلامت ═══════════════ */

.badge svg {
  vertical-align: -2px;
  margin-inline-end: 2px;
}

/* ═══ سوییچر فرد و منوی افراد تحت مراقبت ═══ */

.person-switcher {
  position: relative;
}

.person-switcher-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft, rgba(91, 79, 207, 0.14));
  color: var(--primary, #5b4fcf);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.person-switcher-avatar svg {
  width: 15px;
  height: 15px;
}

.person-switcher.active .person-switcher-avatar {
  box-shadow: 0 0 0 2px var(--primary, #5b4fcf);
}

.person-menu {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 81;
  width: calc(100vw - 32px);
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h) - 16px);
  max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px) - 16px);
  display: flex;
  flex-direction: column;
}

.person-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.person-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14px;
  text-align: start;
}

.person-menu-item:hover {
  background: var(--bg-soft);
}

.person-menu-item.active {
  background: var(--primary-soft, rgba(91, 79, 207, 0.1));
}

.person-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.person-menu-item.active .person-menu-avatar {
  background: var(--primary, #5b4fcf);
  color: #fff;
}

.person-menu-check {
  color: var(--primary, #5b4fcf);
  display: inline-flex;
}

.person-menu-manage {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  color: var(--primary, #5b4fcf);
  font-weight: 600;
  font-size: 14px;
}

/* ═══════════════ تب‌های داروها ═══════════════ */

.med-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05);
}

.med-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.med-tab .med-tab-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--primary);
  transition: background 0.2s, color 0.2s;
}

.med-tab .med-tab-ic.shopping {
  color: var(--amber);
}

.med-tab .med-tab-ic svg {
  width: 15px;
  height: 15px;
}

.med-tab:hover {
  color: var(--text-primary);
}

.med-tab:active {
  transform: scale(0.97);
}

.med-tab.active {
  background: linear-gradient(135deg, #6d5df6, #b96bff);
  color: #fff;
  box-shadow: 0 6px 14px rgb(139 124 255 / 0.4);
}

.med-tab.active[data-tab='shopping'] {
  background: linear-gradient(135deg, var(--amber), #ff7a6b);
  box-shadow: 0 6px 14px rgb(255 194 75 / 0.35);
}

.med-tab.active .med-tab-ic {
  background: rgb(255 255 255 / 0.22);
  color: #fff;
}

.med-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

/* ═══════════════ لیست خرید ═══════════════ */

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 4px;
}

.shop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.shop-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.shop-stepper.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.shop-stepper.disabled {
  opacity: 0.45;
}

.shop-stepper.disabled:hover {
  opacity: 0.75;
}

.shop-step-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.shop-step-btn svg {
  width: 14px;
  height: 14px;
}

.shop-step-val {
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.shop-step-val b {
  color: var(--text-primary);
  font-weight: 600;
}

.shop-pack {
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--primary-light);
}

.shop-pack .row-between {
  padding-block: 3px;
}

/* ─── لیست خرید (نسخه جدید) ─── */

.shop-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.shop-banner::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 0.12);
  top: -50px;
  left: -30px;
}

.shop-banner::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 0.08);
  bottom: -35px;
  right: 60px;
}

.shop-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.shop-banner-title {
  font-weight: 800;
  font-size: 17px;
}

.shop-banner-sub {
  font-size: 11.5px;
  opacity: 0.9;
  margin-top: 2px;
}

.shop-count {
  min-width: 32px;
  height: 32px;
  padding-inline: 8px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.shop-item:hover {
  border-color: var(--neutral-300);
  box-shadow: var(--shadow-sm);
}

.shop-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.shop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  text-align: center;
}

.shop-empty-icon {
  font-size: 34px;
}

/* ═══════════════ مقاله کامل دارو ═══════════════ */

.art-body {
  line-height: 1.9;
}

.art-h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.art-h2::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 3px;
  background: var(--primary);
  display: inline-block;
}

.art-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.art-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.art-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.art-link:hover {
  border-color: var(--primary);
}

.art-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12.5px;
  line-height: 1.8;
}

/* ═══════════════ پروفایل شخصی ═══════════════ */

.prof-tabs-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prof-arrow {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.prof-arrow:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.prof-arrow svg {
  width: 14px;
  height: 14px;
}

.prof-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.prof-tabs::-webkit-scrollbar {
  display: none;
}

.prof-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  scroll-snap-align: center;
}

.prof-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.prof-tab svg {
  width: 13px;
  height: 13px;
}

.sec-row {
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
}

.sec-row:last-child {
  border-bottom: none;
}

.mr-rec {
  position: relative;
}

.mr-thumb {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid var(--border);
}

.mr-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--bg-soft);
}

.faq-item summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-item[open] summary {
  color: var(--primary);
}

/* ═══════════════ مرکز سلامت — تب‌ها تمام‌عرض + گرید ۲ ستونه ═══════════════ */
.hh-tabs-wrap {
  width: 100%;
  margin-bottom: 12px;
}
.hh-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}
.hh-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
  text-align: center;
  min-height: 52px;
  box-shadow: var(--shadow-xs);
}
.hh-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.hh-tab:active {
  transform: scale(0.97);
}
.hh-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.hh-tab.active .hh-tab-icon {
  color: #fff !important;
}
.hh-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hh-tab-label {
  line-height: 1.2;
}
.hh-grid.grid-2 {
  gap: 8px;
}
.health-records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 640px) {
  .hh-grid.grid-2 {
    grid-template-columns: 1fr 1fr !important;
  }
  .health-records-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}
/* === DosTime patch 20260922: compact dash-hero + dose rail === */
.dash-hero{padding:8px;display:flex;flex-direction:column;gap:6px}
.dash-hero-top{display:flex;justify-content:space-between;gap:8px;align-items:center}
.dash-hero-greet{display:flex;gap:6px;align-items:center;flex:1;min-width:0}
.dash-hero-icon{width:28px;height:28px;border-radius:8px;flex-shrink:0}
.dash-hero-date{font-size:9px;color:var(--text-tertiary);line-height:1;white-space:nowrap}
.dash-hero-title{font-size:12px;font-weight:800;line-height:1.2;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-hero-sub{font-size:10px;color:var(--text-secondary);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-hero-stats{display:flex;gap:4px;flex-shrink:0}
.dash-hero-stat{min-width:52px;text-align:center;padding:4px 4px;background:var(--bg-soft);border:1px solid var(--border);border-radius:8px;display:flex;flex-direction:column;gap:0}
.dash-hero-stat-val{font-size:12px;font-weight:800;color:var(--text-primary);line-height:1;white-space:nowrap}
.dash-hero-stat-val small{font-size:8px;font-weight:600;color:var(--text-tertiary)}
.dash-hero-stat-lbl{font-size:8px;color:var(--text-tertiary);line-height:1;white-space:nowrap}
.dash-hero-next{display:flex;align-items:center;gap:6px;padding:5px 6px;background:var(--primary-light);border:1px solid var(--border);border-radius:8px;font-size:10px;min-height:28px}
.dash-hero-next-txt{flex:1;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-hero-foot{display:flex;justify-content:space-between;gap:6px;align-items:center;flex-wrap:nowrap}
.dash-hero-streak{display:inline-flex;align-items:center;gap:3px;font-size:10px;background:var(--amber-light);padding:3px 6px;border-radius:999px;color:var(--text-primary);white-space:nowrap;flex-shrink:0}
.dash-hero-streak em{font-style:normal;color:var(--text-tertiary);font-size:9px}
.dash-hero-xp{display:flex;align-items:center;gap:4px;font-size:9px;flex:1;min-width:120px;color:var(--text-secondary);white-space:nowrap}
.xp-track.xs{height:3px;flex:1;min-width:32px}
.icon-tile.xs{width:20px;height:20px;border-radius:8px;font-size:10px}
.icon-tile.xs svg{width:12px;height:12px}
/* dose rail - horizontal scroll */
.dose-rail{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding:4px 2px 8px;scrollbar-width:none}
.dose-rail::-webkit-scrollbar{display:none}
.dose-rail-item{flex:0 0 auto;scroll-snap-align:start;min-width:260px;max-width:280px}
.dose-rail-item .drug-card{margin:0;flex-wrap:wrap;gap:6px 8px;padding:10px;align-items:center}
.dose-rail-item .drug-card .drug-glyph{flex:0 0 auto}
.dose-rail-item .drug-card .drug-info{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.dose-rail-item .drug-card .drug-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.dose-rail-item .drug-card .drug-detail{white-space:nowrap;flex-shrink:0;margin-top:0;font-size:11px}
.dose-rail-item .drug-card .badge{flex:0 0 auto}
.dose-rail-item .drug-card .btn{flex:1 1 0;min-width:0;justify-content:center;margin-top:2px}
@media (max-width:360px){
  .dash-hero-stats{gap:4px}
  .dash-hero-stat{min-width:50px;padding:5px 4px}
  .dose-rail-item{min-width:170px;max-width:185px}
}

.health-overview{padding:12px}
.health-radial-wrap{display:flex;align-items:center;gap:16px;justify-content:center;flex-wrap:wrap}
.health-radial-wrap svg{flex-shrink:0;filter:drop-shadow(0 4px 12px rgba(0,0,0,0.08))}
.health-legend{display:flex;flex-direction:column;gap:8px;min-width:120px}
.hl-item{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary);white-space:nowrap}
.hl-item i{width:10px;height:10px;border-radius:999px;flex-shrink:0;display:inline-block}
.hl-item b{font-weight:700;color:var(--text-primary)}
@media (max-width:360px){.health-radial-wrap{flex-direction:column}.health-legend{flex-direction:row;flex-wrap:wrap;justify-content:center}}

/* === health-xl big creative overview (Chart.js + SVG radial) === */
.health-overview.health-xl{padding:0;overflow:hidden;border-radius:22px;border:1px solid var(--border);background:linear-gradient(160deg,var(--bg-card),var(--bg-soft));box-shadow:var(--shadow-md);margin-bottom:14px}
.hr-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 18px 14px;background:linear-gradient(135deg,rgba(124,111,217,.14),rgba(91,196,183,.12));border-bottom:1px solid var(--border)}
.hr-eyebrow{font-size:10px;font-weight:700;color:var(--primary);letter-spacing:.3px;margin-bottom:2px}
.hr-head h2{font-size:17px;font-weight:900;color:var(--text-primary)}
.hr-sub{font-size:11px;color:var(--text-secondary);margin-top:2px}
.hr-badge{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:78px;padding:10px 12px;border-radius:16px;background:var(--grad-primary);color:#fff;box-shadow:var(--shadow-primary)}
.hr-badge-num{font-size:20px;font-weight:900;line-height:1}
.hr-badge span:last-child{font-size:10px;opacity:.9}
.hr-main{display:flex;gap:16px;padding:18px;align-items:center}
.hr-radial{flex:0 0 250px;display:flex;flex-direction:column;align-items:center;gap:10px}
.hr-svg{width:250px;height:250px}
.hr-ring-anim{animation:hrDash 1.1s ease}
@keyframes hrDash{from{stroke-dashoffset:600}to{stroke-dashoffset:var(--off,0)}}
.hr-score{font-size:34px;font-weight:900;fill:var(--text-primary)}
.hr-score-sub{font-size:13px;font-weight:800;fill:var(--primary)}
.hr-score-cap{font-size:10px;fill:var(--text-tertiary)}
.hr-legend{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;font-size:10px;color:var(--text-secondary)}
.hr-legend span{display:inline-flex;align-items:center;gap:4px;background:var(--bg-soft);border:1px solid var(--border);padding:3px 8px;border-radius:999px;white-space:nowrap}
.hr-legend i{width:8px;height:8px;border-radius:99px;display:inline-block}
.hr-grid{flex:1;display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0}
.hr-mcard{background:var(--bg-card);border:1px solid var(--border);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:8px;box-shadow:var(--shadow-xs)}
.hr-mtop{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary)}
.hr-mtop b{margin-inline-start:auto;font-size:14px;color:var(--text-primary)}
.hr-dot{width:10px;height:10px;border-radius:99px;flex-shrink:0}
.hr-bar{height:7px;border-radius:99px;background:var(--bg-soft);overflow:hidden}
.hr-fill{height:100%;border-radius:99px;transition:width .8s ease}
.hr-mcard small{font-size:10px;color:var(--text-tertiary)}
.hr-bottom{display:grid;grid-template-columns:1.2fr .8fr;gap:10px;padding:0 18px 18px}
.hr-week,.hr-donut{background:var(--bg-card);border:1px solid var(--border);border-radius:14px;padding:12px}
.hr-week-head{display:flex;justify-content:space-between;font-size:11px;font-weight:700;color:var(--text-primary);margin-bottom:10px}
.hr-week-hint{font-size:9px;color:var(--text-tertiary);font-weight:400}
.hr-wrow{display:flex;gap:6px;align-items:flex-end;justify-content:space-between}
.hr-wcol{display:flex;flex-direction:column;align-items:center;gap:4px;flex:1;font-size:9px;color:var(--text-tertiary)}
.hr-wtrack{height:96px;display:flex;align-items:flex-end;background:var(--bg-soft);border-radius:8px;padding:3px;width:100%;justify-content:center}
.hr-wfill{width:70%;border-radius:6px;min-height:4px}
.hr-canvas-wrap{position:relative;height:170px;display:flex;align-items:center;justify-content:center}
.hr-canvas-wrap canvas{max-height:170px}
.hr-donut-center{position:absolute;display:flex;flex-direction:column;align-items:center;pointer-events:none}
.hr-donut-center b{font-size:20px;color:var(--text-primary)}
.hr-donut-center span{font-size:10px;color:var(--text-tertiary)}
@media (max-width:420px){.hr-main{flex-direction:column}.hr-radial{flex:none}.hr-bottom{grid-template-columns:1fr}.hr-svg{width:230px;height:230px}}

/* === v3: BMI + records halves + advice rail === */
a.hr-mcard{text-decoration:none;color:inherit;display:flex}
.hr-half{background:var(--bg-card);border:1px solid var(--border);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;min-width:0}
.hr-half-head{display:flex;align-items:center;gap:8px}
.hr-half-head>div{flex:1;min-width:0}
.hr-half-head b{font-size:12px;color:var(--text-primary);display:block}
.hr-half-head small{font-size:10px;color:var(--text-tertiary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hr-half-val{font-size:20px;font-weight:900}
.hr-canvas-wrap.bmi{height:120px}
.hr-empty{position:absolute;font-size:10px;color:var(--text-tertiary)}
.hr-half-meta{display:flex;justify-content:space-between;font-size:10px;color:var(--text-secondary)}
.hr-rec-rows{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.hr-rec-row{display:flex;justify-content:space-between;padding:8px 10px;font-size:11px;color:var(--text-secondary)}
.hr-rec-row+.hr-rec-row{border-top:1px solid var(--border)}
.hr-rec-row b{color:var(--text-primary)}
.hr-advice{padding:0 18px 18px}
.hr-advice-head{display:flex;justify-content:space-between;font-size:11px;font-weight:800;color:var(--text-primary);margin-bottom:8px}
.hr-advice-head small{font-size:9px;color:var(--text-tertiary);font-weight:400}
.hr-advice-rail{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 8px;scroll-snap-type:x mandatory;scrollbar-width:none}
.hr-advice-rail::-webkit-scrollbar{display:none}
.hr-tip{flex:0 0 230px;scroll-snap-align:start;display:flex;align-items:center;gap:8px;background:var(--bg-card);border:1px solid var(--border);border-radius:14px;padding:10px;text-decoration:none;color:inherit;box-shadow:var(--shadow-xs)}
.hr-tip-tx{flex:1;min-width:0}
.hr-tip-tx b{font-size:11px;color:var(--text-primary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hr-tip-tx small{font-size:10px;color:var(--text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hr-tip-go{color:var(--text-tertiary);font-size:16px}

/* === v4: gauges + lifestyle + labs === */
.hr-gauge{display:flex;flex-direction:column;gap:5px;padding:9px 0;border-top:1px solid var(--border)}
.hr-gauge:first-of-type{border-top:none}
.hr-gauge-top{display:flex;justify-content:space-between;font-size:11px;color:var(--text-secondary)}
.hr-gauge-top b{color:var(--text-primary);font-size:12px}
.hr-gauge small{font-size:9px;color:var(--text-tertiary)}
.hr-life-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:0 18px 12px}
.hr-life{background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:10px 6px;text-align:center;display:flex;flex-direction:column;gap:2px;align-items:center}
.hr-life-em{font-size:18px}
.hr-life b{font-size:11px;color:var(--text-primary)}
.hr-life small{font-size:9px;color:var(--text-tertiary)}
.hr-life em{font-size:8px;color:var(--text-tertiary);font-style:normal}
.hr-labs{display:flex;flex-direction:column;gap:8px;padding:0 18px 12px}
.hr-lab{display:flex;gap:8px;align-items:flex-start;background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:10px}
.hr-lab b{font-size:11px;color:var(--text-primary);display:block}
.hr-lab small{font-size:10px;color:var(--text-secondary);display:block}
@media (max-width:420px){.hr-life-row{grid-template-columns:repeat(2,1fr)}}

/* === v5: single radial + forex line === */
.hr-main.single{justify-content:center}
.hr-main.single .hr-radial{flex:none}
.hr-line-box{margin:0 18px 18px;background:var(--bg-card);border:1px solid var(--border);border-radius:16px;padding:14px}
.hr-canvas-wrap.line{height:170px}
.hr-canvas-wrap.line canvas{width:100%!important;height:170px!important}

/* === v6: Oura-style contributors === */
.hr-contrib-list{display:flex;flex-direction:column;margin:0 18px 6px;border:1px solid var(--border);border-radius:14px;overflow:hidden;background:var(--bg-card)}
.hr-contrib{display:flex;align-items:center;gap:8px;padding:9px 12px}
.hr-contrib+.hr-contrib{border-top:1px solid var(--border)}
.hr-contrib-tx{flex:1;min-width:0}
.hr-contrib-tx b{font-size:11px;color:var(--text-primary);display:block}
.hr-contrib-tx small{font-size:10px;color:var(--text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hr-contrib-val{font-size:13px;font-weight:800;color:var(--text-primary);white-space:nowrap}
.hr-weights{font-size:9px;color:var(--text-tertiary);text-align:center;padding:6px 18px 12px}

/* === v7: 4 mini charts side by side === */
.hr-minis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:0 18px 18px}
.hr-mini{background:var(--bg-card);border:1px solid var(--border);border-radius:14px;padding:10px 8px;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.hr-mini>b{font-size:10px;color:var(--text-primary)}
.hr-mini small{font-size:9px;color:var(--text-tertiary);white-space:nowrap}
.hr-mini-chart{display:flex;align-items:flex-end;justify-content:center;gap:3px;height:36px;min-width:0}
.hr-mbar{width:8px;border-radius:4px;min-height:4px}
.hr-mspark{width:100%;height:36px}
.hr-mval{font-size:16px;font-weight:900}
.hr-mempty{font-size:10px;color:var(--text-tertiary)}
.hr-mdots{display:flex;gap:8px}
.hr-mdot{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:8px;color:var(--text-secondary)}
.hr-mdot i{width:10px;height:10px;border-radius:99px;display:block}
.hr-mbars{display:flex;align-items:flex-end;gap:4px;height:36px}
@media (max-width:420px){.hr-minis{grid-template-columns:repeat(2,1fr)}}

/* === v8: compact today-doses rail === */
.dose-rail{gap:8px;padding:2px 2px 6px}
.dose-rail-item{min-width:200px;max-width:220px}
.dose-rail-item .drug-card{padding:7px 8px;gap:5px 6px;border-radius:10px}
.dose-rail-item .drug-glyph{width:26px;height:26px;font-size:13px;border-radius:8px}
.dose-rail-item .drug-name{font-size:11.5px}
.dose-rail-item .drug-detail{font-size:10px}
.dose-rail-item .badge{font-size:10px;padding:3px 8px}
.dose-rail-item .btn{height:28px;font-size:11px;padding-inline:8px;gap:4px}
.dose-rail-item .btn svg{width:13px;height:13px}
@media (max-width:360px){
  .dose-rail-item{min-width:150px;max-width:165px}
}

/* === v9: slim reward hero + rail === */
.dashboard-page .reward-hero.slim{padding:10px}
.reward-slim-top{display:flex;align-items:center;gap:8px}
.reward-slim-days{font-size:13px;font-weight:800;color:var(--text-primary);white-space:nowrap}
.reward-slim-tx{flex:1;min-width:0;font-size:11px;color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reward-slim-pct{font-size:11px;font-weight:800;color:var(--success);white-space:nowrap}
.dashboard-page .reward-track.slim{height:5px;margin-top:8px}
.dashboard-page .reward-rail{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding:8px 2px 2px;margin-top:8px;scrollbar-width:none;border-top:1px dashed var(--border)}
.dashboard-page .reward-rail::-webkit-scrollbar{display:none}
.dashboard-page .reward-rail-item{flex:0 0 200px;scroll-snap-align:start;min-width:0}
.dashboard-page .reward-rail-item .reward-item{flex-direction:column;align-items:flex-start;gap:6px;padding:10px}
.dashboard-page .reward-rail-item .reward-item .flex-1{width:100%;min-width:0}
.dashboard-page .reward-rail-item .reward-name{font-size:12px}

/* === v10: outer result ring + 2 duo boxes with share donuts === */
.hr-duo{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 18px 18px}
.hr-duo-box{background:var(--bg-card);border:1px solid var(--border);border-radius:14px;padding:12px 10px;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0}
.hr-duo-title{font-size:11px;font-weight:800;color:var(--text-primary)}
.hr-duo-box>small{font-size:9px;color:var(--text-tertiary);text-align:center}
.hr-duo-row{display:flex;align-items:center;gap:12px}
.hr-duo-bars{display:flex;align-items:flex-end;gap:3px;height:52px}
.hr-duo-bars .hr-mbar{width:7px}
.hr-duo-donuts{display:flex;gap:8px;justify-content:center}
.hr-duo-cell{display:flex;flex-direction:column;align-items:center;gap:2px}
.hr-duo-cell small{font-size:9px;color:var(--text-secondary)}
.hr-donut{position:relative;display:inline-flex;align-items:center;justify-content:center}
.hr-donut-svg{width:60px;height:60px}
.hr-duo-row .hr-donut-svg{width:76px;height:76px}
.hr-donut>b{position:absolute;font-size:11px;font-weight:800;color:var(--text-primary)}
@media (max-width:420px){.hr-duo{grid-template-columns:1fr}}

/* === v11: duo boxes always side-by-side, compact === */
.hr-duo{grid-template-columns:1fr 1fr;gap:6px;margin:0 12px 14px}
.hr-duo-box{padding:8px 6px;gap:6px}
.hr-duo-title{font-size:10px}
.hr-duo-row{gap:8px}
.hr-duo-row .hr-donut-svg{width:56px;height:56px}
.hr-donut-svg{width:44px;height:44px}
.hr-donut>b{font-size:9px}
.hr-duo-bars{height:44px}
.hr-duo-bars .hr-mbar{width:5px}
.hr-duo-donuts{gap:4px}
.hr-duo-box>small{font-size:8px}
@media (max-width:420px){.hr-duo{grid-template-columns:1fr 1fr}}

/* === v12: activation checklist + reward strip === */
.hr-check{margin:0 18px 18px;border:1px solid var(--border);border-radius:14px;background:var(--bg-card);overflow:hidden}
.hr-check-title{font-size:10px;font-weight:800;color:var(--text-primary);padding:10px 12px 4px}
.hr-check-row{display:flex;align-items:center;gap:8px;padding:8px 12px;text-decoration:none;color:inherit}
.hr-check-row+.hr-check-row{border-top:1px solid var(--border)}
.hr-check-mark{width:20px;height:20px;border-radius:99px;display:flex;align-items:center;justify-content:center;font-size:11px;background:var(--bg-soft);color:var(--text-tertiary);flex-shrink:0}
.hr-check-row.done .hr-check-mark{background:var(--success-bg);color:var(--success)}
.hr-check-tx{flex:1;min-width:0}
.hr-check-tx b{font-size:11px;color:var(--text-primary);display:block}
.hr-check-tx small{font-size:10px;color:var(--text-secondary);display:block}
.hr-check-go{color:var(--text-tertiary);font-size:14px}
.hr-reward{display:flex;gap:6px;margin:0 18px 18px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.hr-reward::-webkit-scrollbar{display:none}
.hr-reward-item{flex:1;white-space:nowrap;font-size:10px;font-weight:700;background:var(--amber-light);border-radius:999px;padding:6px 10px;text-align:center;color:var(--text-primary)}

/* === v13: health options grid — 4 per row, no rail === */
.hr-rail{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;overflow:visible;padding:2px 14px 14px;scrollbar-width:none}
.hr-rail::-webkit-scrollbar{display:none}
.hr-rail > :nth-child(9){grid-column:1 / -1}
.hr-rcard{min-width:0;background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:8px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none;color:inherit}
.hr-rcard b{font-size:10px;color:var(--text-primary);white-space:nowrap}
.hr-rcard-val{font-size:12px;font-weight:800;color:var(--text-primary);white-space:nowrap}
.hr-rcard-bar{width:100%;height:4px;border-radius:99px;background:var(--bg-soft);overflow:hidden}
.hr-rcard-bar i{display:block;height:100%;border-radius:99px}
.cal-dots{display:flex;gap:3px;margin-top:2px;justify-content:center}
.cal-dots .cal-dot{margin-top:0}
.cal-dot.info{background:var(--info)}
/* === DosTime patch: back button — شناور روی کادر/فضای خالی، بدون اشغال ردیف === */
.screen{position:relative}
.screen.has-back > .page-back-row{position:sticky;top:10px;height:0;z-index:10;pointer-events:none;margin:0}
.screen.has-back > .page-back-row + *{padding-inline-start:42px;box-sizing:border-box}
.page-back-btn{position:absolute;inset-inline-start:10px;top:0;pointer-events:auto;width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:var(--bg-card);border:1px solid var(--border-strong,#bfdbfe);color:var(--text-primary);box-shadow:var(--shadow-sm);cursor:pointer;padding:0}
.page-back-btn:hover{background:var(--primary-light);border-color:var(--primary)}
.page-back-btn:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.page-back-btn svg{width:16px;height:16px}

/* === DosTime: ارتفاع یکسان + مینی‌نمودار باکس‌های روزانه تقویم === */
.grid-2.hh-ov2 .card.card-pad{height:100%;min-height:184px}
.day-box-head{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:800;color:var(--text-primary);margin-bottom:6px}
.day-box-ic{display:grid;place-items:center;width:24px;height:24px;border-radius:8px;background:var(--primary-light);color:var(--primary);flex-shrink:0}
.day-viz{min-height:48px;display:flex;align-items:center;justify-content:center;margin-top:8px}
.day-viz>.day-mini{width:100%;margin-top:0}
.day-viz>.day-dots{margin-top:0}
.day-mini{height:6px;border-radius:99px;background:var(--bg-soft,#eef2f7);overflow:hidden;margin-top:8px}
.day-mini i{display:block;height:100%;border-radius:99px}
.day-dots{display:flex;gap:5px;margin-top:8px}
.day-dots i{width:11px;height:11px;border-radius:50%;background:var(--neutral-200,#e2e8f0)}
.day-dots i.on{background:#f59e0b}

/* ===== Symptom reward popup: top text never clipped (scoped) ===== */
.modal-overlay.symptom-overlay{align-items:center;overflow-y:auto;overscroll-behavior:contain;padding:14px 12px}
.modal-overlay.symptom-overlay .reward-modal{margin:auto;max-height:calc(94dvh - 28px);width:calc(100vw - 24px)}
.symptom-modal .reward-hero-creative{padding:16px 16px 12px}
.symptom-modal .rhero-icon{width:48px;height:48px;margin-bottom:8px}
.symptom-modal .reward-hero-creative h3{font-size:16px;line-height:1.9}
.symptom-modal .rhero-sub{margin-top:2px}
.symptom-modal .rhero-streak{margin-top:8px}
.symptom-modal .rhero-track{margin:10px 8px 0}
.symptom-modal .rsteps{margin-top:8px}
.symptom-modal .rhero-msg{margin-top:8px;line-height:1.9}
.symptom-modal .modal-body{padding:12px 14px}
.symptom-modal .reward-creative-list{gap:6px}
.symptom-modal .modal-foot{padding:10px 12px}
@media (max-height:700px){
.symptom-modal .reward-hero-creative{padding:12px 14px 10px}
.symptom-modal .rhero-icon{width:42px;height:42px;margin-bottom:6px}
.symptom-modal .reward-hero-creative h3{font-size:15px}
}

/* ===== Creative maintenance page — DosTime theme (pill + heartbeat) ===== */
.maintx-art{position:relative;padding:6px 0 2px;overflow:hidden}
.maintx-bubbles{position:absolute;inset:0;pointer-events:none}
.maintx-bubbles i{position:absolute;bottom:-14px;width:10px;height:10px;border-radius:999px;background:linear-gradient(135deg,#7c6fd9,#5bc4b7);opacity:.35;animation:mxfloat 3.4s ease-in infinite}
.maintx-bubbles i:nth-child(1){left:12%;animation-delay:0s;width:8px;height:8px}
.maintx-bubbles i:nth-child(2){left:26%;animation-delay:.7s}
.maintx-bubbles i:nth-child(3){left:40%;animation-delay:1.2s;width:12px;height:12px}
.maintx-bubbles i:nth-child(4){left:55%;animation-delay:.4s;width:7px;height:7px}
.maintx-bubbles i:nth-child(5){left:68%;animation-delay:1.6s}
.maintx-bubbles i:nth-child(6){left:80%;animation-delay:.9s;width:9px;height:9px}
.maintx-bubbles i:nth-child(7){left:90%;animation-delay:2s;width:7px;height:7px}
@keyframes mxfloat{0%{transform:translateY(0);opacity:0}25%{opacity:.4}100%{transform:translateY(-150px);opacity:0}}
.maintx-pill{position:relative;width:120px;height:52px;margin:6px auto 4px;border-radius:999px;background:var(--bg-card);border:2px solid var(--border);overflow:hidden;box-shadow:var(--shadow-sm)}
.maintx-pill::after{content:'';position:absolute;left:50%;top:6px;bottom:6px;width:2px;background:var(--border);opacity:.7}
.maintx-fill{position:absolute;inset:0;width:40%;border-radius:999px 0 0 999px;background:linear-gradient(135deg,#7c6fd9,#5bc4b7);opacity:.85;animation:mxfill 2.6s ease-in-out infinite}
@keyframes mxfill{0%,100%{width:32%}50%{width:62%}}
.maintx-ecg{display:block;width:200px;max-width:100%;height:40px;margin:2px auto 0}
.maintx-ecg path{stroke-dasharray:240;stroke-dashoffset:240;animation:mxecg 2.8s linear infinite}
@keyframes mxecg{0%{stroke-dashoffset:240}60%{stroke-dashoffset:0}100%{stroke-dashoffset:-240}}
.maintx-doses{display:flex;gap:8px;justify-content:center;margin-top:12px}
.maintx-doses span{font-size:11px;font-weight:800;color:var(--text-tertiary);background:var(--bg-soft);border:1px solid var(--border);border-radius:999px;padding:5px 14px}
.maintx-doses span.on{color:#fff;background:linear-gradient(135deg,#7c6fd9,#5bc4b7);border-color:transparent;box-shadow:var(--shadow-sm);animation:mxpulse 2s infinite}
@keyframes mxpulse{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
.maintx-retry{margin-top:12px;width:100%}
.maintx-note{margin-top:10px;font-size:10.5px;color:var(--text-tertiary);line-height:1.9}
html[data-theme='dark'] .maintx-doses span{background:rgba(255,255,255,.05)}

/* ===== Maintenance page: true centering + promotional content ===== */
.auth-center.maintx-page{min-height:100dvh;justify-content:center;padding:24px 16px calc(24px + env(safe-area-inset-bottom))}
.maintx-card{width:100%;max-width:480px;background:var(--bg-card);border:1px solid var(--border);border-radius:24px;box-shadow:var(--shadow-xl);padding:26px 20px 20px;margin:auto}
.maintx-promo{margin-top:14px;text-align:right}
.maintx-promo-title{font-size:12px;font-weight:900;color:var(--text-primary);margin-bottom:8px}
.maintx-feats{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.maintx-feats span{font-size:10.5px;font-weight:700;color:var(--text-secondary);background:var(--bg-soft);border:1px solid var(--border);border-radius:12px;padding:7px 8px;line-height:1.8}
.maintx-update{margin-top:10px;background:linear-gradient(135deg,var(--primary-light),var(--accent-light));border:1px solid var(--border);border-radius:14px;padding:10px 12px;text-align:right}
.maintx-update-title{font-size:11.5px;font-weight:900;color:var(--text-primary);margin-bottom:6px}
.maintx-update-row{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:600;color:var(--text-secondary);line-height:2}
.maintx-update-row i{flex:none;width:18px;height:18px;border-radius:999px;background:linear-gradient(135deg,#7c6fd9,#5bc4b7);color:#fff;font-style:normal;font-size:11px;font-weight:900;display:grid;place-items:center}
.maintx-apk{display:flex;align-items:center;gap:12px;margin-top:12px;background:#101820;color:#fff;border-radius:18px;padding:12px 14px;text-decoration:none}
.maintx-apk-ic{font-size:22px}
.maintx-apk-tx{flex:1;min-width:0}
.maintx-apk-tx b{display:block;font-size:13px;font-weight:900}
.maintx-apk-tx small{display:block;font-size:10.5px;opacity:.75;margin-top:2px}
.maintx-apk-go{font-size:16px;opacity:.9}
html[data-theme='dark'] .maintx-feats span{background:rgba(255,255,255,.05)}

/* ===== Update image cards (replaces text rows) ===== */
.maintx-cards{display:flex;flex-direction:column;gap:8px}
.maintx-cards figure{position:relative;margin:0;border-radius:14px;overflow:hidden;border:1px solid var(--border)}
.maintx-cards img{width:100%;height:104px;object-fit:cover;display:block}
.maintx-cards figcaption{position:absolute;inset:auto 0 0 0;padding:22px 10px 8px;background:linear-gradient(transparent,rgba(10,10,20,.78));color:#fff;text-align:right}
.maintx-cards figcaption b{display:block;font-size:12px;font-weight:900}
.maintx-cards figcaption small{font-size:10px;opacity:.85}

/* ===== Maintenance promo slider: one full image, finger swipe ===== */
.maintx-slider{position:relative;overflow:hidden;border-radius:14px;border:1px solid var(--border)}
.maintx-track{display:flex;direction:ltr;transition:transform .35s ease}
.maintx-track figure{flex:0 0 100%;position:relative;margin:0;direction:rtl}
.maintx-track img{width:100%;height:150px;object-fit:cover;display:block;pointer-events:none}
.maintx-track figcaption{position:absolute;inset:auto 0 0 0;padding:26px 12px 10px;background:linear-gradient(transparent,rgba(10,10,20,.8));color:#fff;text-align:right}
.maintx-track figcaption b{display:block;font-size:13px;font-weight:900}
.maintx-track figcaption small{font-size:10.5px;opacity:.88}
.maintx-arrow{position:absolute;top:50%;transform:translateY(-50%);width:32px;height:32px;border-radius:999px;border:1px solid var(--border);background:rgba(255,255,255,.92);color:var(--text-primary);font-size:18px;font-weight:900;cursor:pointer;box-shadow:var(--shadow-sm);z-index:2}
.maintx-arrow.next{left:8px}
.maintx-arrow.prev{right:8px}
.maintx-dots{display:flex;gap:6px;justify-content:center;margin-top:8px}
.maintx-dots button{width:8px;height:8px;border-radius:999px;border:0;background:var(--border);cursor:pointer;padding:0;transition:width .25s}
.maintx-dots button.on{width:24px;background:linear-gradient(135deg,#7c6fd9,#5bc4b7)}

/* ===== Promo slider: pure graphic slides (no photos) ===== */
.mxslide{flex:0 0 100%;position:relative;margin:0;direction:rtl;overflow:hidden;min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:18px 12px 14px}
.mx-g1{background:linear-gradient(135deg,#0d9488,#5bc4b7)}
.mx-g2{background:linear-gradient(135deg,#6d5bd0,#a78bfa)}
.mx-g3{background:linear-gradient(135deg,#b45309,#fbbf24)}
.mx-g4{background:linear-gradient(135deg,#0284c7,#38bdf8)}
.mx-g5{background:linear-gradient(135deg,#be123c,#fb7185)}
.mxdeco{position:absolute;border-radius:999px;background:rgba(255,255,255,.14);pointer-events:none}
.mxdeco.a{width:110px;height:110px;top:-40px;inset-inline-start:-30px}
.mxdeco.b{width:70px;height:70px;bottom:-25px;inset-inline-end:12%}
.mxicon{position:relative;width:58px;height:58px;border-radius:18px;background:rgba(255,255,255,.95);display:grid;place-items:center;color:#101820;box-shadow:0 8px 20px rgba(0,0,0,.25);z-index:1}
.mxicon svg{width:30px;height:30px}
.mxslide figcaption{position:relative;z-index:1;text-align:center;color:#fff}
.mxslide figcaption b{display:block;font-size:13.5px;font-weight:900}
.mxslide figcaption small{font-size:10.5px;opacity:.9}
