/* Umbra on the phone: the desktop app's colours, laid out for one thumb */
:root {
  --bg: #0f0d17;
  --panel: #171425;
  --panel-2: #1e1a30;
  --line: #2c2742;
  --text: #ece9f6;
  --muted: #9a93b3;
  --faint: #6c6588;
  --accent: #8f7bff;
  --accent-2: #b8acff;
  --accent-ink: #120f1f;
  --good: #3ecf8e;
  --warn: #f5b84a;
  --bad: #ff6b7d;
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-top);
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- header ---- */
#top {
  position: sticky; top: var(--safe-top); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(15, 13, 23, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.net { font-size: 11px; color: var(--warn); text-transform: uppercase; letter-spacing: 0.08em; }
.logo { width: 30px; height: 30px; flex: none; }
.logo.big { width: 84px; height: 84px; }
.logo-ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.logo-shade { fill: var(--accent); opacity: 0.85; }
.sync { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.sync .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--warn); vertical-align: 1px; }
.sync .dot.ok { background: var(--good); }

/* ---- content ---- */
main { padding: 16px 16px calc(96px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.splash { display: grid; place-items: center; min-height: 60vh; }
h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 0; text-wrap: balance; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero { background: linear-gradient(160deg, #221c3f 0%, var(--panel) 70%); }
.amount { font-size: 38px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; word-break: break-all; }
.amount small { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.kv span:first-child { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ---- controls ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { border-color: rgba(255, 107, 125, 0.5); color: var(--bad); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: -6px; }
input, textarea, select {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 0; }
.check input { width: 22px; min-height: 22px; height: 22px; flex: none; accent-color: var(--accent); margin-top: 1px; }

/* ---- seed ---- */
.seed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; counter-reset: w; }
.seed div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.seed div::before { counter-increment: w; content: counter(w); color: var(--faint); font-size: 11px; margin-right: 6px; }

/* ---- receive ---- */
.qr { width: min(72vw, 260px); aspect-ratio: 1; margin: 4px auto; background: #fff; border-radius: 14px; padding: 10px; }
.qr svg { width: 100%; height: 100%; display: block; }

/* ---- notes ---- */
.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--line); }
.note.warn { border-color: rgba(245, 184, 74, 0.45); background: rgba(245, 184, 74, 0.08); }
.note.err { border-color: rgba(255, 107, 125, 0.45); background: rgba(255, 107, 125, 0.08); color: #ffc2ca; }
.note.ok { border-color: rgba(62, 207, 142, 0.45); background: rgba(62, 207, 142, 0.08); }

/* ---- history ---- */
.tx { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx .what { min-width: 0; }
.tx .what div:last-child { color: var(--faint); font-size: 12px; }
.tx .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.in { color: var(--good); }
.out { color: var(--text); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--warn); margin-left: 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }

/* ---- tabs ---- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + var(--safe-bottom)); background: rgba(23, 20, 37, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
#tabs button { background: none; border: 0; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; min-height: 52px; cursor: pointer; }
#tabs button.active { color: var(--accent-2); }
#tabs svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.25s; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
