/* Layout concept: dark mobile-first storefront, sticky header, bottom tab bar, one neon violet accent on near-black violet neutrals. */
:root {
  --bg: #0c0b11;
  --surface: #151320;
  --surface-2: #1d1a2b;
  --line: #2c2842;
  --fg: #ece9f6;
  --muted: #a09bb8;
  --accent: #b06bff;
  --accent-ink: #14081f;
  --silver: #cfd2de;
  --ok: #5fdc93;
  --warn: #f3c24b;
  --bad: #ff7a85;
  --font-display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  --font-body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: auto; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 96px;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; }
h1, h2, h3 { margin: 0; line-height: 1.35; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.55rem; letter-spacing: 0.01em; }
h3 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }


header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
header.top .wrap { display: flex; align-items: center; gap: 10px; }
.logo { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: .04em; color: var(--fg); text-decoration: none; margin-inline-end: auto; display: flex; align-items: center; gap: 8px; }
.logo i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.iconbtn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 12px; color: var(--silver); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .cnt { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
nav.tabs .wrap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .72rem; }
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

.hero { margin-top: 16px; padding: 28px 20px 24px; border-radius: 22px; border: 1px solid var(--line); background:
  radial-gradient(120% 90% at 85% 0%, rgba(176,107,255,.28), transparent 60%),
  radial-gradient(90% 80% at 0% 100%, rgba(207,210,222,.10), transparent 60%),
  var(--surface); }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 9vw, 3.6rem); letter-spacing: .05em; }
.hero p { max-width: 46ch; color: var(--silver); margin: 8px 0 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--fg); font-weight: 500; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 0 22px rgba(176,107,255,.35); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

section { margin-top: 30px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head a { font-size: .88rem; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--silver); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.card { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.card .art { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: block; }
.card .art svg, .card .art img, .pdp .art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.card .brand { color: var(--muted); font-size: .8rem; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-weight: 700; color: var(--fg); }
.price.hidden { color: var(--muted); font-weight: 500; font-size: .88rem; }
.badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { padding: 1px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); } .badge.low { color: var(--warn); } .badge.out { color: var(--bad); } .badge.used { color: var(--silver); }
.badge.appr { color: var(--ok); } .badge.pend { color: var(--warn); } .badge.rej { color: var(--bad); }
.mini { display: flex; gap: 6px; }
.mini button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; }
.mini button svg { width: 18px; height: 18px; }
.mini button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.tools { display: grid; gap: 10px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; min-height: 46px; background: transparent; border: 0; outline: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176,107,255,.2); }
select, .field { min-height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--fg); }
.empty { padding: 36px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }

.pdp { display: grid; gap: 18px; margin-top: 16px; }
@media (min-width: 760px) { .pdp { grid-template-columns: 1fr 1fr; align-items: start; } }
.pdp .art { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; }
.pdp .art svg { width: 100%; height: 100%; display: block; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: start; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv th { color: var(--muted); font-weight: 500; width: 40%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.panel + .panel { margin-top: 12px; }
.note { font-size: .84rem; color: var(--muted); }
.warn-box { border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
.err { color: var(--bad); font-size: .88rem; }
.okmsg { color: var(--ok); font-size: .88rem; }
form.stack { display: grid; gap: 10px; }
label.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--silver); }
label.chk input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--accent); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.cmp { border-collapse: collapse; min-width: 560px; width: 100%; }
.cmp th, .cmp td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; min-width: 130px; }
.cmp thead th { background: var(--surface); }
.cmp tbody th { color: var(--muted); font-weight: 500; background: var(--surface); position: sticky; inset-inline-start: 0; }
.cmp .na { color: var(--muted); font-style: normal; }

.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.msg.me { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.msg.bot { align-self: flex-end; }
.msg .cards { display: grid; gap: 8px; margin-top: 8px; }
.mc { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; background: var(--surface-2); border-radius: 12px; text-decoration: none; color: var(--fg); }
.mc small { color: var(--muted); display: block; }
.askbar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; margin-top: 14px; background: var(--bg); padding: 8px 0; }
.askbar input { flex: 1; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; }
.arow { display: grid; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow .ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.arow input.field { width: 130px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.stepper output { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.log li { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }

footer.foot-site { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; display: grid; gap: 6px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 500; }

.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(8,6,12,.96); }
.gate .box { max-width: 380px; width: 100%; text-align: center; padding: 28px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.gate .big { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; color: var(--accent); text-shadow: 0 0 24px rgba(176,107,255,.6); }
.toast { position: fixed; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); inset-inline: 16px; z-index: 60; margin: 0 auto; max-width: 420px; padding: 10px 14px; border-radius: 12px; background: var(--silver); color: #15121f; text-align: center; font-weight: 500; }

@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color .2s, transform .2s; }
  .card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .view { animation: rise .28s ease both; }
  @keyframes rise { from { opacity: .0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumb { flex: none; width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loading { padding: 60px 16px; text-align: center; color: var(--muted); }

.crow { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow .th { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: block; }
.crow .th img, .crow .th svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.crow .meta { min-width: 0; display: grid; gap: 6px; }
.crow .meta > a { color: var(--fg); text-decoration: none; font-weight: 700; overflow-wrap: anywhere; }
.mini button[disabled] { opacity: .4; cursor: not-allowed; }
textarea.field { min-height: 120px; padding: 10px 12px; line-height: 1.8; width: 100%; resize: vertical; }
.sumline { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.stepper output { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.logo { white-space: nowrap; font-size: clamp(1.15rem, 5.6vw, 1.45rem); }
textarea.field { font: inherit; }
@media (max-width: 400px) {
  header.top .wrap { gap: 6px; }
  .iconbtn { width: 38px; height: 38px; }
}
