/* ==========================================================
   علمایی — Design System v3
   ========================================================== */

:root {
  /* ink */
  --ink: #151C18;
  --ink-2: #4C564F;
  --ink-3: #8B9389;
  --ink-4: #B4BAB2;
  /* surfaces */
  --paper: #F5F3ED;
  --paper-2: #EFEDE5;
  --card: #FFFFFF;
  --line: #E6E3D9;
  --line-2: #F0EDE4;
  /* brand */
  --forest: #009042;
  --forest-2: #00A651;
  --forest-3: #3FBE7E;
  --navy: #102A52;
  --navy-2: #1B3E70;
  --navy-tint: #E8ECF3;
  --tint: #E1F5EA;
  --tint-2: #EDFBF4;
  /* accent */
  --amber: #C7842E;
  --amber-2: #A8681E;
  --amber-ink: #4A2E06;
  --amber-tint: #FBF0DD;
  /* semantic */
  --danger: #B3492F;
  --danger-tint: #F8E7E1;
  --ok: #3E7A2E;
  --ok-tint: #E9F2E4;
  --info: #2B5FA8;
  --info-tint: #E6EEF8;
  /* shape */
  --r-xs: 9px;
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;
  --sh-1: 0 1px 2px rgba(19, 42, 33, .04), 0 6px 16px rgba(19, 42, 33, .05);
  --sh-2: 0 8px 26px rgba(19, 42, 33, .10);
  --sh-3: 0 18px 40px rgba(19, 42, 33, .16);
  --sh-amber: 0 8px 20px rgba(199, 132, 46, .35);
  --sh-forest: 0 10px 26px rgba(0, 90, 50, .30);
  --sh-navy: 0 10px 26px rgba(16, 42, 82, .35);
  /* product photos keep a bright studio backdrop in both themes */
  --thumb-bg: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #F1F4F0 55%, #E7EDE7 100%);
  --nav-bg: rgba(255, 255, 255, .94);
  --actionbar-bg: rgba(255, 255, 255, .96);
  --body-bg:
    radial-gradient(900px 500px at 20% -10%, #E4E1D4 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 20%, #D9DED6 0%, transparent 55%),
    #CFCCC0;
}

/* ============ dark theme ============ */
:root[data-theme="dark"] {
  --ink: #EEF4F0;
  --ink-2: #B7C7BF;
  --ink-3: #86978F;
  --ink-4: #5B6B64;
  --paper: #0B1512;
  --paper-2: #101B17;
  --card: #16221D;
  --line: #24352C;
  --line-2: #1C2921;
  --tint: #12281F;
  --tint-2: #0F231B;
  --navy-tint: #111D30;
  --amber-tint: #2B1E0D;
  --danger-tint: #2C1712;
  --ok-tint: #142A1B;
  --info-tint: #10203A;
  --nav-bg: rgba(11, 21, 18, .92);
  --actionbar-bg: rgba(11, 21, 18, .94);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .30), 0 6px 16px rgba(0, 0, 0, .28);
  --sh-2: 0 8px 26px rgba(0, 0, 0, .38);
  --sh-3: 0 18px 40px rgba(0, 0, 0, .50);
  --body-bg:
    radial-gradient(900px 500px at 20% -10%, rgba(0, 166, 81, .12) 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 20%, rgba(27, 62, 112, .32) 0%, transparent 55%),
    #060D0B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  background: var(--body-bg);
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 26px 16px 40px;
  transition: background .25s ease
}

.frame, .card, .pcard, .prow, .mrow, .iconbtn, .cat-ic, .visit, .stats,
.spec, .balance, .tile3, .goal, .banner, .searchbar, .navbar, .actionbar {
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer
}

img {
  max-width: 100%;
  display: block
}

::-webkit-scrollbar {
  width: 0;
  height: 0
}

* {
  scrollbar-width: none
}

/* ---------- device frame ---------- */
.frame {
  width: 390px;
  height: 844px;
  background: var(--paper);
  border-radius: 42px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 90px rgba(19, 42, 33, .32), 0 0 0 9px #1A1D1B, 0 0 0 10px #333935;
}

@media (max-width:470px) {

  /* full-bleed app: no bezel, and no background strip under the frame —
     body must use the same dynamic viewport unit the frame does */
  body {
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
  }

  .frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none
  }

  /* on a real device the bottom bars sit on the home indicator, not on the
     fixed 20-22px the desktop mockup uses to fake it */
  .navbar {
    padding-bottom: calc(11px + env(safe-area-inset-bottom, 11px))
  }

  .actionbar {
    padding-bottom: calc(11px + env(safe-area-inset-bottom, 9px))
  }
}

.statusbar {
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.statusbar .sb-right {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: .85
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch
}

.scroll::after {
  content: '';
  display: block;
  height: 14px
}

section {
  padding: 0 18px
}

/* ---------- app bar ---------- */
.appbar {
  flex-shrink: 0;
  padding: 2px 18px 12px;
  background: var(--paper);
  position: relative;
  z-index: 6
}

.appbar.sep {
  border-bottom: 1px solid var(--line-2)
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px
}

.bar-row+.bar-row {
  margin-top: 12px
}

.iconbtn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  position: relative;
  box-shadow: var(--sh-1);
  transition: transform .15s, background .15s;
}

.iconbtn:active {
  transform: scale(.94)
}

.iconbtn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none
}

.iconbtn.solid {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff
}

/* ---------- theme toggle ---------- */
.theme-toggle .ic-moon {
  display: none
}

:root[data-theme="dark"] .theme-toggle .ic-sun {
  display: none
}

:root[data-theme="dark"] .theme-toggle .ic-moon {
  display: block
}

:root[data-theme="dark"] .theme-toggle {
  color: #E8B13A
}

.badge {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}

.dot {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--paper)
}

.greet {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--forest-2), var(--forest));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-forest)
}

.greet-t p {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4
}

.greet-t h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4
}

.pagetitle {
  flex: 1;
  min-width: 0
}

.pagetitle h1 {
  font-size: 16px;
  font-weight: 700
}

.pagetitle p {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px
}

/* search pill */
.searchbar {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--forest-2) 0%, var(--forest) 55%, var(--navy) 100%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: var(--sh-forest);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: #EAF3EC;
}

.searchbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90px 50px at 92% -40%, rgba(199, 132, 46, .35), transparent 70%),
    radial-gradient(80px 70px at 0% 140%, rgba(255, 255, 255, .12), transparent 70%);
  pointer-events: none
}

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

.searchbar .ph {
  flex: 1;
  font-size: 12.5px;
  color: rgba(234, 243, 236, .8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.searchbar .sep-v {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, .22)
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: #fff
}

.searchbar input::placeholder {
  color: rgba(234, 243, 236, .7)
}

.searchbar.focus {
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18), var(--sh-forest)
}

/* ---------- icons ---------- */
.i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0
}

.i.s {
  width: 16px;
  height: 16px
}

.i.xs {
  width: 13px;
  height: 13px;
  stroke-width: 2
}

.i.lg {
  width: 24px;
  height: 24px
}

.i.xl {
  width: 34px;
  height: 34px;
  stroke-width: 1.4
}

.i.fill {
  fill: currentColor;
  stroke: none
}

.il {
  display: block
}

/* ---------- section head ---------- */
.s-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px
}

.s-head h3 {
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px
}

.s-head h3::before {
  content: '';
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--amber)
}

.s-head h3.g::before {
  background: var(--forest)
}

.s-head .more {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--forest-3);
  background: var(--tint-2);
  padding: 5px 9px;
  border-radius: 9px;
}

.s-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: -6px 0 12px
}

/* ---------- brand logo row ---------- */
.brandrow {
  display: flex;
  align-items: center;
  margin-bottom: 2px
}

.appbar .brandrow+.bar-row {
  margin-top: 6px
}

.brand-logo {
  height: 24px;
  width: auto;
  object-fit: contain
}

/* ---------- top banner slider ---------- */
.topslider {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--sh-2)
}

.ts-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch
}

.ts-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: block;
  aspect-ratio: 16/9;
  background: var(--paper-2)
}

.ts-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.ts-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2
}

.ts-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transition: .2s;
  cursor: pointer
}

.ts-dots i.on {
  width: 16px;
  border-radius: 3px;
  background: #fff
}

/* ---------- stories ---------- */
.stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 18px 4px;
  margin: 0 -18px 20px
}

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 64px
}

.story-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--forest-2), var(--forest) 55%, var(--navy));
  display: grid;
  place-items: center;
  transition: transform .15s
}

.story:active .story-ring {
  transform: scale(.94)
}

.story-ic {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--forest)
}

.story span:last-child {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.3
}

/* ---------- promo grid (bottom banners) ---------- */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px
}

.promo {
  display: block;
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-1);
  aspect-ratio: 1/1
}

.promo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

/* ---------- chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 18px 2px;
  margin: 0 -18px 16px
}

.chip {
  flex-shrink: 0;
  padding: 8px 13px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: var(--sh-1);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform .15s
}

.chip:active {
  transform: scale(.96)
}

.chip.on {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  box-shadow: var(--sh-forest)
}

/* ---------- product card ---------- */
.rowscroll {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 2px 18px 6px;
  margin: 0 -18px 22px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch
}

.rowscroll .pcard {
  scroll-snap-align: start
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
  margin-bottom: 22px
}

.pcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  transition: transform .16s, box-shadow .16s;
}

.pcard:active {
  transform: translateY(1px) scale(.985)
}

.rowscroll .pcard {
  flex-shrink: 0;
  width: 142px
}

.pcard .thumb {
  position: relative;
  height: 112px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--thumb-bg);
  border-bottom: 1px solid var(--line-2);
}

.pcard .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.pgrid .pcard .thumb {
  height: 126px
}

.pcard .body {
  padding: 10px 11px 11px;
  display: flex;
  flex-direction: column;
  flex: 1
}

.pcard .name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.pcard .rate {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 5px
}

.pcard .rate .i {
  color: #E8B13A
}

.pcard .foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px
}

.price {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--forest);
  line-height: 1.35
}

.price u {
  text-decoration: none;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-right: 2px
}

.price s {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-4)
}

.add {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(150deg, #DFA45C, #C7842E);
  color: var(--amber-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(199, 132, 46, .32);
  transition: transform .15s
}

.add:active {
  transform: scale(.88)
}

.tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3.5px 7px;
  border-radius: 8px;
  z-index: 1;
}

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

.tag.best {
  background: var(--forest);
  color: #fff
}

.tag.new {
  background: var(--ok);
  color: #fff
}

.tag.low {
  background: #8A5A12;
  color: #fff
}

.fav {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  z-index: 1;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center
}

.fav.on {
  color: var(--danger)
}

/* list variant */
.plist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px
}

.prow {
  display: flex;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 10px;
  box-shadow: var(--sh-1)
}

.prow .thumb {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--thumb-bg);
  border: 1px solid var(--line-2);
  position: relative
}

.prow .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.prow .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between
}

.prow .name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55
}

.prow .foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px
}

/* ---------- categories row ---------- */
.catrow {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 18px 4px;
  margin: 0 -18px 22px
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  width: 62px
}

.cat-ic {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  color: var(--forest);
  transition: transform .15s
}

.cat:active .cat-ic {
  transform: scale(.94)
}

.cat span {
  font-size: 10px;
  color: var(--ink-2);
  text-align: center;
  font-weight: 600;
  line-height: 1.3
}

/* ---------- visits ---------- */
.visits {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px
}

.visit {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 11px 12px;
  box-shadow: var(--sh-1)
}

.visit-av {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex-shrink: 0;
  background: var(--tint);
  color: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px
}

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

.visit-info p {
  font-size: 13px;
  font-weight: 700
}

.visit-info span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px
}

.btn-sm {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: var(--forest);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 12px;
  box-shadow: var(--sh-forest);
  transition: transform .15s
}

.btn-sm:active {
  transform: scale(.95)
}

.btn-sm.soft {
  background: var(--tint);
  color: var(--forest-2);
  box-shadow: none
}

.btn-sm.amber {
  background: var(--amber);
  color: var(--amber-ink);
  box-shadow: var(--sh-amber)
}

/* ---------- banner ---------- */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 16px 18px;
  margin-bottom: 22px;
  background: linear-gradient(120deg, #0B1F3E, var(--navy) 55%, var(--navy-2));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--sh-navy)
}

.banner::after {
  content: '';
  position: absolute;
  top: -30px;
  left: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13)
}

.banner-t {
  flex: 1;
  position: relative;
  z-index: 1
}

.banner-t b {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 3px
}

.banner-t span {
  font-size: 11px;
  opacity: .92
}

.banner .pill {
  position: relative;
  z-index: 1;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 11px;
  white-space: nowrap
}

/* ---------- stats ---------- */
.stats {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-1);
  margin-bottom: 22px
}

.stats div {
  flex: 1;
  text-align: center;
  padding: 13px 6px;
  position: relative
}

.stats div:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 0;
  width: 1px;
  height: 64%;
  background: var(--line-2)
}

.stats b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums
}

.stats span {
  display: block;
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: 4px
}

/* ---------- generic cards & rows ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1)
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px
}

.mrow {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 13px;
  box-shadow: var(--sh-1);
  transition: transform .15s
}

.mrow:active {
  transform: scale(.985)
}

.mrow-ic {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  flex-shrink: 0;
  display: grid;
  place-items: center
}

.mrow-t {
  flex: 1;
  min-width: 0
}

.mrow-t p {
  font-size: 13px;
  font-weight: 700
}

.mrow-t span {
  font-size: 10.5px;
  color: var(--ink-3)
}

.mrow .go {
  color: var(--ink-4)
}

/* spec table */
.spec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1);
  overflow: hidden;
  margin-bottom: 22px
}

.spec .r {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px
}

.spec .r+.r {
  border-top: 1px solid var(--line-2)
}

.spec .k {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink)
}

.spec .v {
  font-size: 12px;
  color: var(--ink-2);
  text-align: left
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(150deg, var(--forest), var(--navy));
  color: #fff;
  box-shadow: var(--sh-forest);
  transition: transform .15s
}

.btn:active {
  transform: scale(.98)
}

.btn.amber {
  background: linear-gradient(150deg, #DFA45C, #C7842E);
  color: var(--amber-ink);
  box-shadow: var(--sh-amber)
}

.btn.ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--sh-1)
}

.btn.danger {
  background: var(--danger-tint);
  color: var(--danger);
  box-shadow: none
}

.btn.ok {
  background: var(--ok-tint);
  color: var(--ok);
  box-shadow: none
}

/* ---------- bottom nav ---------- */
.navbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 11px 6px 22px;
  position: relative;
  z-index: 8;
  box-shadow: 0 -8px 26px rgba(19, 42, 33, .06)
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  padding: 5px 12px 2px;
  border-radius: 14px;
  transition: color .18s
}

.nav-item span {
  font-size: 9.5px;
  font-weight: 600
}

.nav-item .cap {
  position: absolute;
  top: -11px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background .18s
}

.nav-item.on {
  color: var(--forest)
}

.nav-item.on span {
  font-weight: 800
}

.nav-item.on .cap {
  background: var(--amber)
}

.nav-item.on .i {
  stroke-width: 2.1
}

/* ---------- sticky action bar ---------- */
.actionbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--actionbar-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 11px 16px 20px;
  z-index: 8;
  box-shadow: 0 -8px 26px rgba(19, 42, 33, .07)
}

.actionbar .money {
  flex-shrink: 0
}

.actionbar .money b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--forest);
  font-variant-numeric: tabular-nums
}

.actionbar .money span {
  font-size: 10px;
  color: var(--ink-3)
}

/* ---------- fab ---------- */
.fab {
  position: absolute;
  left: 16px;
  bottom: 92px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 17px;
  border-radius: 18px;
  background: linear-gradient(150deg, #E0A45C, #C7842E);
  color: var(--amber-ink);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(199, 132, 46, .45);
  transition: transform .15s
}

.fab:active {
  transform: scale(.95)
}

/* ---------- bottom sheet ---------- */
.sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none
}

.sheet-wrap.open {
  display: block
}

.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 21, .45);
  animation: fade .2s
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  max-height: 88%;
  animation: up .25s cubic-bezier(.22, 1, .36, 1)
}

@keyframes up {
  from {
    transform: translateY(100%)
  }

  to {
    transform: translateY(0)
  }
}

@keyframes fade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.sheet-grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 10px auto 4px;
  flex-shrink: 0
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 12px;
  flex-shrink: 0
}

.sheet-head h3 {
  font-size: 15px;
  font-weight: 800
}

.sheet-body {
  overflow-y: auto;
  padding: 0 18px 14px;
  flex: 1
}

.sheet-foot {
  display: flex;
  gap: 9px;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--card)
}

.sheet-foot .btn {
  height: 46px;
  font-size: 13px
}

/* segmented tabs */
.segs {
  display: flex;
  background: var(--paper-2);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px
}

.seg {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  transition: .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px
}

.seg.on {
  background: var(--card);
  color: var(--forest);
  box-shadow: var(--sh-1)
}

/* option rows */
.optlist {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 12.5px;
  font-weight: 600
}

.opt .box {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: transparent
}

.opt.on {
  border-color: var(--forest);
  background: var(--tint-2)
}

.opt.on .box {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff
}

.opt .count {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--ink-4);
  font-weight: 600
}

/* ---------- toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: 100px;
  z-index: 40;
  background: var(--forest);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 14px;
  box-shadow: var(--sh-3);
  opacity: 0;
  pointer-events: none;
  transition: .28s cubic-bezier(.22, 1, .36, 1);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0)
}

/* ---------- empty state ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 30px;
  gap: 12px
}

.empty .ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--tint-2);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--forest-3)
}

.empty h4 {
  font-size: 14.5px;
  font-weight: 800
}

.empty p {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.8
}

/* ---------- utilities ---------- */
.mb0 {
  margin-bottom: 0
}

.mb8 {
  margin-bottom: 8px
}

.mb14 {
  margin-bottom: 14px
}

.mb22 {
  margin-bottom: 22px
}

.num {
  font-variant-numeric: tabular-nums
}

.divider {
  height: 1px;
  background: var(--line-2);
  margin: 16px 0
}