/* LUX8 Wallet — terminal aesthetic inherited from lux8.net: mono-first
   typography, near-black ground, mint-green accent with glow, amber for data
   badges and warnings. Motion only where it communicates state. */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../vendor/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #171717;
  --surface-3: #1e1e1e;
  --line: #222222;
  --line-strong: #333333;
  --text: #e6e6e6;
  --muted: #888888;
  --faint: #555555;
  --mint: #8afbde;
  --mint-hi: #b8fdec;
  --mint-dim: rgba(138, 251, 222, 0.12);
  --glow-mint: rgba(138, 251, 222, 0.3);
  --amber: #ffb000;
  --amber-hi: #ffc94d;
  --amber-dim: rgba(255, 176, 0, 0.12);
  --green: #8afbde;
  --red: #ff4444;
  --red-dim: rgba(255, 68, 68, 0.12);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'JetBrains Mono', ui-monospace, monospace;
  --r: 10px;
  --r-lg: 12px;
  --pad: 20px;
  --ease: cubic-bezier(0.25, 0.9, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; } /* only screens scroll — keeps the soft keyboard from displacing the app frame */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--mint-dim); color: var(--mint-hi); }

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  position: relative;
  /* clip, not hidden: the off-screen sheet extends scrollable overflow, and
     keyboard focus-scrolling would silently shift the whole app frame */
  overflow: clip;
  background:
    radial-gradient(120% 50% at 50% -10%, rgba(138, 251, 222, 0.04), transparent 60%),
    var(--bg);
}
@media (min-width: 480px) {
  body { background: #060708; }
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- tick ruler motif ---------- */
.ticks {
  height: 10px;
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 9px) bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 3px) bottom / 100% 3px no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticks--amber {
  background:
    repeating-linear-gradient(90deg, var(--mint) 0 1px, transparent 1px 9px) bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, rgba(138, 251, 222, 0.35) 0 1px, transparent 1px 3px) bottom / 100% 3px no-repeat;
}

/* ---------- screens & transitions ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: inherit;
}
.screen.is-on { display: flex; animation: screen-in 0.2s var(--ease); }
.screen.is-on.from-back { animation: screen-back 0.2s var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- header ---------- */
.hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) var(--pad) 10px;
}
.hdr h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.hdr .btn-ico:first-child { margin-left: -10px; }
.btn-ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.btn-ico:active { transform: scale(0.92); background: var(--surface-2); color: var(--text); }
.btn-ico svg { width: 22px; height: 22px; }

.brand {
  display: flex; align-items: center; gap: 10px; flex: 1;
  font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  color: var(--mint);
}
.brand .mark { width: 26px; height: 26px; filter: drop-shadow(0 0 6px var(--glow-mint)); }

/* ---------- home ---------- */
.balance-block { padding: 26px var(--pad) 18px; text-align: center; }
.balance-usd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 48px;
}
.balance-usd .cur { color: var(--faint); font-size: 26px; font-weight: 400; vertical-align: 6px; margin-right: 2px; }
.balance-sub { color: var(--muted); font-family: var(--mono); font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.balance-sub .dot { color: var(--faint); margin: 0 6px; }

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 8px var(--pad) 22px;
}
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.action:active { transform: scale(0.95); background: var(--surface-2); }
.action svg { width: 22px; height: 22px; color: var(--mint); }

.section {
  padding: 6px var(--pad) 4px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.section h2 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.section .lnk { color: var(--mint); font-size: 13px; font-weight: 600; padding: 4px 0; }
.section .lnk:active { color: var(--mint-hi); }

/* ---------- lists / rows ---------- */
.list { padding: 4px 12px 14px; }
.row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px;
  border-radius: var(--r);
  text-align: left;
  transition: background 0.13s, transform 0.12s;
}
button.row:active { background: var(--surface-2); transform: scale(0.985); }
.coin {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  color: var(--muted);
  overflow: hidden;
  border: 1px solid var(--line);
}
.coin img { width: 100%; height: 100%; object-fit: cover; }
.coin--sol { color: var(--mint); background: var(--mint-dim); border-color: transparent; font-size: 19px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex: none; }
.row-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 600; }
.row-num.pos { color: var(--green); }
.row-num.neg { color: var(--text); }
.row-fiat { color: var(--muted); font-size: 12px; font-family: var(--mono); margin-top: 1px; }

.empty { color: var(--faint); text-align: center; padding: 28px 20px; font-size: 14px; }

/* ---------- badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 7px;
}
.chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip--active { color: var(--green); background: var(--mint-dim); }
.chip--activating, .chip--deactivating { color: var(--amber); background: var(--amber-dim); }
.chip--inactive { color: var(--muted); background: var(--surface-3); }
.chip--fail { color: var(--red); background: var(--red-dim); }

/* ---------- forms ---------- */
.form { padding: 8px var(--pad); display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.03em; }
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--mint); background: var(--surface-2); }
.input.mono { font-family: var(--mono); font-size: 14px; }
.input.bad { border-color: var(--red); }
textarea.input { resize: none; min-height: 96px; line-height: 1.6; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.hint.bad { color: var(--red); }
.hint.good { color: var(--green); }

.amount-wrap { position: relative; }
.amount-wrap .input { font-family: var(--mono); font-size: 22px; font-weight: 600; padding-right: 74px; font-variant-numeric: tabular-nums; }
.btn-max {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--mint);
  padding: 7px 10px; border-radius: 8px;
  background: var(--mint-dim);
}
.btn-max:active { color: var(--mint-hi); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: var(--r);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.12s, opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn--primary { background: var(--mint); color: #04231b; }
.btn--primary:active { background: var(--mint-hi); box-shadow: 0 0 24px var(--glow-mint); }
.btn--ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn--ghost:active { background: var(--surface-2); }
.btn--danger { background: var(--red-dim); color: var(--red); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* hold-to-confirm */
.btn-hold { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.btn-hold .fill {
  position: absolute; inset: 0;
  background: rgba(23, 18, 4, 0.22);
  transform: scaleX(0); transform-origin: left;
}
.btn-hold.holding .fill { transform: scaleX(1); transition: transform 1.1s linear; }
.btn-hold span { position: relative; }

/* ---------- seed phrase ---------- */
.seed-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  padding: 4px var(--pad);
}
.seed-word {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  display: flex; gap: 7px; align-items: baseline;
}
.seed-word i { font-style: normal; color: var(--faint); font-size: 11px; min-width: 14px; }
.seed-blur { position: relative; }
.seed-blur .seed-grid { filter: blur(9px); pointer-events: none; }
.seed-blur .reveal {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-opt {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 11px;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
}
.quiz-opt:active { transform: scale(0.95); }
.quiz-opt.on { border-color: var(--mint); background: var(--mint-dim); color: var(--mint-hi); }

/* ---------- panels & note boxes ---------- */
.panel {
  margin: 6px var(--pad) 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.note { display: flex; gap: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.note svg { width: 18px; height: 18px; flex: none; color: var(--amber); margin-top: 1px; }
.note.danger svg { color: var(--red); }
.note b { color: var(--text); font-weight: 600; }

/* ---------- review sheet ---------- */
.sheet-veil {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(4, 5, 6, 0.7);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sheet-veil.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px var(--pad) max(20px, env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.24s var(--ease);
  max-height: 86%;
  overflow-y: auto;
}
.sheet.on { transform: none; }
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 2px auto 14px; }
.sheet h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; font-size: 13.5px; }
.kv .v.big { font-size: 16px; font-weight: 700; }
.kv .v .dim { color: var(--faint); }
.addr-chunks { font-family: var(--mono); font-size: 13px; text-align: right; word-break: break-all; line-height: 1.55; }
.addr-chunks b { color: var(--mint-hi); font-weight: 600; }

/* ---------- receive ---------- */
.qr-card {
  margin: 14px auto 0;
  width: min(280px, 72vw);
  background: #fff;
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.qr-card svg { display: block; width: 100%; height: auto; }
.addr-full {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  word-break: break-all; text-align: center;
  color: var(--muted);
  padding: 16px 34px 6px;
  letter-spacing: 0.03em;
}

/* ---------- status flow (sending / confirmed) ---------- */
.txstate { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 30px; text-align: center; }
.txstate .big-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.txstate .big-ico svg { width: 34px; height: 34px; }
.txstate.ok .big-ico { background: var(--mint-dim); color: var(--green); }
.txstate.fail .big-ico { background: var(--red-dim); color: var(--red); }
.txstate h3 { font-size: 19px; }
.txstate p { color: var(--muted); font-size: 13.5px; word-break: break-all; }
.spinner {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--mint);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 4px;
  margin: 4px var(--pad) 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}
.tab {
  flex: 1; text-align: center;
  padding: 9px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.tab.on { background: var(--surface-3); color: var(--text); }

/* ---------- validator / lst rows ---------- */
.stat-pair { display: flex; gap: 12px; }
.stat-pair .row-end { min-width: 62px; }
.score {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  color: var(--amber);
  background: var(--amber-dim);
  border-radius: 7px; padding: 2px 7px;
}

.search-wrap { padding: 2px var(--pad) 8px; }

/* ---------- toast ---------- */
#toast {
  position: absolute; left: 50%; bottom: 34px; z-index: 60;
  transform: translate(-50%, 70px);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s var(--ease), opacity 0.25s;
  opacity: 0;
  pointer-events: none;
  max-width: 85%;
  text-align: center;
}
#toast.on { transform: translate(-50%, 0); opacity: 1; }
#toast.err { border-color: rgba(255, 93, 93, 0.4); color: var(--red); }

/* ---------- skeleton ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; color: transparent !important; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- onboarding / unlock ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12vh 34px 20px; gap: 14px; flex: 1; justify-content: center; }
.hero .mark-big { width: 96px; height: 96px; filter: drop-shadow(0 0 20px var(--glow-mint)); }
.hero h1 { font-size: 30px; font-weight: 700; letter-spacing: 0.02em; color: var(--mint); text-shadow: 0 0 24px var(--glow-mint); }
.hero .tagline { color: var(--muted); font-size: 15.5px; max-width: 250px; line-height: 1.5; }
.hero .mantra { font-family: var(--mono); color: var(--faint); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.foot { padding: 12px var(--pad) 10px; display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

.step-title { padding: 8px var(--pad) 14px; }
.step-title h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.step-title p { color: var(--muted); margin-top: 6px; font-size: 14px; line-height: 1.55; }

/* settings */
.set-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 15px; font-weight: 500;
}
.set-row:active { background: var(--surface); }
.set-row svg { width: 20px; height: 20px; color: var(--muted); }
.set-row .val { margin-left: auto; color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.set-row.danger { color: var(--red); border-bottom: 0; }
.set-row.danger svg { color: var(--red); }

.pill-opts { display: flex; gap: 8px; }
.pill-opts button {
  flex: 1; padding: 9px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.pill-opts button.on { border-color: var(--mint); color: var(--mint-hi); background: var(--mint-dim); }

.mono-sm { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.tc { text-align: center; }
.copy-tap { cursor: pointer; transition: color 0.15s; }
.copy-tap:active { color: var(--mint); }
