:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --ink: #162225;
  --muted: #657173;
  --line: #dde5e2;
  --brand: #146c63;
  --brand-2: #e0a11b;
  --brand-3: #265073;
  --danger: #b42318;
  --success: #167847;
  --shadow: 0 22px 70px rgba(22, 34, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f8f7 0%, #eef4f1 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-frame {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 26px 22px;
  background: #142326;
  color: #f7faf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-2);
  color: #142326;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #afbdbe;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  background: transparent;
  color: #e3ebea;
  font-weight: 800;
  text-align: left;
}

.nav-link.active,
.nav-link:hover {
  background: #284146;
  color: #ffffff;
}

.rail-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.rail-note p {
  margin: 6px 0 0;
  color: #bfcccd;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.auth-actions,
.hero-actions,
.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 13px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(22, 34, 37, 0.08);
  font-weight: 800;
}

.account-chip button {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: #ecf4f2;
  color: var(--brand);
  font-weight: 900;
}

.primary-button,
.ghost-button {
  position: relative;
  border-radius: 8px;
  min-height: 46px;
  padding: 12px 16px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  border: 0;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(20, 108, 99, 0.22);
}

.primary-button:hover {
  background: #0f5d55;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.78);
  color: var(--ink);
}

.small {
  min-height: 38px;
  padding: 9px 12px;
}

.magnetic:hover {
  transform: translateY(-3px) translateX(2px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hidden {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.78fr);
  gap: 20px;
  align-items: stretch;
  min-height: 470px;
}

.hero-copy,
.machine-stage,
.wide-panel,
.panel,
.stats-grid article,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 55px rgba(22, 34, 37, 0.09);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 70px);
}

.hero-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.machine-stage {
  display: grid;
  min-height: 420px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(38, 80, 115, 0.12), transparent 45%),
    #fffefa;
}

.machine-stage img {
  width: min(92%, 500px);
  filter: drop-shadow(0 32px 30px rgba(22, 34, 37, 0.2));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.stats-grid article {
  min-height: 132px;
  padding: 22px;
}

.stats-grid span,
.balance-banner span,
.fee-box span,
.referral-card span,
.plan-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stats-grid strong {
  display: block;
  margin-top: 15px;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.wide-panel,
.panel {
  padding: 24px;
}

.wide-panel p:last-child,
.panel p:last-child {
  margin-bottom: 0;
}

.mining-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  margin-top: 14px;
  border-radius: 999px;
  padding: 7px 12px;
  background: #e6f5ef;
  color: var(--success);
  font-weight: 900;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading > p {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-page {
  min-height: 66vh;
  place-items: center;
}

.auth-page.active {
  display: grid;
}

.auth-card {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcf9;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(20, 108, 99, 0.16);
}

.message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--brand);
  font-weight: 800;
}

.message.error {
  color: var(--danger);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.plan-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.plan-card.featured {
  border-color: rgba(224, 161, 27, 0.7);
  background: linear-gradient(180deg, #fff8e8 0%, #fffefa 100%);
}

.plan-card strong {
  font-size: 1.7rem;
}

.plan-meta {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.plan-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.deposit-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
}

.coin-list {
  display: grid;
  gap: 12px;
}

.coin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(22, 34, 37, 0.08);
}

.coin-card strong {
  display: block;
  font-size: 1.2rem;
}

.coin-card code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 10px;
  border-radius: 8px;
  padding: 10px;
  background: #eef4f1;
  color: var(--brand-3);
  font-weight: 800;
}

.fine-print {
  color: var(--muted);
  font-size: 0.9rem;
}

.withdraw-panel {
  max-width: 920px;
}

.balance-banner {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 20px;
  background: #eef6f3;
}

.balance-banner.secondary {
  background: #f7f9f8;
}

.balance-banner strong {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  overflow-wrap: anywhere;
}

.balance-banner small {
  color: var(--muted);
  font-weight: 800;
}

.fee-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fbfcf9;
}

.fee-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.referral-card {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.referral-card strong {
  overflow-wrap: anywhere;
  font-size: 1.25rem;
}

.chat-shell {
  display: grid;
  grid-template-rows: minmax(360px, 52vh) auto;
  gap: 14px;
  max-width: 940px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf9;
}

.bubble {
  max-width: 78%;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.5;
}

.bubble.agent {
  align-self: flex-start;
  background: #eef6f3;
}

.bubble.user {
  align-self: flex-end;
  background: #f8edcf;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(22, 34, 37, 0.07);
}

.history-item span,
.history-item p,
.history-item small {
  color: var(--muted);
  font-weight: 800;
}

.history-item strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
}

.history-item p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.history-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 150px;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf2f1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.approved {
  background: #e5f6ed;
  color: var(--success);
}

.status.rejected {
  background: #fee8e6;
  color: var(--danger);
}

@media (max-width: 1160px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-frame {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
  }

  .main {
    padding: 20px;
  }

  .deposit-layout,
  .two-col {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-heading {
    display: grid;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .auth-card,
  .panel,
  .wide-panel {
    padding: 20px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .history-item {
    display: grid;
  }

  .history-meta {
    justify-items: start;
  }
}
