/* =====================================================================
   Gnes Company — css/style.css
   Design system: monochrome, flat, 4px grid, 12px card radius,
   24px card padding, pill buttons, ease-in-out 0.2-0.3s motion.
   Sections: 1 tokens | 2 reset | 3 layout | 4 header/footer | 5 buttons
   6 badges/cards | 7 forms | 8 tables | 9 toast/modal | 10 landing
   11 auth | 12 app shell | 13 mining | 14 referrals | 15 admin | 16 responsive
   ===================================================================== */

/* ---------------------------------------------------------------- 1 tokens */
:root {
  /* palette — strictly monochrome */
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --surface-2: #E9ECEF;
  --surface-3: #DFE3E8;
  --text: #0D0E0F;
  --muted: #5C646C;
  --muted-2: #8A9299;
  --line: #D5DAE0;
  --line-strong: #B9C0C7;
  --accent: #000000;
  --accent-contrast: #FFFFFF;
  --ink-bg: #0D0E0F;
  --ink-text: #F2F4F6;
  --overlay: rgba(13, 14, 15, .62);
  --overlay-soft: rgba(13, 14, 15, .38);
  --focus: #0D0E0F;

  /* radii */
  --r-sm: 8px;
  --r-card: 12px;
  --r-pill: 999px;

  /* 4px spacing grid */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --s12: 48px; --s16: 64px; --s20: 80px;

  /* type */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 20px;
  --fs-xl: 24px; --fs-2xl: 32px; --fs-3xl: 40px; --fs-4xl: 56px;

  /* elevation (flat: very restrained) */
  --shadow-1: 0 1px 2px rgba(13, 14, 15, .06);
  --shadow-2: 0 8px 24px rgba(13, 14, 15, .08);
  --shadow-3: 0 16px 48px rgba(13, 14, 15, .14);

  /* motion */
  --t-fast: .2s ease-in-out;
  --t: .24s ease-in-out;
  --t-slow: .3s ease-in-out;

  /* metrics */
  --maxw: 1200px;
  --header-h: 72px;
  --card-pad: 24px;
}

/* ---------------------------------------------------------------- 2 reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--s3); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0 0 var(--s4); }
a  { color: inherit; text-decoration: none; transition: opacity var(--t-fast); }
a:hover { opacity: .7; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0 0 var(--s4); padding-left: var(--s5); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

/* every photographic asset is desaturated to protect the monochrome identity */
.mono-img { filter: grayscale(1) contrast(1.04); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 3 layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s6); }
.container-wide { max-width: 1440px; }

.section { padding: var(--s16) 0; }
.section-sm { padding: var(--s12) 0; }
.section-ink { background: var(--ink-bg); color: var(--ink-text); }
.section-ink .muted { color: var(--surface-3); }

.grid { display: grid; gap: var(--s6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }

.stack > * + * { margin-top: var(--s4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: var(--s6); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3);
}
.section-ink .eyebrow { color: var(--surface-3); }
.lead { font-size: var(--fs-lg); color: var(--muted); max-width: 62ch; }
.section-ink .lead { color: var(--surface-3); }
.divider { height: 1px; background: var(--line); margin: var(--s6) 0; }

/* ---------------------------------------------------------- 4 header / footer */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(242, 244, 246, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header.on-dark {
  background: rgba(13, 14, 15, .72);
  border-bottom-color: rgba(242, 244, 246, .16);
  color: var(--ink-text);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s6);
}
.brand { display: inline-flex; align-items: center; gap: var(--s3); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { opacity: 1; }
.brand-mark {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  object-fit: cover; object-position: 50% 50%;
  border: 1px solid var(--line); background: var(--surface);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: var(--fs-md); font-weight: 700; }
.brand-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: var(--s2); }
.nav a {
  padding: var(--s2) var(--s3); border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--surface-2); opacity: 1; }
.site-header.on-dark .nav a:hover { background: rgba(242, 244, 246, .14); }
.nav a.is-active { background: var(--accent); color: var(--accent-contrast); }
.site-header.on-dark .nav a.is-active { background: var(--ink-text); color: var(--ink-bg); }
.nav-toggle { display: none; }

.site-footer { background: var(--ink-bg); color: var(--ink-text); padding: var(--s12) 0 var(--s6); }
.site-footer a { color: var(--surface-3); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s8); }
.footer-grid h4 { font-size: var(--fs-sm); letter-spacing: .12em; text-transform: uppercase; color: var(--surface-3); margin-bottom: var(--s4); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); font-size: var(--fs-sm); }
.footer-bottom {
  margin-top: var(--s10); padding-top: var(--s5);
  border-top: 1px solid rgba(242, 244, 246, .16);
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
  font-size: var(--fs-xs); color: var(--muted-2);
}
.footer-legal { max-width: 70ch; font-size: var(--fs-xs); color: var(--muted-2); margin-top: var(--s4); }

/* ---------------------------------------------------------------- 5 buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s3) var(--s6);
  border-radius: var(--r-pill);
  border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-contrast);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.btn:hover { opacity: .86; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); opacity: 1; }
.btn-invert { background: var(--surface); color: var(--ink-bg); border-color: var(--surface); }
.btn-outline-invert { background: transparent; color: var(--ink-text); border-color: rgba(242, 244, 246, .4); }
.btn-sm { padding: var(--s2) var(--s4); font-size: var(--fs-xs); }
.btn-lg { padding: var(--s4) var(--s8); font-size: var(--fs-md); }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ------------------------------------------------------- 6 badges / cards */
.badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 2px var(--s3); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-solid { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: transparent; }
.badge-outline-dashed { border-style: dashed; color: var(--muted); }
.badge-lg { padding: var(--s1) var(--s4); font-size: var(--fs-sm); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--card-pad);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.card-hover:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.card-flat { box-shadow: none; }
.card-ink { background: var(--ink-bg); color: var(--ink-text); border-color: var(--ink-bg); }
.card-ink .muted { color: var(--surface-3); }
.card-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
.card-title { font-size: var(--fs-lg); font-weight: 700; margin: 0; }
.card-sub { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--s4);
}
.card-ink .card-icon { background: rgba(242, 244, 246, .12); }
.card-num { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }

/* stat tiles */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s1);
}
.stat-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.stat-meta { font-size: var(--fs-xs); color: var(--muted-2); }
.stat-ink { background: var(--ink-bg); color: var(--ink-text); border-color: var(--ink-bg); }
.stat-ink .stat-label, .stat-ink .stat-meta { color: var(--surface-3); }

/* progress / meter */
.meter { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-pill); transition: width var(--t-slow); }
.card-ink .meter, .stat-ink .meter { background: rgba(242, 244, 246, .2); }
.card-ink .meter > i, .stat-ink .meter > i { background: var(--ink-text); }

/* --------------------------------------------------------------- 7 tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th, table.data td { padding: var(--s3) var(--s4); text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #FAFBFC; }
table.data td.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
table.data .row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.empty-row { padding: var(--s8); text-align: center; color: var(--muted); }
.table-scroll { max-height: 420px; overflow-y: auto; }

/* ---------------------------------------------------------------- 8 forms */
.field { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s5); }
.field > label, .label {
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
}
.label .req { color: var(--text); font-weight: 700; }
.label .opt { color: var(--muted-2); font-size: var(--fs-xs); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: var(--s3) var(--s4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: var(--fs-md); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 14, 15, .08);
}
.textarea { min-height: 96px; resize: vertical; }
.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% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: var(--s10); }
.input-mono { font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: .02em; }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.error-text { font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.input.is-invalid, .select.is-invalid { border-color: var(--text); border-style: dashed; }
.field-inline { display: flex; gap: var(--s3); align-items: flex-start; }
.field-inline > .input { flex: 1 1 auto; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); margin-bottom: var(--s4); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: #000; flex: 0 0 auto; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5) var(--s6) var(--s2); margin: 0 0 var(--s6); }
.fieldset > legend { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--muted); padding: 0 var(--s2); }
.copy-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s3) var(--s4);
}
.copy-row .copy-value { flex: 1 1 auto; font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* ------------------------------------------------------- 9 toast / modal */
.toast-host {
  position: fixed; right: var(--s5); bottom: var(--s5); z-index: 200;
  display: flex; flex-direction: column; gap: var(--s3); max-width: min(380px, calc(100vw - 32px));
}
.toast {
  background: var(--ink-bg); color: var(--ink-text);
  border-radius: var(--r-card); padding: var(--s4) var(--s5);
  box-shadow: var(--shadow-3); font-size: var(--fs-sm);
  display: flex; gap: var(--s3); align-items: flex-start;
  animation: toast-in var(--t-slow) ease-in-out;
}
.toast strong { display: block; font-size: var(--fs-sm); }
.toast .toast-msg { color: var(--surface-3); font-size: var(--fs-xs); }
.toast.is-out { animation: toast-out var(--t-slow) ease-in-out forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.modal-host {
  position: fixed; inset: 0; z-index: 190; display: none;
  background: var(--overlay); padding: var(--s6);
  align-items: center; justify-content: center;
}
.modal-host.is-open { display: flex; animation: fade-in var(--t) ease-in-out; }
.modal {
  background: var(--surface); border-radius: var(--r-card);
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  padding: var(--card-pad); box-shadow: var(--shadow-3);
  animation: modal-in var(--t-slow) ease-in-out;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.modal-close { background: none; border: 0; cursor: pointer; font-size: var(--fs-xl); line-height: 1; padding: 0 var(--s2); }
.modal-foot { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: flex-end; margin-top: var(--s6); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- 10 landing */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: center;
  background: var(--ink-bg) url('../pic/022c.jpg') center/cover no-repeat;
  color: var(--ink-text); overflow: hidden;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(13,14,15,.94) 0%, rgba(13,14,15,.82) 42%, rgba(13,14,15,.45) 100%); }
.hero > .container { position: relative; z-index: 2; padding-top: var(--s16); padding-bottom: var(--s16); }
.hero-inner { max-width: 720px; }
.hero h1 { font-size: clamp(32px, 5vw, var(--fs-4xl)); margin-bottom: var(--s5); }
.hero .lead { color: var(--surface-3); font-size: var(--fs-lg); margin-bottom: var(--s8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s10); }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--s10); padding-top: var(--s6); border-top: 1px solid rgba(242,244,246,.18); }
.hero-fact b { display: block; font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; }
.hero-fact span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--surface-3); }
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  border: 1px solid rgba(242,244,246,.3); border-radius: var(--r-pill);
  padding: var(--s1) var(--s4); font-size: var(--fs-xs); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: var(--s5); color: var(--surface-3);
}
.hero-3d { position: absolute; inset: 0; z-index: 1; opacity: .55; pointer-events: none; }
.hero-3d canvas { display: block; width: 100%; height: 100%; }

.band { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--s6); }
.band-item { text-align: center; padding: var(--s5) var(--s3); border-left: 1px solid var(--line); }
.band-item:first-child { border-left: 0; }
.band-item b { display: block; font-family: var(--font-mono); font-size: var(--fs-2xl); font-weight: 700; }
.band-item span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.section-ink .band-item { border-left-color: rgba(242,244,246,.18); }
.section-ink .band-item span { color: var(--surface-3); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s10); align-items: center; }
.media-frame { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.media-frame-tall img { aspect-ratio: 4 / 5; }

.step { position: relative; padding-left: var(--s12); }
.step-num {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast);
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700;
}
.section-ink .step-num { background: var(--ink-text); color: var(--ink-bg); }
.step h3 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.step p { color: var(--muted); margin: 0; }
.section-ink .step p { color: var(--surface-3); }

.cta-band { background: var(--ink-bg); color: var(--ink-text); border-radius: var(--r-card); padding: var(--s12); display: flex; flex-wrap: wrap; gap: var(--s8); align-items: center; justify-content: space-between; }
.cta-band h2 { margin-bottom: var(--s2); }
.cta-band p { margin: 0; color: var(--surface-3); }

/* ----------------------------------------------------------------- 11 auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside {
  position: relative; padding: var(--s16) var(--s12);
  background: var(--ink-bg) url('../pic/022T.jpg') center/cover no-repeat;
  color: var(--ink-text); display: flex; flex-direction: column; justify-content: space-between; gap: var(--s10);
}
.auth-aside::after { content: ''; position: absolute; inset: 0; background: rgba(13, 14, 15, .8); }
.auth-aside > * { position: relative; z-index: 2; }
.auth-aside .quote { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; max-width: 34ch; }
.auth-aside .quote span { display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--surface-3); margin-top: var(--s3); letter-spacing: 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--s10) var(--s6); background: var(--bg); }
.auth-card { width: min(520px, 100%); }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--s2); }
.auth-switch { font-size: var(--fs-sm); color: var(--muted); }
.auth-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.auth-steps li { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); color: var(--surface-3); }
.auth-steps li b { color: var(--ink-text); font-family: var(--font-mono); }
.strength { display: flex; gap: var(--s1); margin-top: var(--s1); }
.strength i { height: 4px; flex: 1 1 0; background: var(--surface-3); border-radius: var(--r-pill); }
.strength i.on { background: var(--accent); }
.strength-label { font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------------------------------------ 12 app shell */
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); align-items: start; }
.side {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: var(--s6) var(--s4); position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.side-group { margin-bottom: var(--s6); }
.side-title {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 700; padding: 0 var(--s3) var(--s2);
}
.side-link {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.side-link:hover { background: var(--surface-2); opacity: 1; }
.side-link.is-active { background: var(--accent); color: var(--accent-contrast); }
.side-ico { width: 18px; text-align: center; }
.side-card { border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); background: var(--surface-2); }
.main { padding: var(--s8) var(--s6) var(--s16); min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; justify-content: space-between; margin-bottom: var(--s6); }
.page-head h1 { font-size: var(--fs-2xl); margin: 0; }
.page-head p { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.breadcrumb { display: flex; gap: var(--s2); font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: var(--s2); }
.wallet-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.notice {
  display: flex; gap: var(--s3); align-items: flex-start;
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--r-sm); background: var(--surface);
  padding: var(--s4) var(--s5); font-size: var(--fs-sm); margin-bottom: var(--s6);
}
.notice b { display: block; }
.notice-muted { border-left-color: var(--muted-2); background: var(--surface-2); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s2); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.tab {
  padding: var(--s3) var(--s5); border: 0; background: none; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade-in var(--t) ease-in-out; }

/* -------------------------------------------------------------- 13 mining */
.mine-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.stage {
  position: relative; border-radius: var(--r-card); overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #1A1C1E 0%, #0D0E0F 60%, #000 100%);
  border: 1px solid var(--ink-bg); min-height: 440px;
}
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-overlay {
  position: absolute; inset: 0; padding: var(--s5); color: var(--ink-text);
  display: flex; flex-direction: column; justify-content: space-between; pointer-events: none;
}
.stage-top { display: flex; justify-content: space-between; gap: var(--s4); font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; }
.stage-readout { font-family: var(--font-mono); font-size: clamp(26px, 4vw, 42px); font-weight: 700; letter-spacing: -.02em; }
.stage-caption { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; }
.stage.is-idle .stage-live { opacity: .45; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-text); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.no-3d {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  color: var(--surface-3); font-size: var(--fs-sm); padding: var(--s10);
}
.stage.no-webgl .no-3d { display: grid; }
.timer-cells { display: flex; flex-wrap: wrap; gap: var(--s3); }
.timer-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3) var(--s4); text-align: center; min-width: 72px; }
.timer-cell b { display: block; font-family: var(--font-mono); font-size: var(--fs-xl); }
.timer-cell span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.ledger-list { list-style: none; padding: 0; margin: 0; }
.ledger-list li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.ledger-list li:last-child { border-bottom: 0; }
.ledger-list b { font-family: var(--font-mono); }
.hashrate { font-family: var(--font-mono); font-size: var(--fs-sm); }

/* ----------------------------------------------------------- 14 referrals */
.tier-table td:first-child { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.tier-table tr.is-current td { background: var(--surface-2); }
.tree { list-style: none; margin: 0 0 0 var(--s3); padding-left: var(--s5); border-left: 1px dashed var(--line-strong); }
.tree > li { padding: var(--s2) 0; }
.tree-node { display: inline-flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm); flex-wrap: wrap; }
.tree-node .badge { font-family: var(--font-mono); }
.share-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.code-hero { font-family: var(--font-mono); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: .06em; }
.progress-steps { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; font-size: var(--fs-sm); }
.progress-steps .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.progress-steps .dot.on { background: var(--accent); }

/* --------------------------------------------------------------- 15 admin */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
.admin-search { display: flex; gap: var(--s2); flex: 1 1 280px; }
.admin-search .input { flex: 1 1 auto; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); }
.kv { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s4); background: var(--surface); }
.kv dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 0; }
.kv dd { margin: var(--s1) 0 0; font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 700; }
.admin-login { width: min(460px, 100%); }
.log-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.log-list li { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; padding: var(--s2) 0; border-bottom: 1px dashed var(--line); }
.log-list time { color: var(--muted-2); font-family: var(--font-mono); font-size: var(--fs-xs); }
.bar-chart { display: flex; align-items: flex-end; gap: var(--s2); height: 120px; margin-top: var(--s4); }
.bar-chart i { flex: 1 1 0; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; }
.mono-block {
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s3); overflow-wrap: anywhere;
}
.inline-form { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1 1 160px; }

/* ---------------------------------------------------------- 16 responsive */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .mine-grid, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static; height: auto; border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: var(--s2);
  }
  .side-group { margin: 0; }
  .side-title { display: none; }
  .side-card { display: none; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
}
@media (max-width: 820px) {
  :root { --header-h: 64px; --card-pad: 20px; }
  .section { padding: var(--s10) 0; }
  .grid-2, .grid-3, .grid-4, .band, .wallet-strip, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .band-item { border-left: 0; border-top: 1px solid var(--line); }
  .band-item:first-child { border-top: 0; }
  .container { padding: 0 var(--s5); }
  .cta-band { padding: var(--s8); }
  .main { padding: var(--s6) var(--s5) var(--s12); }
  .hero { min-height: 66vh; }
  .hero-facts { gap: var(--s6); }
  .primary-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: var(--s1);
    background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s3);
    box-shadow: var(--shadow-2);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: var(--s3) var(--s4); border-radius: var(--r-sm); }
  .nav-toggle { display: inline-flex; }
  .timer-cell { min-width: 62px; padding: var(--s2) var(--s3); }
  .stage { min-height: 360px; }
}
@media print {
  .site-header, .site-footer, .side, .toast-host, .btn { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------- 17 utilities & state flags */
.is-hidden { display: none !important; }
.text-invert { color: var(--ink-text); }
.spacer { flex: 1 1 auto; }
.scroll-x { overflow-x: auto; }
.label-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-5 { margin-top: var(--s5); }
.mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); } .mb-5 { margin-bottom: var(--s5); }
.gap-2 { gap: var(--s2); } .gap-4 { gap: var(--s4); }
.w-100 { width: 100%; }
.tier-list { list-style: none; padding: 0; margin: 0; }
.tier-list li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px dashed var(--line); }
.tier-list li:last-child { border-bottom: 0; }
hr.dashed { border-top-style: dashed; }
.stat-ink .badge, .card-ink .badge { background: rgba(242, 244, 246, .12); color: var(--ink-text); border-color: rgba(242, 244, 246, .32); }

/* the sticky header over the dark hero needs inverted controls */
.site-header.on-dark .btn { background: var(--ink-text); color: var(--ink-bg); border-color: var(--ink-text); }
.site-header.on-dark .btn-ghost { background: transparent; color: var(--ink-text); border-color: rgba(242, 244, 246, .42); }
.site-header.on-dark .btn-ghost:hover { background: rgba(242, 244, 246, .14); }
.site-header.on-dark .brand-mark { border-color: rgba(242, 244, 246, .32); }
.site-header.on-dark .brand-tag { color: var(--surface-3); }

/* the plan ladder on the register page is a set of selectable cards */
#register-form [data-plans] { display: grid; gap: var(--s4); }
#register-form [data-plans] label.card { display: block; }
#register-form [data-plans] label.card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#register-form [data-plans] input[type="radio"] { accent-color: #000; width: 18px; height: 18px; }

/* admin tables carry inline editors, so keep them compact and scrollable */
.admin-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.admin-editor .field { margin-bottom: 0; }
td .badge { vertical-align: middle; }

