:root {
  --green: #00ec97;
  --green-d: #00c47f;
  --ink: #0b0f10;
  --bg: #f6f7f5;
  --card: #ffffff;
  --line: #e7e9e4;
  --muted: #6b7280;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "Roboto Mono", ui-monospace, monospace; }
.muted { color: var(--muted); font-size: 13px; }
b { font-weight: 700; }

/* topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; background: var(--ink); color: #fff;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green); color: var(--ink); font-size: 22px; font-weight: 800;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.brand-sub { font-size: 12px; color: #9aa3a0; }
.net { display: flex; gap: 10px; align-items: center; }
.net-name { font-size: 13px; font-weight: 600; }
.net-sub { font-size: 11px; color: #9aa3a0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(0,236,151,0.2); }

/* layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 80px; }

/* account switcher */
.accounts { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.acct {
  display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
}
.acct:hover { border-color: #cfd3cc; }
.acct.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.acct .who { font-weight: 600; font-size: 14px; }
.acct .addr { font-size: 11px; opacity: .6; }

/* balance cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.card.confidential { background: linear-gradient(160deg, #0b0f10, #14201b); color: #fff; border: none; }
.card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; background: #eef0ec; color: #555; }
.tag.green { background: rgba(0,236,151,.15); color: var(--green); }
.card-title { font-size: 14px; font-weight: 600; opacity: .85; }
.bal { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.card.confidential .bal { color: var(--green); }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }
.card.confidential .muted { color: #8ea69b; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 14px; cursor: pointer;
  font-family: inherit; transition: all .15s; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.big { padding: 15px; font-size: 15px; flex: 1; }
.btn.full { width: 100%; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.green { background: var(--green); color: var(--ink); border-color: var(--green); }
.btn.green:hover { background: var(--green-d); }
.btn.ghost { background: transparent; }
.btn.primary span, .btn.big span { font-size: 16px; }

.actions { display: flex; gap: 12px; margin: 18px 0 26px; }

/* proof */
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.proof-col { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.proof-col h3 { margin: 0 0 4px; font-size: 15px; }
.proof-box {
  margin-top: 12px; padding: 16px; border-radius: 12px; background: #f3f4f1; border: 1px dashed var(--line);
  font-size: 13px; min-height: 70px; word-break: break-all; line-height: 1.6;
}
.proof-box.mono { font-size: 12px; color: #334; }
.reveal-amt { font-size: 26px; font-weight: 800; color: var(--green-d); }
.chip-secret { display: inline-block; background: #ffe9e9; color: #c0392b; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }

/* activity */
.activity-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.activity-head h3 { margin: 0; font-size: 16px; }
.feed { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow);
}
.row .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: #eef0ec; }
.row.private .ic { background: rgba(0,236,151,.15); }
.row .main { flex: 1; }
.row .t1 { font-weight: 600; font-size: 14px; }
.row .t2 { font-size: 12px; color: var(--muted); }
.row .amt { font-weight: 700; }
.row .amt.hidden { color: #c0392b; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.txlink { color: var(--green-d); text-decoration: none; font-weight: 600; font-size: 11px; margin-left: 6px; white-space: nowrap; }
.txlink:hover { text-decoration: underline; }
.notice { background: #fff7e6; border: 1px solid #ffe0a3; color: #7a5b00; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px; line-height: 1.5; }
/* NEAR-style Main <-> Confidential account toggle */
.acctToggle { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 2px 0 18px; }
.acctToggle .atlabel { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; background: #eef0ec; border-radius: 999px; padding: 4px; }
.seg-btn { border: none; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); transition: all .15s; }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
#modeConfidential.on { background: var(--ink); color: #fff; }
.atnote { font-size: 13px; color: var(--muted); }
/* emphasize the active account's card, dim the other — mirrors NEAR showing one active account */
.card { transition: opacity .25s, filter .25s, box-shadow .2s; }
#app.mode-public .card.confidential { opacity: .5; filter: saturate(.75); }
#app.mode-public .card.public { box-shadow: 0 0 0 2px var(--ink), var(--shadow); }
#app.mode-confidential .card.public { opacity: .5; }
#app.mode-confidential .card.confidential { box-shadow: 0 0 0 2px var(--green), 0 8px 30px rgba(0,236,151,.25); }
/* primary-action emphasis follows the active account */
#app.mode-public #depositBtn { background: var(--green); color: var(--ink); border-color: var(--green); }
#app.mode-confidential #sendBtn { background: var(--ink); color: #fff; border-color: var(--ink); }
.apphead { padding: 30px 0 10px; }
.apphead h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.5px; }
.apphead a { color: var(--green-d); font-weight: 600; text-decoration: none; }
.apphead a:hover { text-decoration: underline; }

/* modals */
.modal-bg { position: fixed; inset: 0; background: rgba(11,15,16,.55); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border-radius: 20px; padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.x { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.input { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; font-family: inherit; }
.input:focus { outline: none; border-color: var(--ink); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; transition: all .15s; }
.mode:hover { border-color: #cfd3cc; }
.mode.selected { border-color: var(--green); background: rgba(0,236,151,.06); }
.mode-top { font-size: 14px; }
.mode-desc { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.modal .big { margin-top: 18px; }
.modal-note { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; min-height: 16px; }

/* toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 100; transition: transform .3s; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: #c0392b; }
.toast.ok { background: var(--green-d); }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: s 0.7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .cards, .proof { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
}
