/* ==========================================================================
   USDT Mining — user frontend
   One stylesheet for every page under /public/. Dark, dense, mobile-first.

   Chakra Petch is the machine-panel voice: squared, technical, tabular figures.
   It is loaded here so all 14 pages pick it up without touching their <head>.
   If you would rather not depend on Google Fonts, delete the @import — every
   rule falls back to the system stack via --display.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&display=swap');

:root {
  --bg:        #05070a;
  --bg-2:      #0c1118;
  --panel:     #111925;
  --panel-2:   #172230;
  --line:      #223040;
  --line-soft: #1a242f;

  --text:      #e8eef5;
  --muted:     #8798ab;
  --faint:     #5a6b7d;

  --accent:    #26a17b;   /* Tether green — the currency's own colour */
  --accent-2:  #34c793;
  --accent-dim:rgba(38,161,123,.14);

  /* Gold as a metal, not a flat colour: a highlight, a body and a shadow, so
     balances can be given a real specular gradient instead of a tint. */
  --au-hi:     #ffe9a8;
  --au:        #e8b53c;
  --au-mid:    #b8862a;
  --au-lo:     #7a4f0c;
  --au-dim:    rgba(232,181,60,.13);

  /* Hardware LED cyan — the cold counterpoint to the gold, borrowed from the
     coolant/RGB vernacular of real rigs. Used for hashrate and telemetry. */
  --coolant:   #4fe0ff;
  --coolant-dim: rgba(79,224,255,.13);

  --warn:      #e2b33c;
  --warn-dim:  rgba(226,179,60,.14);
  --danger:    #e5544b;
  --danger-dim:rgba(229,84,75,.14);
  --info:      #4a9ede;
  --info-dim:  rgba(74,158,222,.14);

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);

  --sidebar-w: 244px;
  --topbar-h:  60px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* Squared technical face for headings and every number — the machine-panel
     voice. Falls back to the system stack if the webfont never arrives. */
  --display: "Chakra Petch", "Segoe UI Semibold", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Stops the whole page rubber-banding behind fixed bars on iOS. */
  overscroll-behavior-y: none;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 .5rem;
  line-height: 1.2;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 .8rem; }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.1rem 0; }

code, .mono, .ref { font-family: var(--mono); font-size: .86em; }

::selection { background: var(--accent); color: #041008; }

:focus-visible { outline: 2px solid var(--coolant); outline-offset: 2px; border-radius: 4px; }

/* Every figure on the site is a number in a column of numbers: lock the widths
   so digits do not jitter as a balance ticks up. */
.stat .value, .bullion .amt, table.tbl td.num, .kv > b, .kv dd,
.plan-card .pprice, .readout {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------------------------------------------------------- layout -- */

.app { min-height: 100%; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: var(--topbar-h);
  padding: 0 1rem;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.sidebar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #1c7d5f);
  display: grid; place-items: center;
  font-size: .82rem; font-weight: 800; color: #04150e;
}

.nav { padding: .7rem .55rem; overflow-y: auto; flex: 1; }
.nav-group { margin: .9rem 0 .35rem; padding: 0 .55rem; font-size: .68rem;
             text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-dim); color: var(--accent-2); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; flex: 0 0 18px; opacity: .9; }
.nav a .pill {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: .66rem; font-weight: 700;
  padding: .05rem .38rem; border-radius: 999px;
}

.sidebar-foot { padding: .7rem .9rem; border-top: 1px solid var(--line-soft); font-size: .78rem; color: var(--faint); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .8rem;
  padding: 0 1.1rem;
  background: rgba(8,11,16,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { font-size: 1.06rem; margin: 0; font-weight: 650; }
.topbar .spacer { flex: 1; }

.burger {
  display: none;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm);
  width: 36px; height: 36px; font-size: 1.05rem; cursor: pointer;
}

.bell {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
}
.bell:hover { color: var(--text); text-decoration: none; }
.bell .dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .64rem; font-weight: 700;
  display: grid; place-items: center;
}

.who { display: flex; align-items: center; gap: .55rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent-2);
  display: grid; place-items: center;
  font-weight: 700; font-size: .82rem;
  border: 1px solid rgba(38,161,123,.3);
}
.who .name { font-size: .86rem; font-weight: 600; }
.who .sub  { font-size: .72rem; color: var(--faint); }

/* Same initials disc, blown up for the profile header. */
.avatar-lg {
  width: 72px; height: 72px; font-size: 1.6rem;
  margin: 0 auto; border-width: 2px;
}

.content { padding: 1.2rem 1.1rem 5rem; flex: 1; width: 100%; max-width: 1240px; }

.mobile-nav { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 35; }
  .main { margin-left: 0; }
  .burger { display: grid; place-items: center; }
  .who .name, .who .sub { display: none; }
  .content { padding: 1rem .8rem 5.5rem; }

  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 39;
    background: rgba(13,18,25,.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-soft);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1; text-align: center; padding: .35rem .1rem;
    /* 48px so a thumb reaching the bottom bar cannot miss between two items. */
    min-height: 48px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--faint); font-size: .64rem; font-weight: 600;
  }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav a .ico { display: block; font-size: 1.15rem; margin-bottom: .05rem; }
  .mobile-nav a.active { color: var(--accent-2); }
}

/* ----------------------------------------------------------------- cards -- */

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  margin-bottom: 1rem;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 1.05rem 1.1rem; }
.card-foot { padding: .8rem 1.1rem; border-top: 1px solid var(--line-soft); }

.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
                             .g-2-1, .g-1-2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 620px)  { .g2, .g3, .g4 { grid-template-columns: 1fr; }
                             .g4.keep-2, .g2.keep-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* stat tile */
.stat {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: .95rem 1rem;
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: .3rem; }
.stat .value { font-size: 1.42rem; font-weight: 700; letter-spacing: -.02em; }
.stat .value small { font-size: .62em; font-weight: 600; color: var(--muted); margin-left: .18rem; }
.stat .note  {
  /* Scoped override: a stat's caption is plain text, not one of the boxed
     .note callouts, so the box styling has to be cleared explicitly. */
  background: none; border: 0; padding: 0; border-radius: 0;
  font-size: .76rem; color: var(--muted); margin-top: .25rem;
}
.stat.accent { background: linear-gradient(150deg, rgba(38,161,123,.16), var(--panel) 62%); border-color: rgba(38,161,123,.28); }
.stat.accent .value { color: var(--accent-2); }
@media (max-width: 620px) {
  .stat { padding: .8rem .85rem; }
  .stat .value { font-size: 1.2rem; }
}

/* ----------------------------------------------------------------- forms -- */

label, .lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: .62rem .7rem;
  border-radius: var(--radius-sm);
  font: inherit;
  /* 16px is the threshold below which iOS Safari zooms the page on focus.
     Anything smaller here makes every form on a phone jump. */
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 92px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                                              linear-gradient(135deg, var(--muted) 50%, transparent 50%);
         background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
         background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }

.field { margin-bottom: .9rem; }
.field .hint { font-size: .76rem; color: var(--faint); margin-top: .28rem; }
.field .err  { font-size: .78rem; color: var(--danger); margin-top: .28rem; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .err { display: block; }

.row { display: flex; gap: .7rem; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 560px) { .row.stack > * { flex-basis: 100%; } }

.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .86rem; color: var(--muted); font-weight: 400; }
.check input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); margin-top: .12rem; flex: 0 0 17px; }

.input-suffix { position: relative; }
.input-suffix > span {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  font-size: .8rem; color: var(--faint); font-weight: 600; pointer-events: none;
}
/* A trailing button (show/hide password, "max") sits in the same slot. */
.input-suffix > button {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
}
.input-suffix input { padding-right: 3.6rem; }

/* ---------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: .58rem 1rem;
  border-radius: var(--radius-sm);
  font: inherit; font-family: var(--display); font-weight: 600; font-size: .92rem;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.14); text-decoration: none; }
.btn:active { filter: brightness(.95); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04150e; }
.btn-danger  { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warn    { background: var(--warn); border-color: var(--warn); color: #1a1403; }
.btn-ghost   { background: transparent; }
.btn-block   { width: 100%; }
.btn-sm      { padding: .34rem .6rem; font-size: .8rem; }
.btn-lg      { padding: .78rem 1.4rem; font-size: 1rem; }
.btn.is-loading::after {
  content: ''; width: 13px; height: 13px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ----------------------------------------------------------------- table -- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th {
  text-align: left; padding: .6rem .8rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--bg-2);
}
table.tbl td { padding: .62rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .sub { display: block; font-size: .76rem; color: var(--faint); }

.empty { padding: 2.2rem 1rem; text-align: center; color: var(--faint); }
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; opacity: .6; }

.pager { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .85rem; font-size: .84rem; color: var(--muted); }

/* ------------------------------------------------------------------ misc -- */

.badge {
  display: inline-block;
  padding: .16rem .5rem;
  border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge.ok      { background: var(--accent-dim); color: var(--accent-2); }
.badge.pend    { background: var(--warn-dim);   color: var(--warn); }
.badge.bad     { background: var(--danger-dim); color: var(--danger); }
.badge.info    { background: var(--info-dim);   color: var(--info); }
.badge.muted   { background: var(--panel-2);    color: var(--muted); }

.pos { color: var(--accent-2); }
.neg { color: var(--danger); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .82rem; }
.tiny  { font-size: .74rem; }
/* Secondary line under a heading or value. Tables, .who and .opt override it. */
.sub { display: block; font-size: .76rem; color: var(--faint); font-weight: 400; }
.bold  { font-weight: 700; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mt1 { margin-top: .6rem; } .mt2 { margin-top: 1.1rem; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: .6rem; } .mb2 { margin-bottom: 1.1rem; }
.hidden { display: none !important; }
.break { overflow-wrap: anywhere; }

.note {
  background: var(--info-dim);
  border: 1px solid rgba(74,158,222,.28);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  font-size: .85rem;
  color: #cfe5f7;
}
.note.warn   { background: var(--warn-dim);   border-color: rgba(226,179,60,.3);  color: #f2e2b6; }
.note.danger { background: var(--danger-dim); border-color: rgba(229,84,75,.3);   color: #f6cdca; }
.note.ok     { background: var(--accent-dim); border-color: rgba(38,161,123,.3);  color: #c3ecdc; }
.note b { color: #fff; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .88rem; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
/* A <div class="kv"> is one label/value row. Stack several inside a .pad-0
   card body to get a receipt-style list. */
div.kv { padding: .62rem .9rem; align-items: center; gap: .45rem .7rem; }
div.kv + div.kv { border-top: 1px solid var(--line-soft); }
.kv > span { color: var(--faint); }
.kv > b, .kv > strong { text-align: right; font-weight: 600; }

a.link { color: var(--accent-2); font-weight: 600; }
a.link:hover { text-decoration: underline; }
.text { color: var(--text); }
.mono { font-family: var(--mono); font-size: .84rem; }

.copy {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-2); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: .55rem .7rem;
}
.copy input {
  border: 0; background: transparent; padding: 0;
  font-family: var(--mono); font-size: .84rem; color: var(--text);
}
.copy input:focus { box-shadow: none; }

.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }

.tabs { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 1px solid var(--line-soft); margin-bottom: 1rem; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600;
  padding: .55rem .8rem; cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px;
  padding: .3rem .75rem; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--accent-dim); border-color: rgba(38,161,123,.4); color: var(--accent-2); }

/* A selectable row in a list of choices (deposit channel, payout account). */
.opt {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  color: var(--text); font: inherit; padding: .72rem .9rem; cursor: pointer;
}
.opt:last-child { border-bottom: 0; }
.opt:hover { background: var(--panel-2); }
.opt.active { background: var(--accent-dim); box-shadow: inset 3px 0 0 var(--accent); }
.opt .ico {
  flex: 0 0 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 1rem;
  background: var(--panel-2); border: 1px solid var(--line);
}
.opt.active .ico { border-color: rgba(38,161,123,.45); color: var(--accent-2); }
.opt .sub { color: var(--faint); font-size: .76rem; font-weight: 400; }

/* Support thread: the user's messages sit right, staff replies left. */
.thread { display: flex; flex-direction: column; gap: .7rem; max-height: 460px; overflow-y: auto; padding: 1rem 1.1rem; }
.msg { max-width: 80%; }
.msg .bubble {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 14px 14px 14px 4px; padding: .6rem .8rem;
  font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg .meta { font-size: .7rem; color: var(--faint); margin-top: .22rem; }
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: var(--accent-dim); border-color: rgba(38,161,123,.32); border-radius: 14px 14px 4px 14px; }
.msg.mine .meta { text-align: right; }
@media (max-width: 560px) { .msg { max-width: 92%; } }

/* skeleton loading */
.skel { background: linear-gradient(90deg, var(--panel-2) 25%, var(--line-soft) 37%, var(--panel-2) 63%);
        background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
        border-radius: 6px; height: 1em; display: block; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: .5rem; }
.chart .bar { flex: 1; min-width: 0; background: var(--panel-2); border-radius: 3px 3px 0 0; position: relative; transition: background .15s; }
.chart .bar > i { position: absolute; inset: auto 0 0 0; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 3px 3px 0 0; }
.chart .bar:hover { background: var(--line); }
.chart-x { display: flex; justify-content: space-between; font-size: .7rem; color: var(--faint); margin-top: .4rem; }

/* toast */
#toasts {
  position: fixed; z-index: 90;
  left: 50%; transform: translateX(-50%);
  top: .8rem;
  display: flex; flex-direction: column; gap: .5rem;
  width: calc(100% - 1.6rem); max-width: 420px;
  pointer-events: none;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  font-size: .88rem;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
  pointer-events: auto;
}
.toast.ok  { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* modal */
.modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,6,9,.72);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease;
  margin: auto;
}
.modal-box.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; flex: 1; }
.modal-head .x { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.modal-body { padding: 1.1rem; }
.modal-foot { padding: .85rem 1.1rem; border-top: 1px solid var(--line-soft); display: flex; gap: .5rem; justify-content: flex-end; }

/* ----------------------------------------------------- auth + landing --- */

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(900px 480px at 15% -5%, rgba(38,161,123,.16), transparent 60%),
    radial-gradient(700px 420px at 95% 105%, rgba(79,224,255,.10), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.auth-card .brand { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.2rem;
                    font-size: 1.1rem; font-weight: 700; color: var(--text); }
.auth-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: .25rem; }
.auth-card .lede { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 1.3rem; }
.auth-foot { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 1.1rem; }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; margin-bottom: .9rem; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600;
              padding: .42rem; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--accent); color: #04150e; }

.site-head {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.2rem;
  background: rgba(8,11,16,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); }
.site-head nav { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.site-head nav a.link { color: var(--muted); font-size: .9rem; font-weight: 600; padding: .4rem .6rem; }
@media (max-width: 620px) { .site-head nav a.link { display: none; } }

.hero {
  padding: 3.4rem 1.2rem 2.6rem;
  text-align: center;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(38,161,123,.18), transparent 62%),
    var(--bg);
}
.hero h1 { font-size: clamp(1.8rem, 5.2vw, 3rem); letter-spacing: -.03em; margin-bottom: .7rem; }
.hero h1 em { font-style: normal; color: var(--accent-2); }
.hero p { max-width: 620px; margin: 0 auto 1.5rem; color: var(--muted); font-size: 1.02rem; }
.hero .btn-row { justify-content: center; }

/* The hero leads with the machine itself — the same rig deck the dashboard
   shows, driven by a real published plan, so the marketing picture and the
   product a member gets are literally the same component. */
.hero-deck { max-width: 420px; margin: 0 auto 1.6rem; }
.hero-deck .chips { justify-content: center; padding: .75rem .8rem 0; }
.hero-deck .bullion { padding-top: .9rem; }
.hero-legal { font-size: .72rem; color: var(--faint); max-width: 420px; margin: 0 auto 1.8rem; }

.section { max-width: 1120px; margin: 0 auto; padding: 2.4rem 1.1rem; }
.section > h2 { text-align: center; font-size: 1.5rem; margin-bottom: .4rem; }
.section > .lede { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 1.8rem; }

.plan-card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column;
  position: relative;
}
.plan-card.featured { border-color: rgba(38,161,123,.45); background: linear-gradient(170deg, rgba(38,161,123,.1), var(--panel) 55%); }
.plan-card .tag {
  position: absolute; top: -10px; right: 14px;
  background: var(--accent); color: #04150e;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  padding: .18rem .5rem; border-radius: 999px; text-transform: uppercase;
}
.plan-card .pname { font-size: 1.05rem; font-weight: 700; }
.plan-card .phash { font-size: .8rem; color: var(--faint); margin-bottom: .8rem; }
.plan-card .pprice { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.plan-card .pprice small { font-size: .5em; color: var(--muted); font-weight: 600; }
.plan-card ul { list-style: none; margin: .9rem 0 1.1rem; padding: 0; font-size: .87rem; }
.plan-card ul li { display: flex; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-bottom: 1px dashed var(--line-soft); }
.plan-card ul li:last-child { border-bottom: 0; }
.plan-card ul li span:first-child { color: var(--muted); }
.plan-card ul li span:last-child { font-weight: 650; }
.plan-card .btn { margin-top: auto; }

.site-foot { border-top: 1px solid var(--line-soft); padding: 1.6rem 1.2rem 2.4rem; text-align: center; color: var(--faint); font-size: .84rem; }

.step { display: flex; gap: .9rem; margin-bottom: 1.1rem; }
.step .n {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%; background: var(--accent-dim); color: var(--accent-2);
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  border: 1px solid rgba(38,161,123,.3);
}
.step h4 { margin-bottom: .2rem; }
.step p { margin: 0; font-size: .88rem; color: var(--muted); }

/* ==========================================================================
   THE RIG DECK
   The dashboard hero: a CSS-3D mining rig sitting above a gold balance
   readout, both on one enclosure, like the display panel on real hardware.

   Everything here is driven by data, not decoration:
     .rig.is-idle        no active contracts — fans stop, LEDs go dark
     --fan-speed         seconds per fan revolution, from real hashrate
     --cards             how many GPUs are drawn, from active contract count
   ========================================================================== */

.deck {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(79,224,255,.10), transparent 62%),
    linear-gradient(178deg, #131c28, #0a0e14 78%);
  box-shadow: 0 22px 50px -22px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Vent slots milled into the top of the enclosure. */
.deck::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--coolant), transparent);
  opacity: .5;
}

.deck-stage {
  position: relative;
  height: 210px;
  display: grid; place-items: center;
  perspective: 760px;
  overflow: hidden;
}

/* Floor grid — gives the 3D rig something to stand on and read depth against. */
.deck-stage::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 46%;
  background:
    linear-gradient(transparent, rgba(79,224,255,.05)),
    repeating-linear-gradient(90deg, rgba(79,224,255,.10) 0 1px, transparent 1px 34px);
  transform: perspective(160px) rotateX(52deg);
  transform-origin: bottom;
  opacity: .55;
  pointer-events: none;
}

.rig {
  position: relative;
  width: 210px; height: 132px;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-26deg);
  animation: rig-drift 14s ease-in-out infinite alternate;
}
@keyframes rig-drift {
  from { transform: rotateX(12deg) rotateY(-29deg); }
  to   { transform: rotateX(9deg)  rotateY(-17deg); }
}

/* Open aluminium frame: two end plates joined by a spine. */
.rig .frame {
  position: absolute; inset: 0;
  border: 2px solid #2c3a4c;
  border-radius: 6px;
  background: linear-gradient(120deg, rgba(70,90,112,.28), rgba(20,28,38,.5));
  transform: translateZ(-26px);
  box-shadow: inset 0 0 22px rgba(0,0,0,.75);
}

/* --- GPU cards: the stack that does the work --- */
.rig .card-gpu {
  position: absolute;
  left: 8px; right: 8px; height: 26px;
  border-radius: 4px;
  background: linear-gradient(100deg, #1d2836 0%, #2b3a4d 46%, #141c26 100%);
  border: 1px solid #38495d;
  box-shadow: 0 5px 12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px;
  padding: 0 9px;
}
.rig .card-gpu:nth-child(2) { top: 14px;  transform: translateZ(16px); }
.rig .card-gpu:nth-child(3) { top: 53px;  transform: translateZ(6px); }
.rig .card-gpu:nth-child(4) { top: 92px;  transform: translateZ(-4px); }

/* Fans. Blades are a conic sweep so one element gives a convincing rotor. */
.rig .fan {
  width: 19px; height: 19px; flex: 0 0 19px;
  border-radius: 50%;
  background: #0b1016;
  border: 1px solid #3d4f64;
  position: relative;
  overflow: hidden;
}
.rig .fan::before {
  content: '';
  position: absolute; inset: 1px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(150,180,205,.62) 0deg 26deg, transparent 26deg 90deg,
    rgba(150,180,205,.62) 90deg 116deg, transparent 116deg 180deg,
    rgba(150,180,205,.62) 180deg 206deg, transparent 206deg 270deg,
    rgba(150,180,205,.62) 270deg 296deg, transparent 296deg 360deg);
  animation: fan-spin var(--fan-speed, 1.1s) linear infinite;
}
.rig .fan::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: #4a5d73;
}
@keyframes fan-spin { to { transform: rotate(360deg); } }

/* Status LED on each card. */
.rig .led {
  margin-left: auto;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 7px var(--accent-2);
  animation: led-blink 2.4s ease-in-out infinite;
}
.rig .card-gpu:nth-child(3) .led { animation-delay: .5s; }
.rig .card-gpu:nth-child(4) .led { animation-delay: 1.1s; }
@keyframes led-blink { 0%, 100% { opacity: 1; } 45% { opacity: .25; } }

/* Power LED — the one place other than the balance where gold appears. */
.rig .psu {
  position: absolute; bottom: -6px; left: 8px; right: 8px; height: 15px;
  border-radius: 3px;
  background: linear-gradient(100deg, #161f2b, #202d3d);
  border: 1px solid #33445a;
  transform: translateZ(-12px);
  display: flex; align-items: center; padding: 0 8px;
}
.rig .psu i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--au);
  box-shadow: 0 0 8px var(--au);
}

/* Heat haze rising off the stack. */
.rig .heat {
  position: absolute; inset: -18% -12% 30% -12%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(232,181,60,.16), transparent 70%);
  filter: blur(7px);
  animation: heat-breathe 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes heat-breathe { from { opacity: .35; } to { opacity: .8; } }

/* Hash particles drifting up out of the rig. */
.deck-stage .motes { position: absolute; inset: 0; pointer-events: none; }
.deck-stage .motes i {
  position: absolute; bottom: 26%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--coolant);
  box-shadow: 0 0 6px var(--coolant);
  opacity: 0;
  animation: mote-rise 4.4s linear infinite;
}
@keyframes mote-rise {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  18%  { opacity: .85; }
  100% { opacity: 0; transform: translateY(-108px) scale(1.15); }
}

/* --- Idle state: no active contracts. The machine is visibly off. --- */
.rig.is-idle .fan::before,
.rig.is-idle { animation-play-state: paused; }
.rig.is-idle .fan::before { animation: none; opacity: .3; }
.rig.is-idle .led { animation: none; background: #33445a; box-shadow: none; }
.rig.is-idle .psu i { background: #33445a; box-shadow: none; }
.rig.is-idle .heat { display: none; }
.rig.is-idle .card-gpu { filter: saturate(.35) brightness(.72); }
.deck.is-idle .motes { display: none; }
.deck.is-idle::before { background: var(--line); opacity: 1; }

/* --- Telemetry strip across the stage --- */
/* --- Telemetry band between the stage and the readout ---
   In normal flow on purpose: App.rig() owns the stage's innerHTML, so anything
   absolutely positioned inside it would be wiped on every render. */
.deck-tele {
  position: relative;
  display: flex; gap: .1rem;
  margin-top: -2.2rem;                 /* rides up over the foot of the stage */
  padding: .5rem .8rem .6rem;
  font-family: var(--display);
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
  background: linear-gradient(transparent, rgba(5,7,10,.9) 62%);
}
.deck-tele span { flex: 1; }
.deck-tele b {
  display: block;
  font-size: .95rem; letter-spacing: 0; text-transform: none;
  color: var(--coolant);
  font-variant-numeric: tabular-nums;
}
.deck-tele.is-idle b { color: var(--faint); }

/* --- The balance readout, etched into the base of the enclosure --- */
.bullion {
  padding: 1.1rem 1.15rem 1.2rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(232,181,60,.05), transparent 60%);
}
/* Shown without a rig above it — on the wallet page the balance is the whole
   point of the panel, so there is no seam to draw. */
.deck > .bullion:first-child { border-top: 0; padding-top: 1.3rem; }
.bullion .cap {
  font-family: var(--display);
  font-size: .7rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .2rem;
}
/* Struck metal: a highlight across the top third of the glyphs, a warm body
   below, and a soft bloom behind. background-clip does the work. */
.bullion .amt {
  display: block;
  font-size: clamp(2.1rem, 11vw, 3.3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  white-space: nowrap;
  background: linear-gradient(176deg, var(--au-hi) 6%, var(--au) 44%, var(--au-lo) 99%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  filter: drop-shadow(0 2px 14px rgba(232,181,60,.28));
}
/* The fractional tail is smaller and quieter than the whole units — the eye
   lands on the money, then notices the small digits moving.
   It gets an explicit fill rather than a lower opacity: opacity < 1 makes this
   a separate compositing group, which drops its glyphs out of the parent's
   background-clip: text region and paints nothing at all. --au-mid is roughly
   the shade the gradient reaches at the tail's height, so the metal reads
   continuous. */
.bullion .amt s,
.au-figure s {
  text-decoration: none;
  font-size: .42em;
  letter-spacing: 0;
  -webkit-text-fill-color: var(--au-mid);
          color: var(--au-mid);
}
/* -webkit-text-fill-color inherits and beats `color`, so the unit has to opt
   back out of the parent's transparent fill to show its own gold. */
.bullion .unit,
.au-figure .unit {
  font-family: var(--display);
  font-size: .82rem; font-weight: 600; letter-spacing: .1em;
  -webkit-text-fill-color: var(--au);
  color: var(--au);
  opacity: .8;
  margin-left: .35rem;
}

/* The same struck metal at card scale, for a balance that sits inside a panel
   instead of leading the page. */
.au-figure {
  font-family: var(--display);
  font-size: 1.6rem; font-weight: 700; line-height: 1.15;
  letter-spacing: -.015em;
  background: linear-gradient(176deg, var(--au-hi) 10%, var(--au) 50%, var(--au-lo) 99%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
.au-figure .unit { font-size: .6rem; }

.bullion .accrue {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-top: .7rem;
  padding: .34rem .7rem .34rem .55rem;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(38,161,123,.3);
  font-family: var(--display);
  font-size: .84rem; font-weight: 600;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.bullion .accrue .pulse {
  width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%;
  background: var(--accent-2);
  animation: pulse-ring 1.6s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(52,199,147,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(52,199,147,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,147,0); }
}
.bullion .accrue.is-idle { background: var(--panel-2); border-color: var(--line); color: var(--muted); }
.bullion .accrue.is-idle .pulse { animation: none; background: var(--faint); }
.bullion .foot { font-size: .78rem; color: var(--faint); margin-top: .55rem; }

/* A digit that just changed gets a brief lift — the tick you feel rather than
   read. Applied by script to the fractional tail only. */
.bullion .amt s.tick { animation: digit-tick .45s ease-out; }
@keyframes digit-tick {
  0%   { opacity: 1; filter: brightness(1.5); }
  100% { opacity: .62; filter: none; }
}

/* --- Wallet strip: swipeable cards instead of a cramped stack on phones --- */
.w-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(146px, 1fr);
  gap: .6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: .3rem;
  scrollbar-width: none;
}
.w-strip::-webkit-scrollbar { display: none; }
.w-strip > div {
  scroll-snap-align: start;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: .7rem .8rem;
}
.w-strip .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.w-strip .v {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: 1.08rem; font-weight: 700; margin-top: .15rem;
}
.w-strip > div.locked .v { color: var(--warn); }

/* ==========================================================================
   Mobile hardening
   ========================================================================== */

@media (max-width: 620px) {
  /* Tap targets. Anything a thumb has to hit gets 44px of height. */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 34px; padding: .4rem .7rem; }
  .chip { min-height: 36px; display: inline-flex; align-items: center; }
  .tabs button { min-height: 44px; }
  .opt { min-height: 56px; }
  .bell, .burger { width: 40px; height: 40px; }

  /* Notch-safe gutters in landscape. */
  .content { padding-left: max(.8rem, env(safe-area-inset-left));
             padding-right: max(.8rem, env(safe-area-inset-right)); }

  .deck-stage { height: 178px; }
  .rig { transform: scale(.86) rotateX(12deg) rotateY(-26deg); }

  /* Long values in a receipt row must wrap rather than push the label off. */
  .kv { grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
  .kv > b, .kv > strong, .kv dd { overflow-wrap: anywhere; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-width: none; border-radius: 18px 18px 0 0; margin: 0; animation: sheet-up .22s ease; }
  @keyframes sheet-up { from { transform: translateY(14px); opacity: 0; } }

  /* Inner scrollers should not drag the page with them. */
  .table-wrap, .thread, .tabs { overscroll-behavior-x: contain; }

  /* Tables stay tables on a phone rather than folding into stacked cards: these
     are ledgers, and a column of right-aligned amounts is the whole point of
     reading one. Instead of crushing the columns, keep them their natural width
     and pin the first cell — the row's identity — so it is still on screen when
     the reader has scrolled across to the amount. */
  table.tbl { min-width: 520px; }
  table.tbl th:first-child,
  table.tbl td:first-child {
    position: sticky; left: 0; z-index: 1;
    min-width: 116px;
    box-shadow: 8px 0 8px -8px rgba(0,0,0,.65);
  }
  /* The pinned cell holds a date or a name over a reference: let it size to its
     content instead of wrapping, or a row grows to three lines and the ledger
     becomes unreadable. The table scrolls, so the extra width costs nothing. */
  table.tbl td:first-child { background: var(--panel); white-space: nowrap; }
  table.tbl tbody tr:hover td:first-child { background: var(--panel-2); }
  /* An empty-state or skeleton cell spans the table, so pinning it would drag
     the message off to the left as the reader scrolls. */
  table.tbl td[colspan] { position: static; box-shadow: none; }
  /* …and with nothing to scroll to, the min-width only pushes that centred
     message half off screen. A colspan cell is only ever a skeleton or an empty
     state here — never a totals row — so it is a safe signal to drop the floor.
     The header goes too: its nowrap columns alone are wider than a phone, and
     there are no rows for them to label. */
  table.tbl:has(td[colspan]) { min-width: 0; }
  table.tbl:has(td[colspan]) thead { display: none; }
}

/* Respect the system setting. The rig holds its pose and stays lit, so the
   page still reads as "running" without anything moving. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rig .fan::before { opacity: .55; }
  .rig, .rig .heat { animation: none; }
  .rig .heat { opacity: .6; }
}
