/* Labs: inbox (envelope + reader) and the Kalshi Wallets page. Uses the theme tokens from themes.css. */

/* ── Inbox ── */
.inbox #inbox-btn { position: relative; }
.inbox-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--down); color: #fff; font: 700 10.5px/18px var(--label); text-align: center;
  box-shadow: 0 0 0 2px var(--bg); animation: inbox-pop .4s cubic-bezier(.2,1.6,.4,1);
}
@keyframes inbox-pop { from { transform: scale(0); } }
.inbox-pop { width: min(360px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.inbox-head b { font-family: var(--label); letter-spacing: .12em; font-size: 12px; text-transform: uppercase; }
.inbox-head .link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; padding: 0; }
.inbox-head .link:hover { color: var(--text); }
.inbox-list { max-height: min(60vh, 420px); overflow: auto; display: flex; flex-direction: column; }
.inbox-item { position: relative; display: flex; border-bottom: 1px solid var(--line); }
.inbox-pop .inbox-open {
  flex: 1; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 12px 40px 12px 14px; border: 0; border-radius: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.inbox-pop .inbox-open:hover { background: var(--panel-2); }
.inbox-trash { position: absolute; right: 8px; bottom: 9px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid transparent;
  border-radius: 7px; background: none; color: var(--faint); cursor: pointer; opacity: .55; transition: opacity .15s, color .15s, border-color .15s; }
.inbox-item:hover .inbox-trash, .inbox-trash:focus-visible { opacity: 1; }
.inbox-trash:hover { color: var(--down); border-color: var(--line); }
.inbox-foot { border-top: 1px solid var(--line); padding: 9px 14px; text-align: center; }
.inbox-foot .link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; padding: 0; }
.inbox-foot .link:hover { color: var(--text); }
.inbox-foot:has(.link[hidden]) { display: none; }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item .inbox-emoji { font-size: 18px; line-height: 1.2; }
.inbox-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inbox-text b { font-weight: 600; font-size: 13.5px; }
.inbox-text small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.inbox-open time { color: var(--faint); font: 500 11px var(--mono); white-space: nowrap; }
.inbox-item.unread { background: var(--panel-2); }
.inbox-item.unread .inbox-text b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.inbox-empty { padding: 18px 14px; margin: 0; font-size: 13px; }
.inbox-read { width: min(620px, 100%); }
.inbox-read .inbox-emoji { font-size: 26px; }
.inbox-when { margin: -6px 0 0; font: 500 12px var(--mono); }
.inbox-body { line-height: 1.6; font-size: 14.5px; }
.inbox-body h3 { font-family: var(--display); font-size: 15px; margin: 18px 0 6px; }
.inbox-body p { margin: 0 0 12px; }
.inbox-body ul { margin: 0 0 12px; padding-left: 20px; }
.inbox-body li { margin: 4px 0; }
.inbox-body li::marker { color: var(--accent); }
.inbox-action { display: flex; justify-content: center; padding-top: 4px; border-top: 1px solid var(--line); }
.inbox-action .btn { margin-top: 14px; min-width: 200px; justify-content: center; text-align: center; text-decoration: none; }
.new-tag { font: 700 9.5px var(--label); letter-spacing: .12em; color: var(--on-accent); background: var(--accent); border-radius: 4px; padding: 2px 5px; margin-left: 6px; vertical-align: 1px; }

/* ── Wallets ── */
.wal { display: grid; gap: 16px; }
.wal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wal-head .page-title { margin: 0; }
.wal-sync { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.wal-hero { display: grid; gap: 14px; }
.wal-hero .big { font: 700 clamp(38px, 8vw, 64px)/1 var(--display); letter-spacing: -.02em; }
.wal-bar { display: flex; gap: 3px; height: 12px; border-radius: 99px; overflow: hidden; background: var(--sunken); }
.wal-bar i { display: block; min-width: 4px; transition: flex .5s ease; }
.wal-bar .general, .wal-legend .dot.general { background: color-mix(in srgb, var(--text) 70%, transparent); }
.wal-bar .crypto, .wal-legend .dot.crypto { background: var(--accent); }
.wal-bar .bets, .wal-legend .dot.bets { background: var(--warn); }
.wal-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13px; color: var(--muted); }
.wal-legend li { display: flex; align-items: baseline; gap: 8px; }
.wal-legend .dot { width: 9px; height: 9px; border-radius: 50%; align-self: center; }
.wal-legend b { color: var(--text); font: 600 15px var(--mono); }
.wal-legend small { color: var(--faint); font: 500 11px var(--mono); }
.wal-pockets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.wal-pocket { position: relative; overflow: hidden; display: grid; gap: 8px; align-content: start; }
.wal-pocket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: color-mix(in srgb, var(--text) 50%, transparent); }
.wal-pocket.crypto::before { background: var(--accent); }
.wal-pocket.crypto::after { content: ""; position: absolute; inset: auto -40px -70px auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%); pointer-events: none; }
.wal-pocket-top { display: flex; justify-content: space-between; align-items: center; }
.wal-pocket .tag { font: 700 10px var(--label); letter-spacing: .14em; color: var(--on-accent); background: var(--accent); padding: 3px 7px; border-radius: 5px; }
.wal-pocket .amt { font: 600 34px/1.05 var(--mono); }
.wal-pocket .pnote { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; max-width: 46ch; }
.wal-low { margin: 0; font-size: 12.5px; color: var(--warn); }
.wal-quick { justify-self: start; margin-top: 4px; position: relative; z-index: 1; }
.wal-move-sub { font-size: 12px; }
.wal-move form { display: grid; gap: 16px; margin-top: 14px; }
.wal-move .lbl { font: 600 10.5px var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wal-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.wal-tile { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunken); cursor: pointer; transition: border-color .15s; }
.wal-tile:hover, .wal-tile:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.wal-tile select { appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 2px center;
  border: 0; color: var(--text); font: 700 20px var(--display); padding: 0 22px 0 0; cursor: pointer; width: 100%; }
.wal-tile select option { background: var(--panel-solid); color: var(--text); font: 500 15px var(--body); }
.wal-after { display: flex; gap: 8px; align-items: baseline; font: 500 12.5px var(--mono); color: var(--muted); min-height: 1.2em; }
.wal-after b { color: var(--accent); font-weight: 600; }
.wal-after b.bad { color: var(--down); }
.wal-swap { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 18px; cursor: pointer; transition: transform .25s, border-color .15s, color .15s; }
.wal-swap:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); }
.wal-send { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 12px; align-items: end; }
.wal-amt { display: grid; gap: 6px; }
.wal-amt-box { position: relative; display: block; }
.wal-amt-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font: 600 20px var(--mono); color: var(--muted); font-style: normal; }
.wal-amt-box input { width: 100%; min-width: 0; background: var(--sunken); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px 13px 32px; font: 600 22px var(--mono); }
.wal-amt-box input:focus { outline: none; border-color: var(--accent); }
.wal-amt-box input::-webkit-outer-spin-button, .wal-amt-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wal-amt-box input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.wal-chips { display: flex; gap: 8px; }
.wal-chips .chip { border: 1px solid var(--line); background: var(--sunken); color: var(--text); border-radius: 99px; padding: 0 14px; height: 52px; font: 600 13px var(--mono); cursor: pointer; }
.wal-chips .chip:hover { border-color: var(--accent); color: var(--accent); }
.wal-go { height: 52px; padding: 0 26px; justify-content: center; font-size: 14px; white-space: nowrap; }
.wal-move .fine { margin: 0; font-size: 12.5px; color: var(--muted); }
.wal-bets { list-style: none; margin: 8px 0 0; padding: 0; }
.wal-bets li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 18px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.wal-bets li:last-child { border-bottom: 0; }
.wal-bets .mkt { font-weight: 600; }
.wal-bets .mkt small { display: block; color: var(--muted); font: 500 12px var(--mono); margin-top: 2px; }
.wal-bets .side { font: 700 11px var(--label); letter-spacing: .1em; padding: 4px 9px; border-radius: 99px; border: 1px solid currentColor; }
.wal-bets .side-yes { color: var(--up); } .wal-bets .side-no { color: var(--down); }
.wal-bets .n { font: 500 14px var(--mono); } .wal-bets .n small { color: var(--muted); font-size: 11px; }
.wal-bets b { font: 600 15px var(--mono); min-width: 64px; text-align: right; }
.wal-none { margin: 8px 0 0; }
.wal-err { border-color: var(--down); }
.wal-confirm p { margin: 0; line-height: 1.5; }
.wal-confirm .big { font: 600 30px var(--mono); }
.skel { display: inline-block; min-width: 90px; height: 1em; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2), var(--sunken), var(--panel-2)); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
@media (max-width: 900px) { .wal-send { grid-template-columns: 1fr auto; } .wal-send .wal-chips { grid-row: 2; grid-column: 1 / -1; } .wal-send .wal-go { grid-row: 1; grid-column: 2; } }
@media (max-width: 640px) {
  .inbox-pop { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
  .wal-route { grid-template-columns: 1fr; }
  .wal-swap { justify-self: center; margin: -6px 0; transform: rotate(90deg); }
  .wal-swap:hover { transform: rotate(270deg); }
  .wal-send { grid-template-columns: 1fr; }
  .wal-send .wal-chips, .wal-send .wal-go { grid-row: auto; grid-column: auto; }
  .wal-chips .chip { flex: 1; height: 40px; }
  .wal-go { width: 100%; }
  .wal-bets li { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .wal-bets .n { grid-column: 1; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) { .inbox-badge, .skel { animation: none; } }

/* ── Theme picker sections ── */
.theme-groups { display: grid; gap: 18px; }
.theme-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font: 600 11px var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.theme-group h3 em { font-style: normal; font-size: 9.5px; letter-spacing: .12em; color: var(--on-accent); background: var(--accent); padding: 2px 6px; border-radius: 4px; }
.theme-group h3 small { text-transform: none; letter-spacing: 0; font: 500 11.5px var(--body); color: var(--faint); }
