/* ------------------------------------------------------------------
   Trustline Mini App
   Design intent: a private-banking instrument, not a crypto casino.
   Restraint, density, monospaced numbers, one accent that means money.
   Adapts to Telegram's own theme variables when present.
------------------------------------------------------------------- */

:root {
  --bg: var(--tg-theme-bg-color, #0a0b0d);
  --bg-elev: var(--tg-theme-secondary-bg-color, #121317);
  --bg-elev-2: #171920;
  --text: var(--tg-theme-text-color, #e9eaee);
  --text-dim: #8b8f9a;
  --text-faint: #5b5f6a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: var(--tg-theme-button-color, #4ade80);
  --accent-ink: #05130a;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #7dd3fc;
  --radius: 14px;
  --radius-sm: 10px;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Light values are applied when Telegram says the client is light, or when the
   OS prefers light and we are running outside Telegram. Explicit beats implicit. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: var(--tg-theme-bg-color, #f7f7f8);
    --bg-elev: var(--tg-theme-secondary-bg-color, #ffffff);
    --bg-elev-2: #f0f1f3;
    --text: var(--tg-theme-text-color, #0b0c0e);
    --text-dim: #62666f;
    --text-faint: #9599a2;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.16);
    --accent: var(--tg-theme-button-color, #0f9d58);
    --accent-ink: #ffffff;
  }
}
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--tg-theme-bg-color, #f7f7f8);
  --bg-elev: var(--tg-theme-secondary-bg-color, #ffffff);
  --bg-elev-2: #f0f1f3;
  --text: var(--tg-theme-text-color, #0b0c0e);
  --text-dim: #62666f;
  --text-faint: #9599a2;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: var(--tg-theme-button-color, #0f9d58);
  --accent-ink: #ffffff;
}
[data-theme="dark"] {
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- boot */

.boot {
  position: fixed; inset: 0;
  display: grid; place-content: center; gap: 20px; justify-items: center;
  background: var(--bg);
  z-index: 100;
}
.boot-mark {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-content: center;
  font-family: var(--mono); font-weight: 700; letter-spacing: -0.5px;
  background: var(--accent); color: var(--accent-ink);
  animation: breathe 2s ease-in-out infinite;
}
.boot-text { color: var(--text-dim); font-size: 13px; letter-spacing: 0.02em; }
@keyframes breathe { 0%,100% { opacity: 1 } 50% { opacity: 0.55 } }

/* --------------------------------------------------------------- shell */

.shell {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
}
.shell[hidden] { display: none; }
.boot[hidden], .tabbar[hidden] { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
}
.brand-name { font-weight: 620; letter-spacing: -0.01em; font-size: 15px; }

.pill {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-dim);
  white-space: nowrap;
}
.pill-ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.view {
  flex: 1;
  padding: 18px 18px calc(96px + var(--safe-bottom));
  animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

/* --------------------------------------------------------------- type */

h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 6px; font-weight: 660; }
h2 { font-size: 17px; letter-spacing: -0.015em; margin: 0 0 12px; font-weight: 620; }
.lede { color: var(--text-dim); font-size: 14px; margin: 0 0 24px; max-width: 40ch; }
.eyebrow {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 10px; }
.mt-4 { margin-top: 4px } .mt-8 { margin-top: 8px } .mt-16 { margin-top: 16px }
.mt-24 { margin-top: 24px } .mt-32 { margin-top: 32px }

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

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 10px; }
.card-flat { background: var(--bg-elev-2); border: none; }

.deal {
  display: block; width: 100%; text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}
.deal:active { transform: scale(0.995); border-color: var(--line-strong); }
.deal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.deal-title { font-weight: 600; letter-spacing: -0.01em; font-size: 14.5px; }
.deal-sub { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); margin-top: 3px; }
.deal-amount { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 560; letter-spacing: 0.01em;
  padding: 3.5px 8px; border-radius: 6px;
  background: var(--bg-elev-2); color: var(--text-dim);
  border: 1px solid var(--line);
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-funded { color: var(--warn); }
.badge-live { color: var(--info); }
.badge-done { color: var(--accent); }
.badge-bad { color: var(--danger); }

/* -------------------------------------------------------------- big number */

.hero-amount {
  font-family: var(--mono);
  font-size: 40px;
  letter-spacing: -0.045em;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-unit { font-size: 15px; color: var(--text-faint); margin-left: 6px; letter-spacing: 0; }

/* --------------------------------------------------------------- lists */

.kv { display: grid; gap: 0; }
.kv-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--text-dim); }
.kv-val { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.kv-val.accent { color: var(--accent); }
.kv-val.warn { color: var(--warn); }
.kv-val.danger { color: var(--danger); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-weight: 580; font-size: 14.5px; letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 640; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-ghost { border-color: transparent; color: var(--text-dim); min-height: 40px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sm { min-height: 38px; font-size: 13px; width: auto; padding: 0 14px; }

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

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.label { font-size: 12px; color: var(--text-dim); letter-spacing: 0.01em; }
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--bg-elev);
}
.input.mono { font-family: var(--mono); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }
.hint-warn { color: var(--warn); }
.error-text { color: var(--danger); font-size: 12.5px; }

.seg { display: grid; grid-auto-flow: column; gap: 4px; background: var(--bg-elev-2); padding: 4px; border-radius: 10px; }
.seg button {
  border: none; background: transparent; color: var(--text-dim);
  padding: 9px 8px; border-radius: 7px; font-size: 13px; font-weight: 560; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.18); }

/* -------------------------------------------------------------- timeline */

.timeline { display: grid; gap: 0; margin-top: 4px; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.tl-rail { display: grid; justify-items: center; }
.tl-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-strong); margin-top: 6px;
}
.tl-item:first-child .tl-dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.tl-line { width: 1px; flex: 1; background: var(--line); min-height: 18px; }
.tl-body { padding-bottom: 14px; }
.tl-label { font-size: 13px; }
.tl-time { font-size: 11px; color: var(--text-faint); font-family: var(--mono); margin-top: 2px; }

/* --------------------------------------------------------------- notice */

.notice {
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
}
.notice-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--bg-elev-2)); }
.notice-danger { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--bg-elev-2)); }
.notice-ok { border-color: color-mix(in srgb, var(--accent) 28%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-elev-2)); }

/* ---------------------------------------------------------------- tabs */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 560px; margin: 0 auto;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid; justify-items: center; gap: 3px;
  background: none; border: none; padding: 7px 0;
  color: var(--text-faint); font-size: 10.5px; font-weight: 560;
  cursor: pointer; border-radius: 9px;
}
.tab svg { width: 21px; height: 21px; }
.tab[aria-current="page"] { color: var(--text); }
.tab-primary { color: var(--accent); }

/* ---------------------------------------------------------------- sheet */

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); animation: fade 0.18s ease; }
.sheet-body {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  background: var(--bg-elev);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 20px 18px calc(24px + var(--safe-bottom));
  max-height: 88dvh; overflow-y: auto;
  animation: slideup 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideup { from { transform: translateY(24px); opacity: 0.6 } to { transform: none; opacity: 1 } }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 11px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 520;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80; max-width: 88vw; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* -------------------------------------------------------------- empty */

.empty { text-align: center; padding: 56px 20px; color: var(--text-dim); }
.empty-mark {
  width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 14px;
  display: grid; place-content: center;
  border: 1px dashed var(--line-strong); color: var(--text-faint);
}

/* ------------------------------------------------------------- skeleton */

.skel { background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%); background-size: 200% 100%; animation: shim 1.4s infinite; border-radius: 8px; }
@keyframes shim { to { background-position: -200% 0 } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =================================================================
   Product surface — deals list, wallet, create wizard, help
   ================================================================= */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-head h1 { margin-bottom: 2px; }
.lede.tight { margin-bottom: 0; }
.lede { margin-bottom: 0; }

.fab {
  flex: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: none; border-radius: 999px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 640;
  cursor: pointer;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform 0.12s ease;
}
.fab:active { transform: scale(0.96); }

.x-btn {
  background: var(--bg-elev-2); border: none; color: var(--text-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 13px; line-height: 1;
}

/* ---- deal card (matches the incumbent's row: avatar, handle, meta, amount) */

.deal {
  display: block; width: 100%; text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 11px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}
.deal:active { transform: scale(0.995); border-color: var(--line-strong); }

.deal-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: start; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-content: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  flex: none;
}
.avatar.lg { width: 46px; height: 46px; font-size: 14px; }
.brand-mark.lg { width: 44px; height: 44px; font-size: 15px; border-radius: 13px; }

.deal-main { min-width: 0; }
.deal-name {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.005em;
  min-width: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-chip {
  flex: none;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.deal-handle { font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); margin-top: 2px; }
.deal-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }

.deal-right { text-align: right; flex: none; }
.deal-amount { font-family: var(--mono); font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-role { font-size: 10.5px; color: var(--text-faint); margin-top: 5px; }
.deal-role b { color: var(--text-dim); font-weight: 600; }

.deal-head { display: flex; align-items: center; gap: 12px; }

.deal-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.spacer { flex: 1; }

/* ---- status chips */

.chip {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 620; letter-spacing: 0.01em;
  padding: 3px 8px; border-radius: 6px;
  background: var(--bg-elev-2); color: var(--text-dim);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-amber { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.chip-blue { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.chip-green { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.chip-red { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.chip-pink { color: #f0abfc; background: color-mix(in srgb, #f0abfc 10%, transparent); border-color: color-mix(in srgb, #f0abfc 24%, transparent); }

/* ---- 3-step wizard */

.stepper { display: flex; align-items: center; gap: 4px; margin: 16px 0 22px; }
.step { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.step .dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-content: center; flex: none;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--bg-elev-2); color: var(--text-faint);
  border: 1px solid var(--line);
}
.step .lbl { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.step.on .dot { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.step.on .lbl { color: var(--text); font-weight: 600; }
.step.done .dot { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.step.done .lbl { color: var(--text-dim); }

.wiz-actions {
  position: sticky; bottom: calc(64px + var(--safe-bottom));
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 14px 0 6px; margin-top: 20px;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}

.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option small { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
.option b { font-size: 14px; font-weight: 600; }
.option.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--bg-elev)); }
.option-ico {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-content: center;
  background: var(--bg-elev-2); color: var(--text-dim);
  font-size: 14px;
}
.option.on .option-ico { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat {
  text-align: left; padding: 12px 12px 10px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cat-label { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.cat small { display: block; font-size: 10.5px; color: var(--text-faint); margin-top: 4px; font-family: var(--mono); }
.cat.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev)); }
.cat.on .cat-label { color: var(--accent); }

.row-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle {
  width: 42px; height: 25px; border-radius: 999px; flex: none;
  background: var(--bg-elev-2); border: 1px solid var(--line);
  position: relative; cursor: pointer; padding: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.toggle span {
  position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.18s ease;
}
.toggle.on { background: color-mix(in srgb, var(--accent) 28%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.toggle.on span { transform: translateX(17px); background: var(--accent); }

/* ---- wallet */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini {
  background: var(--bg-elev-2); border-radius: var(--radius-sm);
  padding: 10px 12px; display: grid; gap: 3px;
}
.mini-k { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.02em; }
.mini-v { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-v.accent { color: var(--accent); }
.mini-v.warn { color: var(--warn); }

.addr-box {
  display: grid; gap: 8px;
  background: var(--bg-elev-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; margin-top: 14px;
}
.addr-box code {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  word-break: break-all; color: var(--text);
}
.addr-box .btn { justify-self: start; }

/* ---- faq / rules */

.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; background: none; border: none;
  padding: 15px 2px; font-size: 13.5px; font-weight: 560; cursor: pointer;
  color: var(--text);
}
.faq-q .chev { color: var(--text-faint); transition: transform 0.18s ease; font-size: 16px; }
.faq-item.open .chev { transform: rotate(90deg); }
.faq-a { padding: 0 2px 16px; font-size: 13px; color: var(--text-dim); line-height: 1.55; }

.rules h3 { font-size: 13px; margin: 18px 0 6px; letter-spacing: -0.01em; }
.rules h3:first-child { margin-top: 4px; }
.rules p { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0; }

/* ---- login */

.login { display: grid; justify-items: center; text-align: center; padding-top: 48px; }
.login h1 { margin: 18px 0 6px; }
.login .lede { text-align: center; max-width: 30ch; }
.login .field { width: 100%; text-align: left; }
.input.center { text-align: center; letter-spacing: 0.22em; font-size: 19px; }

/* category label sits with the metadata so the title keeps its full width */
.cat-inline {
  display: inline-block;
  font-size: 9.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
  margin-right: 6px;
}
.deal-meta { display: flex; align-items: baseline; gap: 0; flex-wrap: wrap; }
.deal-role { font-size: 10.5px; color: var(--text-faint); }

.deal-handle { display: flex; align-items: baseline; gap: 0; }
.deal-handle .cat-inline { margin-left: 7px; }
.deal-handle .cat-inline::before {
  content: "·";
  color: var(--text-faint);
  margin-right: 7px;
  font-weight: 400;
}

/* wizard body must clear the sticky action bar */
#step-body { padding-bottom: 96px; }
.lede + .field, .lede + .mt-24 { margin-top: 18px; }
.mini-v.neutral { color: var(--text-dim); }

/* wallet */
.addr-inline {
  display: block; margin-top: 10px; padding: 10px 12px;
  background: var(--bg-elev-2); border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; word-break: break-all;
  color: var(--text-dim);
}
.mnemonic { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.mnemonic span {
  display: flex; align-items: baseline; gap: 7px;
  background: var(--bg-elev-2); border-radius: 8px; padding: 9px 11px;
  font-family: var(--mono); font-size: 12.5px;
}
.mnemonic b { color: var(--text-faint); font-size: 10px; font-weight: 500; min-width: 12px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-dim); }
.checkline input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

/* a field the server or the wizard rejected */
.field-invalid .input,
.field-invalid .textarea,
.field-invalid .select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}
.field-invalid .label { color: var(--danger); }

/* ------------------------------------------------------------- market */

.deal-card {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.deal-card:hover { border-color: var(--line-strong, var(--line)); }
.deal-card .amount {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.deal-card .amount small { font-size: 11px; color: var(--text-dim); }

.chips-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-filter {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 560;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.chip-filter.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-block { width: 100%; }
