/* ============================================================
   PETINEX PWA — Mobile-First Design System v3.0
   Pure mobile, RTL, Persian, no desktop frame
   ============================================================ */

/* ── Fonts ── */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn/Vazirmatn-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ── Design Tokens ── */
:root {
  --px-purple: #782eff;
  --px-purple-light: #9b5fff;
  --px-pink: #ff4fa3;
  --px-orange: #ff9a3d;
  --px-blue: #4f7bff;
  --px-green: #34c759;
  --px-red: #ff3b30;

  --bg: #0f0d17;
  --bg-2: #1a1726;
  --bg-3: #252136;
  --bg-4: #302a47;
  --fg: #f5f3fa;
  --fg-2: #c4bfd4;
  --muted: #8a839e;
  --border: rgba(255,255,255,0.07);
  --border-2: rgba(255,255,255,0.12);
  --input-bg: rgba(255,255,255,0.06);

  --grad: linear-gradient(135deg, var(--px-blue) 0%, var(--px-purple) 35%, var(--px-pink) 70%, var(--px-orange) 100%);
  --grad-soft: linear-gradient(135deg, rgba(120,46,255,0.12) 0%, rgba(255,79,163,0.08) 100%);
  --grad-card: linear-gradient(145deg, rgba(120,46,255,0.08) 0%, rgba(79,123,255,0.06) 50%, rgba(255,79,163,0.04) 100%);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-glow: 0 4px 24px rgba(120,46,255,0.3);

  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.light {
  --bg: #f5f4f8;
  --bg-2: #ffffff;
  --bg-3: #ede9f5;
  --bg-4: #e0dbed;
  --fg: #1a1726;
  --fg-2: #4a4560;
  --muted: #7a7490;
  --border: rgba(0,0,0,0.06);
  --border-2: rgba(0,0,0,0.10);
  --input-bg: rgba(0,0,0,0.03);
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.05);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow: hidden; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app { width: 100%; height: 100%; overflow: hidden; position: relative; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--px-purple); color: #fff; }

/* ── Page System ── */
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  padding-top: var(--safe-t);
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page.active { opacity: 1; transform: translateY(0); z-index: 1; }
.page.with-tabs { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
.page-pad { padding: 0 20px; }

/* ── Sub-page Header (back button) ── */
.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.sub-header__back {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.sub-header__back:active { transform: scale(0.9); }

.sub-header__title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
}

.sub-header__action {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* ── Splash ── */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.splash::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,46,255,0.12) 0%, transparent 70%);
  filter: blur(40px);
}

.splash__logo { width: 96px; height: 96px; border-radius: 28px; animation: splash-in 0.7s var(--ease-spring) both; position: relative; z-index: 1; }
.splash__name { font-size: 34px; font-weight: 800; margin-top: 20px; opacity: 0; animation: fade-up 0.5s ease 0.3s both; position: relative; z-index: 1; }
.splash__tagline { font-size: 14px; color: var(--muted); margin-top: 8px; opacity: 0; animation: fade-up 0.5s ease 0.5s both; position: relative; z-index: 1; }
.splash__paws { position: absolute; inset: 0; pointer-events: none; }
.splash__paw { position: absolute; opacity: 0.04; font-size: 36px; }
.splash__loader { margin-top: 48px; width: 40px; height: 3px; border-radius: 3px; background: var(--bg-3); overflow: hidden; opacity: 0; animation: fade-up 0.5s ease 0.7s both; position: relative; z-index: 1; }
.splash__loader::after { content: ''; display: block; width: 60%; height: 100%; background: var(--grad); border-radius: 3px; animation: loader-slide 1s ease-in-out infinite; }

/* ── Onboarding ── */
.onboarding { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.onboarding__skip { position: absolute; top: calc(16px + var(--safe-t)); left: 20px; z-index: 10; font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: var(--r-sm); transition: background 0.2s; }
.onboarding__skip:active { background: var(--bg-3); }
.onboarding__slides { flex: 1; display: flex; overflow: hidden; position: relative; }
.onboarding__slide { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 32px 32px; text-align: center; transition: transform 0.45s var(--ease-out); }
.onboarding__slide:nth-child(2) { transform: translateX(100%); }
.onboarding__slide:nth-child(3) { transform: translateX(200%); }
.onboarding__illustration { width: 200px; height: 200px; border-radius: 50%; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 40px; overflow: hidden; border: 1px solid var(--border); }
.onboarding__illustration img { width: 150px; height: auto; object-fit: contain; }
.onboarding__illustration--icons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 36px; }
.onboarding__feat-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.onboarding__title { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 14px; }
.onboarding__desc { font-size: 14px; color: var(--muted); line-height: 1.9; max-width: 280px; }
.onboarding__footer { padding: 24px 28px calc(28px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.onboarding__dots { display: flex; gap: 8px; }
.onboarding__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-4); transition: all 0.3s var(--ease-out); }
.onboarding__dot.active { width: 28px; border-radius: 4px; background: var(--px-purple); }

/* ── Auth ── */
.auth { height: 100%; display: flex; flex-direction: column; padding: calc(60px + var(--safe-t)) 24px calc(24px + var(--safe-b)); }
.auth__logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; }
.auth__title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.auth__subtitle { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 32px; }
.auth__tabs { display: flex; background: var(--bg-2); border-radius: var(--r-md); padding: 4px; margin-bottom: 28px; border: 1px solid var(--border); }
.auth__tab { flex: 1; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center; transition: all 0.25s var(--ease-out); color: var(--muted); }
.auth__tab.active { background: var(--px-purple); color: #fff; box-shadow: 0 2px 12px rgba(120,46,255,0.3); }
.auth__form { display: flex; flex-direction: column; gap: 16px; flex: 1; }

.input-group { position: relative; }
.input-group__label { font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 8px; display: block; }
.input-field { width: 100%; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--border-2); background: var(--input-bg); color: var(--fg); font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; direction: ltr; text-align: right; }
.input-field:focus { border-color: var(--px-purple); box-shadow: 0 0 0 3px rgba(120,46,255,0.15); }
.input-field::placeholder { color: var(--muted); direction: rtl; }
.auth__divider { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--muted); font-size: 12px; }
.auth__divider::before, .auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Buttons ── */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: var(--r-md); font-size: 15px; font-weight: 700; transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s; position: relative; overflow: hidden; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn--secondary { background: var(--bg-2); border: 1.5px solid var(--border-2); color: var(--fg); }
.btn--ghost { color: var(--px-purple); font-weight: 600; }
.btn--danger { background: rgba(255,59,48,0.10); color: var(--px-red); border: 1px solid rgba(255,59,48,0.15); }
.btn--full { width: 100%; }
.btn--lg { padding: 16px 28px; font-size: 16px; border-radius: var(--r-lg); }
.btn--sm { padding: 10px 16px; font-size: 13px; }
.btn--pill { border-radius: var(--r-full); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Tab Bar ── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(15,13,23,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  z-index: 100;
}
body.light .tab-bar { background: rgba(245,244,248,0.94); }

.tab-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; min-width: 52px; color: var(--muted); transition: color 0.2s; position: relative; }
.tab-item span { font-size: 10px; font-weight: 600; }
.tab-item.active { color: var(--px-purple); }
.tab-item.active::before { content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 24px; height: 2px; border-radius: 2px; background: var(--px-purple); }

.tab-item--fab { position: relative; padding: 0; min-width: auto; }
.tab-item--fab::before { display: none !important; }
.tab-fab { width: 50px; height: 50px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 20px rgba(120,46,255,0.4); margin-top: -14px; transition: transform 0.2s var(--ease-spring); }
.tab-item--fab:active .tab-fab { transform: scale(0.9); }

/* ── Home Page ── */
.home-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 8px; }
.home-header__right { display: flex; flex-direction: column; }
.home-header__greeting { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.home-header__name { font-size: 20px; font-weight: 800; }
.home-header__actions { display: flex; gap: 8px; }
.home-header__btn { width: 40px; height: 40px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; position: relative; transition: transform 0.15s; }
.home-header__btn:active { transform: scale(0.9); }
.home-header__dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--px-pink); border: 2px solid var(--bg-2); }

.pet-card { margin: 14px 20px 18px; padding: 18px; border-radius: var(--r-xl); background: var(--grad-card); border: 1px solid var(--border-2); display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; transition: transform 0.15s; }
.pet-card:active { transform: scale(0.98); }
.pet-card::before { content: ''; position: absolute; top: -60%; right: -30%; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(120,46,255,0.1) 0%, transparent 70%); }
.pet-card__avatar { width: 64px; height: 64px; border-radius: 20px; overflow: hidden; flex-shrink: 0; border: 2px solid rgba(120,46,255,0.3); position: relative; z-index: 1; }
.pet-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-card__info { flex: 1; position: relative; z-index: 1; }
.pet-card__name { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.pet-card__breed { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.pet-card__stats { display: flex; gap: 12px; }
.pet-card__stat { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fg-2); }
.pet-card__stat svg { width: 12px; height: 12px; color: var(--px-purple-light); }
.pet-card__score { width: 48px; height: 48px; flex-shrink: 0; position: relative; z-index: 1; }

.quick-actions { display: flex; gap: 10px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; margin-bottom: 22px; -webkit-overflow-scrolling: touch; }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: transform 0.15s; min-width: 82px; flex-shrink: 0; }
.quick-action:active { transform: scale(0.94); }
.quick-action__icon { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.quick-action__icon--purple { background: rgba(120,46,255,0.12); }
.quick-action__icon--pink { background: rgba(255,79,163,0.12); }
.quick-action__icon--orange { background: rgba(255,154,61,0.12); }
.quick-action__icon--blue { background: rgba(79,123,255,0.12); }
.quick-action__icon--green { background: rgba(52,199,89,0.12); }
.quick-action__label { font-size: 11px; font-weight: 600; color: var(--fg-2); line-height: 1.3; }

.section-title { font-size: 15px; font-weight: 700; padding: 0 20px; margin-bottom: 12px; }

/* ── Activity Feed ── */
.activity-list { padding: 0 20px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-2); border-radius: var(--r-md); border: 1px solid var(--border); transition: transform 0.15s; }
.activity-item:active { transform: scale(0.98); }
.activity-item__icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.activity-item__text { flex: 1; }
.activity-item__title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.activity-item__time { font-size: 11px; color: var(--muted); }

/* ── Chat Page ── */
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.chat-header__avatar { width: 36px; height: 36px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.chat-header__avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header__info { flex: 1; }
.chat-header__name { font-size: 14px; font-weight: 700; }
.chat-header__status { font-size: 11px; color: var(--px-green); display: flex; align-items: center; gap: 4px; }
.chat-header__status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--px-green); }

.chat-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 84%; padding: 12px 14px; border-radius: 18px; font-size: 13px; line-height: 1.85; animation: bubble-in 0.3s var(--ease-out) both; }
.chat-bubble--ai { align-self: flex-end; background: var(--bg-2); border: 1px solid var(--border); border-bottom-right-radius: 6px; }
.chat-bubble--user { align-self: flex-start; background: var(--px-purple); color: #fff; border-bottom-left-radius: 6px; }
.chat-bubble__name { font-size: 11px; font-weight: 700; color: var(--px-purple-light); margin-bottom: 4px; }

.chat-suggestions { display: flex; gap: 6px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.chat-suggestions::-webkit-scrollbar { display: none; }
.chat-chip { padding: 7px 14px; border-radius: var(--r-full); background: var(--bg-2); border: 1px solid var(--border); font-size: 12px; font-weight: 500; white-space: nowrap; transition: background 0.15s; }
.chat-chip:active { background: var(--bg-3); }

.chat-input-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--bg); }
.chat-input-bar input { flex: 1; padding: 11px 14px; border-radius: var(--r-full); border: 1.5px solid var(--border-2); background: var(--input-bg); color: var(--fg); font-size: 14px; outline: none; }
.chat-input-bar input:focus { border-color: var(--px-purple); }
.chat-input-bar input::placeholder { color: var(--muted); }
.chat-send { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; box-shadow: var(--shadow-glow); transition: transform 0.15s; }
.chat-send:active { transform: scale(0.88); }

/* ── Profile Page ── */
.profile-hero { text-align: center; padding: 24px 20px 20px; position: relative; }
.profile-hero__avatar { width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 12px; overflow: hidden; border: 3px solid var(--px-purple); background: var(--bg-2); box-shadow: 0 4px 24px rgba(120,46,255,0.2); }
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.profile-hero__breed { font-size: 13px; color: var(--muted); }
.profile-hero__edit { position: absolute; top: 24px; left: 20px; width: 36px; height: 36px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
.profile-hero__edit:active { transform: scale(0.9); }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 20px; margin-bottom: 20px; }
.profile-stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 8px; text-align: center; }
.profile-stat__value { font-size: 18px; font-weight: 800; margin-bottom: 3px; }
.profile-stat__label { font-size: 10px; color: var(--muted); font-weight: 500; }

.timeline { padding: 0 20px; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item::before { content: ''; position: absolute; right: 19px; top: 40px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item__dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; position: relative; z-index: 1; }
.timeline-item__content { flex: 1; padding-top: 2px; }
.timeline-item__title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.timeline-item__date { font-size: 11px; color: var(--muted); }

/* ── Learning Page ── */
.learn-header { padding: 20px 20px 0; margin-bottom: 8px; }
.learn-header__title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.learn-header__sub { font-size: 13px; color: var(--muted); }

.learn-xp { display: flex; align-items: center; gap: 12px; margin: 14px 20px; padding: 14px 16px; background: var(--grad-soft); border-radius: var(--r-md); border: 1px solid var(--border); }
.learn-xp__badge { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.learn-xp__text { flex: 1; }
.learn-xp__label { font-size: 11px; color: var(--muted); }
.learn-xp__value { font-size: 16px; font-weight: 700; }

/* ── Learning: Lane Cards (Path Selection) ── */
.lane-select { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

.lane-card { border-radius: 28px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.12); transition: transform 0.2s var(--ease-spring); cursor: pointer; }
.lane-card:active { transform: scale(0.97); }
.lane-card--hero { box-shadow: 0 10px 30px rgba(120,46,255,0.18); border-color: rgba(120,46,255,0.25); }

.lane-cap { padding: 18px 20px; display: flex; align-items: center; gap: 14px; color: #fff; position: relative; }
.lane-cap--t1 { background: linear-gradient(135deg, #4F78FF, #7A6BFF); }
.lane-cap--t2 { background: linear-gradient(135deg, #7B2EFF, #FF4FA3); }
.lane-cap--t3 { background: linear-gradient(135deg, #FF9A3D, #FF6FA0); }

.lane-cap__icon { width: 48px; height: 48px; border-radius: 16px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.lane-cap__info { flex: 1; }
.lane-cap__name { font-size: 17px; font-weight: 800; }
.lane-cap__audience { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.lane-cap__order { font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-full); background: rgba(255,255,255,0.2); white-space: nowrap; }
.lane-cap__hero-tag { position: absolute; top: 10px; left: 10px; font-size: 9px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-full); background: rgba(255,255,255,0.25); }

.lane-body { padding: 14px 20px 18px; display: flex; align-items: center; justify-content: space-between; }
.lane-meta { display: flex; gap: 8px; }
.lane-meta__tag { font-size: 11px; font-weight: 600; color: var(--fg-2); padding: 4px 10px; border-radius: var(--r-full); background: var(--bg-3); }
.lane-body__chev { color: var(--muted); }

/* ── Learning: Path Map ── */
.pm { padding: 0 16px; position: relative; }
.pm__header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 16px; }
.pm__title { font-size: 18px; font-weight: 800; }
.pm__back { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--px-purple-light); padding: 6px 14px; border-radius: var(--r-full); background: rgba(120,46,255,0.1); transition: background 0.15s; }
.pm__back:active { background: rgba(120,46,255,0.2); }

.pm-cert { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.pm-cert__medal { width: 96px; height: 96px; border-radius: 50%; border: 3px dashed var(--border-2); display: flex; align-items: center; justify-content: center; font-size: 36px; background: var(--bg-2); margin-bottom: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.pm-cert__label { font-size: 12px; font-weight: 700; padding: 6px 18px; border-radius: var(--r-full); color: #fff; }
.pm-cert__label--t1 { background: linear-gradient(135deg, #4F78FF, #7A6BFF); }
.pm-cert__label--t2 { background: linear-gradient(135deg, #7B2EFF, #FF4FA3); }
.pm-cert__label--t3 { background: linear-gradient(135deg, #FF9A3D, #FF6FA0); }

.pm-lane { border-radius: 28px; background: var(--bg-2); border: 1px solid var(--border); overflow: visible; box-shadow: 0 10px 30px rgba(0,0,0,0.12); margin-bottom: 18px; }
.pm-lane--hero { box-shadow: 0 10px 30px rgba(120,46,255,0.15); }

.pm-nodes { padding: 32px 20px 20px; display: flex; flex-direction: column; align-items: center; position: relative; overflow: visible; }

.pm-wire-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.pm-wire-svg path { fill: none; stroke: var(--border-2); stroke-width: 2.5; stroke-dasharray: 6 4; stroke-linecap: round; }

.pm-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.pm-node:last-child { margin-bottom: 0; }

.pm-disc { width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; position: relative; flex-shrink: 0; cursor: pointer; transition: transform 0.2s var(--ease-spring); }
.pm-disc:active { transform: scale(0.88) translateY(4px); }

.pm-disc--t1 { background: linear-gradient(150deg, #4F78FF, #7A6BFF); box-shadow: 0 7px 0 #3a5ad0, 0 12px 24px rgba(79,120,255,0.3); }
.pm-disc--t2 { background: linear-gradient(150deg, #7B2EFF, #FF4FA3); box-shadow: 0 7px 0 #5e1fcc, 0 12px 24px rgba(123,46,255,0.3); }
.pm-disc--t3 { background: linear-gradient(150deg, #FF9A3D, #FF6FA0); box-shadow: 0 7px 0 #d07a2a, 0 12px 24px rgba(255,154,61,0.3); }

.pm-disc::after { content: ''; position: absolute; top: 2px; left: 12%; width: 76%; height: 44%; border-radius: 50% 50% 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 100%); pointer-events: none; }

.pm-disc--done { background: linear-gradient(150deg, #34c759, #5ad87a) !important; box-shadow: 0 7px 0 #28a745, 0 12px 24px rgba(52,199,89,0.3) !important; }

.pm-node--current .pm-disc--t1 { --sh-base: #3a5ad0; --sh-glow: rgba(79,120,255,0.45); --sh-ring: rgba(79,120,255,0.15); }
.pm-node--current .pm-disc--t2 { --sh-base: #5e1fcc; --sh-glow: rgba(123,46,255,0.45); --sh-ring: rgba(123,46,255,0.15); }
.pm-node--current .pm-disc--t3 { --sh-base: #d07a2a; --sh-glow: rgba(255,154,61,0.45); --sh-ring: rgba(255,154,61,0.15); }
.pm-node--current .pm-disc { animation: pm-pulse 2s ease-in-out infinite; }
@keyframes pm-pulse {
  0%, 100% { box-shadow: 0 7px 0 var(--sh-base), 0 12px 24px var(--sh-glow); }
  50% { box-shadow: 0 7px 0 var(--sh-base), 0 12px 30px var(--sh-glow), 0 0 0 10px var(--sh-ring); }
}

.pm-disc--locked { background: var(--bg-4) !important; box-shadow: 0 4px 0 var(--bg-3) !important; opacity: 0.45; cursor: default; }
.pm-disc--locked::after { display: none; }
.pm-disc--locked:active { transform: none; }

.pm-disc--final { width: 86px !important; height: 86px !important; font-size: 26px; background: linear-gradient(150deg, #FFD15C, #FF9A3D, #FFD15C) !important; box-shadow: 0 7px 0 #d4870f, 0 12px 28px rgba(255,154,61,0.4) !important; }

.pm-med { position: absolute; top: -2px; right: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

.pm-label { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--fg-2); text-align: center; max-width: 160px; line-height: 1.5; text-wrap: balance; }
.pm-label--locked { opacity: 0.35; }

.pm-start { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--r-full); font-size: 14px; font-weight: 700; margin: 0 auto; max-width: 220px; }
.pm-start--t1 { background: rgba(79,120,255,0.12); color: #4F78FF; }
.pm-start--t2 { background: rgba(120,46,255,0.12); color: #7B2EFF; }
.pm-start--t3 { background: rgba(255,154,61,0.12); color: #FF9A3D; }

/* ── Shop Page ── */
.shop-header { padding: 20px 20px 0; margin-bottom: 12px; }
.shop-header__title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.shop-header__sub { font-size: 13px; color: var(--muted); }

.shop-search { margin: 0 20px 12px; position: relative; }
.shop-search input { width: 100%; padding: 12px 16px 12px 42px; border-radius: var(--r-full); border: 1.5px solid var(--border-2); background: var(--input-bg); color: var(--fg); font-size: 14px; outline: none; }
.shop-search input:focus { border-color: var(--px-purple); }
.shop-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.shop-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 20px; }
.shop-cat-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; background: none; border: none; transition: transform 0.15s; }
.shop-cat-card:active { transform: scale(0.93); }
.shop-cat-card__circle { width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.shop-cat-card__icon { font-size: 30px; }
.shop-cat-card__name { font-size: 11px; font-weight: 600; color: var(--fg-2); text-align: center; line-height: 1.4; }

.shop-product-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 14px; }
.shop-product-header__title { font-size: 18px; font-weight: 800; }
.shop-product-header__back { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--px-purple-light); padding: 6px 12px; border-radius: var(--r-full); background: rgba(120,46,255,0.1); transition: background 0.15s; }
.shop-product-header__back:active { background: rgba(120,46,255,0.2); }

.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 20px; }
.shop-product { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: transform 0.15s; }
.shop-product:active { transform: scale(0.97); }
.shop-product__img { height: 110px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.shop-product__body { padding: 12px; }
.shop-product__name { font-size: 12px; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.shop-product__footer { display: flex; align-items: center; justify-content: space-between; }
.shop-product__price { font-size: 13px; font-weight: 800; color: var(--px-purple); }
.shop-product__unit { font-size: 10px; font-weight: 400; color: var(--muted); margin-right: 2px; }
.shop-product__add { width: 30px; height: 30px; border-radius: 10px; background: var(--px-purple); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; transition: transform 0.15s; }
.shop-product__add:active { transform: scale(0.85); }

/* ── Settings Page ── */
.settings-header { padding: 20px 20px 0; font-size: 20px; font-weight: 800; }
.settings-user { display: flex; align-items: center; gap: 14px; padding: 14px; margin: 14px 20px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); }
.settings-user__avatar { width: 48px; height: 48px; border-radius: 16px; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.settings-user__name { font-size: 15px; font-weight: 700; }
.settings-user__phone { font-size: 12px; color: var(--muted); direction: ltr; text-align: right; }

.settings-group { margin: 0 20px 14px; }
.settings-group__title { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 4px; margin-bottom: 6px; letter-spacing: 0.3px; }
.settings-item { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--bg-2); border: 1px solid var(--border); transition: background 0.15s; }
.settings-item:active { background: var(--bg-3); }
.settings-item:first-of-type { border-radius: var(--r-md) var(--r-md) 0 0; }
.settings-item:last-of-type { border-radius: 0 0 var(--r-md) var(--r-md); }
.settings-item:only-of-type { border-radius: var(--r-md); }
.settings-item + .settings-item { border-top: none; }
.settings-item__icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.settings-item__label { flex: 1; font-size: 14px; font-weight: 500; }
.settings-item__chevron { color: var(--muted); }

.toggle { width: 44px; height: 26px; border-radius: 13px; background: var(--bg-4); position: relative; cursor: pointer; transition: background 0.25s; }
.toggle.on { background: var(--px-purple); }
.toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease-spring); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.toggle.on::after { transform: translateX(-18px); }

.settings-version { text-align: center; padding: 16px; font-size: 11px; color: var(--muted); }

/* ── Sub-page: Generic Content ── */
.sub-content { padding: 20px; }
.sub-content h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.sub-content p { font-size: 13px; line-height: 1.9; color: var(--fg-2); margin-bottom: 16px; }

/* ── Info Card (used in sub-pages) ── */
.info-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.info-card__header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.info-card__icon { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.info-card__title { font-size: 14px; font-weight: 700; }
.info-card__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.info-card__body { font-size: 13px; color: var(--fg-2); line-height: 1.7; }

/* ── Stat Row (vaccine, weight pages) ── */
.stat-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row__icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-row__text { flex: 1; }
.stat-row__title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.stat-row__desc { font-size: 12px; color: var(--muted); }
.stat-row__badge { padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 600; }

/* ── Weight Chart ── */
.weight-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 16px 0; }
.weight-bar { flex: 1; border-radius: 6px; background: var(--bg-3); transition: height 0.4s var(--ease-out); }
.weight-bar--active { background: var(--px-purple); box-shadow: 0 2px 12px rgba(120,46,255,0.3); }
.weight-labels { display: flex; justify-content: space-around; font-size: 10px; color: var(--muted); padding-top: 6px; }

/* ── Form page (add pet, edit profile) ── */
.form-page { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ── Product Detail ── */
.product-detail__img { height: 200px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 64px; }
.product-detail__body { padding: 20px; }
.product-detail__name { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.product-detail__price { font-size: 22px; font-weight: 800; color: var(--px-purple); margin-bottom: 16px; }
.product-detail__desc { font-size: 13px; line-height: 1.9; color: var(--fg-2); margin-bottom: 20px; }

/* ── Cart ── */
.cart-item { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 10px; }
.cart-item__img { width: 50px; height: 50px; border-radius: 14px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.cart-item__info { flex: 1; }
.cart-item__name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cart-item__price { font-size: 14px; font-weight: 800; color: var(--px-purple); }
.cart-item__qty { display: flex; align-items: center; gap: 10px; }
.cart-item__qty-btn { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.cart-item__qty-num { font-size: 14px; font-weight: 700; }

.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 16px; margin-top: 8px; background: var(--grad-soft); border-radius: var(--r-md); border: 1px solid var(--border); }
.cart-total__label { font-size: 14px; font-weight: 600; }
.cart-total__value { font-size: 18px; font-weight: 800; color: var(--px-purple); }

/* ── Notification Item ── */
.notif-item { display: flex; gap: 12px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 8px; }
.notif-item--unread { border-color: rgba(120,46,255,0.2); background: rgba(120,46,255,0.04); }
.notif-item__icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-item__text { flex: 1; }
.notif-item__title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-item__time { font-size: 11px; color: var(--muted); }

/* ── Empty State ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 40px; text-align: center; }
.empty-state__icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state__title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state__desc { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ── Toast ── */
.toast { position: fixed; top: calc(16px + var(--safe-t)); left: 50%; transform: translateX(-50%) translateY(-120%); max-width: 340px; width: calc(100% - 40px); padding: 12px 16px; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--r-md); font-size: 13px; font-weight: 600; text-align: center; z-index: 9999; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform 0.35s var(--ease-spring), opacity 0.25s ease; pointer-events: none; opacity: 0; display: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; display: block; }
.toast--info { border-color: rgba(79,123,255,0.3); color: var(--px-blue); }
.toast--success { border-color: rgba(52,199,89,0.3); color: var(--px-green); }

/* ── Install Banner ── */
.install-banner { position: fixed; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); right: 16px; left: 16px; max-width: 400px; margin: 0 auto; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 16px; z-index: 800; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: fade-up 0.4s var(--ease-out) both; animation-delay: 1.5s; }
.install-banner__close { position: absolute; top: 10px; left: 10px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px; }
.install-banner__title { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.install-banner__title img { width: 28px; height: 28px; border-radius: 8px; }
.install-banner__steps { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 0; padding: 0; list-style: none; }
.install-banner__steps li { display: flex; align-items: center; gap: 6px; }
.install-banner__steps li::before { content: ''; display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-4); text-align: center; line-height: 18px; font-size: 10px; font-weight: 700; color: var(--fg); flex-shrink: 0; }
.install-banner__steps li:nth-child(1)::before { content: '۱'; }
.install-banner__steps li:nth-child(2)::before { content: '۲'; }
.install-banner__steps li:nth-child(3)::before { content: '۳'; }

/* ── Animations ── */
@keyframes splash-in { from { opacity: 0; transform: scale(0.5) rotate(-10deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loader-slide { 0% { transform: translateX(100%); } 50% { transform: translateX(-60%); } 100% { transform: translateX(100%); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.anim-card { animation: card-in 0.35s var(--ease-out) both; }
.anim-card-1 { animation-delay: 0.04s; }
.anim-card-2 { animation-delay: 0.08s; }
.anim-card-3 { animation-delay: 0.12s; }
.anim-card-4 { animation-delay: 0.16s; }
.anim-card-5 { animation-delay: 0.20s; }
.anim-card-6 { animation-delay: 0.24s; }

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