/* portofel — a WALLET, dark, mobile-first: one column of balance cards, the
   money first and biggest, no chat chrome anywhere. Safe areas + dvh + 16px
   inputs throughout. Tokens follow the suite look (accent: sage, matching the
   hub card); retheme by editing :root. */

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2129;
  --border: #262c36;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #a3be8c;
  --accent-2: #7fa06b;
  --accent-ink: #10150c;
  --danger: #f85149;
  --warn: #d29922;
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#app {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input {
  font: inherit;
  font-size: 16px; /* iOS: never smaller, or focus zooms */
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

input::placeholder {
  color: var(--muted);
}

/* ---- the column ---------------------------------------------------------- */

main.wallet {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
}

header.top h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lead {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.hint.warn {
  color: var(--warn);
}

.err {
  color: var(--danger);
  font-size: 13px;
  min-height: 1em;
}

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

section.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

section.card.bank {
  cursor: pointer;
}

section.card.bank.open {
  border-color: var(--accent-2);
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-names {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.card-label {
  font-weight: 650;
  font-size: 16px;
}

.card-issuer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.chip.mine {
  color: var(--accent);
  border-color: var(--accent-2);
}

.chip.dim {
  opacity: 0.7;
}

.card-state {
  color: var(--muted);
  font-size: 14px;
}

.card-state.fail {
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* the money — the biggest thing on the screen */
.bal-amt {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bal-num {
  font-size: 34px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.bal-code {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

.outs {
  border-left: 3px solid var(--warn);
  padding: 2px 0 2px 10px;
  margin-top: 4px;
}

.outs.lock {
  border-left-color: var(--accent-2);
}

.outs-word {
  font-size: 13px;
}

.outs-warn {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.outs-final {
  color: var(--muted);
  font-size: 12px;
}

.card-act {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 18px;
}

button.primary:active {
  background: var(--accent-2);
}

button.primary:disabled {
  opacity: 0.6;
}

button.primary.big {
  width: 100%;
  padding: 13px 18px;
  font-size: 16px;
}

button.small {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
}

button.ghost,
button.small.ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--muted);
}

/* expanded-card tools */
h3.sub,
h4.sub {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hist-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}

.hist-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 5.5em;
}

.hist-amt.in {
  color: var(--accent);
}

.hist-who {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-state {
  color: var(--muted);
  font-size: 12px;
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

button.tool {
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
}

button.tool.danger {
  color: var(--danger);
}

button.tool.danger.armed {
  background: var(--danger);
  color: var(--bg);
  border-color: var(--danger);
}

.card-tools .hint {
  flex-basis: 100%;
}

/* ---- the identity chip ---------------------------------------------------- */

.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.who-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: hsl(var(--who-h, 0) 45% 26%);
  flex: none;
}

.who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10em;
}

/* ---- the send sheet -------------------------------------------------------- */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}

.sheet {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 82dvh;
  overflow-y: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet h3 {
  font-size: 17px;
}

.sheet-row {
  display: flex;
  gap: 10px;
}

.sheet-row .ghost {
  flex: none;
}

.sheet-row .primary {
  flex: 1;
}

button.payee {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
}

div.payee.off {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  opacity: 0.9;
}

.payee-name {
  font-weight: 600;
}

.payee-sub {
  color: var(--muted);
  font-size: 12px;
}

.invite-note {
  flex-basis: 100%;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex: none;
}

.dot.on {
  background: var(--accent);
}

.confirm-amt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
  padding: 8px 0;
}

.confirm-amt .bal-num {
  font-size: 40px;
}

.confirm-to,
.confirm-memo {
  text-align: center;
}

.confirm-memo {
  color: var(--muted);
  font-style: italic;
}

.confirm-issuer {
  text-align: center;
}

/* ---- adding a bank -------------------------------------------------------- */

.add-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.add-row .err {
  flex-basis: 100%;
}

.pub-name {
  font-weight: 600;
}

.pub-code {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}

.pub-banks,
.import-banks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* the hash-add banner */
section.card.banner {
  border-color: var(--accent-2);
}

/* ---- footer + toast -------------------------------------------------------- */

footer.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  z-index: 40;
  max-width: 90vw;
}

/* the vendored lang picker (.i18n-pick) styles itself (i18n/runtime) */

.ver {
  white-space: nowrap;
}

@media (min-width: 700px) {
  main.wallet {
    padding-top: 32px;
  }
}
