:root {
  --bg: #0b0a1a;
  --bg2: #151330;
  --card: #17152f;
  --line: #2c2852;
  --text: #f4f2ff;
  --muted: #a9a3cf;
  --pink: #ff3fd1;
  --cyan: #3fd8ff;
  --violet: #7a3fff;
  --ok: #38e08c;
  --warn: #ffb547;
  --err: #ff5a7a;
  --grad: linear-gradient(90deg, #ff3fd1, #7a3fff, #3fd8ff);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(circle at 15% 0%, #2a0f3d 0%, var(--bg) 50%, #05050d 100%) fixed;
  background-color: var(--bg);
  font: 16px/1.5 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}
a { color: var(--cyan); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; gap: 12px; }
.brand {
  font-family: 'Arial Black', 'Inter', sans-serif; font-weight: 900; font-size: 22px; letter-spacing: 4px;
  color: var(--pink); text-shadow: 0 0 8px rgba(255, 63, 209, .7); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--cyan); text-shadow: 0 0 8px rgba(63, 216, 255, .7); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.lang button { background: none; border: 0; color: var(--muted); padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.lang button.on { background: var(--grad); color: #fff; font-weight: 700; }

h1 { font-size: clamp(28px, 7vw, 44px); line-height: 1.1; margin: 28px 0 8px; text-shadow: 0 0 24px rgba(255, 63, 209, .45); }
h2 { font-size: 22px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.sub { color: var(--muted); font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
section { margin: 28px 0; }

.search { display: flex; gap: 8px; }
input, textarea, select {
  width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; outline: none;
}
textarea { resize: vertical; min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(63, 216, 255, .18); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.btn {
  flex: none; border: 0; border-radius: 14px; padding: 14px 22px; font: inherit; font-weight: 700; color: #fff;
  background: var(--grad); cursor: pointer; box-shadow: 0 0 18px rgba(122, 63, 255, .35);
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--text); font-weight: 600; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 14px; }

.msg { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.msg.err { border-color: rgba(255, 90, 122, .5); color: #ffc2cf; }
.msg.ok { border-color: rgba(56, 224, 140, .5); color: #bdf6d8; }
.hidden { display: none !important; }

/* карточка посылки */
.parcel .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tn { font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700; word-break: break-all; }
.badge { flex: none; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); white-space: nowrap; }
.badge.s-balkhash { background: rgba(56, 224, 140, .15); border-color: var(--ok); color: var(--ok); }
.badge.s-issued { color: var(--muted); }
.badge.s-transit, .badge.s-kz { border-color: var(--cyan); color: var(--cyan); }
.badge.s-china { border-color: var(--violet); color: #c4a9ff; }
.steps { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.steps li { position: relative; text-align: center; font-size: 11px; line-height: 1.25; color: var(--muted); padding-top: 22px; }
.steps li::before { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.steps li::after { content: ''; position: absolute; top: 9px; left: calc(50% + 8px); right: calc(-50% + 8px); height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--grad); }
.steps li.done::after { background: linear-gradient(90deg, var(--pink), var(--cyan)); }
.steps li.cur::before { width: 16px; height: 16px; top: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.steps li.cur { color: var(--cyan); font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; margin-top: 8px; }
details.hist { margin-top: 8px; font-size: 14px; color: var(--muted); }
details.hist summary { cursor: pointer; color: var(--cyan); }
details.hist ul { margin: 8px 0 0; padding-left: 18px; }

.howto { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.howto li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.howto li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--grad);
}
.res-list { list-style: none; padding: 0; margin: 8px 0 0; }
.res-list li { padding: 4px 0; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.res-list .y { color: var(--ok); } .res-list .n { color: var(--err); }

/* вход / регистрация / кабинет */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; }
.tabs button { flex: 1; background: none; border: 0; border-radius: 10px; color: var(--muted); padding: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--grad); color: #fff; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.links { margin: 12px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 24px; letter-spacing: 10px; text-align: center; }
.me-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
#me { margin: 28px 0; }

footer { color: var(--muted); font-size: 14px; padding: 24px 0 40px; border-top: 1px solid var(--line); margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

@media (max-width: 480px) {
  .search { flex-direction: column; }
  .search .btn { width: 100%; }
  .steps li { font-size: 10px; }
}
