/* GxMarket «Neon Vault»: компоненты: кнопки, чипы, поля, шиты, степпер, тосты, скелетоны.
   Свет: только на интерактиве и статусах (канон DESIGN.md); статика, спокойное тёмное стекло. */

/* ============================== стекло ============================== */
.plate { position: relative; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--plate-2), var(--plate)); box-shadow: var(--spec), inset 0 0 0 1px var(--line), var(--shadow-1); }
.plate--pad { padding: 18px; }
.well { border-radius: var(--r-sm); background: var(--well); box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.35), inset 0 0 0 1px var(--line); }

/* ============================== кнопки ============================== */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl); padding: 0 20px; border-radius: var(--r-pill);
  font: 650 15px/1 var(--font); letter-spacing: -0.01em; color: var(--text); white-space: nowrap; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: var(--plate-2); box-shadow: var(--spec), inset 0 0 0 1px var(--line-2);
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t) var(--ease), background var(--t-fast), filter var(--t-fast), opacity var(--t);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { box-shadow: var(--spec), inset 0 0 0 1px var(--a-40), 0 8px 26px -12px var(--a-60); }
.btn:active { transform: scale(0.96); }
.btn[disabled], .btn.is-busy { opacity: 0.5; pointer-events: none; }
.btn--sm { height: var(--ctl-sm); padding: 0 14px; font-size: 13px; }
.btn--lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn--ghost:hover { color: var(--text); background: var(--plate); box-shadow: none; }
.btn--primary { color: var(--on-accent); background: var(--grad); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 10px 30px -10px var(--a-60); font-weight: 750; }
.btn--primary:hover { filter: brightness(1.08) saturate(1.1); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), 0 14px 38px -8px var(--a-60); }
.btn--danger { color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bad) 40%, transparent); }
.btn--danger:hover { box-shadow: inset 0 0 0 1px var(--bad), 0 8px 24px -12px var(--bad); }
.btn--good { color: #04140c; background: linear-gradient(135deg, var(--good), color-mix(in oklab, var(--good) 60%, var(--accent))); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 10px 30px -10px var(--good); font-weight: 750; }
.link { color: var(--accent-ink); font-weight: 600; transition: opacity var(--t-fast); }
.link:hover { opacity: 0.8; text-decoration: underline; text-underline-offset: 3px; }
.link[disabled] { color: var(--faint); pointer-events: none; }

/* ============================== чипы, сегменты, переключатель ============================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-sm); padding: 0 14px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 650; color: var(--muted); white-space: nowrap; user-select: none; -webkit-user-select: none;
  background: var(--plate); box-shadow: inset 0 0 0 1px var(--line); transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease-spring);
}
.chip:hover { color: var(--text); background: var(--plate-2); }
.chip:active { transform: scale(0.95); }
.chip.is-active { color: var(--accent-ink); background: var(--a-12); box-shadow: inset 0 0 0 1px var(--a-60), 0 0 22px -6px var(--a-60); }
.chip img, .chip svg { width: 17px; height: 17px; flex: 0 0 auto; }
.chip__n { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 650; color: var(--muted); transition: color var(--t-fast), background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.seg button.is-active { color: var(--text); background: var(--plate-3); box-shadow: var(--spec), inset 0 0 0 1px var(--a-40); }
.sw { position: relative; width: 50px; height: 30px; border-radius: 15px; flex: 0 0 auto; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 0.45); transition: transform var(--t) var(--ease-spring); }
.sw[aria-checked='true'] { background: var(--grad); box-shadow: 0 0 20px -4px var(--accent); }
.sw[aria-checked='true']::after { transform: translateX(20px); }

/* ============================== поля ============================== */
.field { display: grid; gap: 7px; }
.field__l { font-size: 12.5px; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; }
.inp {
  width: 100%; height: 50px; padding: 0 16px; border-radius: var(--r-sm); border: 0; font-size: 16px; color: var(--text); background: var(--well);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.3), inset 0 0 0 1px var(--line); transition: box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
.inp::placeholder { color: var(--faint); }
.inp:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 5px var(--a-12), 0 0 34px -8px var(--a-60); }
.inp--search { padding-left: 46px; height: 48px; border-radius: var(--r-pill); }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--faint); pointer-events: none; }
.search__x { position: absolute; right: 8px; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 50%; color: var(--faint); display: grid; place-items: center; }
.search__x svg { position: static; margin: 0; width: 16px; height: 16px; }

/* ============================== степпер и «+» ============================== */
.qty { display: inline-flex; align-items: center; height: 38px; }
.qty__add { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--on-accent); background: var(--grad); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 8px 22px -8px var(--a-60); transition: transform var(--t-fast) var(--ease-spring), filter var(--t-fast); }
.qty__add svg { width: 20px; height: 20px; }
.qty__add:hover { filter: brightness(1.1); }
.qty__add:active { transform: scale(0.88); }
.qty__add[disabled] { background: var(--plate-2); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.stp { display: inline-flex; align-items: center; height: 38px; border-radius: var(--r-pill); background: var(--plate-3); box-shadow: var(--spec), inset 0 0 0 1px var(--a-40), 0 0 22px -8px var(--a-60); animation: pop 0.34s var(--ease-spring) both; }
.stp button { width: 36px; height: 38px; display: grid; place-items: center; border-radius: var(--r-pill); font-size: 19px; font-weight: 600; color: var(--text); transition: transform var(--t-fast) var(--ease-spring), color var(--t-fast); }
.stp button:active { transform: scale(0.8); }
.stp button[disabled] { color: var(--faint); pointer-events: none; }
.stp__n { min-width: 22px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.stp--lg { height: 46px; } .stp--lg button { height: 46px; width: 44px; }

/* ============================== бейджи и цена ============================== */
.bdg { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; color: var(--muted); background: var(--plate); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.bdg::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bdg--nodot::before { display: none; }
.bdg--good { color: var(--good); background: color-mix(in oklab, var(--good) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--good) 38%, transparent); }
.bdg--warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warn) 38%, transparent); }
.bdg--bad { color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bad) 38%, transparent); }
.bdg--info { color: var(--info); background: color-mix(in oklab, var(--info) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--info) 38%, transparent); }
.bdg--accent { color: var(--accent-ink); background: var(--a-12); box-shadow: inset 0 0 0 1px var(--a-40); }
.price { font-weight: 780; font-size: 17px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price s { margin-right: 7px; color: var(--faint); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.asset-ico, .prov-ico { display: inline-block; vertical-align: -3px; border-radius: 50%; flex: 0 0 auto; }
.prov-ico { border-radius: 6px; }

/* ============================== шиты ============================== */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; justify-items: center; }
.sheet__scrim { position: absolute; inset: 0; background: color-mix(in oklab, #000 58%, transparent); backdrop-filter: blur(10px) saturate(130%); -webkit-backdrop-filter: blur(10px) saturate(130%); animation: fade 0.3s var(--ease) both; }
.sheet__box {
  position: relative; width: 100%; max-width: 560px; max-height: min(92vh, calc(100dvh - 24px - var(--safe-t))); display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y;
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: linear-gradient(180deg, color-mix(in oklab, var(--ink-3) 92%, transparent), color-mix(in oklab, var(--ink-1) 96%, transparent));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--spec), inset 0 0 0 1px var(--line-2), 0 -20px 80px -30px var(--a-60), var(--shadow-3);
  padding-bottom: var(--safe-b); animation: sheet-in 0.5s var(--ease-spring) both; will-change: transform;
}
.sheet.is-leaving .sheet__box { animation: sheet-out 0.28s var(--ease) both; }
.sheet.is-leaving .sheet__scrim { animation: fade-out 0.28s var(--ease) both; }
.sheet__grab { flex: 0 0 auto; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet__grab::after { content: ''; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet__head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 10px; }
.sheet__head h2 { font-size: 20px; font-weight: 780; letter-spacing: -0.04em; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet__foot { flex: 0 0 auto; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: color-mix(in oklab, var(--ink-1) 60%, transparent); }
.sheet--full .sheet__box { max-width: none; width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
@media (min-width: 768px) {
  .sheet { align-items: center; }
  .sheet__box { border-radius: var(--r-xl); max-height: min(86vh, 860px); animation-name: pop-in; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 20px; }
  .sheet--drawer { justify-items: end; align-items: stretch; }
  .sheet--drawer .sheet__box { max-width: 460px; height: 100%; max-height: none; border-radius: var(--r-xl) 0 0 var(--r-xl); animation-name: drawer-in; }
  .sheet--drawer.is-leaving .sheet__box { animation-name: drawer-out; }
  .sheet--full .sheet__box { max-width: none; border-radius: 0; }
}

/* ============================== тосты ============================== */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--dock-h) + var(--safe-b) + 28px); translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
@media (min-width: 768px) { .toasts { bottom: 28px; } }
.toast {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; max-width: 100%;
  background: color-mix(in oklab, var(--ink-2) 86%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--spec), inset 0 0 0 1px var(--line-2), 0 0 34px -8px var(--a-60), var(--shadow-2); animation: toast-in 0.4s var(--ease-spring) both;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); flex: 0 0 auto; }
.toast::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad); transform-origin: left; animation: life 3.4s linear both; }
.toast--err { box-shadow: var(--spec), inset 0 0 0 1px color-mix(in oklab, var(--bad) 55%, transparent), 0 0 34px -8px var(--bad), var(--shadow-2); }
.toast--err::before { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.toast--err::after { background: var(--bad); }
.toast.is-leaving { animation: toast-out 0.25s var(--ease) both; }

/* ============================== скелетон, пустое, спиннер ============================== */
.sk { position: relative; overflow: hidden; border-radius: var(--r-sm); background: var(--plate); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--plate-3), transparent); animation: sheen 1.5s ease-in-out infinite; }
.sk--card { aspect-ratio: 4 / 5; border-radius: var(--r-lg); }
.sk--line { height: 14px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty__ico { position: relative; width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--plate-2); box-shadow: var(--spec), inset 0 0 0 1px var(--line-2), 0 10px 36px -14px var(--a-60); font-size: 34px; }
.empty__ico svg { width: 34px; height: 34px; color: var(--accent-ink); }
.empty h3 { color: var(--text); font-size: 18px; font-weight: 740; letter-spacing: -0.03em; }
.empty p { max-width: 34ch; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

/* ============================== ключи, строки, таблицы-списки ============================== */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv b { font-variant-numeric: tabular-nums; }
.kv--total { font-size: 17px; font-weight: 750; }

/* ============================== keyframes (общие) ============================== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes life { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes sheen { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
