/* TKBK Store — Telegram Mini App. Visual language follows tkbk.io:
   warm near-black, copper accent, teal/violet glows, Inter + JetBrains Mono. */
:root {
  --bg: #0a0908;
  --bg-2: #100e0c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f4efea;
  --muted: #a39b93;
  --dim: #6f6861;
  --accent: #e0855c;
  --accent-2: #f3a983;
  --accent-ink: #1a0f09;
  --accent-soft: rgba(224, 133, 92, 0.14);
  --teal: #7fa8a2;
  --violet: #8b5cf6;
  --ok: #5ad39a;
  --warn: #f0b35c;
  --err: #ff7a6b;
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
.mono { font-family: var(--mono); letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient::before, .ambient::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: drift 18s var(--ease) infinite alternate;
}
.ambient::before { width: 380px; height: 380px; left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(224,133,92,.55), transparent 65%); }
.ambient::after { width: 420px; height: 420px; right: -180px; bottom: 5%;
  background: radial-gradient(circle, rgba(139,92,246,.35), transparent 65%); animation-delay: -6s; }
.grid-bg { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); }
@keyframes drift { to { transform: translate(40px, 60px) scale(1.15); } }

/* ---------- layout ---------- */
.app { padding: calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 96px); max-width: 640px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.logo { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); align-self: center; }
.logo .tag { font: 500 11px var(--mono); color: var(--muted); letter-spacing: 0; }
.balance-pill {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font: 600 14px var(--mono);
  transition: transform .2s var(--ease), border-color .2s;
}
.balance-pill:active { transform: scale(.96); }
.balance-pill .plus { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; }

.screen { animation: screenIn .35s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.section-title .hint { font: 500 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.glass { background: rgba(20, 17, 15, .72); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }

.hero {
  position: relative; overflow: hidden; padding: 20px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(224,133,92,.18), rgba(139,92,246,.08) 60%, rgba(127,168,162,.08));
  border: 1px solid rgba(224,133,92,.25);
}
.hero::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%;
  background: conic-gradient(from 90deg, var(--accent), var(--violet), var(--teal), var(--accent));
  filter: blur(46px); opacity: .45; animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font: 500 11px var(--mono); color: var(--accent-2); text-transform: uppercase; letter-spacing: .12em; }
.hero h1 { margin: 6px 0 6px; font-size: 25px; line-height: 1.12; letter-spacing: -0.04em; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent-2), #ffd9c4 50%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 34ch; }
.hero-stats { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.stat { padding: 8px 11px; border-radius: 12px; background: rgba(10,9,8,.45); border: 1px solid var(--border); }
.stat b { display: block; font: 700 15px var(--mono); }
.stat span { font-size: 11px; color: var(--muted); }

/* ---------- search & chips ---------- */
.search { position: relative; margin-top: 16px; }
.search input {
  width: 100%; padding: 13px 14px 13px 42px; border-radius: 14px; outline: none;
  background: var(--surface-2); border: 1px solid var(--border); transition: border-color .2s, background .2s;
}
.search input:focus { border-color: rgba(224,133,92,.55); background: var(--surface-3); }
.search input::placeholder { color: var(--dim); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all .2s var(--ease);
}
.chip .n { font: 500 11px var(--mono); color: var(--dim); margin-left: 4px; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.active .n { color: #6b625b; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; text-align: left;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s var(--ease), border-color .25s, background .25s; animation: rise .45s var(--ease) both;
}
.p-card:active { transform: scale(.97); background: var(--surface-2); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.p-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.p-card .name { font-weight: 650; font-size: 13.5px; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.price { font: 700 17px var(--mono); letter-spacing: -0.03em; }
.price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.stock { font-size: 11px; color: var(--dim); }

.brand {
  --b1: #e0855c; --b2: #8b5cf6;
  width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center;
  font: 800 15px var(--font); color: #fff; letter-spacing: -0.03em;
  background: linear-gradient(145deg, var(--b1), var(--b2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px -6px var(--b1);
}
.brand.lg { width: 64px; height: 64px; border-radius: 19px; font-size: 22px; }

.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 7px;
  font: 600 10.5px var(--font); background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.fast { color: var(--ok); background: rgba(90,211,154,.08); border-color: rgba(90,211,154,.2); }
.badge.warranty { color: var(--teal); background: rgba(127,168,162,.08); border-color: rgba(127,168,162,.22); }
.badge.nowarranty { color: var(--warn); background: rgba(240,179,92,.08); border-color: rgba(240,179,92,.2); }
.badge.manual { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(224,133,92,.25); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { font-size: 36px; margin-bottom: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border-radius: 15px; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), #d9724a); color: var(--accent-ink);
  box-shadow: 0 10px 28px -10px rgba(224,133,92,.8), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .15s var(--ease), filter .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border-2); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.sm { width: auto; padding: 9px 13px; font-size: 13px; border-radius: 11px; }
.btn .spinner { width: 16px; height: 16px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- bottom sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,3,.6); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .3s var(--ease); }
.overlay.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto;
  padding: 10px 18px calc(var(--safe-bottom) + 18px); border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #1a1614, #110f0d); border-top: 1px solid var(--border-2);
  transform: translateY(100%); transition: transform .4s var(--ease); max-width: 640px; margin: 0 auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
}
.sheet.open { transform: translateY(0); }
.sheet .handle { width: 38px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 0 auto 14px; }
.sheet h3 { margin: 12px 0 6px; font-size: 20px; letter-spacing: -0.03em; line-height: 1.2; }
.sheet .desc { white-space: pre-line; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-height: 180px; overflow: hidden; position: relative; }
.sheet .desc.expanded { max-height: none; }
.sheet .desc:not(.expanded)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50px; background: linear-gradient(transparent, #141110); }
.sheet .more { color: var(--accent-2); font-size: 13px; font-weight: 600; margin-top: 6px; }
.sheet-actions { position: sticky; bottom: calc(-1 * (var(--safe-bottom) + 18px)); padding: 14px 0 0; margin-top: 16px;
  background: linear-gradient(transparent, #110f0d 30%); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.kv > div { padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.kv b { display: block; font: 700 15px var(--mono); }
.kv span { font-size: 11px; color: var(--muted); }

/* ---------- success ---------- */
.success { text-align: center; padding: 8px 0 4px; }
.check { width: 74px; height: 74px; margin: 6px auto 12px; }
.check circle { stroke: var(--ok); stroke-width: 3; fill: rgba(90,211,154,.08); stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw .6s var(--ease) forwards; }
.check path { stroke: var(--ok); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s .45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.code-row { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; margin-top: 8px; border-radius: 13px;
  background: rgba(0,0,0,.35); border: 1px dashed var(--border-2); text-align: left; }
.code-row code { flex: 1; font: 500 13.5px var(--mono); word-break: break-all; }
.icon-btn { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: transform .15s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn.ok { color: var(--ok); border-color: rgba(90,211,154,.4); }

/* ---------- keys ---------- */
.keys-hero { text-align: left; }
.glyphs { display: flex; gap: 8px; margin-bottom: 12px; }
.glyph { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 11px; font-weight: 700; font-size: 13px;
  background: rgba(10,9,8,.5); border: 1px solid var(--border-2); }
.glyph i { font-style: normal; font-size: 16px; }
.glyph.claude i { color: #e38a64; }
.glyph.codex i { color: var(--teal); }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.feature { display: flex; gap: 9px; align-items: flex-start; padding: 11px; border-radius: 13px; background: rgba(10,9,8,.4); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.feature b { display: block; color: var(--text); font-size: 12.5px; }
.feature .fi { font-size: 16px; line-height: 1; }

.tariffs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tariff {
  position: relative; padding: 14px; text-align: left; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--border); transition: all .25s var(--ease); animation: rise .45s var(--ease) both;
}
.tariff:active { transform: scale(.97); }
.tariff.selected { border-color: var(--accent); background: linear-gradient(160deg, rgba(224,133,92,.16), rgba(224,133,92,.03)); box-shadow: 0 10px 30px -14px rgba(224,133,92,.7); }
.tariff .limit { font: 800 24px var(--mono); letter-spacing: -0.05em; }
.tariff .limit small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.tariff .cost { margin-top: 2px; font: 600 14px var(--mono); color: var(--accent-2); }
.tariff .ratio { margin-top: 8px; font-size: 11px; color: var(--dim); }
.tariff .ratio b { color: var(--teal); font-family: var(--mono); }
.ribbon { position: absolute; top: -9px; right: 10px; padding: 3px 8px; border-radius: 7px; font: 700 10px var(--font);
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; letter-spacing: .02em; }

.key-card { padding: 14px; margin-bottom: 10px; animation: rise .45s var(--ease) both; }
.key-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.key-head .title { font-weight: 700; }
.key-head .sub { font-size: 12px; color: var(--muted); }
.meter { height: 8px; margin: 12px 0 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width 1s var(--ease); }
.meter.hot > div { background: linear-gradient(90deg, var(--warn), var(--err)); }
.key-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.key-stats b { color: var(--text); font-family: var(--mono); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); margin-right: 6px; }
.status-dot.off { background: var(--err); box-shadow: 0 0 8px var(--err); }

.tabs-mini { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin: 14px 0 10px; }
.tabs-mini button { flex: 1; padding: 8px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tabs-mini button.active { background: var(--surface-3); color: var(--text); }
pre.code { position: relative; margin: 0; padding: 13px 14px; border-radius: 13px; background: #070605; border: 1px solid var(--border);
  font: 12px/1.6 var(--mono); color: #e9d9cd; white-space: pre-wrap; word-break: break-all; }
pre.code .copy-abs { position: absolute; top: 8px; right: 8px; }
.key-reveal { font: 600 13px var(--mono); word-break: break-all; }

/* ---------- orders ---------- */
.order { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 8px; width: 100%; text-align: left; animation: rise .4s var(--ease) both; }
.order .info { flex: 1; min-width: 0; }
.order .t { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order .s { font-size: 12px; color: var(--muted); }
.pill { padding: 4px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill.delivered { color: var(--ok); background: rgba(90,211,154,.1); }
.pill.processing, .pill.new { color: var(--warn); background: rgba(240,179,92,.1); }
.pill.refunded { color: var(--muted); background: var(--surface-2); }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 76px; min-height: 50vh; }
.assistant-head { display: flex; align-items: center; gap: 12px; padding: 14px; }
.ai-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px;
  background: conic-gradient(from 200deg, var(--accent), var(--violet), var(--teal), var(--accent)); position: relative; }
.ai-avatar::after { content: ""; position: absolute; inset: 2px; border-radius: 12px; background: #15110f; }
.ai-avatar span { position: relative; z-index: 1; }
.online { font-size: 12px; color: var(--ok); }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 17px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #d06d45); color: var(--accent-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg code { font: 12.5px var(--mono); padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.35); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.suggest { display: flex; flex-wrap: wrap; gap: 7px; }
.suggest button { padding: 8px 12px; border-radius: 12px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--border-2); color: var(--text); }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 70px); z-index: 20; padding: 8px 16px; max-width: 640px; margin: 0 auto; }
.composer form { display: flex; gap: 8px; padding: 6px; border-radius: 18px; border: 1px solid var(--border-2); }
.composer input { flex: 1; min-width: 0; padding: 10px 12px; background: none; border: 0; outline: none; }
.composer button { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.composer button:disabled { opacity: .4; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.avatar { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; display: grid; place-items: center; font-weight: 800; font-size: 20px;
  background: linear-gradient(145deg, var(--accent), var(--violet)); }
.balance-card { position: relative; overflow: hidden; padding: 20px; border-radius: 22px; border: 1px solid rgba(224,133,92,.3);
  background: radial-gradient(120% 140% at 100% 0%, rgba(224,133,92,.28), transparent 55%), linear-gradient(160deg, #1b1512, #0f0c0b); }
.balance-card .label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.balance-card .amount { font: 800 40px var(--mono); letter-spacing: -0.06em; margin: 4px 0 2px; }
.balance-card .amount span { font-size: 22px; color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 16px 0 12px; }
.amounts button { padding: 11px 0; border-radius: 12px; font: 700 14px var(--mono); background: rgba(10,9,8,.5); border: 1.5px solid var(--border-2); transition: all .2s; }
.amounts button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.assets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.assets span { font: 600 10.5px var(--mono); color: var(--dim); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border); }
.links { display: grid; gap: 8px; margin-top: 10px; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left; }
.link-row .li { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 16px; }
.link-row .lt { flex: 1; font-weight: 600; font-size: 14px; }
.link-row .ls { font-size: 12px; color: var(--muted); }
.pending { display: flex; align-items: center; gap: 12px; padding: 14px; margin-top: 12px; border-color: rgba(240,179,92,.35); }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 10px calc(var(--safe-bottom) + 8px);
  border-top: 1px solid var(--border); }
.tabbar nav { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 640px; margin: 0 auto; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--dim);
  font-size: 10.5px; font-weight: 600; transition: color .2s; }
.tab svg { transition: transform .3s var(--ease); }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--accent); transform: translateY(-1px); }
.tab.active::before { content: ""; position: absolute; top: -9px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.tab .dot-badge { position: absolute; top: 3px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-top) + 14px); z-index: 100; transform: translate(-50%, -150%);
  padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600; max-width: 90vw; text-align: center;
  background: rgba(30,25,22,.92); border: 1px solid var(--border-2); backdrop-filter: blur(16px); transition: transform .4s var(--ease); }
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,122,107,.5); color: #ffc9c2; }
.toast.ok { border-color: rgba(90,211,154,.5); color: #c8f5df; }

.fatal { text-align: center; padding: 80px 24px; }
.fatal h2 { margin: 10px 0 6px; }

@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } .tariffs { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 519px) { .tariff:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---------- helper chat & profile cards ---------- */
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-products { display: grid; gap: 6px; margin-top: 10px; }
.chat-product { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left;
  background: rgba(0,0,0,.25); border: 1px solid var(--border); font-size: 13px; }
.chat-product span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product .brand { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.ref-card { padding: 16px; }
.textarea { width: 100%; padding: 12px 14px; border-radius: 14px; resize: vertical; outline: none;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); }
.textarea:focus { border-color: rgba(224,133,92,.55); }

/* ---------- v6: shop extras ---------- */
.p-card.oos { opacity: .55; }
.p-card .rub, .rub { font-size: 11px; color: var(--dim); }
.rating { color: #ffc86b; font-weight: 700; font-size: 12px; }
.fav-dot { color: #ff6b8a; font-size: 14px; }
.promo-banner { margin-top: 12px; padding: 11px 14px; font-size: 13px; border-color: rgba(224,133,92,.35); color: var(--accent-2); }
.recent { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent-item { flex: none; width: 128px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); text-align: left; font-size: 12px; }
.recent-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.recent-item .brand { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.icon-btn.fav.on { color: #ff6b8a; border-color: rgba(255,107,138,.45); }
.icon-btn.fav.on svg { fill: #ff6b8a; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stepper button { width: 36px; height: 34px; border-radius: 9px; font-size: 18px; font-weight: 700; background: var(--surface-3); }
.stepper b { min-width: 32px; text-align: center; font-family: var(--mono); }
.field-label { display: block; margin: 16px 2px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.promo-line { font-size: 13px; color: var(--ok); margin-bottom: 8px; text-align: center; min-height: 0; }
.promo-line:empty { display: none; }
.review { padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.review b { color: #ffc86b; letter-spacing: 1px; }
.rate { display: flex; justify-content: center; gap: 6px; margin: 8px 0 4px; }
.rate button { font-size: 30px; line-height: 1; color: var(--surface-3); transition: transform .15s, color .15s; }
.rate button.on { color: #ffc86b; }
.rate button:active { transform: scale(1.25); }
.cashback-note { color: var(--ok); font-weight: 600; font-size: 13px; margin: 10px 0 0; }

/* ---------- v6: profile ---------- */
.level-card { padding: 16px; margin-top: 12px; }
.level-top { display: flex; justify-content: space-between; align-items: flex-end; }
.level-card .label, .top-ref .label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.level-name { font-size: 18px; }
.level-pct { font: 700 14px var(--mono); color: var(--teal); }
.promo-card { padding: 14px; margin-top: 10px; }
.promo-active { font-size: 13px; color: var(--ok); margin-bottom: 10px; }
.promo-form { display: flex; gap: 8px; }
.promo-form input, .promo-grid input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 12px; outline: none;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); text-transform: none; }
.top-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.top-row span:first-child { flex: 1; }
.top-row.me { color: var(--accent-2); font-weight: 700; }
.file-btn { display: inline-block; margin-top: 10px; padding: 9px 12px; border-radius: 11px; font-size: 13px; cursor: pointer;
  background: var(--surface-2); border: 1px dashed var(--border-2); color: var(--muted); }

/* ---------- v6: admin ---------- */
.admin-tabs { margin-top: 0; }
.admin-user { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; font-size: 14px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 10px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar div { width: 100%; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--violet)); min-height: 3px; }
.bar span { font: 500 9px var(--mono); color: var(--dim); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
select.textarea { appearance: none; }
