/* Screen styles: wallets group (Wallets, Transactions, Investments,
   Scheduled Transfers). Uses the tokens in app.css. */

.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

/* ---------- Wallets tab ---------- */

.wl-top { align-items: stretch; }
.wl-hero { --hero: var(--accent-fill); min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.wl-hero-row { display: flex; align-items: center; gap: 16px; }
.wl-hero-mascot { flex: none; width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; overflow: hidden; }
.wl-hero .hero-figure { word-break: break-word; }
.wl-figs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wl-figs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wl-fig-btn { border: 0; padding: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-panel); font: inherit; color: inherit; display: block; }
.wl-fig-btn .figure-card { height: 100%; }
.wl-fig-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-worth { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel), inset 0 0 0 1px var(--hair); }
.wl-worth-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.wl-worth-title { font-size: 16px; font-weight: 600; }
.wl-worth-figure { text-align: right; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.wl-all-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.wl-all-title { font-size: 17px; font-weight: 600; }
.wl-section { gap: 12px; }
.wl-sec-head { display: flex; align-items: center; gap: 6px; }
.wl-sec-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 4px 2px; border-radius: 8px; text-align: left; }
.wl-sec-toggle > .icon { color: var(--accent); }
.wl-sec-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-sec-title { font-size: 17px; font-weight: 600; min-width: 0; }
.wl-subtotal { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-chev { color: var(--text-2); display: inline-flex; transition: transform .18s; }
.wl-chev.closed { transform: rotate(-90deg); }
.wl-dim .wallet-card { opacity: .7; }
.wl-hidden > summary { font-size: 17px; }
.wl-row-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }

/* Stack (MacCardDeck) */
.wl-deck-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.wl-deck { height: auto; aspect-ratio: 85.6 / 53.98; margin-top: 24px; }
.wl-deck .wallet-card { top: 0; }
.wl-deck .wallet-card:nth-child(n+2) { cursor: pointer; }
.wl-deck-count { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.25); border-radius: 999px; padding: 3px 8px; }
.wl-dock { display: flex; gap: 8px; overflow-x: auto; padding: 6px 10px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-hair); scrollbar-width: none; }
.wl-dock::-webkit-scrollbar { display: none; }
.wl-dock-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--wc); box-shadow: 0 0 0 2.5px transparent; padding: 0; overflow: hidden; }
.wl-dock-btn img { width: 100%; height: 100%; object-fit: cover; }
.wl-dock-btn[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--accent); }
.wl-dock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Wallet / holding sheet (MacWalletWindow) */
.wd-head { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.wd-card { display: flex; flex-direction: column; gap: 6px; }
.wd-card .wallet-card { cursor: default; }
.wd-card .wallet-card:hover { transform: none; }
.wd-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; align-content: start; }
.wd-fig-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.wd-fig-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wd-fig.big .wd-fig-value { font-size: 21px; font-weight: 700; }
.wd-actions { gap: 8px; }
.wd-qr { display: flex; flex-direction: column; gap: 6px; }
.wd-qr img { width: 160px; height: 160px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; box-shadow: inset 0 0 0 1px var(--hair); }
.wd-txs { padding: 6px 14px; }
.wd-txs .tx-row { cursor: pointer; }

/* Kind pickers (New Wallet, New Investment) */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.kind-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair-2); cursor: pointer; text-align: left; color: inherit; font: inherit; font-size: 14px; font-weight: 600; }
.kind-btn:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.kind-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kind-name { display: block; }
.kind-blurb { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ---------- Investments ---------- */

.inv-note { display: flex; align-items: center; gap: 4px; }
.inv-note .icon { color: var(--accent); flex: none; }
.inv-group { gap: 10px; }
.inv-card .wc-logo .icon { color: #fff; }
.inv-history { padding: 6px 14px; }
.inv-entry { background: none; border: 0; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.inv-entry:hover .tx-title { text-decoration: underline; text-decoration-color: var(--hair-2); }

/* ---------- Transactions ---------- */

.tx-split { min-height: calc(100vh - 52px); }
.tx-page { max-width: none; width: 100%; padding-bottom: 20px; min-width: 0; }
.tx-search { flex: 0 1 320px; min-width: 0; }
.tx-search input { width: 100%; min-width: 0; }
.tx-chips[hidden] { display: none; }
.tx-table-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-panel), inset 0 0 0 1px var(--hair); background: var(--card); min-width: 0; }
.tx-wrap { max-height: calc(100vh - 250px); min-height: 260px; border-radius: 0; box-shadow: none; outline: none; }
.tx-wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ring); }
.tx-table { min-width: 720px; }
.tx-table th { padding: 0; }
.tx-table th.tx-check, .tx-table td.tx-check { width: 34px; padding: 0 4px 0 12px; }
.tx-table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent-fill); cursor: pointer; vertical-align: middle; }
.th-btn { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 8px 12px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: left; white-space: nowrap; }
.tx-table th.num .th-btn { justify-content: flex-end; }
.th-btn:hover { color: var(--text); }
.th-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.sort-mark { font-size: 9px; color: var(--accent-ink); }
.tx-table tbody tr { cursor: default; user-select: none; }
.tx-date { white-space: nowrap; width: 112px; font-variant-numeric: tabular-nums; }
.tx-desc, .tx-cat, .tx-wallet { max-width: 0; }
.tx-desc { width: 34%; }
.tx-cat { width: 22%; }
.tx-wallet { width: 18%; }
.tx-desc-in, .tx-cat-in { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tx-cat-in .cat-badge { width: 20px; height: 20px; }
.tx-wallet .truncate { display: block; }
.tx-amount { white-space: nowrap; font-family: var(--mono); font-weight: 500; }
.tx-amount.in { color: var(--income); }
.tx-amount.pending { opacity: .55; }
.tx-more { display: flex; justify-content: center; padding: 10px; }
.tx-foot { position: static; }
.tx-foot-fig strong { font-variant-numeric: tabular-nums; }
.tx-inspector { gap: 12px; }
.tx-inspector[hidden] { display: none; }
.tx-noselect { padding-top: 60px; }
.tx-noselect .icon { color: var(--text-3); }
.insp-head { display: flex; align-items: center; gap: 10px; }
.insp-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.insp-form { gap: 10px; }
.insp-inline { display: flex; gap: 6px; align-items: center; }
.insp-inline > .select, .insp-inline > .input { flex: 1; min-width: 0; }

.tx-presets { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tx-presets button { white-space: nowrap; flex: none; }

/* Filter sheet */
.tf-sec { display: flex; flex-direction: column; gap: 6px; }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }
.tf-grid .check, .tf-radios .check { font-size: 14px; min-width: 0; }
.tf-radios { display: flex; gap: 16px; flex-wrap: wrap; }
.tf-radios input { accent-color: var(--accent-fill); }

@media (max-width: 1100px) {
  .tx-wrap { max-height: 70vh; }
  .tx-split { min-height: 0; }
}
@media (max-width: 860px) {
  .wl-figs.two { grid-template-columns: minmax(0, 1fr); }
  .wd-head { grid-template-columns: minmax(0, 1fr); }
  .wd-card { max-width: 340px; }
  .tx-search { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .wl-hero-row { gap: 12px; }
  .wl-hero-mascot { width: 56px; height: 56px; }
  .wl-hero-mascot img { width: 56px !important; height: 56px !important; }
  .wl-worth { flex-wrap: wrap; }
  .wl-worth-figure { text-align: left; width: 100%; }
  .kind-grid { grid-template-columns: minmax(0, 1fr); }
}
