/* لەنگە — ڕووکاری ئەپ (v3) */
:root {
  --ground: #F4F4F5;
  --card: #FFFFFF;
  --ink: #18181B;
  --ink2: #3F3F46;
  --muted: #71717A;
  --line: #E9E9EC;
  --line2: #D4D4D8;
  --chip: #F1F1F3;
  --red: #D23B29;
  --red-dark: #B12F1F;
  --red-soft: #FDEDEA;
  --kraft: #FDEDEA;
  --amber: #F59E0B;
  --amber-soft: #FEF5E3;
  --green: #15803D;
  --green-bg: #E9F6EE;
  --green-ink: #166534;
  --cream: #FFFFFF;
  --cream-muted: #A1A1AA;
  --dark2: #27272A;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ground); }
body { color: var(--ink); font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red); }
img { display: block; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 480px; min-height: 100%; height: 100dvh; margin: 0 auto; position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--ground); }
.boot { flex: 1; display: flex; align-items: center; justify-content: center; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pad { padding: 0 12px; }
.stack { display: flex; flex-direction: column; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g16 { gap: 16px; } .g18 { gap: 18px; } .g22 { gap: 22px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.fs13 { font-size: 13px; } .fs14 { font-size: 14px; } .fs15 { font-size: 15px; }
.b7 { font-weight: 500; } .b8 { font-weight: 600; } .b9 { font-weight: 700; }
.lh { line-height: 1.75; }
.h1 { font-size: 22px; font-weight: 700; line-height: 1.45; margin: 0; }
.h2 { font-size: 16px; font-weight: 700; margin: 0; }
.h3 { font-size: 15px; font-weight: 700; margin: 0; }
.spacer { flex: 1; min-height: 8px; }
.scroll.stack > * { flex-shrink: 0; }
.scroll.stack > .spacer { flex-shrink: 1; }

/* دووگمەکان */
.btn { height: 48px; border-radius: 12px; border: 0; font-size: 15px; font-weight: 600; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.985); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:active { background: var(--red-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-amber { background: var(--red); color: #fff; }
.btn-outline { background: var(--card); border: 1px solid var(--line2); color: var(--ink); }
.btn-off { background: var(--chip); color: var(--cream-muted); }
.btn-sm { height: 40px; font-size: 14px; border-radius: 10px; }
.btn-link { background: none; border: 0; padding: 0; height: 40px; color: var(--red); font-size: 14px; font-weight: 600; }
.btn-link.inline { height: auto; display: inline; font-size: inherit; text-decoration: underline; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.iconbtn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); position: relative; }
.iconbtn:active { background: var(--chip); }
.pill { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--card); color: var(--ink2); border: 1px solid var(--line2); display: inline-flex; align-items: center; gap: 6px; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.ghost { background: var(--card); }
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; white-space: nowrap; align-self: flex-start; }
.chip-fit { background: var(--green-bg); color: var(--green-ink); }
.chip-plain { background: var(--chip); color: var(--ink2); }
.chip-amber { background: var(--amber); color: #fff; }
.chip-green { background: var(--green); color: #fff; }
.chip-red { background: var(--red); color: #fff; }
.chip-dark { background: rgba(24,24,27,.75); color: #fff; }

/* خانەکان */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink2); }
.input { height: 48px; border-radius: 10px; background: var(--card); border: 1px solid var(--line2); outline: none; font-size: 15px; padding: 0 14px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.06); }
.input.soft { font-size: 14px; }
textarea.input { height: 100px; padding: 10px 14px; resize: none; line-height: 1.8; }
select.input { appearance: auto; }
.phonebox, .pwbox { display: flex; align-items: center; height: 48px; border-radius: 10px; background: var(--card); border: 1px solid var(--line2); overflow: hidden; }
.phonebox { direction: ltr; }
.phonebox:focus-within, .pwbox:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.06); }
.phonebox .cc { padding: 0 12px; height: 100%; display: flex; align-items: center; border-right: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--muted); }
.phonebox input { flex: 1; height: 100%; padding: 0 12px; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 500; letter-spacing: .5px; min-width: 0; }
.pwbox input { flex: 1; height: 100%; border: 0; outline: none; background: transparent; font-size: 15px; padding: 0 14px; direction: ltr; text-align: right; min-width: 0; }
.pwbox button { height: 100%; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.otp { height: 60px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); outline: none; font-size: 28px; font-weight: 700; text-align: center; letter-spacing: 18px; direction: ltr; padding-left: 18px; width: 100%; }
.otp:focus { border-color: var(--ink); }
.hint-ok { color: var(--green-ink); }

/* سەرپەڕ */
.topbar { height: 52px; flex-shrink: 0; padding: 0 6px; padding-top: var(--safe-t); box-sizing: content-box; display: flex; align-items: center; justify-content: space-between; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .h2 { font-size: 16px; }
.hdr { flex-shrink: 0; background: var(--card); padding-top: var(--safe-t); border-bottom: 1px solid var(--line); }
.hdr-top { height: 52px; padding: 0 12px 0 6px; }
.brand { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 800; color: var(--red); letter-spacing: -.2px; }
.walletchip { height: 32px; padding: 0 10px; border-radius: 999px; border: 0; background: var(--chip); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.walletchip svg { width: 16px; height: 16px; }
.search { margin: 0 12px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--chip); }
.search input { flex: 1; background: transparent; border: 0; outline: none; font-size: 14px; min-width: 0; }
.tabs { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding: 0 14px; margin-top: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex-shrink: 0; height: 40px; border: 0; background: none; padding: 0; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--red); }
.dot-badge { position: absolute; top: 8px; left: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }

/* لیستی سەرەکی */
.toolbar { padding: 12px 12px 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sechead { padding: 14px 12px 8px; display: flex; align-items: baseline; justify-content: space-between; }
.sechead h2 { font-size: 16px; font-weight: 700; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 12px; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 12px 2px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > .pc { flex: 0 0 42%; }
.pc { width: 100%; border: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; text-align: right; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pc .ph { position: relative; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pc .ph img, .gal img, .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc .ph .chip { position: absolute; top: 8px; right: 8px; font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.pc .cd { position: absolute; bottom: 8px; right: 8px; left: auto; height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(24,24,27,.72); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); }
.pc .cd.urgent { background: var(--red); }
.pc .meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.pc .ttl { font-size: 13px; font-weight: 500; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .pr { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc .pr b { font-size: 15px; font-weight: 700; color: var(--ink); }
.pc .pr s { font-size: 11px; color: var(--cream-muted); }
.pc .sub { font-size: 11px; color: var(--muted); }
.ended { opacity: .55; filter: grayscale(.4); }
.timer.urgent { color: var(--red); }

/* لاپەڕەی پارچە */
.gal-wrap { position: relative; aspect-ratio: 1 / 1; width: 100%; flex-shrink: 0; }
.gal { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal::-webkit-scrollbar { display: none; }
.gal > div { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.gal-top { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.fab { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.fab.on { color: var(--red); }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: width .2s; }
.dots span.on { width: 16px; background: #fff; }
.sec { background: var(--card); padding: 14px 16px; }
.sec + .sec { margin-top: 8px; }
.price-xl { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bigtimer { font-weight: 700; border-radius: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; padding: 5px 10px; background: var(--amber-soft); color: #9A5B00; }
.bigtimer.urgent { background: var(--red); color: #fff; }
.bigtimer.done { background: var(--chip); color: var(--muted); }
.save { font-size: 12px; font-weight: 600; color: var(--green-ink); background: var(--green-bg); padding: 2px 6px; border-radius: 5px; }
.inforow { display: flex; align-items: center; gap: 12px; }
.inforow .ic { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--chip); color: var(--ink2); }
.inforow .ic.g { background: var(--green-bg); color: var(--green-ink); }
.inforow .ic.r { background: var(--red-soft); color: var(--red); }
.measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.measures > div { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.hist .av { width: 30px; height: 30px; border-radius: 50%; background: var(--chip); color: var(--ink2); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hist.top .av { background: var(--green-bg); color: var(--green-ink); }
.actionbar { flex-shrink: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + var(--safe-b)); display: flex; align-items: center; gap: 14px; }
.actionbar .btn { flex: 1.4; }
.statusbar { flex-shrink: 0; padding: 12px 16px calc(12px + var(--safe-b)); font-size: 14px; font-weight: 600; text-align: center; border-top: 1px solid var(--line); }
.statusbar.win { background: var(--green-bg); color: var(--green-ink); }
.statusbar.off { background: var(--card); color: var(--muted); }
.box { padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.darkbox { padding: 16px; border-radius: 12px; background: var(--ink); color: #fff; }
.guarantee { display: flex; gap: 12px; align-items: center; }
.dashed { padding: 14px; border-radius: 10px; background: var(--chip); font-size: 13px; color: var(--muted); line-height: 1.8; }

/* لیستەکان */
.listrow { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); text-align: right; width: 100%; }
.group { background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.group > .listrow:last-child { border-bottom: 0; }
.thumb { width: 60px; height: 72px; flex-shrink: 0; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.menu { border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.menu > button, .menu > a { min-height: 50px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 14px; text-align: right; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); text-decoration: none; }
.menu > button:active, .menu > a:active { background: var(--chip); }
.menu > :last-child { border-bottom: 0; }
.menu svg { color: var(--ink2); flex-shrink: 0; }
.menu .small { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--cream-muted); font-size: 18px; line-height: 1; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line2); text-align: right; width: 100%; }
.opt.on { border: 1.5px solid var(--ink); box-shadow: 0 0 0 3px rgba(24,24,27,.05); }
.radio { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--line2); }
.opt.on .radio { border: 6px solid var(--ink); }
.sizechip { min-width: 52px; height: 42px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 500; background: var(--card); border: 1px solid var(--line2); }
.sizechip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.amt { height: 46px; border-radius: 10px; font-size: 15px; font-weight: 600; background: var(--card); border: 1px solid var(--line2); }
.amt.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.paybox { padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); font-size: 13px; line-height: 1.9; color: #5C3D00; }
.sum { padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.sum > div { display: flex; justify-content: space-between; }
.warn { padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: #8A2414; font-size: 13px; line-height: 1.8; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.tl { display: flex; gap: 12px; align-items: flex-start; }
.tl .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--card); border: 2px solid var(--line2); }
.tl .dot.on { background: var(--green); border-color: var(--green); }
.tl .ln { width: 2px; flex: 1; min-height: 24px; background: var(--line); }
.tl .ln.on { background: var(--green); }
.pagehead { padding: calc(14px + var(--safe-t)) 16px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.pagehead h1 { font-size: 20px; font-weight: 700; margin: 0; }
.sect { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; margin-bottom: -6px; }
.invite { display: flex; align-items: center; gap: 12px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; letter-spacing: 1px; }

/* شریتی خوارەوە */
.nav { flex-shrink: 0; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav button { height: 56px; border: 0; background: transparent; color: var(--cream-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; position: relative; }
.nav button.on { color: var(--ink); font-weight: 700; }
.nav button.on svg { color: var(--red); }
.nav .badge { position: absolute; top: 5px; left: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }

/* سەرلێدان */
.toast { position: absolute; bottom: calc(76px + var(--safe-b)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 10px 16px; border-radius: 10px; background: rgba(24,24,27,.94); color: #fff; font-size: 13px; font-weight: 500; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.18); z-index: 60; line-height: 1.7; animation: up .2s ease-out; }
.toast.err { background: #B42318; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }
.sheet-wrap { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-wrap .scrim { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.4); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; background: var(--card); border-radius: 16px 16px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; max-height: 88%; overflow-y: auto; animation: slide .22s ease-out; }
.sheet h2 { font-size: 17px !important; font-weight: 700 !important; }
@keyframes slide { from { transform: translateY(30px); opacity: .6; } }
.sheet .grab { align-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line2); }
.busy { position: absolute; inset: 0; z-index: 70; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 32px; }
.busy > div { background: var(--card); border-radius: 14px; padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.spin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--chip); border-top-color: var(--red); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { margin: 24px 12px; padding: 32px 20px; border-radius: 12px; background: var(--card); font-size: 14px; color: var(--muted); line-height: 1.8; text-align: center; }
.skeleton { background: linear-gradient(90deg, #ECECEE, #F7F7F8, #ECECEE); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.tick { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; border-radius: 6px; border: 1.5px solid var(--line2); background: var(--card); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tick.on { background: var(--ink); border-color: var(--ink); }
.auth { background: var(--card); }

@media (min-width: 520px) {
  body { background: #E4E4E7; }
  .app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.08); }
}
.app.white { background: var(--card); }
