/* ============================================
   بیمت با من — Mobile / PWA Stylesheet
   (design tokens & components adapted from prototype)
   ============================================ */

/* Local Vazirmatn fonts — same as desktop theme.css */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

:root {
  /* Brand palette — synced with desktop theme.css */
  --c-primary: #1a365d;          /* navy — bb-navy */
  --c-primary-2: #2c4870;
  --c-primary-3: #3a5a85;
  --c-accent: #2d9d6e;            /* green — bb-green */
  --c-accent-2: #1a6b47;          /* green-dark — bb-green-dark */
  --c-accent-soft: #e6f4ee;       /* bb-green-light */

  --c-bg: #f0f4f8;                /* bb-bg */
  --c-surface: #ffffff;
  --c-surface-2: #e8eef5;         /* bb-bg-alt */
  --c-surface-elev: #ffffff;

  --c-text: #2d3748;              /* bb-text */
  --c-text-2: #4a5568;
  --c-text-3: #718096;            /* bb-text-muted */
  --c-text-inverse: #ffffff;

  --c-border: #e2e8f0;            /* bb-border */
  --c-border-strong: #cbd5e0;

  --c-success: #2d9d6e;
  --c-success-soft: #e6f4ee;
  --c-warning: #d97706;
  --c-warning-soft: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-soft: #fee2e2;
  --c-info: #2563bc;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 999px;

  --sh-sm: 0 1px 2px rgba(26,54,93,0.05), 0 1px 1px rgba(26,54,93,0.03);
  --sh-md: 0 4px 12px rgba(26,54,93,0.07), 0 2px 4px rgba(26,54,93,0.04);
  --sh-lg: 0 12px 32px rgba(26,54,93,0.12), 0 4px 12px rgba(26,54,93,0.07);
  --sh-card: 0 1px 0 rgba(26,54,93,0.04), 0 8px 24px rgba(26,54,93,0.06);

  --f-sans: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-num: 'Vazirmatn', 'Inter', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bb-mobile * { box-sizing: border-box; }
.bb-mobile, .bb-mobile body {
  margin: 0;
  padding: 0;
  font-family: var(--f-sans);
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

.bb-mobile button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
.bb-mobile input, .bb-mobile textarea, .bb-mobile select { font-family: inherit; }
.bb-mobile a { color: inherit; text-decoration: none; }

/* ===== App stage / phone frame ===== */
.app-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 10% 10%, rgba(45,157,110,0.06), transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(26,54,93,0.05), transparent 50%),
    var(--c-bg);
  position: relative;
}
.stage-context { position: absolute; inset: 0; display: none; pointer-events: none; }
@media (min-width: 900px) {
  .stage-context { display: block; }
  .stage-context::before {
    content: 'بیمت با من';
    position: absolute; top: 48px; right: 56px;
    font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--c-primary);
  }
  .stage-context::after {
    content: 'Bimat Ba Man — Mobile App';
    position: absolute; bottom: 48px; left: 56px;
    font-family: 'Inter', monospace; font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-text-3);
  }
}

.phone {
  width: 100%;
  max-width: 412px;
  height: min(900px, calc(100dvh - 64px));
  background: var(--c-surface);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 10px #0a1628, 0 0 0 11px #1f2d3f, var(--sh-lg);
  display: flex;
  flex-direction: column;
}
@media (max-width: 600px), (display-mode: standalone), (display-mode: fullscreen) {
  .app-stage { padding: 0; }
  .phone { max-width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
}

.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px; background: #0a1628; border-radius: 18px;
  z-index: 100; pointer-events: none;
}
@media (max-width: 600px) { .phone-notch { display: none; } }

.phone-status {
  height: 44px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--c-text); flex-shrink: 0; position: relative; z-index: 1;
  padding-top: env(safe-area-inset-top);
}
.phone-status .right { display: flex; gap: 6px; align-items: center; }
.phone-status .icon { width: 16px; height: 10px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; }
.phone-status .icon::after { content: ''; position: absolute; inset: 1.5px; background: currentColor; border-radius: 1px; width: 80%; }
@media (max-width: 600px) { .phone-status { display: none; } }

.screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  position: relative; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-thumb { background: rgba(26,54,93,0.15); border-radius: 4px; }

/* ===== Tab bar ===== */
.tabbar {
  height: 76px; background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom);
  position: relative; z-index: 5;
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 10.5px; font-weight: 500; color: var(--c-text-3);
  position: relative; transition: color 0.2s var(--ease-out);
  text-decoration: none;
}
.tabbar-item.active { color: var(--c-primary); }
.tabbar-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; background: var(--c-accent); border-radius: 0 0 3px 3px;
}
.tabbar-item .ic { width: 22px; height: 22px; transition: transform 0.3s var(--ease-spring); }
.tabbar-item.active .ic { transform: scale(1.1); }

.tabbar-item.center { position: relative; }
.tabbar-item.center .fab {
  width: 52px; height: 52px; border-radius: 18px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
  display: flex; align-items: center; justify-content: center;
  margin-top: -16px; margin-bottom: 2px; color: var(--c-accent);
  box-shadow: 0 8px 20px rgba(26,54,93,0.25), 0 2px 4px rgba(26,54,93,0.15);
  transition: transform 0.3s var(--ease-spring);
}
.tabbar-item.center.active .fab { transform: translateY(-2px); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 20px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600;
  transition: all 0.2s var(--ease-out); white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--c-primary); color: var(--c-text-inverse); }
.btn-primary:hover { background: var(--c-primary-2); }
.btn-primary:active { transform: scale(0.98); }
.btn-accent { background: var(--c-accent); color: var(--c-primary); }
.btn-accent:hover { background: var(--c-accent-2); }
.btn-ghost { background: transparent; color: var(--c-primary); }
.btn-ghost:hover { background: rgba(26,54,93,0.05); }
.btn-outline { background: transparent; color: var(--c-primary); border: 1.5px solid var(--c-border-strong); }
.btn-outline:hover { border-color: var(--c-primary); }
.btn-danger { background: var(--c-danger); color: white; }
.btn-success { background: var(--c-success); color: white; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ===== Cards & chips ===== */
.card {
  background: var(--c-surface); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-card);
  border: 1px solid rgba(26,54,93,0.04);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--c-surface-2);
  border: 1px solid var(--c-border); border-radius: var(--r-full);
  font-size: 12px; font-weight: 500; color: var(--c-text-2);
}
.chip-accent { background: var(--c-accent-soft); color: var(--c-accent-2); border-color: rgba(45,157,110,0.2); }
.chip-success { background: var(--c-success-soft); color: var(--c-success); border-color: rgba(16,145,111,0.2); }
.chip-warning { background: var(--c-warning-soft); color: var(--c-warning); border-color: rgba(217,119,6,0.2); }
.chip-danger { background: var(--c-danger-soft); color: var(--c-danger); border-color: rgba(192,59,45,0.2); }

/* ===== Section heading ===== */
.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 12px;
}
.section-h h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--c-text-2); letter-spacing: 0; }
.section-h .more { font-size: 12px; font-weight: 500; color: var(--c-accent-2); }

/* ===== Form inputs ===== */
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--c-text-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--c-border); background: var(--c-surface);
  font-size: 15px; color: var(--c-text);
  transition: all 0.2s var(--ease-out); font-family: inherit;
}
.textarea { height: auto; padding: 14px 16px; min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(45,157,110,0.12);
}

/* ===== Numeric ===== */
.num-hero {
  font-family: var(--f-num); font-weight: 800; font-size: 56px;
  line-height: 1; letter-spacing: -0.04em; color: var(--c-primary);
  font-feature-settings: 'tnum';
}
.num-hero .currency { font-size: 18px; font-weight: 600; color: var(--c-text-3); letter-spacing: 0; margin-right: 8px; }
.num-md { font-family: var(--f-num); font-weight: 700; letter-spacing: -0.02em; font-feature-settings: 'tnum'; }

/* ===== Animations ===== */
.screen-enter { animation: screenIn 0.4s var(--ease-out) forwards; }
@keyframes screenIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes cardSlide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Utility ===== */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--c-text-2); }
.dim { color: var(--c-text-3); }

/* ===== Type tile ===== */
.type-tile {
  background: var(--c-surface); border-radius: var(--r-lg);
  padding: 14px; display: flex; flex-direction: column;
  align-items: flex-start; gap: 8px;
  border: 1px solid var(--c-border);
  transition: all 0.2s var(--ease-out);
  text-align: right; position: relative; overflow: hidden;
}
.type-tile:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.type-tile.active {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
  color: var(--c-text-inverse);
}
.type-tile .icon-wrap {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--c-accent-soft); display: flex;
  align-items: center; justify-content: center; color: var(--c-primary);
}
.type-tile.active .icon-wrap { background: rgba(45,157,110,0.2); color: var(--c-accent); }
.type-tile .label { font-size: 13px; font-weight: 600; }
.type-tile .sub { font-size: 11px; color: var(--c-text-3); }
.type-tile.active .sub { color: rgba(255,255,255,0.7); }

/* ===== Plan card ===== */
.plan-card {
  background: var(--c-surface); border-radius: var(--r-lg);
  padding: 16px; border: 1.5px solid var(--c-border);
  position: relative; transition: all 0.3s var(--ease-spring); overflow: hidden;
}
.plan-card.recommended {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(45,157,110,0.15);
}
.plan-card.recommended::before {
  content: 'پیشنهاد ویژه';
  position: absolute; top: 0; left: 0;
  background: var(--c-accent); color: var(--c-primary);
  font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 0 0 var(--r-md) 0;
}

/* ===== Step indicator ===== */
.step-indicator {
  display: flex; gap: 6px; align-items: center; margin-bottom: 24px;
}
.step-dot {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--c-border); transition: background 0.4s var(--ease-out);
}
.step-dot.done { background: var(--c-accent); }
.step-dot.active { background: var(--c-primary); }

/* ===== List row ===== */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--c-border);
}
.list-row:last-child { border-bottom: none; }
.list-row .leading {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--c-surface-2); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--c-primary);
}
.list-row .body { flex: 1; min-width: 0; }
.list-row .body .t { font-size: 14px; font-weight: 600; color: var(--c-text); }
.list-row .body .s { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }
.list-row .trailing { color: var(--c-text-3); font-size: 13px; font-weight: 500; }

/* ===== Bottom sheet ===== */
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(26,54,93,0.4); backdrop-filter: blur(2px);
  z-index: 50; animation: fadeIn 0.25s var(--ease-out);
}
.sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--c-surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 24px; z-index: 51;
  animation: sheetUp 0.35s var(--ease-spring);
  max-height: 80%; overflow-y: auto;
}

/* ===== Header inside screen ===== */
.m-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  min-height: 56px; flex-shrink: 0;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.m-header.transparent { background: transparent; border: none; }
.m-header .m-back {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--c-surface-2);
  display: flex; align-items: center; justify-content: center;
}
.m-header .m-title { flex: 1; min-width: 0; }
.m-header .m-title .t { font-size: 16px; font-weight: 700; color: var(--c-text); }
.m-header .m-title .s { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* ===== Hero greeting ===== */
.m-hero {
  background:
    linear-gradient(135deg, rgba(45,157,110,0.28) 0%, transparent 55%),
    linear-gradient(160deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
  color: white; padding: 22px 20px 88px;
  position: relative; overflow: hidden;
}
/* Animated decorative grid */
.m-hero .grid-deco {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(45,157,110,.10) 0, transparent 25%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.05) 0, transparent 30%);
  pointer-events: none;
  opacity: .9;
}
/* Mascot peeking */
.m-hero-mascot {
  position: absolute;
  bottom: -8px; inset-inline-start: -14px;
  width: 96px; height: 96px;
  opacity: .18; pointer-events: none;
  z-index: 0;
}
.m-hero-mascot .bb-mascot-g { animation: mascotFloat 4s ease-in-out infinite; }
.m-hero::before {
  content: ''; position: absolute; top: -40px; left: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,157,110,0.20), transparent 70%);
}
.m-hero::after {
  content: ''; position: absolute; bottom: 50px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
}
.m-hero .greet { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; position: relative; }
.m-hero .greet .name { font-size: 18px; font-weight: 700; margin-top: 2px; }
.m-hero .greet .hi { font-size: 12px; color: rgba(255,255,255,0.6); }
.m-hero .actions { display: flex; gap: 8px; }
.m-hero .actions button, .m-hero .actions a {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: white; position: relative;
}
.m-hero .total-label {
  font-size: 12px; color: var(--c-accent);
  letter-spacing: 0.1em; text-transform: uppercase;
  font-family: 'Inter'; margin-bottom: 8px;
}
.m-hero .total-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; position: relative; }
.m-hero .total-row .num-hero { color: white; font-size: 44px; }
.m-hero .total-row .cur { font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 500; }
.m-hero .badges { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.m-hero .badges .b {
  background: rgba(255,255,255,0.08); padding: 8px 12px;
  border-radius: 12px; display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.m-hero .badges .b.warn { background: rgba(217,119,6,0.2); color: #fef3c7; }
.m-hero .badges .b .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--c-accent); }

/* ===== Quick actions row (floating over hero) ===== */
.m-quick {
  padding: 0 20px; margin-top: -56px;
  animation: cardSlide 0.6s var(--ease-spring) .2s backwards;
}
.m-quick .grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 14px;
  background: var(--c-surface);
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(26,54,93,.10), 0 2px 6px rgba(26,54,93,.04);
  border: 1px solid rgba(26,54,93,.04);
}
.m-quick .qa {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 4px; border-radius: 12px;
  transition: all 0.2s var(--ease-out);
  position: relative;
}
.m-quick .qa::before {
  content: '';
  position: absolute;
  inset: 0; border-radius: 12px;
  background: var(--c-surface-2);
  opacity: 0;
  transition: opacity .15s ease-out;
  z-index: 0;
}
.m-quick .qa:active::before { opacity: 1; }
.m-quick .qa > * { position: relative; z-index: 1; }
.m-quick .qa .ic {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--c-accent-soft), rgba(45,157,110,.08));
  color: var(--c-accent-2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s var(--ease-spring);
  border: 1px solid rgba(45,157,110,.10);
}
.m-quick .qa:active .ic {
  transform: scale(.92);
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
}
.m-quick .qa span { font-size: 11px; font-weight: 600; color: var(--c-text-2); }

/* Bento-style stats row (above quick actions) */
.m-bento {
  padding: 0 20px;
  margin-top: -56px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: cardSlide 0.55s var(--ease-spring) .15s backwards;
}
.m-bento-card {
  background: var(--c-surface);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--sh-card);
  border: 1px solid rgba(26,54,93,.04);
  position: relative; overflow: hidden;
}
.m-bento-card .bento-ic {
  position: absolute;
  top: 12px; inset-inline-end: 12px;
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.m-bento-card .bento-lab {
  font-size: 11px; color: var(--c-text-3);
  font-family: Inter, sans-serif; font-weight: 500;
}
.m-bento-card .bento-val {
  font-size: 20px; font-weight: 800;
  color: var(--c-primary); letter-spacing: -.02em;
  margin-top: 6px;
  font-family: 'Vazirmatn','Inter',sans-serif;
  font-feature-settings: 'tnum';
}
.m-bento-card .bento-sub {
  font-size: 10.5px; color: var(--c-text-2);
  margin-top: 4px;
}

/* ===== Mini policy card (hscroll) ===== */
.m-hscroll {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 4px 0 14px; margin: 0 -20px;
  padding-inline: 20px; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
}
.m-hscroll::-webkit-scrollbar { display: none; }

/* ====== Premium policy card ====== */
.policy-card {
  flex-shrink: 0;
  width: 280px;
  height: 180px;
  border-radius: 22px;
  padding: 18px;
  color: white;
  text-align: right;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  scroll-snap-align: start;
  background: linear-gradient(135deg, var(--pc-from, #1a365d) 0%, var(--pc-to, #0a1f3d) 100%);
  box-shadow:
    0 10px 28px rgba(26,54,93,.20),
    0 2px 6px rgba(26,54,93,.10),
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.10);
  animation: cardSlide 0.55s var(--ease-spring) backwards;
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.policy-card:active {
  transform: scale(.98);
  box-shadow: 0 6px 18px rgba(26,54,93,.18);
}

/* Decorative wave pattern */
.policy-card::before {
  content: '';
  position: absolute;
  bottom: -50px; inset-inline-start: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.10) 0%, transparent 50%);
  pointer-events: none;
}
.policy-card::after {
  content: '';
  position: absolute;
  top: -60px; inset-inline-end: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Big translucent icon */
.policy-card .pc-bg-icon {
  position: absolute;
  inset-inline-start: -12px;
  bottom: -16px;
  color: rgba(255,255,255,.08);
  pointer-events: none;
  transform: rotate(-12deg);
}

/* Top row: insurer + status */
.policy-card .pc-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; position: relative; z-index: 2;
}
.policy-card .pc-insurer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255,255,255,.10);
}
.policy-card .pc-insurer-logo {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--pc-from, var(--c-primary));
  flex-shrink: 0;
  overflow: hidden;
}
.policy-card .pc-insurer-logo img {
  width: 100%; height: 100%; object-fit: contain; padding: 2px;
}
.policy-card .pc-insurer-name {
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
  color: white;
}
/* Status chip — adapts to each card's color spectrum.
   It's a glossy "stamp" with white background and the card's
   own gradient colour as text, so contrast stays perfect on
   any type-theme (green, navy, blue, orange, rose, …). */
.policy-card .pc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  color: var(--pc-from);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  position: relative;
  letter-spacing: -.005em;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Small status dot at the leading edge */
.policy-card .pc-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pc-from);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
/* Tinted variants — still use the card's color but signal urgency */
.policy-card .pc-chip.success { color: var(--pc-from); }
.policy-card .pc-chip.success::before { background: #16a34a; }
.policy-card .pc-chip.warning {
  background: #fef3c7;
  color: #92400e;
}
.policy-card .pc-chip.warning::before { background: #d97706; }
.policy-card .pc-chip.danger {
  background: #fee2e2;
  color: #991b1b;
}
.policy-card .pc-chip.danger::before { background: #dc2626; }

/* Type name */
.policy-card .pc-type {
  font-size: 19px; font-weight: 800;
  letter-spacing: -.015em;
  position: relative; z-index: 2;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,.35), 0 1px 8px rgba(0,0,0,.18);
}
.policy-card .pc-asset {
  font-size: 11.5px;
  opacity: 1;
  margin-top: 3px;
  position: relative; z-index: 2;
  font-weight: 600;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* Bottom row: premium + go */
.policy-card .pc-bottom {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; position: relative; z-index: 2;
}
.policy-card .pc-premium-label {
  font-size: 9.5px;
  opacity: 1;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.policy-card .pc-premium-amount {
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: -.02em;
  font-family: 'Vazirmatn','Inter',sans-serif;
  font-feature-settings: 'tnum';
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,.35), 0 1px 8px rgba(0,0,0,.18);
}
.policy-card .pc-premium-amount .cur {
  font-size: 11px;
  font-weight: 600;
  opacity: 1;
  color: rgba(255,255,255,.88);
  margin-inline-start: 4px;
}
.policy-card .pc-go {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .15s var(--ease-spring);
}
.policy-card:active .pc-go { transform: translateX(-3px); }

/* Type-based color themes (RTL-aware) */
.policy-card.type-third_party { --pc-from: #1a6b47; --pc-to: #0e3d2a; }
.policy-card.type-body        { --pc-from: #1a365d; --pc-to: #0a1f3d; }
.policy-card.type-travel      { --pc-from: #2563bc; --pc-to: #14407d; }
.policy-card.type-fire        { --pc-from: #d97706; --pc-to: #8a4806; }
.policy-card.type-health      { --pc-from: #be185d; --pc-to: #6e0c38; }
.policy-card.type-life        { --pc-from: #7c3aed; --pc-to: #4b1f96; }
.policy-card.type-moto        { --pc-from: #dc2626; --pc-to: #7e1313; }
.policy-card.type-pet         { --pc-from: #2d9d6e; --pc-to: #155e3f; }

/* "View all" tile at end of hscroll */
.policy-card-cta {
  flex-shrink: 0;
  width: 100px;
  height: 180px;
  border-radius: 22px;
  background: linear-gradient(160deg, var(--c-accent-soft), white);
  border: 1.5px dashed var(--c-accent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--c-accent-2);
  text-decoration: none;
  scroll-snap-align: start;
  transition: all .2s;
}
.policy-card-cta:active { transform: scale(.97); background: var(--c-accent-soft); }
.policy-card-cta .pc-cta-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(45,157,110,.18);
}
.policy-card-cta span { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.4; }

/* ===== Type tile grid (browse) ===== */
.m-types-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.m-types-grid .tile {
  background: var(--c-surface); border-radius: 14px;
  padding: 14px 8px; display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  border: 1px solid var(--c-border); transition: all 0.2s;
  text-align: center;
}
.m-types-grid .tile:active { border-color: var(--c-primary); transform: translateY(-2px); }
.m-types-grid .tile .ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--c-accent-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.m-types-grid .tile span { font-size: 11px; font-weight: 600; line-height: 1.3; }

/* ===== Renewal banner ===== */
.m-banner-warn {
  background: linear-gradient(135deg, #fef9e7, #fef3c7);
  border: 1px solid rgba(217,119,6,0.2); border-radius: 18px;
  padding: 16px; display: flex; align-items: center; gap: 14px;
}
.m-banner-warn .ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c-warning); color: white;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.m-banner-warn .ttl { font-size: 13px; font-weight: 700; color: #7A4A0E; }
.m-banner-warn .sub { font-size: 11px; color: #7A4A0E; opacity: 0.7; margin-top: 2px; }

/* ===== Empty state ===== */
.m-empty {
  text-align: center; padding: 40px 20px; color: var(--c-text-3);
}
.m-empty .ic {
  width: 80px; height: 80px; border-radius: 24px;
  background: var(--c-surface-2); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 16px;
  color: var(--c-text-3);
}
.m-empty .t { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.m-empty .s { font-size: 13px; }

/* ===== OTP input ===== */
.otp-row { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp-row input {
  width: 48px; height: 56px; text-align: center;
  font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); color: var(--c-text);
}
.otp-row input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 4px rgba(45,157,110,0.12); }

/* ===== Install prompt ===== */
.m-install {
  position: fixed; bottom: 20px; left: 16px; right: 16px;
  background: var(--c-primary); color: white;
  border-radius: 18px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--sh-lg); z-index: 1000;
  animation: sheetUp 0.4s var(--ease-spring);
}
.m-install.hidden { display: none; }
.m-install .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--c-accent); color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-install .body { flex: 1; min-width: 0; }
.m-install .t { font-size: 13px; font-weight: 700; }
.m-install .s { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.m-install .actions { display: flex; gap: 6px; }
.m-install button { background: var(--c-accent); color: var(--c-primary); padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.m-install button.dismiss { background: rgba(255,255,255,0.1); color: white; }

/* ===== Toast ===== */
.m-toast {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--c-primary); color: white;
  padding: 12px 18px; border-radius: 16px;
  box-shadow: var(--sh-lg); z-index: 200;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  animation: sheetUp 0.3s var(--ease-spring);
}

/* ===== Skeleton ===== */
.skel {
  background: linear-gradient(90deg, var(--c-border) 0%, var(--c-surface-2) 50%, var(--c-border) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* ===== Agent specific ===== */
.agent-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: -56px; padding: 0 20px;
}
.agent-stats .s-card {
  background: var(--c-surface); border-radius: 16px;
  padding: 14px; box-shadow: var(--sh-card);
  border: 1px solid rgba(26,54,93,0.04);
}
.agent-stats .s-card .lab { font-size: 11px; color: var(--c-text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; font-family: 'Inter'; }
.agent-stats .s-card .val { font-size: 22px; font-weight: 800; color: var(--c-primary); letter-spacing: -0.02em; }
.agent-stats .s-card .delta { font-size: 11px; margin-top: 4px; color: var(--c-success); }

/* ===== Request row ===== */
.req-card {
  background: var(--c-surface); border-radius: 16px;
  padding: 14px; border: 1px solid var(--c-border);
  display: flex; gap: 12px; align-items: flex-start;
}
.req-card .av {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c-accent-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.req-card .body { flex: 1; min-width: 0; }
.req-card .t { font-size: 14px; font-weight: 700; }
.req-card .s { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }
.req-card .meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ===== Auth screens — beautiful + animated ===== */
.auth-wrap {
  padding: 24px 20px 30px; min-height: 100%;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
/* Animated background gradient orbs */
.auth-wrap::before {
  content: ''; position: absolute;
  top: -120px; left: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,157,110,.18) 0%, transparent 65%);
  filter: blur(20px);
  animation: authOrb1 12s ease-in-out infinite alternate;
  pointer-events: none;
}
.auth-wrap::after {
  content: ''; position: absolute;
  bottom: -120px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,54,93,.12) 0%, transparent 65%);
  filter: blur(20px);
  animation: authOrb2 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes authOrb1 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px,30px) scale(1.15); }
}
@keyframes authOrb2 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-30px,-40px) scale(1.1); }
}

.auth-wrap > * { position: relative; z-index: 1; }

.auth-wrap .logo-row {
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  margin-top: 26px; margin-bottom: 24px;
  animation: authFadeDown .6s var(--ease-spring) both;
}
@keyframes authFadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-wrap .logo-row .b {
  width: 80px; height: 80px; border-radius: 24px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 12px 28px rgba(45,157,110,.32),
    inset 0 -3px 0 rgba(0,0,0,.08);
  position: relative;
}
/* Floating ring around logo */
.auth-wrap .logo-row .b::after {
  content: ''; position: absolute;
  inset: -8px; border-radius: 30px;
  border: 2px dashed rgba(45,157,110,.25);
  animation: authRing 20s linear infinite;
}
@keyframes authRing { to { transform: rotate(360deg); } }

.auth-wrap h1 {
  font-size: 22px; font-weight: 800; margin: 0 0 6px;
  color: var(--c-text); letter-spacing: -0.01em;
  animation: authSlideUp .6s var(--ease-out) .15s both;
}
.auth-wrap p.lead {
  font-size: 13px; color: var(--c-text-2); margin: 0 0 22px;
  line-height: 1.7;
  animation: authSlideUp .6s var(--ease-out) .22s both;
}
@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-wrap .field {
  animation: authSlideUp .6s var(--ease-out) .3s both;
}
.auth-wrap .field:nth-of-type(2) { animation-delay: .36s; }
.auth-wrap .field:nth-of-type(3) { animation-delay: .42s; }

/* Input with animated underline accent */
.auth-wrap .input {
  background: rgba(255,255,255,.92);
  border: 1.5px solid var(--c-border);
  height: 54px;
  font-size: 16px;
  border-radius: 14px;
  padding: 0 16px;
  transition: all .25s var(--ease-out);
  position: relative;
}
.auth-wrap .input:hover { border-color: var(--c-border-strong); }
.auth-wrap .input:focus {
  background: white;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(45,157,110,.14), 0 6px 14px rgba(45,157,110,.08);
  transform: translateY(-1px);
}

.auth-wrap .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  margin-bottom: 8px;
  letter-spacing: -.005em;
}

/* Submit button — bouncy */
.auth-wrap .btn-primary {
  height: 56px; font-size: 15px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
  box-shadow: 0 10px 24px rgba(26,54,93,.25);
  position: relative; overflow: hidden;
  animation: authSlideUp .6s var(--ease-out) .48s both;
}
.auth-wrap .btn-primary::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transition: left .6s;
}
.auth-wrap .btn-primary:hover::before,
.auth-wrap .btn-primary:active::before { left: 100%; }

.auth-wrap .btn-ghost {
  animation: authSlideUp .6s var(--ease-out) .54s both;
  color: var(--c-text-2);
  font-weight: 600;
}
.auth-wrap .btn-ghost:hover { color: var(--c-primary); background: rgba(45,157,110,.06); }

.auth-wrap .switch {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: var(--c-text-2);
  animation: authSlideUp .6s var(--ease-out) .6s both;
  line-height: 1.7;
}
.auth-wrap .switch a { color: var(--c-primary); font-weight: 700; }

/* ===== Onboarding ===== */
.onb-stage { display: flex; flex-direction: column; flex: 1; min-height: 100%; padding: 30px 24px; }
.onb-stage .illus {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--c-accent-soft), transparent);
  border-radius: 32px; margin-bottom: 24px; min-height: 200px; color: var(--c-primary);
}
.onb-stage .ttl { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.onb-stage .desc { font-size: 14px; color: var(--c-text-2); line-height: 1.6; margin-bottom: 20px; }
.onb-stage .dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.onb-stage .dots .d { width: 8px; height: 8px; border-radius: 999px; background: var(--c-border); }
.onb-stage .dots .d.on { width: 24px; background: var(--c-primary); }

/* ===== Splash screen ===== */
.splash {
  position: relative; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1a365d 0%, #2c4870 50%, #1a6b47 130%);
  color: white; flex-direction: column; gap: 18px;
  overflow: hidden; padding: 24px;
}
/* Animated background glow */
.splash::before {
  content: ''; position: absolute;
  top: -20%; left: -20%; width: 140%; height: 140%;
  background:
    radial-gradient(circle at 20% 20%, rgba(45,157,110,0.25), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(230,244,238,0.15), transparent 45%);
  animation: splashGlow 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splashGlow {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(2%,-2%) scale(1.05); }
}
/* Floating orbs */
.splash::after {
  content: ''; position: absolute;
  inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 80px at 15% 25%, rgba(255,255,255,0.06), transparent),
    radial-gradient(circle 60px at 85% 70%, rgba(45,157,110,0.18), transparent),
    radial-gradient(circle 100px at 70% 15%, rgba(255,255,255,0.04), transparent);
}

.splash .splash-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 22px;
  animation: splashIn 0.7s var(--ease-spring) both;
}
@keyframes splashIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.splash .mascot-wrap {
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.splash .mascot-wrap::before {
  content: ''; position: absolute;
  inset: -10px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
  animation: mascotHalo 3s ease-in-out infinite;
}
@keyframes mascotHalo {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50%      { transform: scale(1.05); opacity: 1; }
}

.splash .brand-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}
.splash .brand-logo img { max-width: 100%; max-height: 100%; }

.splash .name {
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.01em; color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.splash .tag {
  font-size: 11px; opacity: 0.65;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  color: var(--c-accent-soft);
}
.splash .tagline {
  font-size: 13px; color: rgba(255,255,255,0.78);
  max-width: 280px; text-align: center; line-height: 1.7;
  margin-top: 4px;
}

/* Loading dots */
.splash .loader {
  position: absolute; bottom: calc(40px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
  z-index: 2;
}
.splash .loader span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-accent);
  animation: loaderBounce 1.2s ease-in-out infinite;
}
.splash .loader span:nth-child(2) { animation-delay: 0.15s; }
.splash .loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes loaderBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ===== Mascot — used in splash, onboarding, empty states ===== */
.bb-mascot { display: block; }
.bb-mascot--animated .bb-mascot-g {
  transform-origin: 120px 192px;
  animation: mascotFloat 3.5s ease-in-out infinite;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-6px) rotate(-1.5deg); }
}
.bb-mascot--animated .bb-mascot-eye {
  transform-origin: center;
  animation: mascotBlink 4.5s ease-in-out infinite;
}
.bb-mascot--animated .bb-mascot-eye--r { animation-delay: 0s; }
.bb-mascot--animated .bb-mascot-eye--l { animation-delay: 0s; }
@keyframes mascotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97%      { transform: scaleY(0.1); }
}

/* ===== Common helpers ===== */
.txt-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-success { color: var(--c-success); }
.text-danger { color: var(--c-danger); }
.text-warning { color: var(--c-warning); }
.text-primary { color: var(--c-primary); }
.text-muted { color: var(--c-text-2); }
.text-dim { color: var(--c-text-3); }
.fz-11 { font-size: 11px; } .fz-12 { font-size: 12px; } .fz-13 { font-size: 13px; }
.fz-14 { font-size: 14px; } .fz-15 { font-size: 15px; } .fz-16 { font-size: 16px; }
.fz-18 { font-size: 18px; } .fz-22 { font-size: 22px; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }

.section { padding: 16px 20px; }
.section-tight { padding: 8px 20px; }
.bb-screen-pad { padding-bottom: 16px; }

/* ============================================
   Chat — native bubble UI
   ============================================ */
.chat-stage { display: flex; flex-direction: column; height: 100%; background: var(--c-bg); }
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
  color: white; min-height: 60px; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(26,54,93,.15);
  position: relative; z-index: 5;
}
.chat-header .back-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,.1); color: white;
  display: flex; align-items: center; justify-content: center;
}
.chat-header .avatar {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--c-accent-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.chat-header .meta { flex: 1; min-width: 0; }
.chat-header .meta .t { font-size: 14px; font-weight: 700; }
.chat-header .meta .s { font-size: 11px; opacity: .7; margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.chat-header .meta .s .live-dot { width: 7px; height: 7px; border-radius: 999px; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); animation: pulse 2s infinite; }

.chat-body {
  flex: 1; overflow-y: auto; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 6px;
  background-image:
    radial-gradient(rgba(26,54,93,.04) 1px, transparent 1px),
    radial-gradient(rgba(26,54,93,.025) 1px, transparent 1px);
  background-size: 22px 22px, 18px 18px;
  background-position: 0 0, 11px 11px;
}
.chat-day-sep {
  align-self: center; font-size: 11px; color: var(--c-text-3);
  background: var(--c-surface); padding: 4px 12px; border-radius: 999px;
  margin: 10px 0; border: 1px solid var(--c-border);
}
.chat-bubble {
  max-width: 78%; padding: 9px 13px;
  font-size: 14px; line-height: 1.55;
  border-radius: 16px; word-break: break-word;
  position: relative;
  animation: bubbleIn 0.2s var(--ease-out);
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-bubble.me {
  align-self: flex-end; background: var(--c-primary); color: white;
  border-bottom-right-radius: 5px;
}
.chat-bubble.them {
  align-self: flex-start; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-bottom-left-radius: 5px;
}
.chat-bubble .time { font-size: 10px; opacity: .65; margin-top: 4px; font-family: 'Inter', sans-serif; letter-spacing: 0; }
.chat-bubble.me .time { color: rgba(255,255,255,.7); text-align: left; }
.chat-bubble.them .time { color: var(--c-text-3); text-align: right; }

.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--c-text-3); text-align: center;
}
.chat-empty .ic {
  width: 80px; height: 80px; border-radius: 24px;
  background: var(--c-accent-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}

.chat-input-row {
  display: flex; gap: 8px; padding: 10px;
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  align-items: flex-end; flex-shrink: 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.chat-input-row .chat-input {
  flex: 1; min-height: 44px; max-height: 120px;
  padding: 10px 14px; border-radius: 22px;
  border: 1.5px solid var(--c-border); background: var(--c-surface-2);
  font-size: 14px; resize: none; outline: none;
  font-family: inherit; line-height: 1.4;
}
.chat-input-row .chat-input:focus { border-color: var(--c-accent); background: var(--c-surface); }
.chat-input-row .send-btn {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: var(--c-primary); color: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease-spring);
}
.chat-input-row .send-btn:active { transform: scale(.94); }
.chat-input-row .send-btn:disabled { opacity: .5; }

/* ============================================
   Ticket — message bubble + cards
   ============================================ */
.ticket-card {
  background: var(--c-surface); border-radius: 16px;
  padding: 14px; border: 1px solid var(--c-border);
  display: flex; gap: 12px; align-items: flex-start;
  position: relative; overflow: hidden;
}
.ticket-card .av {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c-accent-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ticket-card .body { flex: 1; min-width: 0; }
.ticket-card .body .subject { font-size: 14px; font-weight: 700; }
.ticket-card .body .meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ticket-card .body .preview { font-size: 12px; color: var(--c-text-2); margin-top: 6px; line-height: 1.5; }
.ticket-card .body .when { font-size: 11px; color: var(--c-text-3); margin-top: 6px; }

.tk-bubble {
  max-width: 86%; padding: 11px 14px;
  border-radius: 16px; font-size: 13px; line-height: 1.6;
  word-break: break-word;
  animation: bubbleIn 0.2s var(--ease-out);
}
.tk-bubble.me {
  align-self: flex-end; background: var(--c-primary); color: white;
  border-bottom-right-radius: 5px;
}
.tk-bubble.staff {
  align-self: flex-start; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-bottom-left-radius: 5px;
}
.tk-bubble .meta { font-size: 10px; opacity: .65; margin-top: 6px; font-family: 'Inter', sans-serif; display: flex; gap: 8px; }
.tk-bubble.me .meta { color: rgba(255,255,255,.75); justify-content: flex-end; }

/* ============================================
   FAB for new ticket / new chat
   ============================================ */
.m-fab {
  position: absolute; bottom: calc(90px + env(safe-area-inset-bottom));
  inset-inline-end: 16px;
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
  color: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(26,54,93,.25);
  z-index: 20;
  transition: transform .2s var(--ease-spring);
}
.m-fab:active { transform: scale(.94); }

/* ===== Notification bell dot ===== */
.bell-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--c-accent); }

/* ============================================
   UI Polish — typography, spacing, touch, motion
   ============================================ */

/* All interactive elements: minimum touch target 44px */
.bb-mobile button, .bb-mobile a, .bb-mobile label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bb-mobile button:focus-visible, .bb-mobile a:focus-visible, .bb-mobile input:focus-visible, .bb-mobile select:focus-visible, .bb-mobile textarea:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Typography rhythm */
.bb-mobile h1 { font-size: 22px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; margin: 0; }
.bb-mobile h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; margin: 0; }
.bb-mobile h3 { font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.35; margin: 0; }
.bb-mobile h4 { font-size: 13px; font-weight: 700; line-height: 1.4; margin: 0; }
.bb-mobile p  { font-size: 14px; line-height: 1.7; margin: 0; }

/* Headings inside cards/heroes */
.m-hero h1, .m-hero h2 { color: white; }

/* Smoother button press feedback */
.btn:active { transform: scale(.97); transition: transform .08s ease-out; }
.btn { transition: background .2s, color .2s, transform .12s, box-shadow .2s; }

/* Card hover/press states on touch */
.card { transition: box-shadow .2s, transform .12s ease-out; }
.card:active { transform: scale(.995); }

/* Skeleton loader (reused) */
.skel { display: block; }
.skel-line { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skel-circle { width: 44px; height: 44px; border-radius: 50%; }

/* Pull-to-refresh placeholder (visual only) */
.m-ptr {
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden;
  transition: height .25s var(--ease-out);
  color: var(--c-text-3);
}
.m-ptr.is-visible { height: 56px; }

/* Floating action button reusable */
.fab-bottom {
  position: absolute;
  bottom: calc(88px + env(safe-area-inset-bottom));
  inset-inline-end: 16px;
  width: 56px; height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
  color: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(26,54,93,.25), 0 4px 8px rgba(26,54,93,.12);
  z-index: 20;
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.fab-bottom:active { transform: scale(.92); }

/* Empty state polish */
.m-empty {
  padding: 56px 24px;
  animation: emptyIn .5s var(--ease-out);
}
@keyframes emptyIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.m-empty .ic {
  background: radial-gradient(circle at 30% 30%, var(--c-accent-soft), var(--c-surface-2));
  border: 1px solid rgba(45,157,110,.15);
}

/* Better dividers */
.m-divider {
  height: 1px; background: var(--c-border);
  margin: 14px 0;
}

/* Polished list rows with chevron */
.list-row {
  border-radius: 0;
  transition: background .12s ease-out;
}
.list-row:active { background: var(--c-surface-2); }

/* Make the chip clickable feel */
a.chip, button.chip { transition: transform .12s, background .2s; }
a.chip:active, button.chip:active { transform: scale(.95); }

/* Section heading tightening */
.section-h h3 {
  font-size: 13px; font-weight: 700;
  text-transform: none; letter-spacing: 0;
  color: var(--c-text-2);
}

/* Tab bar polish: stronger hit area, smoother active */
.tabbar-item {
  min-height: 48px;
  padding-block: 4px;
}
.tabbar-item.active .ic { color: var(--c-primary); }
.tabbar-item.active.center .fab {
  animation: fabPop .4s var(--ease-spring);
}
@keyframes fabPop {
  0% { transform: translateY(0) scale(1); }
  60% { transform: translateY(-3px) scale(1.05); }
  100% { transform: translateY(-2px) scale(1); }
}

/* Numeric inputs: tabular-nums for predictable widths */
.bb-mobile input[type="tel"], .bb-mobile input[type="number"], .bb-mobile input[inputmode="numeric"], .bb-mobile .num-md, .bb-mobile .num-hero {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* Avoid double scroll on PWA */
@media (display-mode: standalone) {
  .bb-mobile body { overscroll-behavior-y: contain; }
}

/* Quick action grid item polish (home dashboard) */
.m-quick .qa { min-height: 76px; }
.m-quick .qa .ic { transition: transform .15s var(--ease-spring), background .2s; }
.m-quick .qa:active .ic { transform: scale(.92); background: var(--c-accent); color: var(--c-primary); }

/* Type-tile polish */
.m-types-grid .tile { min-height: 96px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.m-types-grid .tile:active { transform: translateY(0) scale(.97); }

/* Toast multi-line + safe wrap */
.m-toast { max-width: calc(100% - 40px); word-break: break-word; }

/* Make the policy mini cards more compelling */
.policy-mini::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(45,157,110,.05);
}

/* Page header consistency */
.m-header {
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Better selection */
.bb-mobile ::selection { background: var(--c-accent-soft); color: var(--c-primary); }

/* Long-press visual on cards */
.req-card, .ticket-card, .m-corp-card { transition: transform .15s, border-color .15s, box-shadow .15s; }
.req-card:active, .ticket-card:active, .m-corp-card:active { transform: scale(.99); }

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

/* ─── رنگ متن دکمه‌های btn-primary همیشه سفید — جهانی ─── */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #ffffff !important;
}
