/* Pocketful: one visual system. No external fonts, scripts or images. */
:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --ink: #14262b;
  --muted: #4a5d63;
  --line: #d3dedd;
  --primary: #0b6b5c;
  --primary-hover: #08574a;
  --primary-ink: #ffffff;
  --focus: #1b4fd8;
  --ok-bg: #e4f4ec;  --ok-ink: #0c5a3d;  --ok-line: #a9d9c2;
  --err-bg: #fdecee; --err-ink: #8f1a2a;  --err-line: #eeb1ba;
  --warn-bg: #fff3d4; --warn-ink: #6a4600; --warn-line: #e7c46c;
  --info-bg: #e9eefb; --info-ink: #2a3a8a;
  --hold-bg: #fff0d1; --hold-ink: #6a4600;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 1.125rem; }
p { margin: 0; }
a { color: var(--primary); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 0; }

/* focus: always visible */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* header + navigation */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: .75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand-mark { width: 1.6rem; height: 1.6rem; border-radius: 8px; background: var(--primary); display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 5px; border-radius: 3px; background: #fff; opacity: .92; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; flex: 1 1 auto; }
.nav a { display: inline-block; padding: .4rem .75rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }
.who { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--info-bg); color: var(--info-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.who-name { font-weight: 700; }
.who-handle { color: var(--muted); font-size: .9rem; }

main { max-width: 960px; margin: 0 auto; padding: 1rem 1rem 3rem; display: grid; gap: 1rem; }
.page-title { font-size: 1.5rem; margin: .5rem 0 0; }
.page-sub { color: var(--muted); }
@media (max-width: 899px) { .two-col { display: grid; gap: 1rem; } }
@media (min-width: 900px) {
  .two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
}
.stack { display: grid; gap: 1rem; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: grid; gap: .85rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }

/* wallet */
.wallet { background: linear-gradient(160deg, #0b6b5c, #0a4f5c); color: #fff; border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .6rem; }
.wallet .eyebrow { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #d9f2ec; font-weight: 700; }
.available { font-size: clamp(2.25rem, 9vw, 3.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.wallet-secondary { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; }
.wallet-secondary div { display: flex; gap: .5rem; align-items: baseline; }
.wallet-secondary dt { color: #d9f2ec; font-size: .9rem; margin: 0; }
.wallet-secondary dd { margin: 0; font-weight: 600; font-size: 1rem; }
.wallet .held-tag dd { background: var(--hold-bg); color: var(--hold-ink); padding: .05rem .6rem; border-radius: 999px; }
.wallet-foot { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.skeleton { display: inline-block; min-width: 8rem; height: 1.2em; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,.5), rgba(255,255,255,.25)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.card .skeleton { background: linear-gradient(90deg, #e6eceb, #f4f7f6, #e6eceb); background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { scroll-behavior: auto !important; } }

/* forms */
form { display: grid; gap: .85rem; }
.field { display: grid; gap: .3rem; }
label, .label { font-weight: 600; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input:not([type]), select {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem; border: 1px solid #8ea0a4; border-radius: 10px; background: #fff; color: var(--ink); font: inherit;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.checkbox input { width: 1.25rem; height: 1.25rem; }
button { font: inherit; font-weight: 700; min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
button.primary { background: var(--primary); color: var(--primary-ink); }
button.primary:hover { background: var(--primary-hover); }
button.secondary { background: #fff; color: var(--ink); border-color: #8ea0a4; }
button.secondary:hover { background: var(--bg); }
button.danger { background: #fff; color: var(--err-ink); border-color: var(--err-line); }
button.danger:hover { background: var(--err-bg); }
button.small { min-height: 2.25rem; padding: .3rem .8rem; font-size: .9rem; }
button[disabled], button[aria-busy="true"] { opacity: .65; cursor: progress; }

/* feedback */
.notice { border-radius: 10px; padding: .6rem .8rem; border: 1px solid; font-weight: 500; display: flex; gap: .5rem; align-items: flex-start; }
.notice::before { font-weight: 800; flex: none; width: 1.2rem; text-align: center; }
.notice.error { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-line); }
.notice.error::before { content: "!"; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.notice.ok::before { content: "\2713"; }
.notice.uncertain { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.notice.uncertain::before { content: "?"; }
.notice.loading { background: var(--info-bg); color: var(--info-ink); border-color: #c5cff0; }
.notice.loading::before { content: "\2026"; }
.slot { display: grid; gap: .5rem; }
.slot:empty { display: none; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; display: grid; gap: .5rem; }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.item-main { display: grid; gap: .15rem; min-width: 0; flex: 1 1 12rem; }
.parties { font-weight: 700; }
.note { color: var(--ink); min-height: 1.3em; white-space: pre-wrap; }
.item-side { min-width: 11rem; display: grid; gap: .1rem; justify-items: end; text-align: right; }
.amount-line { display: flex; align-items: baseline; gap: .3rem; justify-content: flex-end; }
.amount { font-weight: 800; font-size: 1.1rem; }
.sign { font-weight: 800; }
.sign.in { color: var(--ok-ink); }
.sign.out { color: var(--ink); }
.meta { color: var(--muted); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip { display: inline-block; padding: .05rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--info-bg); color: var(--info-ink); }
.chip.sent { background: #eceff1; color: #25363b; }
.chip.received { background: var(--ok-bg); color: var(--ok-ink); }
.chip.private { background: #efe9f8; color: #4a2b7a; }
.chip.public { background: #e8f1f8; color: #1e4a73; }
.chip.pending, .chip.open { background: var(--warn-bg); color: var(--warn-ink); }
.chip.paid, .chip.captured { background: var(--ok-bg); color: var(--ok-ink); }
.chip.declined, .chip.cancelled, .chip.voided, .chip.expired { background: #eceff1; color: #3a4a4f; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.actions .field { min-width: 8rem; flex: 1 1 8rem; max-width: 14rem; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem 1rem; background: var(--surface); border: 1px dashed #aab9bb; border-radius: 12px; display: grid; gap: .25rem; }
.empty strong { color: var(--ink); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .25rem; }
.preview { display: grid; gap: .4rem; background: var(--bg); border-radius: 10px; padding: .75rem; }
.preview ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.preview li { display: flex; justify-content: space-between; gap: 1rem; }
.preview .share { font-weight: 700; }
.auth-card { max-width: 28rem; margin: 1rem auto; width: 100%; }
@media (max-width: 480px) {
  .item-side { justify-items: start; text-align: left; min-width: 0; }
  .amount-line { justify-content: flex-start; }
  .actions .field { max-width: none; }
}
@media (min-width: 481px) {
  .item-top { flex-wrap: nowrap; }
  .item-main { flex: 1 1 0; }
  .item-side { flex: none; width: 15rem; }
}
.nowrap { white-space: nowrap; }
