:root {
  --bg: #f7efe2;
  --panel: rgba(255, 252, 246, .88);
  --ink: #17120d;
  --muted: #776b5d;
  --line: #e1d3bf;
  --brand: #c46928;
  --brand2: #14213d;
  --green: #d9f8df;
  --yellow: #fff1b8;
  --red: #ffd1c8;
  --gray: #ece6dc;
  font-family: "Aptos", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #ffe2bd 0 18rem, transparent 19rem),
    radial-gradient(circle at 86% 4%, #dce8ff 0 16rem, transparent 17rem),
    linear-gradient(140deg, #fbf6eb, var(--bg));
  min-height: 100vh;
  overflow-x: hidden;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 46px);
  backdrop-filter: blur(16px);
  background: rgba(247, 239, 226, .78);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 900; letter-spacing: -.04em; font-size: 24px; }
.brand img { width: 44px; height: 44px; }
.inline-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.tx-counter {
  border: 1px solid var(--line);
  background: rgba(255, 248, 237, .78);
  border-radius: 999px;
  color: var(--brand2);
  font-weight: 900;
  padding: 9px 14px;
  white-space: nowrap;
}
.nav { display: flex; gap: 10px; }
.lang-select {
  margin-left: auto;
  margin-right: 12px;
  width: auto;
  min-width: 140px;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
}
main { padding: clamp(18px, 4vw, 46px); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: clamp(18px, 4vw, 46px);
  align-items: center;
  min-height: calc(100vh - 110px);
}
h1 { font-size: clamp(42px, 8vw, 96px); line-height: .9; letter-spacing: -.08em; margin: 0 0 22px; max-width: 900px; }
h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.05em; }
.lead { color: var(--muted); font-size: 19px; max-width: 700px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.pill { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: #fff8ed; border-radius: 999px; padding: 13px 18px; font-weight: 900; }
.primary-pill { background: var(--ink); color: #fff8ed; border-color: var(--ink); }
.telegram-pill { border-color: rgba(20, 33, 61, .28); color: var(--brand2); }
.eyebrow { color: var(--brand); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin: 0 0 10px; }
.auth-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 28px 70px rgba(43, 31, 18, .12);
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--brand2);
  padding: 8px 0;
  font-weight: 900;
  text-decoration: underline;
  box-shadow: none;
}
.reset-box {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wide { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-weight: 800; color: #30281f; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  border-radius: 15px;
  padding: 13px 14px;
  font: inherit;
}
textarea { min-height: 320px; font-family: "Cascadia Code", ui-monospace, monospace; font-size: 13px; }
button {
  border: 0;
  background: #fff8ed;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 17px;
  font-weight: 900;
  cursor: pointer;
}
button.primary { background: var(--ink); color: #fff8ed; border-color: var(--ink); }
.row { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.status { color: var(--muted); min-height: 22px; }
.story-grid, .feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.story-card, .feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(43, 31, 18, .1);
  overflow: hidden;
}
.feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-grid h3 { margin: 16px 0 8px; font-size: 21px; letter-spacing: -.04em; }
.feature-grid p, .story-card p { color: var(--muted); }
.flow-diagram {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  align-items: center;
}
.flow-diagram div {
  min-height: 88px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: linear-gradient(145deg, #fff8ed, #f0dfc5);
  border: 1px solid var(--line);
}
.flow-diagram span { height: 3px; background: var(--brand); position: relative; }
.flow-diagram span::after { content: ""; position: absolute; right: -1px; top: -5px; border-left: 10px solid var(--brand); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.visual-card { background: linear-gradient(145deg, rgba(255,252,246,.95), rgba(232,241,255,.88)); }
.mini-workers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.mini-workers i {
  display: block;
  min-height: 96px;
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: inset 0 -18px 30px rgba(0,0,0,.06);
}
.mini-workers .ok { background: var(--green); }
.mini-workers .warn { background: var(--yellow); }
.mini-workers .bad { background: var(--red); }
.mini-workers .off { background: var(--gray); }
.icon-chart, .icon-ring, .icon-chain, .icon-switch {
  height: 96px;
  border-radius: 26px;
  background: #fff8ed;
  border: 1px solid var(--line);
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 18px;
}
.icon-chart b { flex: 1; border-radius: 999px 999px 8px 8px; background: var(--brand); }
.icon-chart b:nth-child(1) { height: 30%; }
.icon-chart b:nth-child(2) { height: 72%; }
.icon-chart b:nth-child(3) { height: 50%; background: var(--brand2); }
.icon-chart b:nth-child(4) { height: 88%; }
.icon-ring { display: block; position: relative; background: conic-gradient(var(--brand) 0 70%, #ead9c2 70%); }
.icon-ring::after { content: "0.5%"; position: absolute; inset: 22px; border-radius: 50%; background: #fff8ed; display: grid; place-items: center; font-weight: 900; }
.icon-chain { align-items: center; justify-content: center; text-align: center; font-weight: 900; font-size: 28px; letter-spacing: -.05em; color: var(--brand2); }
.icon-switch { position: relative; display: block; }
.icon-switch::before, .icon-switch::after { content: ""; position: absolute; left: 18px; right: 18px; height: 12px; border-radius: 99px; background: var(--line); }
.icon-switch::before { top: 28px; }
.icon-switch::after { bottom: 28px; background: var(--brand); }
.icon-switch { box-shadow: inset 70px 0 0 rgba(196,105,40,.16), inset -70px 0 0 rgba(20,33,61,.1); }
.landing-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}
.landing-detail.reverse { grid-template-columns: minmax(320px, .9fr) minmax(0, 1fr); }
.detail-copy, .mock-screen, .method-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(43, 31, 18, .1);
}
.detail-copy p { color: var(--muted); font-size: 17px; }
.fact-grid, .mock-stats, .method-grid, .wallet-workers {
  display: grid;
  gap: 12px;
}
.fact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.fact-grid span, .mock-stats i, .method-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff8ed;
  padding: 16px;
}
.fact-grid b { display: block; font-size: 28px; color: var(--brand2); }
.fact-grid small, .mock-stats small { color: var(--muted); font-weight: 800; }
.mock-screen {
  background: linear-gradient(145deg, rgba(255, 252, 246, .96), rgba(232, 241, 255, .82));
}
.mock-top, .wallet-master {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 18px;
  background: var(--ink);
  color: #fff8ed;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.mock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mock-stats b { display: block; margin-top: 6px; font-size: 22px; color: var(--ink); }
.wallet-workers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wallet-workers i {
  min-height: 88px;
  border-radius: 20px;
  padding: 14px;
  font-style: normal;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.08);
}
.wallet-workers .ok { background: var(--green); }
.wallet-workers .warn { background: var(--yellow); }
.wallet-workers .bad { background: var(--red); }
.wallet-workers .off { background: var(--gray); }
.method-section { margin-top: 18px; }
.method-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.method-grid article b { font-size: 20px; color: var(--brand2); }
.method-grid article p { color: var(--muted); }
.chat-mock span {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  margin: 5px;
  background: #fff8ed;
  font-weight: 900;
}
.chat-line {
  border-radius: 16px;
  padding: 13px;
  margin-top: 12px;
  font-weight: 900;
}
.chat-line.buy { background: rgba(77, 166, 87, 0.16); }
.chat-line.sell { background: rgba(221, 72, 54, 0.16); }
.summary, .stats, .table { margin-top: 14px; color: var(--muted); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.stats-grid span {
  background: rgba(255, 250, 242, .78);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 12px;
}
.stats-grid b { color: var(--ink); display: block; margin-top: 4px; }
.muted { color: var(--muted); }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.settings-grid textarea { min-height: 76px; resize: vertical; }
.ref-tree {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 6px;
}
.ref-node {
  margin-left: calc(var(--depth) * 24px);
  border-left: 2px solid color-mix(in srgb, var(--brand), transparent 55%);
  padding-left: 12px;
}
.ref-card {
  display: grid;
  gap: 4px;
  background: color-mix(in srgb, var(--panel), var(--brand) calc(4% + var(--depth) * 4%));
  border: 1px solid color-mix(in srgb, var(--brand), transparent 72%);
  border-radius: 16px;
  padding: 10px 12px;
  margin: 7px 0;
  box-shadow: var(--shadow-soft);
}
.ref-card span, .ref-card small { color: var(--muted); overflow-wrap: anywhere; }
.depth-1 .ref-card { border-color: color-mix(in srgb, var(--green), transparent 55%); }
.depth-2 .ref-card { border-color: color-mix(in srgb, var(--yellow), transparent 45%); }
.depth-3 .ref-card, .depth-4 .ref-card, .depth-5 .ref-card { border-color: color-mix(in srgb, var(--red), transparent 55%); }
.table select {
  width: auto;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
}
.token-info {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: #fff8ed;
  color: var(--muted);
}
.table { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
tr.trade-ok { background: rgba(77, 166, 87, 0.13); }
tr.trade-error { background: rgba(221, 72, 54, 0.14); }
tr.trade-ok td:first-child, tr.trade-error td:first-child { border-radius: 12px 0 0 12px; }
tr.trade-ok td:last-child, tr.trade-error td:last-child { border-radius: 0 12px 12px 0; }
.worker-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(680px, calc(100vw - 36px));
  max-height: 78vh;
  overflow: hidden;
  background: rgba(255, 252, 246, .95);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 26px 80px rgba(20, 15, 10, .24);
  z-index: 20;
}
.dock-toggle { width: 100%; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--ink); color: white; }
.worker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  max-height: 68vh;
  overflow: auto;
}
.worker-dock.collapsed .worker-grid { display: none; }
.worker-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: var(--green);
  min-height: 120px;
  font-size: 13px;
}
.assignment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
  max-height: 420px;
  overflow: auto;
}
.assign-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff8ed;
  border-radius: 16px;
  padding: 10px;
  font-size: 13px;
}
.assign-card input { width: auto; flex: 0 0 auto; }
.assign-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.key-secret {
  filter: blur(5px);
  user-select: none;
}
.keys-revealed .key-secret {
  filter: none;
  user-select: text;
}
.key-copy { display: none; }
.keys-revealed .key-copy { display: inline-flex; }
.reveal-bar {
  position: sticky;
  top: 0;
  background: rgba(247,239,226,.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin: 16px 0;
  z-index: 3;
}
.worker-card.yellow { background: var(--yellow); }
.worker-card.red { background: var(--red); }
.worker-card.gray { background: var(--gray); }
.addr { font-family: "Cascadia Code", ui-monospace, monospace; font-size: 12px; word-break: break-all; color: #35291d; }
.copy { margin-top: 8px; padding: 7px 10px; font-size: 12px; }
.small-copy { margin-top: 0; padding: 5px 9px; font-size: 11px; }
.copy-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}
.copy-line code { overflow-wrap: anywhere; word-break: break-all; }
.copy-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.check-row input { width: auto; }
.smtp-test-row { min-width: min(480px, 100%); }
.assign-card .copy { margin-left: auto; flex: 0 0 auto; }
.wallet-history {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.wallet-history h3 { margin: 0 0 10px; }
.wallet-history ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.wallet-history li {
  background: rgba(255, 248, 237, .7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 11px;
}
.wallet-history small { color: var(--muted); display: block; margin-top: 3px; }
.tx-cell { display: grid; gap: 4px; max-width: 420px; }
.tx-cell code, .tx-cell span { overflow-wrap: anywhere; word-break: break-word; }
.job-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(38, 27, 18, .24);
  backdrop-filter: blur(8px);
}
.job-modal.hidden { display: none; }
.job-card {
  width: min(720px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.job-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.job-head h2 { margin: 0; }
.job-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(92, 47, 20, .12);
  border: 1px solid var(--line);
}
.job-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #18c6ff, #f5b94b);
  transition: width .25s ease;
}
.job-items {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}
.job-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}
.job-item.success { background: rgba(53, 191, 111, .14); border-color: rgba(53, 191, 111, .32); }
.job-item.error { background: rgba(239, 68, 68, .13); border-color: rgba(239, 68, 68, .32); }
.job-item.running { background: rgba(24, 198, 255, .12); border-color: rgba(24, 198, 255, .28); }
.job-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 1000;
  background: rgba(92, 47, 20, .1);
}
.job-item.success .job-icon { color: #118341; background: rgba(53, 191, 111, .2); }
.job-item.error .job-icon { color: #b91c1c; background: rgba(239, 68, 68, .18); }
.job-item.running .job-icon { color: #0369a1; background: rgba(24, 198, 255, .18); }
.job-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.job-text b, .job-text small, .job-text code { overflow-wrap: anywhere; word-break: break-word; }
.worker-page { max-width: 980px; margin: 0 auto; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 46px);
  color: var(--muted);
  font-weight: 900;
  border-top: 1px solid var(--line);
}
.telegram-inline .nav { display: none !important; }
.telegram-inline .topbar {
  position: relative;
  width: 100%;
}
.telegram-inline main {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
@media (max-width: 760px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 16px; gap: 8px; min-width: 0; }
  .brand img { width: 30px; height: 30px; flex: 0 0 auto; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lang-select { min-width: 104px; max-width: 42vw; margin-right: 0; padding: 8px 10px; font-size: 12px; }
  main { padding: 12px; }
  .nav { position: fixed; right: 12px; top: 64px; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
  .hero, .dashboard, .two { grid-template-columns: 1fr; }
  .story-grid, .feature-grid { grid-template-columns: 1fr; }
  .landing-detail, .landing-detail.reverse, .method-grid { grid-template-columns: 1fr; }
  .fact-grid, .mock-stats, .wallet-workers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-diagram { grid-template-columns: 1fr; gap: 10px; }
  .flow-diagram span { width: 3px; height: 24px; justify-self: center; }
  .flow-diagram span::after { left: -5px; right: auto; top: auto; bottom: -2px; border-top: 10px solid var(--brand); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 0; }
  h1 { font-size: 46px; }
  .worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 340px;
  }
  .assign-card {
    gap: 6px;
    border-radius: 13px;
    padding: 8px;
    font-size: 11px;
  }
  .panel .row button {
    max-width: 100%;
    padding: 10px 12px;
    font-size: 12px;
  }
  .job-modal { padding: 10px; place-items: end center; }
  .job-card { border-radius: 22px; padding: 14px; max-height: 86vh; }
  .inline-page-head { align-items: flex-start; flex-direction: column; }
  .row { flex-wrap: wrap; }
  .site-footer { flex-direction: column; padding: 16px 12px; }
  .telegram-inline .topbar { justify-content: space-between; }
  .telegram-inline .brand { font-size: 15px; }
  .telegram-inline .lang-select { margin-left: 0; }
}
