/* person · ₽ → USDT. Палитра с аватарки: ночной синий, золото, зелёный USDT, серебро. */
:root {
  --bg: #060a14;
  --bg2: #0b1222;
  --card: #0f182b;
  --line: #1c2840;
  --text: #eef2f8;
  --muted: #8592ab;
  --gold: #f5b62a;
  --gold2: #ffd76a;
  --green: #1fd08a;
  --green2: #0fa86c;
  --blue: #2b6cff;
  --red: #ff5d6c;
  --r: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(43, 108, 255, .22), transparent 60%),
    radial-gradient(60% 40% at 100% 10%, rgba(31, 208, 138, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold2); }
h1, h2 { margin: 0; }
h2 { font-size: 16px; margin-bottom: 12px; }

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; display: block; }
.wrap { word-break: break-all; }

/* ---------- Шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  background: rgba(6, 10, 20, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(28, 40, 64, .7);
}
.brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; }
.logo {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #04120c;
  background: conic-gradient(from 210deg, var(--gold), var(--gold2), var(--green), var(--green2), var(--gold));
  box-shadow: 0 0 18px rgba(245, 182, 42, .35);
}
#brand {
  font-weight: 800; font-style: italic; font-size: 21px; letter-spacing: -.02em; text-transform: lowercase;
  background: linear-gradient(180deg, #ffffff 0%, #c9d1de 55%, #8d97a8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-nav { display: flex; gap: 6px; }
.pill {
  border: 1px solid var(--line); background: var(--bg2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted);
}
.pill.on { color: var(--text); border-color: var(--gold); }
.pill-admin { color: var(--gold2); }

main { max-width: 520px; margin: 0 auto; padding: 16px; }

/* ---------- Главная ---------- */

.hero { text-align: center; padding: 14px 4px 18px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold2); border: 1px solid rgba(245, 182, 42, .45); background: rgba(245, 182, 42, .07);
}
.rate-big { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.rate-big span { color: var(--muted); font-size: 17px; }
.rate-big b { font-size: 40px; letter-spacing: -.02em; color: var(--green); text-shadow: 0 0 24px rgba(31, 208, 138, .3); }
.hero p { margin: 6px 0 0; }
.tiers {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px;
}
.tiers div {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px;
  display: flex; flex-direction: column; min-width: 88px;
}
.tiers span { color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(20, 31, 54, .9), rgba(13, 21, 38, .9));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-bottom: 14px;
}
.calc { border-color: rgba(245, 182, 42, .25); box-shadow: 0 10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04); }

.field { display: block; margin-bottom: 12px; }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s;
}
input:focus { border-color: var(--gold); }
input.good { border-color: var(--green2); }
input.bad { border-color: var(--red); }

.amount { position: relative; }
.amount input { font-size: 24px; font-weight: 700; padding-right: 74px; }
.cur {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-weight: 700; font-size: 13px; padding: 4px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line);
}
.arrow { text-align: center; color: var(--gold); margin: -4px 0 6px; font-size: 18px; }
.hint { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.hint.bad { color: var(--red); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  flex: 1 1 0; min-width: 92px; text-align: left;
  border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 1px;
}
.chip small { color: var(--muted); font-size: 11px; }
.chip.on { border-color: var(--green); background: rgba(31, 208, 138, .08); box-shadow: 0 0 0 1px var(--green) inset; }
.filters .chip { flex: 0 0 auto; min-width: 0; padding: 6px 12px; font-size: 13px; }

.addr { display: flex; gap: 6px; }
.addr input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.ghost {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0 12px; font-size: 13px;
}
.check { display: block; min-height: 18px; margin-top: 6px; font-size: 13px; }
.check.good { color: var(--green); }
.check.bad { color: var(--red); }

.summary:empty { display: none; }
.summary { border-top: 1px dashed var(--line); padding-top: 12px; margin: 4px 0 14px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.summary span { color: var(--muted); }
.summary .total { font-size: 17px; padding-top: 8px; }
.summary .total b { color: var(--green); }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  border: 0; border-radius: 14px; padding: 15px; margin-bottom: 8px;
  font-weight: 700; font-size: 16px; color: #1a1203; text-decoration: none;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  box-shadow: 0 6px 24px rgba(245, 182, 42, .28);
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .35; box-shadow: none; cursor: default; }
.btn-ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.busy { opacity: .6; pointer-events: none; }
.btn.sticky { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }
.btn-text { display: block; width: 100%; background: none; border: 0; padding: 12px; color: var(--muted); font-size: 14px; }
.btn-text.danger { color: var(--red); }
.link { display: block; margin-top: 12px; font-size: 14px; text-decoration: none; }

.how { padding: 8px 4px; }
.how ol { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.how li {
  counter-increment: s; position: relative; padding: 0 0 14px 44px; display: flex; flex-direction: column;
}
.how li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  color: var(--gold2); border: 1px solid rgba(245, 182, 42, .5);
}
.how li span { color: var(--muted); font-size: 13px; }

/* ---------- Заявка ---------- */

.order-head { text-align: center; padding: 6px 0 14px; }
.order-head h1 { font-size: 30px; letter-spacing: -.01em; }
.order-head p { margin: 4px 0 0; }

.steps { list-style: none; display: flex; padding: 0; margin: 0 0 14px; }
.steps li { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--muted); }
.steps li i {
  display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line); position: relative; z-index: 1;
}
.steps li:not(:first-child)::before {
  content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--line);
}
.steps li.done i { background: var(--green); border-color: var(--green); }
.steps li.done, .steps li.now { color: var(--text); }
.steps li.done::before, .steps li.now::before { background: var(--green); }
.steps li.now i { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 5px rgba(245, 182, 42, .18); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(245, 182, 42, 0); } }
.status-bad { text-align: center; margin-bottom: 14px; color: var(--muted); }

.timer {
  text-align: center; padding: 10px; border-radius: 12px; margin-bottom: 14px; font-size: 14px;
  background: rgba(245, 182, 42, .08); border: 1px solid rgba(245, 182, 42, .3);
}
.timer b { color: var(--gold2); font-variant-numeric: tabular-nums; }
.note { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; background: rgba(43, 108, 255, .1); border: 1px solid rgba(43, 108, 255, .3); }
.note.good { background: rgba(31, 208, 138, .08); border-color: rgba(31, 208, 138, .35); }
.note.warn { background: rgba(255, 93, 108, .08); border-color: rgba(255, 93, 108, .35); }

.req {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l c" "v c";
  align-items: center; column-gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.req:last-of-type { border-bottom: 0; }
.req span { grid-area: l; font-size: 12px; color: var(--muted); }
.req b { grid-area: v; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.req .copy { grid-area: c; }
.req.big b { font-size: 22px; color: var(--green); }
.copy {
  border: 1px solid rgba(245, 182, 42, .4); background: rgba(245, 182, 42, .08); color: var(--gold2);
  border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.pay { border-color: rgba(31, 208, 138, .35); }
.warn-text { margin: 10px 0 0; font-size: 13px; color: var(--gold2); }

/* ---------- Списки ---------- */

.page-title { font-size: 24px; margin: 4px 0 14px; }
.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.row {
  display: flex; justify-content: space-between; gap: 10px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.row .right { text-align: right; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 4px; background: var(--line); color: var(--muted); }
.s-new { background: rgba(245, 182, 42, .15); color: var(--gold2); }
.s-paid { background: rgba(43, 108, 255, .2); color: #8fb0ff; }
.s-sent { background: rgba(31, 208, 138, .15); color: var(--green); }
.s-done { background: rgba(31, 208, 138, .25); color: var(--green); }
.s-cancel, .s-expired { background: rgba(255, 93, 108, .12); color: #ff97a1; }
.loading, .empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .btn { margin-top: 16px; }

/* ---------- Админка ---------- */

.tabs { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs button, .seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-size: 13px; color: var(--muted); }
.tabs button.on, .seg button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--gold) inset; }
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 10px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.stats span { font-size: 12px; color: var(--muted); }
.stats b { font-size: 22px; }
.stats small { font-size: 11px; color: var(--muted); }

.receipt img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.actions .btn { margin-bottom: 8px; }

.tier { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tier label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tier label:first-child { flex: 1.4; }
.tier label:nth-child(2) { flex: 1; }
.tier input { padding: 9px 10px; }
.t-del { border: 0; background: none; color: var(--muted); padding: 6px; }
.preview { font-size: 12px; color: var(--muted); margin-top: 6px; }
.preview b { color: var(--green); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.net-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.net-row:last-child { border-bottom: 0; }
.fee { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fee input { width: 70px; padding: 7px 8px; text-align: right; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { display: none; }
.switch span { width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--green2); }
.switch input:checked + span::after { transform: translateX(16px); }

.card-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 0; padding: 12px 14px; }
.card-item.off { opacity: .5; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card-actions .ghost { padding: 7px 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1b2742; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 50; max-width: calc(100% - 32px); text-align: center;
}

[hidden] { display: none !important; }
body { overflow-x: hidden; }
main > * { min-width: 0; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.tiers div { min-width: 0; }
.chip { min-width: 0; }
.addr input { min-width: 0; }
@media (max-width: 380px) {
  .pill { padding: 6px 9px; font-size: 12px; }
  #brand { font-size: 19px; }
  .rate-big b { font-size: 34px; }
}
