/* ═══════════════════════════════════════════════════════════════════
   پوستهٔ موبایل‌فرست آنیار ۱۴۰۵/۰۶ — سرمه‌ای عمیق + کبالت
   آخرین لایهٔ cascade برای app.html:
   هدر جمع‌وجور، خانهٔ جدید، داک پایین منحنی با گودی U،
   منوی سه‌پیل شناور، ردیف‌های مالی فشرده، ریل دسکتاپ.
   همهٔ رنگ‌ها از توکن‌های anyar-tokens.css.
   ═══════════════════════════════════════════════════════════════════ */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ── بوم کلی ── */
.connected .dashboard {
  position: relative;
  isolation: isolate;
  display: block;
  min-height: 100dvh;
  background: var(--anyar-bg);
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}
.app-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(460px 320px at 88% -60px, rgba(33, 107, 255, 0.11), transparent 70%),
    radial-gradient(340px 240px at 50% calc(100% - 110px), rgba(33, 107, 255, 0.05), transparent 72%);
}

/* ── هدر جمع‌وجور: لوگو راست، زنگ و آواتار چپ ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(180deg, rgba(7, 20, 38, 0.94), rgba(7, 20, 38, 0.72) 68%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.app-logo { display: block; line-height: 0; }
.app-logo img {
  display: block;
  filter: drop-shadow(0 8px 18px rgba(33, 107, 255, 0.35));
}
.app-header-tools { display: flex; align-items: center; gap: 8px; }
.app-bell,
.app-more {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--anyar-line);
  border-radius: 13px;
  background: var(--anyar-surface);
  color: var(--anyar-muted);
  cursor: pointer;
  transition: color var(--anyar-fast) ease, border-color var(--anyar-fast) ease;
}
.app-bell:hover,
.app-more:hover { color: var(--anyar-ink); border-color: var(--anyar-line-strong); }
.app-bell svg,
.app-more svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-bell .notification-count {
  position: absolute;
  top: -5px; inset-inline-end: -5px;
  min-width: 17px; height: 17px;
  display: grid; place-items: center;
  padding-inline: 4px;
  border-radius: 99px;
  background: var(--anyar-cobalt);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.app-avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--anyar-grad-cobalt);
  box-shadow: 0 0 0 2px rgba(33, 107, 255, 0.22), 0 8px 20px -8px rgba(33, 107, 255, 0.6);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.app-avatar:active { transform: scale(0.96); }

/* ── ستون محتوا ── */
.connected .dashboard-shell {
  display: block;
  min-width: 0;
  min-height: 100dvh;
}
.connected #dashboard-main {
  max-width: 768px;
  margin-inline: auto;
  padding: 6px 16px 24px;
  outline: none;
}
.connected #dashboard-main:focus-visible {
  outline: 2px solid var(--anyar-cobalt);
  outline-offset: 4px;
  border-radius: 14px;
}

/* ── خانه: دوره و دامنه ── */
.home-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 44px;
}
.home-scope {
  margin-inline-start: auto;
}
.home-period-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.home-period-wrap select {
  appearance: none;
  min-height: 40px;
  padding: 6px 34px 6px 14px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.home-period-wrap select:focus-visible {
  outline: 2px solid var(--anyar-cobalt);
  outline-offset: 2px;
}
.home-period-wrap > svg {
  position: absolute;
  inset-inline-end: 11px;
  width: 15px; height: 15px;
  pointer-events: none;
  fill: none;
  stroke: var(--anyar-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 55%;
  padding: 7px 12px;
  border: 1px solid rgba(33, 107, 255, 0.4);
  border-radius: 999px;
  background: var(--anyar-cobalt-soft);
  color: #eaf0ff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.home-scope::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--anyar-cobalt);
  flex-shrink: 0;
}
.home-scope b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── خانه: مانده بازه (وسط‌چین) و سطح مشترک درآمد/هزینه ── */
.home-balance {
  display: grid;
  gap: 14px;
  padding: 10px 2px 4px;
  text-align: center;
}
.home-balance > p {
  margin: 0;
  color: var(--anyar-muted);
  font-size: 13px;
  font-weight: 600;
}
.home-balance h2 {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--anyar-ink);
  font-size: clamp(30px, 8.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.home-balance h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--anyar-faint);
  letter-spacing: 0;
}
.home-flow {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--anyar-line);
  border-radius: var(--anyar-radius-lg);
  background: var(--anyar-surface);
  padding: 13px 8px;
}
.home-flow > div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}
.home-flow span { color: var(--anyar-muted); font-size: 12px; }
.home-flow b {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.home-flow > div:first-child b { color: var(--anyar-income); }
.home-flow > div:last-child b { color: var(--anyar-expense); }
.home-flow > i {
  width: 1px;
  margin: 3px 2px;
  background: var(--anyar-line-strong);
}
.home-note {
  margin: 0;
  color: var(--anyar-faint);
  font-size: 11.5px;
}
/* ── خانه: چیپ‌های حساب ── */
.home-chips-section { padding-block: 4px; }
.home-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 8px;
  scrollbar-width: none;
}
.home-chips::-webkit-scrollbar { display: none; }
.chip-account {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--anyar-line);
  border-radius: 14px;
  background: var(--anyar-surface);
  color: var(--anyar-ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--anyar-fast) ease, background var(--anyar-fast) ease, color var(--anyar-fast) ease;
}
.chip-account svg { width: 16px; height: 16px; fill: none; stroke: var(--anyar-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chip-account:hover { border-color: var(--anyar-line-strong); color: var(--anyar-ink); }
.chip-account.active {
  border-color: rgba(33, 107, 255, 0.65);
  background: var(--anyar-cobalt-soft);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(33, 107, 255, 0.35);
}
.chip-account.active svg { stroke: var(--anyar-soft-blue); }

.fin-row.row-link { cursor: pointer; transition: background var(--anyar-fast) ease; }
.fin-row.row-link:active, .fin-row.row-link:focus-visible { background: var(--anyar-glass); outline: none; }

/* ── بخش‌های خانه ── */
.home-section { display: grid; gap: 4px; padding-block: 10px; }
.home-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 4px;
}
.home-section h3 {
  margin: 0;
  color: var(--anyar-ink);
  font-size: 15px;
  font-weight: 800;
}
.home-more {
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--anyar-soft-blue);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.home-more:hover { text-decoration: underline; }
.home-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 28px 20px;
  border: 1px dashed var(--anyar-line-strong);
  border-radius: var(--anyar-radius-lg);
  text-align: center;
}
.home-empty h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--anyar-ink); }
.home-empty p { margin: 0; color: var(--anyar-muted); font-size: 13.5px; line-height: 2; max-width: 34ch; }

/* ── ردیف مالی فشرده (تراکنش/شخص/کالا) ── */
.fin-list { display: block; }
.fin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--anyar-line);
  background: none;
  font: inherit;
  text-align: start;
  color: var(--anyar-ink);
}
.fin-list > *:last-child { border-bottom: 0; }
.fin-row:hover { background: rgba(255, 255, 255, 0.02); }
.fin-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: #14223a;
  color: var(--anyar-soft-blue);
}
.fin-icon .category-icon { width: 20px; height: 20px; display: grid; place-items: center; }
.fin-icon svg { width: 20px; height: 20px; }
.fin-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.fin-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.fin-title b {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--anyar-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.fin-row .fin-badge { display: inline-flex; align-items: center; justify-content: center; }
.fin-badge.income { color: var(--anyar-income); background: rgba(123, 220, 169, 0.13); }
.fin-badge.expense { color: var(--anyar-expense); background: rgba(242, 154, 147, 0.13); }
.fin-sub {
  color: var(--anyar-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-side {
  margin-inline-start: auto;
  display: grid;
  justify-items: end;
  gap: 2px;
  flex-shrink: 0;
  overflow: hidden;
}
/* کالا (product-line): مبلغ و خرید همیشه کامل و چپ‌چسب؛ برش فقط روی نام راست */
.product-line .fin-side {
  max-width: none;
  flex-shrink: 0;
  overflow: visible;
}
.product-line .fin-side .fin-amount { white-space: nowrap; }
.product-line .fin-side .fin-status {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.product-line .fin-main { flex: 1 1 0; min-width: 0; }
.fin-amount {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--anyar-ink);
  white-space: nowrap;
}
.fin-amount.income { color: var(--anyar-income); }
.fin-amount.expense { color: var(--anyar-expense); }
.fin-status { color: var(--anyar-faint); font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-status.income { color: var(--anyar-income); }
.fin-status.expense { color: var(--anyar-expense); }

/* آواتار شخص در ردیف */
.person-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  background: var(--anyar-surface-higher);
  color: var(--anyar-ink);
  font-size: 15px;
  font-weight: 800;
}
button.fin-row { cursor: pointer; width: 100%; }
/* ردیف اشخاص: نام راست، فقط مبلغ رنگی چپ (رنگ، معنی طلب/بدهی را می‌رساند) */
.person-row { min-height: 68px; }
.person-row .fin-main { flex: 1; }
.person-row .person-balance {
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 16px;
  white-space: nowrap;
}

/* ── سرصفحهٔ صفحات داخلی ── */
.screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px 14px;
}
.screen-head h2 {
  margin: 0;
  color: var(--anyar-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.screen-head p { margin: 3px 0 0; color: var(--anyar-muted); font-size: 12.5px; }
.fab-mini {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--anyar-grad-cobalt);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(33, 107, 255, 0.65);
}
.fab-mini svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fab-mini:active { transform: scale(0.95); }

/* ── صفحه اشخاص: نوار خلاصه + جستجو + چیپ‌ها ── */
.debt-summary-strip {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--anyar-line);
  border-radius: var(--anyar-radius-lg);
  background: var(--anyar-surface);
  padding: 13px 8px;
  margin-bottom: 14px;
}
.debt-summary-strip > div {
  flex: 1;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
  min-width: 0;
}
.debt-summary-strip span { color: var(--anyar-muted); font-size: 12px; }
.debt-summary-strip b { font-size: clamp(15px, 4vw, 17px); font-weight: 800; overflow-wrap: anywhere; }
.debt-summary-strip > div:first-child b { color: var(--anyar-income); }
.debt-summary-strip > div:last-child b { color: var(--anyar-expense); }
.debt-summary-strip > i { width: 1px; margin: 3px 2px; background: var(--anyar-line-strong); }
.people-tools { display: grid; gap: 10px; margin-bottom: 6px; }
.search-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 14px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
}
.search-pill svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--anyar-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.search-pill input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--anyar-ink);
  font: inherit;
  font-size: 14px;
}
.search-pill input:focus { outline: none; }
.search-pill:focus-within { border-color: rgba(33, 107, 255, 0.45); }
.chip-row { display: flex; gap: 8px; }
.chip-row .chip {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--anyar-fast) ease, color var(--anyar-fast) ease, border-color var(--anyar-fast) ease;
}
.chip-row .chip.active {
  border-color: rgba(33, 107, 255, 0.45);
  background: var(--anyar-cobalt-soft);
  color: #fff;
}

/* ── داک پایین منحنی با گودی U ── */
.app-dock {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: min(428px, calc(100% - 24px));
}
.dock-body {
  position: relative;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr 76px 1fr 1fr;
  align-items: stretch;
  filter: drop-shadow(0 16px 34px rgba(2, 8, 18, 0.65));
}
.dock-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #101f34;
  pointer-events: none;
}
.dock-tab {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--anyar-muted);
  font: inherit;
  cursor: pointer;
  min-height: 48px;
  transition: color var(--anyar-fast) ease;
}
.dock-tab svg {
  width: 23px; height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dock-tab:hover { color: var(--anyar-ink-soft); }
.dock-tab.active { color: var(--anyar-soft-blue); }
.dock-tab.active::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(33, 107, 255, 0.3) 0%, rgba(33, 107, 255, 0.12) 55%, transparent 72%);
  pointer-events: none;
}
.dock-fab {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--anyar-grad-cobalt);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--anyar-bg) 92%, transparent),
    0 14px 30px -10px rgba(33, 107, 255, 0.7);
  transition: transform var(--anyar-base) var(--anyar-spring);
}
.dock-fab svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: transform 180ms ease;
}
.dock-fab:active { transform: translateX(-50%) scale(0.94); }
.dock-fab.is-open svg { transform: rotate(45deg); }
.dock-fab:focus-visible {
  outline: 2px solid var(--anyar-soft-blue);
  outline-offset: 3px;
}

/* ── منوی سه‌پیل شناور ── */
.quick-entry-scrim {
  position: fixed;
  inset: 0;
  z-index: 75;
  border: 0;
  padding: 0;
  background: rgba(4, 12, 24, 0.58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 190ms ease;
  cursor: pointer;
}
.quick-entry-scrim.is-open { opacity: 1; }
.entry-pills {
  position: fixed;
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(428px, calc(100% - 24px));
  height: 104px;
  pointer-events: none;
}
.entry-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 200ms var(--anyar-enter),
    transform 200ms var(--anyar-enter),
    visibility 0ms linear 200ms;
}
.entry-pills.is-open .entry-pill {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0ms;
}
.entry-pill svg {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pill-voice {
  top: 0;
  left: 50%;
  margin-left: -59px;
  width: 118px;
  border: 0;
  background: var(--anyar-grad-cobalt);
  color: #fff;
  box-shadow: 0 16px 34px -12px rgba(33, 107, 255, 0.75);
}
.entry-pills.is-open .pill-voice { transition-delay: 0ms; }
.pill-manual {
  top: 54px;
  right: calc(50% + 6px);
  width: 94px;
  border: 1px solid var(--anyar-line-strong);
  background: var(--anyar-surface-higher);
  color: var(--anyar-ink);
  box-shadow: 0 14px 30px -14px rgba(2, 8, 18, 0.8);
}
.entry-pills.is-open .pill-manual { transition-delay: 25ms; }
.pill-text {
  top: 54px;
  left: calc(50% + 6px);
  width: 94px;
  border: 1px solid var(--anyar-line-strong);
  background: var(--anyar-surface-higher);
  color: var(--anyar-ink);
  box-shadow: 0 14px 30px -14px rgba(2, 8, 18, 0.8);
}
.entry-pills.is-open .pill-text { transition-delay: 45ms; }
.entry-pill:active { transform: scale(0.95); }
.entry-pill:focus-visible {
  outline: 2px solid var(--anyar-soft-blue);
  outline-offset: 3px;
}

/* ── ردیف‌های کامل لِجر (تراکنش‌ها): دکمهٔ ردیف + اکشن‌های بازشو ── */
.fin-row-main {
  display: contents;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  text-align: start;
  cursor: pointer;
}
.fin-row .ledger-ribbon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fin-row .ledger-ribbon-actions:not([hidden]) {
  padding-top: 8px;
  flex-basis: 100%;
  justify-content: flex-end;
}
.fin-row .ledger-ribbon-actions .record-actions {
  display: contents;
}
.fin-row .record-actions {
  display: none;
  align-items: center;
  gap: 2px;
}
.fin-row:hover .record-actions,
.fin-row:focus-within .record-actions { display: inline-flex; }
@media (hover: none) {
  .fin-row .record-actions { display: inline-flex; }
}
.fin-row .record-actions button {
  border: 0;
  background: none;
  padding: 6px 7px;
  color: var(--anyar-soft-blue);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.fin-row .record-actions .delete-record { color: var(--anyar-coral); }

/* ── فروشگاه ── */
.store-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.store-select-wrap {
  flex: 1;
  min-width: 0;
}
.store-select-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}
.store-tabs { margin-bottom: 12px; }
.store-strip { margin-bottom: 12px; }
.store-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.store-tools .search-pill { flex: 1; min-width: 0; }
.connected :is(.store-tools, .invoice-search-row) .search-pill input {
  background: none;
  box-shadow: none;
  outline: none;
}
.invoice-search-row { display: flex; align-items: center; gap: 8px; margin-block: 4px; }
.connected .invoice-search-row .search-pill {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: none;
}
.invoice-search-row .search-pill { flex: 1; min-width: 0; }
.invoice-search-row .secondary-small { flex-shrink: 0; }
/* هم‌ترازی روز/ماه/سال در دیت‌پیکر */
.connected .persian-picker > div:first-of-type { align-items: end; }
.connected .persian-picker :is(select, input):not([type="hidden"]) {
  min-height: 45px;
  height: 45px;
  box-sizing: border-box;
}
.connected .persian-picker input[data-date-part="year"] {
  width: 100%;
  margin: 0;
  text-align: center;
}
.store-mini-select select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
}
.scan-button {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--anyar-line);
  border-radius: 13px;
  background: var(--anyar-surface);
  color: var(--anyar-muted);
  cursor: pointer;
}
.scan-button:hover { color: var(--anyar-ink); }
.scan-button svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.store-extras { display: flex; justify-content: center; margin-block: 4px 10px; }
.product-thumb {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: #14223a;
  color: var(--anyar-soft-blue);
  font-size: 15px;
  font-weight: 800;
}
.fin-row .product-actions { margin-inline-start: 2px; }
.fin-row .product-actions summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  color: var(--anyar-faint);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
}
.fin-row .product-actions summary::-webkit-details-marker { display: none; }
.fin-row .product-actions[open] summary {
  color: var(--anyar-ink);
  background: var(--anyar-glass);
}
.fin-row .product-actions > div {
  position: absolute;
  inset-inline-end: 16px;
  z-index: 20;
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--anyar-line-strong);
  border-radius: 14px;
  background: var(--anyar-surface-higher);
  box-shadow: 0 22px 50px -20px rgba(2, 8, 18, 0.85);
}
.fin-row .product-actions > div button {
  border: 0;
  background: none;
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--anyar-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  white-space: nowrap;
}
.fin-row .product-actions > div button:hover { background: var(--anyar-glass); }
.fin-row { position: relative; }

/* ── نوار ابزار تراکنش‌ها: جستجو و دسته در یک ردیف؛ فیلترها کوچک و وسط ── */
/* ابزار تراکنش‌ها: جستجو و دسته در ردیف اول؛ فیلترها ردیف دوم */
.connected [data-panel="transactions"] .toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.connected [data-panel="transactions"] .toolbar > label {
  flex: 1 1 130px;
  min-width: 0;
  display: flex;
  align-items: center;
}
.connected [data-panel="transactions"] .toolbar > label > span {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.connected [data-panel="transactions"] .toolbar label.connected-filter {
  flex: 0 1 auto;
}
.connected [data-panel="transactions"] .toolbar :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink);
  font: inherit;
  font-size: 13px;
}
.connected [data-panel="transactions"] .toolbar .filter-tabs {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-block: 2px;
  background: none;
  padding: 0;
  border: 0;
}
.connected [data-panel="transactions"] .toolbar .filter-tabs button {
  min-height: 42px;
  padding: 6px 13px;
  border: 1px solid var(--anyar-line);
  border-radius: 999px;
  background: var(--anyar-surface);
  color: var(--anyar-ink-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--anyar-fast) ease, color var(--anyar-fast) ease, border-color var(--anyar-fast) ease;
}
.connected [data-panel="transactions"] .toolbar .filter-tabs button:hover {
  color: var(--anyar-ink);
  border-color: var(--anyar-line-strong);
}
.connected [data-panel="transactions"] .toolbar .filter-tabs button.active {
  border-color: rgba(33, 107, 255, 0.45);
  background: var(--anyar-cobalt-soft);
  color: #fff;
}

/* ── سایدبار دسکتاپ ── */
.app-rail {
  display: none;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  z-index: 65;
  width: 224px;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px;
  border-inline-end: 1px solid var(--anyar-line);
  background: color-mix(in srgb, var(--anyar-bg-deep) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.app-rail .rail-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 2px 8px;
  text-decoration: none;
}
.app-rail .rail-brand { color: var(--anyar-ink); font-size: 19px; font-weight: 900; }
.app-rail .rail-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--anyar-grad-cobalt);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(33, 107, 255, 0.7);
}
.app-rail .rail-add svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.app-rail .rail-add:hover { filter: brightness(1.08); }
.app-rail .rail-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 13px;
  background: none;
  color: #a9bcd9;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: color var(--anyar-fast) ease, background var(--anyar-fast) ease;
}
.app-rail .rail-item svg {
  width: 21px; height: 21px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-rail .rail-item:hover { color: var(--anyar-ink); background: var(--anyar-glass); }
.app-rail .rail-item.active { color: var(--anyar-soft-blue); background: var(--anyar-cobalt-soft); }
.app-rail .rail-logout { margin-top: auto; color: var(--anyar-coral); }
.app-rail .rail-logout:hover { color: var(--anyar-coral); background: rgba(240, 140, 133, 0.1); }

/* ── خروج موبایل ── */
.logout-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid rgba(240, 140, 133, 0.25);
  border-radius: var(--anyar-radius);
  background: rgba(240, 140, 133, 0.06);
  color: var(--anyar-coral);
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}
.logout-row svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── دسکتاپ: سایدبار + دو ستون خانه + بدون داک موبایل ── */
@media (min-width: 900px) {
  .app-rail { display: flex; }
  .app-dock { display: none; }
  .connected .dashboard { padding-bottom: 24px; }
  .connected .dashboard-shell { margin-inline-start: 224px; }
  .connected #dashboard-main {
    max-width: 1180px;
    padding: 10px 28px 28px;
  }
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 8px 28px;
    align-items: start;
  }
  .home-col { display: grid; gap: 4px; min-width: 0; }
  .app-header { padding-inline: 28px; }
  .app-header .app-logo img { width: 34px; height: auto; }
  .confirm-marquee { margin-inline: 28px; }
}
@media (min-width: 1280px) {
  .connected #dashboard-main { max-width: 1280px; }
}

/* ── عرضهای باریک ── */
@media (max-width: 359px) {
  .connected #dashboard-main { padding-inline: 12px; }
  .fin-row { gap: 9px; }
  .fin-icon { width: 38px; height: 38px; }
  .pill-manual, .pill-text { width: 86px; }
  .pill-voice { width: 108px; margin-left: -54px; }
}

/* ── کاهش حرکت ── */
@media (prefers-reduced-motion: reduce) {
  .entry-pill, .dock-fab, .dock-fab svg { transition: none; }
}

/* ── خلاصهٔ نمای کلی فروشگاه: متن و دکمه در یک سطر ── */
.store-summary-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--anyar-line);
  border-radius: 14px;
  background: var(--anyar-surface);
  margin-block: 10px;
}
.store-summary-inline span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--anyar-ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}
.store-summary-inline .home-more { flex-shrink: 0; }

/* ── عکس پروفایل اشخاص و عکس کالا ── */
.person-avatar {
  overflow: hidden;
}
.person-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
img.product-thumb.product-photo {
  object-fit: cover;
  border-radius: 11px;
}
.avatar-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--anyar-line);
  border-radius: 14px;
  background: var(--anyar-glass);
}
.avatar-picker .avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--anyar-surface-higher);
  border: 1px solid var(--anyar-line-strong);
}
.product-image-picker .avatar-preview,
.product-image-picker .product-image-preview {
  border-radius: 14px;
  width: 56px;
  height: 56px;
}
.avatar-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── گالری آواتار در فرم شخص ── */
.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-block: 6px 10px;
}
.avatar-gallery[hidden] { display: none; }
.avatar-option {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: none;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
}
.avatar-option img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-option.selected {
  border-color: var(--anyar-cobalt);
  box-shadow: 0 0 0 3px rgba(33, 107, 255, 0.25);
}

/* ── دکمهٔ خواندم اعلان‌ها: سبز کمرنگ ── */
.connected .secondary-small.mark-read {
  border-color: rgba(123, 220, 169, 0.4);
  background: rgba(123, 220, 169, 0.14);
  color: var(--anyar-income);
}
.connected .secondary-small.mark-read:hover {
  background: rgba(123, 220, 169, 0.22);
}

/* ── صفحهٔ ورود موبایل: فرم بالا بماند ── */
@media (max-width: 860px) {
  .auth-shell { padding-top: 8px; padding-bottom: 12px; }
  .auth-brand { padding-top: 2px; min-height: auto; padding-block: 4px 2px; gap: 8px; }
  .auth-brand .auth-message { gap: 6px; }
  .auth-brand .auth-message h1 { font-size: clamp(20px, 5.5vw, 25px); margin: 4px 0; }
  .auth-brand .auth-message p { font-size: 12.5px; margin: 0; }
  .auth-brand .eyebrow { margin: 0; font-size: 11px; }
  .auth-logo img { width: 46px; height: auto; }
  .auth-logo > span:last-of-type { font-size: 16px; }
  .login-voice-scene { display: none; }
  .auth-panel { padding-top: 10px; }
  .auth-form-wrap { padding-block: 12px; }
  .auth-form-wrap h2 { margin-block: 2px; }
  .phone-input input { min-height: 46px; }
}

/* ── پایداری سایز بخش‌های خانه هنگام تغییر حساب/بازه ── */
.home-balance > p { min-height: 22px; }
.home-balance h2 { min-height: 44px; align-content: center; }
.home-note {
  min-height: 36px;
  display: grid;
  align-content: start;
}
.home-flow b { min-height: 24px; }

/* ── آیکن چک و کپسول روزشمار سررسید ── */
.fin-icon.cheque-tile img {
  width: 22px;
  height: auto;
  display: block;
}
.fin-icon.cheque-tile img[src="installment-icon.png"] {
  width: 24px;
}
.due-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  font-style: normal;
  color: var(--anyar-soft-blue);
  background: var(--anyar-cobalt-soft);
}
.due-chip.soon {
  color: var(--anyar-warning);
  background: rgba(255, 197, 110, 0.13);
}
.due-chip.overdue {
  color: var(--anyar-expense);
  background: rgba(242, 154, 147, 0.13);
}
.due-chip.passed {
  color: var(--anyar-muted);
  background: rgba(255, 255, 255, 0.06);
}
