:root {
  --bg: #0a0a0b;
  --panel: rgba(18, 18, 20, 0.86);
  --panel-2: rgba(26, 26, 29, 0.9);
  --border: #242428;
  --border-hi: #3a3a40;
  --text: #ededef;
  --muted: #9a9aa2;
  --dim: #5e5e66;
  --red: #ff6b6b;
  --amber: #d9b35b;
  --ok: #f2f2f4;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --display: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  min-height: 100vh;
  overflow-x: clip;
}

::selection { background: #e6e6e6; color: #000; }

/* BACKGROUND */
#tiles { position: fixed; inset: 0; z-index: 0; }

#floaters { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.floater {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  animation: drift linear infinite;
  will-change: transform, opacity;
}
.floater svg { display: block; width: 100%; height: auto; }

@keyframes drift {
  0% { transform: translate(var(--x0), 110vh) rotate(var(--r0)); opacity: 0; }
  10% { opacity: var(--op); }
  90% { opacity: var(--op); }
  100% { transform: translate(var(--x1), -20vh) rotate(var(--r1)); opacity: 0; }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 10, 11, 0.85) 0%, rgba(10, 10, 11, 0.2) 45%, rgba(10, 10, 11, 0.6) 100%),
    linear-gradient(180deg, transparent 60%, rgba(10, 10, 11, 0.9) 100%);
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 908px;
  margin: 0 auto;
  padding: 48px 24px 48px;
}

/* HERO */
.hero { text-align: center; }

.brand-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.logo {
  height: clamp(130px, 17vw, 170px);
  margin-bottom: -6px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.title { position: relative; line-height: 0; }
.dotmx {
  display: block;
  height: clamp(52px, 9vw, 84px);
  width: auto;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28));
}
.dotmx circle { animation: dot-on 0.5s both; animation-delay: var(--d); }
@keyframes dot-on { from { opacity: 0; } to { opacity: 1; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tagline {
  margin-top: 16px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 860px;
  margin: 40px auto 0;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--border);
  gap: 1px;
}
.stile {
  background: var(--panel);
  backdrop-filter: blur(6px);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.stile::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--muted);
  border-left: 1px solid var(--muted);
}
.sval { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.slbl { font-size: 11px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }

/* CONSOLE */
.console {
  margin-top: 48px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(8px);
}
.console-head { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.tabs { display: flex; flex: none; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tab:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.03); box-shadow: none; }
.tab.active, .tab.active:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #e8e8ea; }

.console-body { padding: 22px; }

/* TELEGRAM */
.tg-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0 20px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #0a0a0b;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #cfcfd4 100%);
  border: none;
  animation: tg-glow 2.8s ease-in-out infinite;
  transition: transform 0.15s;
}
.tg-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.9) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: tg-shine 3.6s ease-in-out infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.tg-btn:hover { animation-play-state: paused; box-shadow: 0 0 30px rgba(255, 255, 255, 0.35), 0 0 4px rgba(255, 255, 255, 0.6); }
@keyframes tg-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.12), 0 0 1px rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 26px rgba(255, 255, 255, 0.3), 0 0 3px rgba(255, 255, 255, 0.6); }
}
@keyframes tg-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }

.panel { display: none; animation: fadein 0.25s ease; }
.panel.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* INPUTS */
.prompt {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-hi);
  background: #0e0e10;
  transition: border-color 0.15s;
}
.prompt:focus-within, textarea:focus, .dir-bar input:focus, .dir-bar select:focus { border-color: #6e6e76; }
.prompt label {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.prompt input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  letter-spacing: 4px;
  padding: 14px 16px;
  caret-color: #fff;
}
.prompt input::placeholder, textarea::placeholder { color: var(--dim); letter-spacing: 0; font-size: 14px; }
.prompt button { border-radius: 0; margin: -1px -1px -1px 0; }

button {
  background: #ececee;
  color: #0a0a0b;
  border: 1px solid #ececee;
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
button:hover:not(:disabled) { background: #fff; box-shadow: 0 0 24px rgba(255, 255, 255, 0.15); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--border-hi); }
button.ghost:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.05); }
button.link { background: none; border: none; padding: 0; color: var(--dim); font-weight: 400; text-decoration: underline; }
button.link:hover { color: var(--text); box-shadow: none; background: none; }

textarea {
  width: 100%;
  background: #0e0e10;
  border: 1px solid var(--border-hi);
  color: var(--text);
  font: inherit;
  padding: 14px;
  outline: none;
  resize: vertical;
  letter-spacing: 1px;
  transition: border-color 0.15s;
}

.row { display: flex; gap: 10px; margin-top: 10px; align-items: center; }

.dir-bar { display: grid; grid-template-columns: 1fr 280px; gap: 10px; }
.dir-bar > * { min-width: 0; }
.dir-bar input, .dir-bar select {
  width: 100%;
  background: #0e0e10;
  border: 1px solid var(--border-hi);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.dir-bar select { cursor: pointer; }
#dir-bank-bar { margin-top: 10px; }
.dir-actions { display: flex; gap: 10px; }
.dir-actions button { flex: 1; }
tr.bank-row { cursor: pointer; }
#dir-pager { justify-content: space-between; }
#dir-pager .muted { font-size: 12px; }
.hint { color: var(--muted); margin-bottom: 12px; font-size: 12px; }

/* OUTPUT */
.terminal { margin-top: 18px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.terminal:empty { display: none; }
.terminal .card-box, .terminal table { white-space: normal; }
#bulk-out, #dir-out { overflow-x: auto; }

.line { opacity: 0; animation: appear 0.08s forwards; }
@keyframes appear { to { opacity: 1; } }

.muted { color: var(--dim); }
.err { color: var(--red); }
.warn { color: var(--amber); }
.okc { color: var(--ok); }

.card-box {
  position: relative;
  border: 1px solid var(--border);
  padding: 8px 22px;
  margin-top: 12px;
  background: #0e0e10;
}
.card-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--muted);
  border-left: 1px solid var(--muted);
}
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 0; }
.kv .k, .kv .v { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.kv .k:nth-last-child(2), .kv .v:last-child { border-bottom: none; }
.kv .k { color: var(--dim); font-size: 11px; letter-spacing: 0.1em; padding-top: 9px; }
.kv .v { color: var(--text); word-break: break-word; }
.kv a { color: #cfcfd4; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--dim); font-weight: 400; letter-spacing: 0.1em; }
tr:hover td { background: rgba(255, 255, 255, 0.03); }

.history { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--border); }
.history-head { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
#history-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  font-size: 12px;
  font-weight: 400;
  padding: 5px 12px;
  background: #0e0e10;
  color: var(--muted);
  border: 1px solid var(--border);
}
.chip-btn:hover:not(:disabled) { background: #1a1a1d; color: var(--text); box-shadow: none; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.stat-box { padding: 18px; background: #0e0e10; }
.stat-box h3 { font-weight: 400; color: var(--dim); font-size: 11px; letter-spacing: 0.12em; margin-bottom: 14px; text-transform: uppercase; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 64px; gap: 10px; align-items: center; font-size: 12px; margin: 7px 0; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row > span:last-child { text-align: right; }
.bar { height: 6px; background: #1e1e21; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #5e5e66, #ececee); }
.big { font-family: var(--display); font-weight: 700; font-size: 44px; letter-spacing: -0.02em; }

/* FAQ */
.about { margin-top: 48px; }
.about h2 { font-weight: 400; color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; }
.about details { border: 1px solid var(--border); border-top: none; background: var(--panel); backdrop-filter: blur(6px); }
.about details:first-of-type { border-top: 1px solid var(--border); }
.about summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.15s;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: '+'; color: var(--dim); }
.about details[open] summary::after { content: '−'; }
.about summary:hover, .about details[open] summary { color: var(--text); }
.about p { padding: 0 18px 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }

footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--dim);
}
code { color: var(--muted); }

@media (max-width: 820px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .dir-bar { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tg-btn span { display: none; }
  .tg-btn { padding: 0 14px; }
}
@media (max-width: 560px) {
  .wrap { padding-top: 40px; }
  .prompt { flex-wrap: wrap; }
  .prompt label { display: none; }
  .prompt button { width: 100%; margin: 0; }
  .bar-row { grid-template-columns: 90px 1fr 50px; }
  .console-head { flex-wrap: wrap; }
  .tabs { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tab { border-bottom: 1px solid var(--border); text-align: center; }
  .tab:nth-child(2n) { border-right: none; }
  .tg-btn { flex-basis: 100%; padding: 12px 14px; }
  .tg-btn span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .tg-btn, .tg-btn::after, .dotmx circle { animation: none; }
}
