/* NADO browser light-miner — mobile-first dark theme */
:root {
  --bg: #0b0f14;
  --bg-elev: #131a23;
  --bg-elev2: #1a232e;
  --border: #243140;
  --txt: #e6edf3;
  --txt-dim: #93a1b0;
  --txt-faint: #5d6b7a;
  --accent: #00ad93;          /* NADO brand teal (matches the logo + nadochain.com) */
  --accent-2: #00c9a7;        /* lighter teal for gradients/hover */
  --bonded: #d29922;
  --open: #3fb950;
  --danger: #f85149;
  --warn: #d29922;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  /* one shared type system across the interface + the nadochain.com site */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1100px 560px at 50% -12%, rgba(0,173,147,.10), var(--bg) 62%);
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: 0 0 64px;
  min-height: 100vh;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

header.app {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(11,15,20,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
#langSelect { max-width: 130px; margin-top: 4px; }
header.app .logo {
  width: 34px; height: 34px;
  display: block; flex: none;
  /* the real NADO torus mark (static/logo.svg) — transparent bg, its own band colors + black stroke */
}
header.app h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .2px; }
header.app .sub { font-size: 11px; color: var(--txt-dim); margin-top: 1px; }
header.app .conn { margin-left: auto; text-align: right; font-size: 11px; color: var(--txt-dim); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--txt-faint); margin-right: 5px; vertical-align: middle; }
.dot.ok { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot.bad { background: var(--danger); }
.dot.warn { background: var(--warn); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-dim); font-weight: 700; }
.card h2 .pill { float: right; text-transform: none; letter-spacing: 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.grow { flex: 1 1 auto; }

button, .btn {
  font-family: inherit; font-size: 15px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--bg-elev2); color: var(--txt);
  padding: 12px 16px; cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
/* brand-teal CTAs (match nadochain.com): dark text on a teal gradient, subtle lift on hover */
button.primary, button.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #04110a; font-weight: 800; box-shadow: 0 6px 20px rgba(0,173,147,.30); }
button.primary:hover:not(:disabled), button.accent:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0,173,147,.42); }
button.ghost { background: transparent; }
button.ghost:hover:not(:disabled) { border-color: var(--accent); }
button.danger { color: var(--danger); border-color: #4a2326; background: #1c1416; }
button.big { width: 100%; padding: 18px; font-size: 18px; font-weight: 800; border-radius: 14px; letter-spacing: .3px; }

label { display: block; font-size: 12px; color: var(--txt-dim); margin: 0 0 5px; }
input, textarea, select {
  width: 100%; font-family: var(--mono); font-size: 13px;
  background: var(--bg); color: var(--txt);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-2); }

.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.dim { color: var(--txt-dim); }
.faint { color: var(--txt-faint); }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.hidden { display: none !important; }
.break { word-break: break-all; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; }
.kv .k { color: var(--txt-dim); font-size: 12px; }
.kv .v { font-family: var(--mono); font-size: 13px; text-align: right; word-break: break-all; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stat .label { font-size: 11px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 20px; font-weight: 700; margin-top: 4px; font-family: var(--mono); }
.stat .value.sm { font-size: 15px; }
.stat[title] { cursor: help; }
.hint { color: var(--txt-faint); font-size: 10px; margin-left: 4px; cursor: help; font-weight: 700; }
.stat[title]:hover { border-color: var(--accent-2); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }
.badge.ok { background: rgba(63,185,80,.14); color: var(--accent); border-color: rgba(63,185,80,.4); }
.badge.no { background: rgba(248,81,73,.12); color: var(--danger); border-color: rgba(248,81,73,.4); }
.badge.idle { background: rgba(147,161,176,.1); color: var(--txt-dim); }

.addr-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.addr-box .a { font-family: var(--mono); font-size: 12.5px; word-break: break-all; flex: 1; }
.copy { font-size: 12px; padding: 6px 10px; flex: 0 0 auto; }

.warnbox { background: rgba(210,153,34,.1); border: 1px solid rgba(210,153,34,.4); color: #f0d488; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.warnbox.danger { background: rgba(248,81,73,.1); border-color: rgba(248,81,73,.4); color: #ffb4ae; }

/* progress */
.progress { height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; }
.progress.indet > span { width: 35%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0%{margin-left:-35%} 100%{margin-left:100%} }

/* lane split visual */
.lanes { margin-top: 6px; }
.lanebar { display: flex; height: 30px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.lanebar .open { background: linear-gradient(180deg,#3fb95040,#3fb95015); border-right: 1px solid var(--border); display: grid; place-items: center; color: var(--open); font-size: 11px; font-weight: 700; }
.lanebar .bonded { background: linear-gradient(180deg,#d2992240,#d2992215); display: grid; place-items: center; color: var(--bonded); font-size: 11px; font-weight: 700; }
.lane-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11.5px; color: var(--txt-dim); }
.lane-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.lane-legend i.open { background: var(--open); }
.lane-legend i.bonded { background: var(--bonded); }
.myshare { margin-top: 10px; font-size: 12px; color: var(--txt-dim); }

/* log */
#log { font-family: var(--mono); font-size: 12px; max-height: 260px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
#log .line { padding: 3px 0; border-bottom: 1px dashed #1c2630; white-space: pre-wrap; word-break: break-word; }
#log .line:last-child { border-bottom: none; }
#log .t { color: var(--txt-faint); }
#log .ok { color: var(--accent); }
#log .err { color: var(--danger); }
#log .info { color: var(--accent-2); }
#log .win { color: #f0d488; font-weight: 700; }

/* self-test */
#selftest .case { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-family: var(--mono); padding: 3px 0; border-bottom: 1px dashed #1c2630; }
#selftest .case .name { color: var(--txt-dim); }
#selftest .case .res.pass { color: var(--accent); }
#selftest .case .res.fail { color: var(--danger); }
.summary-line { font-weight: 700; margin: 8px 0; }

footer { text-align: center; color: var(--txt-faint); font-size: 11px; padding: 24px 0 0; }
a { color: var(--accent-2); }

/* ---- full-wallet additions ---- */

/* tab bar */
.tabbar {
  display: flex; gap: 6px; flex-wrap: wrap;   /* wrap so every tab is reachable without horizontal scroll (touchless) */
  padding: 8px; margin: 14px 0;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar .tab {
  flex: 0 0 auto; font-size: 13px; font-weight: 700;
  padding: 9px 14px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--txt-dim);
}
.tabbar .tab.active { background: var(--bg-elev2); border-color: var(--border); color: var(--txt); }

/* receive QR */
.qr-wrap { display: grid; place-items: center; padding: 10px 0 4px; }
.qr { background: #fff; border-radius: 10px; padding: 10px; max-width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }

/* transaction history */
.hist { display: flex; flex-direction: column; gap: 8px; max-height: 440px; overflow-y: auto; }
.hist .empty { color: var(--txt-faint); font-size: 12px; text-align: center; padding: 14px; }
.hist .htx { display: flex; align-items: center; gap: 10px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: help; }
.hist .htx .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; background: var(--bg); border: 1px solid var(--border); }
.hist .htx .mid { flex: 1 1 auto; min-width: 0; }
.hist .htx .tp { font-size: 13px; font-weight: 700; text-transform: capitalize; }
.hist .htx .cp { font-family: var(--mono); font-size: 11px; color: var(--txt-dim); word-break: break-all; }
.hist .htx .meta { font-size: 11px; color: var(--txt-faint); }
.hist .htx .amt { font-family: var(--mono); font-size: 13px; font-weight: 700; flex: 0 0 auto; text-align: right; white-space: nowrap; }
.hist .htx .amt.pos { color: var(--accent); }
.hist .htx .amt.neg { color: var(--danger); }
.hist .htx .amt.zero { color: var(--txt-dim); }

/* inline form-result messages */
.msg-ok { color: var(--accent); }
.msg-err { color: var(--danger); }

/* payment-request banner (reuses the .hint ⓘ convention) on the Send tab */
.hint-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,173,147,.08); border: 1px solid rgba(0,173,147,.28);
  color: var(--txt-dim); border-radius: 12px; padding: 13px 15px;
  font-size: 12.5px; line-height: 1.5; margin: 14px 0;
}
/* block-layout banners (the APY estimate + auto-bond controls) space their rows evenly */
.hint-banner[style*="block"] > * + * { margin-top: 10px; }
.hint-banner label { font-weight: 600; color: var(--txt); }
.hint-banner .hint { color: inherit; cursor: default; font-size: 12px; margin: 0; font-weight: 400; }
.hint-banner b { color: var(--txt); }
/* staged status banner state variants (registration confirmed / failed) */
.hint-banner.ok { background: rgba(63,185,80,.10); border-color: rgba(63,185,80,.4); color: #8be39a; }
.hint-banner.warn { background: rgba(248,81,73,.10); border-color: rgba(248,81,73,.4); color: #ffb4ae; }

/* inline button spinner — shown on the Start/Mine button while one-time registration is underway */
.spin {
  display: inline-block; width: 14px; height: 14px;
  margin-right: 9px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* non-blocking toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 90%; z-index: 50;
  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--txt);
  border-radius: 12px; padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow);
}
.toast.err { border-color: rgba(248,81,73,.5); color: #ffb4ae; }
.toast.ok { border-color: rgba(63,185,80,.4); color: var(--accent); }
.toast.info { border-color: rgba(47,129,247,.4); color: #9fc6ff; }

/* Social share buttons (Receive tab → Share NADO): circular brand-colored icon buttons */
.social-share { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.social-btn { width:40px; height:40px; border-radius:50%; border:none; padding:0; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; transition:transform .12s ease, filter .12s ease; }
.social-btn:hover { transform:translateY(-2px); filter:brightness(1.12); }
.social-btn:active { transform:translateY(0); }
.social-btn svg { width:20px; height:20px; fill:#fff; display:block; }
.social-btn[data-social="x"] { background:#000; }
.social-btn[data-social="telegram"] { background:#26A5E4; }
.social-btn[data-social="whatsapp"] { background:#25D366; }
.social-btn[data-social="reddit"] { background:#FF4500; }
.social-btn[data-social="facebook"] { background:#1877F2; }
.social-btn[data-social="email"] { background:#6b7280; }

/* Custom dialogs (replace native confirm/alert/prompt) — styled + translatable */
.modal-backdrop { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
  padding:20px; background:rgba(3,6,10,.66); backdrop-filter:blur(3px); animation:modalFade .14s ease; }
.modal-backdrop.hidden { display:none; }
.modal { max-width:400px; width:100%; margin:0; animation:modalPop .16s cubic-bezier(.2,.9,.3,1.15); }
.modal-title { margin:0 0 12px; font-size:16px; font-weight:700; color:var(--txt); }
.modal-body { color:var(--txt-dim); font-size:14px; margin-bottom:14px; white-space:pre-line; }
.modal-rows { display:flex; flex-direction:column; gap:9px; margin-bottom:16px; }
.modal-rows.hidden, .modal-body.hidden, .modal-warn.hidden, .modal-note.hidden, .modal-input.hidden { display:none; }
.modal-row { display:flex; justify-content:space-between; gap:14px; font-size:14px; align-items:baseline; }
.modal-row .k { color:var(--txt-dim); white-space:nowrap; }
.modal-row .v { font-family:var(--mono); text-align:right; word-break:break-all; }
.modal-warn { color:var(--warn); font-size:13px; font-weight:600; margin-bottom:14px; }
.modal-note { color:var(--txt-faint); font-size:12px; margin-bottom:14px; }
.modal-input { margin-bottom:16px; }
.modal-actions { display:flex; gap:10px; }
.modal-actions button { flex:1; }
@keyframes modalFade { from{opacity:0} to{opacity:1} }
@keyframes modalPop { from{opacity:0; transform:translateY(10px) scale(.97)} to{opacity:1; transform:none} }
