/* The wallet button and the agent modal. Uses the HUD's variables from style.css. */

#wallet-btn { position: fixed; right: 274px; top: 16px; height: 38px; padding: 0 12px; font-size: 20px; line-height: 1; color: var(--title); white-space: nowrap; font-variant-numeric: tabular-nums; }
#wallet-btn:hover { background: var(--hover); }
#wallet-btn .wlt-short { display: none; }
body.clean #wallet-btn { display: none; }

#wallet-btn:focus-visible, .wlt-back :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wlt-modal:focus-visible { outline: none; }

.wlt-back { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: minmax(0, 1fr); justify-items: center; align-items: center; padding: calc(24px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); background: rgba(72, 49, 41, .45); }
.wlt-back[hidden] { display: none; }

/* The scroller is .wlt-body, not the panel: a scrolling panel would clip the h2 tag hung on its frame. */
.wlt-modal { position: relative; display: flex; flex-direction: column; width: min(460px, 100%); max-height: 100%; min-height: 0; padding: 14px 14px 12px; }
.wlt-modal h2 { flex: none; margin-right: 34px; }

.wlt-x { position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; }
.wlt-x:hover { color: var(--hurt); }

.wlt-acct { flex: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-right: 26px; color: var(--muted); }
.wlt-acct[hidden] { display: none; }

.wlt-steps { flex: none; display: flex; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.wlt-steps[hidden] { display: none; }
.wlt-steps li { display: flex; flex: 1; align-items: center; gap: 6px; padding: 3px 7px; color: var(--muted); background: var(--track); border-radius: 3px; }
.wlt-steps b { font: 12px/1 "Silkscreen", "Sprout", monospace; }
.wlt-steps li.on { color: #fbecc9; background: var(--tag); }
.wlt-steps li.done { color: var(--chip-ready); }

.wlt-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; margin-top: 10px; padding: 2px; overflow-y: auto; overscroll-behavior: contain; }

.wlt-foot { flex: none; display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.wlt-btn { min-height: 38px; padding: 4px 14px; font-size: 18px; color: var(--title); background: var(--panel); border: 2px solid var(--frame); border-radius: 3px; }
.wlt-btn:hover:not(:disabled) { background: var(--hover); }
.wlt-btn:disabled { color: var(--muted); background: var(--track); border-color: var(--muted); cursor: not-allowed; }
.wlt-primary { color: #fbecc9; background: var(--tag); }
.wlt-primary:hover:not(:disabled) { color: var(--title); }

.wlt-link { padding: 0; font-size: 18px; color: var(--accent); background: none; border: 0; text-decoration: underline; }
.wlt-link:hover:not(:disabled) { color: var(--hurt); }
a.wlt-link { width: fit-content; }

.wlt-note { color: var(--muted); }
.wlt-err { padding: 6px 8px; color: #fff8e6; background: var(--hurt); border-radius: 3px; }

.wlt-wallets { display: flex; flex-direction: column; gap: 6px; }
.wlt-wallet { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; text-align: left; background: var(--panel); border: 2px solid var(--frame); border-radius: 3px; }
.wlt-wallet:hover { background: var(--hover); }
.wlt-wallet img, .wlt-noicon { flex: none; width: 28px; height: 28px; background: var(--track); border-radius: 3px; }

.wlt-label { display: block; margin-bottom: 6px; }
.wlt-input { display: block; width: 100%; height: 42px; padding: 0 10px; font-size: 20px; background: #fbf0d6; border: 2px solid var(--frame); border-radius: 3px; }
.wlt-hint { min-height: 20px; margin-top: 6px; color: var(--muted); }
.wlt-bad { color: var(--hurt); }
.wlt-good { color: var(--chip-ready); }

.wlt-cards { display: flex; flex-direction: column; gap: 6px; }
.wlt-card { position: relative; display: block; cursor: pointer; }
.wlt-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wlt-card-in { display: flex; align-items: center; gap: 10px; padding: 3px 8px 3px 3px; border: 2px solid var(--line); border-radius: 4px; }
.wlt-card:hover .wlt-card-in { background: var(--hover); }
.wlt-card input:checked + .wlt-card-in { background: var(--on); border-color: var(--frame); }
.wlt-card input:focus-visible + .wlt-card-in { outline: 2px solid var(--accent); outline-offset: 1px; }
.wlt-card-tx { display: flex; flex-direction: column; min-width: 0; color: var(--muted); }
.wlt-card-tx b { font: 16px/1.1 "Silkscreen", "Sprout", monospace; color: var(--title); }

.wlt-face { flex: none; display: block; width: 72px; height: 72px; background: var(--track); border-radius: 4px; image-rendering: pixelated; }

.wlt-summary { display: flex; align-items: center; gap: 12px; }
.wlt-rows { flex: 1; min-width: 0; }
.wlt-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.wlt-row + .wlt-row { border-top: 2px solid var(--line); }
.wlt-row span { color: var(--muted); }
.wlt-row b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlt-net { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.wlt-test { padding: 6px 8px; border: 2px dashed var(--muted); border-radius: 3px; }
.wlt-test p { margin-bottom: 4px; color: var(--muted); }
.wlt-test .wlt-btn { width: 100%; }

/* Between phone and wide desktop the slot left of #top runs into #finder, so the button sits under #brand. */
@media (min-width: 821px) and (max-width: 1140px) {
  #wallet-btn { left: 14px; right: auto; top: 122px; }
}

@media (max-width: 820px) {
  /* Under the #zoom column, which ends at about 240px. */
  #wallet-btn { top: calc(248px + env(safe-area-inset-top)); right: 8px; padding: 0 8px; font-size: 18px; }
  #wallet-btn .wlt-long { display: none; }
  #wallet-btn .wlt-short { display: inline; }
  body.clean #wallet-btn { display: none; }
  .wlt-back { padding-left: 8px; padding-right: 8px; }
  .wlt-input, .wlt-btn, .wlt-link { font-size: 18px; }
}

/* My agents */
.wlt-agents { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wlt-agent { display: flex; align-items: center; gap: 10px; width: 100%; padding: 3px 8px 3px 3px; text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; }
.wlt-agent:hover:not(:disabled) { background: var(--hover); border-color: var(--frame); }
.wlt-agent:disabled { cursor: default; opacity: .7; }
.wlt-agent-tx { display: flex; flex-direction: column; min-width: 0; color: var(--muted); }
.wlt-agent-tx b { font: 16px/1.1 "Silkscreen", "Sprout", monospace; color: var(--title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlt-face-sm { width: 44px; height: 44px; }
