/* FidEx — стиль «Хром»: тёмный фон, стеклянные карточки, серебро как у логотипа */
:root {
  --bg: #0A0A0B; --tx: #F4F4F5; --mu: #8E8F96; --line: rgba(255,255,255,.08);
  --s1: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  --s2: rgba(255,255,255,.08); --s3: rgba(255,255,255,.18); --tile: rgba(0,0,0,.35);
  --silver: linear-gradient(120deg, #C9CACF 0%, #FFFFFF 40%, #B5B6BB 75%, #E9E9EB 100%);
  --glow: 0 8px 24px -8px rgba(255,255,255,.35);
  --ok: #4ADE80; --bad: #F87171; --warn: #FBBF24; --info: #3B82F6;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.4 -apple-system, "SF Pro Text", Inter, Manrope, Roboto, system-ui, sans-serif; }
body { background: radial-gradient(120% 60% at 50% 0%, #34353B 0%, #151619 38%, #0A0A0B 70%) fixed; min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
input, textarea, select { background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; width: 100%; outline: none; }
input:focus, textarea:focus { border-color: rgba(255,255,255,.4); }
textarea { min-height: 96px; resize: vertical; }
a { color: inherit; }
.scrollx { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.scrollx::-webkit-scrollbar { display: none; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.splash { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.splash img { width: 88px; height: 88px; border-radius: 24px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }

.page { flex: 1; padding: 10px 18px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 18px; }
.page > * { flex-shrink: 0; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 -6px; }
h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.mu { color: var(--mu); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }

/* шапка */
.hello { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.hello img { width: 44px; height: 44px; border-radius: 14px; }
.hello .h1 { font-size: 13px; color: var(--mu); }
.hello .h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: #fff; box-shadow: 0 0 8px #fff; }

/* карточки */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.card.big { border-radius: 24px; padding: 16px; position: relative; overflow: hidden; }
.halo::before { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.list { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
.status-dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; margin: 0 4px; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status-dot.off { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

/* курс на сегодня — бегущая лента */
.ticker { overflow: hidden; margin: 0 -16px; padding: 0 16px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent); }
.ticker.static { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
.track { display: flex; width: max-content; }
.track.run { animation: tick var(--dur, 20s) linear infinite; }
.ticker:hover .track, .ticker:active .track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .track.run { animation: none; } }
.rtile { width: 106px; margin-right: 8px; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--tile); text-align: left; }
.rtile .c { font-size: 13px; font-weight: 800; display: flex; gap: 6px; }
.rtile .p { font-size: 18px; font-weight: 800; }
.live { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 4px; background: #fff; box-shadow: 0 0 10px #fff; }

/* акции */
.promos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 0 18px; scroll-padding: 0 18px; scrollbar-width: none; }
.promos::-webkit-scrollbar { display: none; }
.promo { flex: 0 0 100%; scroll-snap-align: start; background: var(--silver); color: #0A0A0B; border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.promo .tag { align-self: flex-start; padding: 3px 8px; border-radius: 8px; border: 1px solid #0A0A0B; font-size: 11px; font-weight: 700; }
.promo .t { font-size: 15px; font-weight: 800; }
.promo .d { font-size: 13px; color: #3B3C42; }
.dots { display: flex; justify-content: center; gap: 2px; margin-top: -8px; }
.dots button { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.dots i { display: block; width: 6px; height: 6px; border-radius: 3px; background: var(--s3); transition: width .2s; }
.dots .on i { width: 18px; background: var(--tx); }

/* калькулятор */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.4); gap: 3px; }
.seg button { padding: 9px 4px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--mu); }
.seg button.on { background: var(--silver); color: #0A0A0B; }
.calc { display: flex; flex-direction: column; }
.amt { background: transparent; border: 0; padding: 2px 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.chip { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--s2); font-weight: 700; white-space: nowrap; }
.chip .sym { min-width: 18px; text-align: center; font-weight: 800; }
.divider { position: relative; height: 1px; background: var(--line); margin: 14px 0; }
.swap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 22px; border: 4px solid #17181B; background: #0A0A0B; box-shadow: 0 0 18px rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.outv { font-size: 30px; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; }

/* кнопки */
.btn { min-height: 52px; border-radius: 16px; font-size: 16px; font-weight: 800; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.btn.pri { background: var(--silver); color: #0A0A0B; box-shadow: var(--glow); }
.btn.pri:disabled { background: var(--s2); color: var(--mu); box-shadow: none; opacity: 1; }
.btn.sec { background: var(--s2); border: 1px solid var(--line); }
.btn.out { border: 1px solid rgba(255,255,255,.5); }
.btn.danger { border: 1px solid rgba(248,113,113,.6); color: var(--bad); }
.btn.sm { min-height: 40px; font-size: 14px; border-radius: 12px; width: auto; }
.pill { min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--s2); border: 1px solid var(--line); font-size: 13px; font-weight: 800; flex-shrink: 0; }
.pill.on { background: var(--silver); color: #0A0A0B; border-color: transparent; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.link { text-decoration: underline; font-weight: 700; font-size: 13px; }

/* сделка */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps i { height: 4px; border-radius: 2px; background: var(--s3); }
.steps i.on { background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.5); }
.code { font-size: 28px; font-weight: 800; letter-spacing: .12em; font-family: ui-monospace, Menlo, monospace; }
.codebox { background: var(--silver); color: #0A0A0B; border-radius: var(--r); padding: 14px 16px; }
.warn { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.5); font-size: 13px; font-weight: 600; display: flex; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { text-align: right; word-break: break-all; }

/* таб-бар */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 8px calc(10px + var(--safe-b)); background: rgba(14,14,16,.92); border-top: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: 520px; margin: 0 auto; z-index: 5; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; font-size: 11px; font-weight: 700; color: #6E6F75; }
.tabs button.on { color: #fff; }
.tabs .ic { position: relative; width: 52px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.tabs button.on .ic { background: #2A2A2A; }
.badge { position: absolute; top: -4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #000; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #000; }

/* шторка */
#sheet { position: fixed; inset: 0; z-index: 20; display: none; }
#sheet.open { display: flex; flex-direction: column; justify-content: flex-end; background: rgba(0,0,0,.6); }
#sheet .panel { background: #16171A; border-radius: 22px 22px 0 0; padding: 10px 0 calc(20px + var(--safe-b)); max-height: 75vh; display: flex; flex-direction: column; max-width: 520px; width: 100%; margin: 0 auto; }
#sheet .grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--s3); }
#sheet .title { font-size: 17px; font-weight: 800; padding: 14px 20px 8px; }
#sheet .body { overflow-y: auto; }
#sheet .opt { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px; border-top: 1px solid var(--line); text-align: left; }
#sheet .opt .sym { width: 32px; text-align: center; font-size: 18px; font-weight: 800; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #fff; color: #000; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* админка */
.adm .tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: #161616; }
.adm .tile b { font-size: 22px; }
.adm .tile.hot { background: var(--warn); color: #000; }
.adm .tile.hot span { color: #3A2A06; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ocard { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px 14px 12px 18px; border-radius: 16px; border: 1px solid #2A2A2A; background: #141414; width: 100%; }
.ocard .amt2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.st { padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.st-new { background: #FBBF24; color: #000; } .st-taken, .st-mid { background: #1D4ED8; color: #fff; }
.st-done { background: #0F3D22; color: #4ADE80; } .st-rej { background: #3A1414; color: #F87171; }
.st-cancel { background: #262626; color: #BDBDBD; } .st-exp { background: #3A2A06; color: #FBBF24; }
.flag { align-self: flex-start; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.flag-black { background: #DC2626; color: #fff; } .flag-vip { background: #fff; color: #000; } .flag-limit { background: #3A2A06; color: #FBBF24; }
.wait { align-self: flex-start; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; background: #3A2A06; color: #FBBF24; }
.wait.long { background: #DC2626; color: #fff; }
.alert { padding: 12px 14px; border-radius: 14px; background: #DC2626; color: #fff; font-weight: 700; font-size: 14px; }
.white { background: #fff; color: #000; border-radius: var(--r); padding: 16px; }
.mk { display: flex; align-items: center; gap: 4px; }
.mk button { width: 36px; height: 40px; border-radius: 10px; border: 1px solid #333; background: #000; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.mk input { text-align: center; font-weight: 800; padding: 8px 4px; border-width: 2px; border-radius: 10px; }
.mk input.pos { border-color: #22C55E; color: var(--ok); } .mk input.neg { border-color: #EF4444; color: var(--bad); }
.setrow { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-weight: 700; }
.setrow:last-child { border-bottom: 0; }
label.l { font-size: 12px; font-weight: 700; color: var(--mu); }
.toggle { position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--s3); flex-shrink: 0; }
.toggle.on { background: var(--ok); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: .2s; }
.toggle.on::after { left: 23px; }
.empty { text-align: center; color: var(--mu); padding: 24px 0; }
