:root {
  --bg: #0b0d0c;
  --panel: #121614;
  --panel2: #171c19;
  --line: #24302a;
  --text: #e3ece6;
  --muted: #7d8b83;
  --accent: #c4f542;
  --accent-ink: #0b0d0c;
  --ok: #5ee08a;
  --warn: #f5c542;
  --bad: #ff6b6b;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
}
header {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--accent); }
.brand span { color: var(--muted); font-weight: 400; }
.chainbar { font-family: var(--mono); font-size: 12px; color: var(--muted); flex: 1; }
.chainbar b { color: var(--text); font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ok); }
.dot.bad { background: var(--bad); }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card.narrow { max-width: 380px; margin: 80px auto; }
h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: .02em; }
h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.sub { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 200px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, code { font-family: var(--mono); font-size: 12.5px; }
.err { color: var(--bad); margin-top: 8px; min-height: 1em; }

input, select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; width: 100%;
}
.row input, .row select { width: auto; flex: 1; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 12px; resize: vertical; margin-bottom: 8px; }
#unlockForm { display: grid; gap: 8px; }
#unlockForm input { width: 100%; }

button {
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: wait; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 500; }
button.ghost:hover { border-color: var(--muted); }
button.danger { color: var(--bad); }
button.primary { padding: 8px 18px; }

.tablewrap { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel2); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr:hover td { background: #1f1610; }
td input[type=checkbox], th input[type=checkbox] { width: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.addr { font-family: var(--mono); font-size: 12.5px; }
.copy { cursor: pointer; color: var(--muted); margin-left: 6px; }
.copy:hover { color: var(--text); }
.label-edit { background: transparent; border: none; padding: 2px 0; width: 120px; }

.info { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.info div b { display: block; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.info div span { font-family: var(--mono); }

.log { font-family: var(--mono); font-size: 12px; max-height: 360px; overflow: auto; display: grid; gap: 2px; }
.log div { padding: 3px 0; border-bottom: 1px dashed #2a1f17; word-break: break-all; }
.log .t { color: var(--muted); margin-right: 8px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 18px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog p { margin: 0 0 10px; white-space: pre-line; }
#dlgFields input { margin-bottom: 8px; }
.secret { font-family: var(--mono); font-size: 12px; word-break: break-all; white-space: pre-wrap; max-height: 320px; overflow: auto; background: var(--bg); border: 1px solid var(--warn); border-radius: 6px; padding: 10px; user-select: all; }
.reveal { cursor: pointer; color: var(--muted); margin-left: 6px; font-size: 12px; }
.reveal:hover { color: var(--warn); }

#archiveBox > summary::-webkit-details-marker { display: none; }
#archiveBox > summary h2::before { content: "▸ "; color: var(--muted); }
#archiveBox[open] > summary h2::before { content: "▾ "; }
#archiveBox[open] > summary { margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 18px; font-family: var(--mono); font-weight: 600; letter-spacing: .08em; }
.tab:hover { color: var(--text); filter: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpanel { display: grid; gap: 16px; }

.subtabs .tab { padding: 8px 16px; font-size: 13px; }

#dlgMsg { max-height: 50vh; overflow: auto; }
#dlgFields select { width: 100%; margin-bottom: 8px; }
#distBtn { margin-top: 4px; }

/* disperse panel */
dialog.dist { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; display: flex; flex-direction: column; }
dialog.dist:not([open]) { display: none; }
.dist-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.dist-head h2 { margin: 0; font-size: 17px; }
.dist-head a { text-decoration: none; }
.dist-x { background: transparent; border: none; color: var(--muted); font-size: 18px; padding: 4px 6px; }
.dist-x:hover { color: var(--text); filter: none; }
.info-i { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 50%; color: var(--muted); font: 600 11px/1 var(--mono); cursor: help; }
.dist-view { padding: 4px 20px 0; overflow: auto; flex: 1; }
.dist .err { margin: 6px 20px 0; flex: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.seg button { background: transparent; color: var(--muted); border: none; border-radius: 6px; padding: 9px; font-weight: 500; }
.seg button:hover { color: var(--text); filter: none; }
.seg button.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.icon-btn { padding: 8px 10px; }
#varRange { width: 100%; accent-color: var(--accent); padding: 0; border: none; background: transparent; margin: 10px 0 2px; }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.dist-box { border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; overflow: hidden; }
.dist-box-head, .dist-box-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; color: var(--muted); }
.dist-box-head { border-bottom: 1px solid var(--line); }
.dist-box-foot { border-top: 1px solid var(--line); }
.dist-box-foot b, .dist-box-head b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.dist-rows { max-height: 260px; overflow: auto; }
.dist-rows.short { max-height: 150px; }
.dist-row { display: grid; grid-template-columns: auto 1fr 120px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #2a1f17; }
.dist-row.fund { grid-template-columns: auto 1fr auto; }
.dist-row:last-child { border-bottom: none; }
.dist-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.dist-who div:first-child { font-weight: 500; }
.badge { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 5px; padding: 0 6px; font: 600 10.5px/1.6 var(--mono); margin-left: 6px; vertical-align: 1px; }
.dist-amt { text-align: right; font-family: var(--mono); }
.dist-amt:disabled { opacity: .35; }
.dist-plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #2a1f17; font-family: var(--mono); font-size: 12.5px; }
.dist-plan-row:last-child { border-bottom: none; }
.dist-plan-row.hist { cursor: pointer; }
.dist-plan-row.hist:hover { background: #1f1610; }
.quote { padding: 6px 14px 10px; display: grid; gap: 6px; }
.quote > div:not(.q-sources):not(.muted) { display: flex; justify-content: space-between; }
.quote b { font-family: var(--mono); font-weight: 500; }
.quote .q-total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 15px; }
.quote .q-total b { color: var(--accent); font-weight: 700; }
.q-sources { border: 1px solid #2a1f17; border-radius: 8px; }
.q-sources:empty { display: none; }
.dist-go { display: block; flex: none; width: calc(100% - 40px); margin: 12px 20px 20px; padding: 13px; font-size: 15px; }
.dist-go:disabled { background: color-mix(in srgb, var(--accent) 12%, transparent); color: color-mix(in srgb, var(--accent) 45%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); cursor: not-allowed; }

/* Move ETH panel */
.move-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); margin-top: 18px; }
.move-head .tabs { border-bottom: none; }
.move-head .tab { font-size: 15px; padding: 10px 14px; }
.move-head .tab span { color: inherit; opacity: .8; }
.move-balance { margin: 0 0 14px; }
.move-big { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.move-big b { font-size: 40px; font-weight: 700; letter-spacing: -.02em; font-family: var(--mono); }
.move-big span { color: var(--muted); font-size: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .action-grid { grid-template-columns: 1fr 1fr; } }
.action { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px; font-size: 15px; font-weight: 500; }
.action svg { color: var(--muted); flex: none; }
.action:hover { border-color: var(--accent); filter: none; }
.action:hover svg { color: var(--accent); }
#actionHint { margin: 8px 0 0; }

/* archive reason tags */
.arch-tag { margin-top: 2px; }
.reason { display: inline-block; border-radius: 5px; padding: 0 6px; font: 600 10.5px/1.7 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.reason.deleted { color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 60%, transparent); }
.reason.archived { color: var(--muted); border: 1px solid var(--line); }
.seg-small { display: inline-grid; grid-template-columns: repeat(3, auto); }
.seg-small button { padding: 4px 10px; font-size: 12px; }

/* total balance */
.seg-unit { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; }
.seg-unit button { padding: 4px 12px; font-size: 12px; font-family: var(--mono); }
#balBig { cursor: pointer; user-select: none; }
#balBig b { color: var(--accent); }
#balBig:hover b { filter: brightness(1.15); }
#balAlt { margin-top: 2px; }
.bal-break { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bal-break b { color: var(--text); font-weight: 600; margin-right: 4px; }

/* click-to-copy addresses */
.copyable { cursor: copy; color: var(--accent); border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.copyable:hover { border-bottom-style: solid; }
.ext { color: var(--muted); margin-left: 6px; font-size: 12px; text-decoration: none; }
.ext:hover { color: var(--accent); text-decoration: none; }

/* fees & spend */
.seg-period { display: inline-grid; grid-template-columns: repeat(4, auto); padding: 3px; }
.seg-period button { padding: 4px 10px; font-size: 12px; }
.fee-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 760px) { .fee-top { grid-template-columns: 1fr 1fr; } }
.fee-top > div { display: grid; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.fee-top b { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.fee-main b { color: var(--accent); font-size: 22px; }
.fee-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #2a1f17; font-family: var(--mono); font-size: 12.5px; }
.fee-row:last-child { border-bottom: none; }
.fee-row b { font-weight: 500; }
.fee-recent { max-height: 280px; overflow: auto; margin-top: 6px; }

/* mint wallet picker */
.mint-pick { border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; overflow: hidden; }
.mint-pick .move-head { margin-top: 0; padding: 0 14px; background: var(--panel2); }
.mint-pick .move-head a { font-size: 13px; }
.mint-rows { max-height: 300px; }
.mint-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.mint-plan { margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); }
.mint-plan b { color: var(--text); }
.advanced { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.advanced > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.advanced[open] > summary { color: var(--text); }

/* mint amount + delay */
.mint-opts { margin: 12px 0 0; gap: 12px; }
.mint-opts label { margin-top: 0; }
.mint-opts p { margin: 4px 0 0; }

/* per-wallet mint amount */
.mint-rows .dist-row.fund { grid-template-columns: auto 1fr auto 64px; }
.mint-rows .qty { width: 64px; padding: 6px 8px; text-align: center; font-family: var(--mono); }
.mint-rows .qty::placeholder { color: var(--muted); opacity: .6; }
.mint-rows .qty.over { border-color: var(--warn); color: var(--warn); }

/* confirm mint panel */
dialog.mintdlg { width: min(520px, calc(100vw - 32px)); }
.mc-what { margin: 14px 0 12px; color: var(--muted); font-size: 13px; }
.mc-what b { color: var(--text); }
/* Small tiles in a row (as many as fit, at least 110px each), then the total as one full-width bar. */
.mc-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-card { flex: 1 1 120px; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.mc-card span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mc-card em { font-style: normal; opacity: .7; text-transform: none; letter-spacing: 0; }
.mc-card b { font-family: var(--mono); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.mc-card small { font-size: 11.5px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.mc-card.total { flex-basis: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; row-gap: 2px; padding: 13px 16px;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--panel2)), color-mix(in srgb, var(--accent) 4%, var(--panel2))); }
.mc-card.total span { grid-column: 1; grid-row: 1; }
.mc-card.total small { grid-column: 1; grid-row: 2; }
.mc-card.total b { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: 26px; text-align: right; }
.mc-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 10px; border-radius: 999px; font-size: 12px; line-height: 1.3;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.mc-pill.warn { color: var(--warn, #e0a040); background: color-mix(in srgb, #e0a040 10%, transparent); border-color: color-mix(in srgb, #e0a040 35%, var(--line)); }
.mc-more { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.mc-more summary { cursor: pointer; width: fit-content; }
.mc-more summary:hover { color: var(--text); }
.mc-more p { margin: 6px 0 0; line-height: 1.5; }
.mc-cols { display: grid; grid-template-columns: 40px 76px 104px; gap: 8px; text-align: right; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.dist-box-head .mc-cols { font-family: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.mc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #2a1f17; }
.mc-row:last-child { border-bottom: none; }
.mc-row.fail { opacity: .75; }
.mc-note { font-size: 12.5px; margin: 10px 0 0; }
.mc-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 12px 20px 20px; }
.mc-actions .dist-go { width: 100%; margin: 0; }
@media (max-width: 520px) { .mc-card { flex-basis: 96px; } .mc-card b { font-size: 16px; } .mc-card.total b { font-size: 22px; } .mc-cols { grid-template-columns: 30px 64px 92px; font-size: 12px; } }

/* profit & loss */
.pnl-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 760px) { .pnl-top { grid-template-columns: 1fr 1fr; } }
.pnl-top > div { display: grid; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pnl-top span { font-size: 12px; color: var(--muted); }
.pnl-top em { font-style: normal; opacity: .7; }
.pnl-top b { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.pnl-main b { font-size: 24px; }
.pnl-main small { font-size: 11px; color: var(--muted); }
.pnl-flows { margin-top: 12px; }
.flow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #2a1f17; font-size: 13px; flex-wrap: wrap; }
.flow:last-child { border-bottom: none; }
.flow b { font-family: var(--mono); }
.flow.untagged { background: color-mix(in srgb, var(--warn) 6%, transparent); padding: 8px 10px; border-radius: 6px; }
.flow-tags { display: flex; gap: 6px; align-items: center; }
.chip { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--muted); filter: none; }
.chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* PNL calendar */
dialog.caldlg { width: min(760px, calc(100vw - 24px)); }
.cal-tz { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; background: var(--panel2); max-width: 100%; }
.cal-month { min-width: 92px; text-align: center; font-size: 15px; }
.cal-body { padding-bottom: 18px; }
.cal-total { font-family: var(--mono); font-size: 34px; font-weight: 700; margin: 12px 0 8px; }
.cal-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.cal-bar span:first-child { background: var(--ok); }
.cal-bar span:last-child { background: var(--bad); margin-left: auto; }
.cal-wl { margin: 8px 0 14px; font-family: var(--mono); font-weight: 600; font-size: 13px; }
.cal-wl .pos { color: var(--ok); } .cal-wl .neg { color: var(--bad); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; padding-bottom: 4px; }
.cal-day { position: relative; display: grid; place-items: center; min-height: 64px; background: var(--panel2); border: 1px solid transparent; border-radius: 6px; }
.cal-day b { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.cal-d { position: absolute; top: 5px; left: 7px; font-size: 11px; color: var(--muted); }
.cal-day.up { background: color-mix(in srgb, var(--ok) 16%, var(--panel2)); }
.cal-day.up b { color: var(--ok); }
.cal-day.down { background: color-mix(in srgb, var(--bad) 18%, var(--panel2)); }
.cal-day.down b { color: var(--bad); }
.cal-day.today { border-color: var(--accent); }
.cal-day.future { opacity: .4; }
.cal-streak { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.cal-streak b { color: var(--text); }
@media (max-width: 560px) { .cal-day { min-height: 46px; } .cal-day b { font-size: 10.5px; } }

/* watch: live mints */
.live-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live-pill.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.live-pill.on .live-dot { background: var(--ok); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.watch-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.watch-card { display: grid; gap: 6px; text-align: left; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-weight: 400; }
.watch-card:hover { border-color: var(--muted); filter: none; }
.watch-card.on { border-color: var(--accent); }
.watch-card b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar.small { height: 5px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.wd-progress { margin-top: 16px; }
.wd-progress b { font-family: var(--mono); font-size: 18px; }
.wd-progress .bar { margin-top: 8px; height: 10px; }
.wd-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 760px) { .wd-stats { grid-template-columns: 1fr 1fr; } }
.wd-stats > div { display: grid; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.wd-stats span { font-size: 12px; color: var(--muted); }
.wd-stats em { font-style: normal; opacity: .7; }
.wd-stats b { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.wd-mine { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)) !important; }
.wd-mine b { color: var(--accent); font-size: 20px; }
.wd-feed { max-height: 360px; overflow: auto; }
.wd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed #2a1f17; font-size: 12.5px; }
.wd-row:last-child { border-bottom: none; }
.wd-row.mine { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; padding: 7px 8px; }
.wd-row.fresh { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--ok) 28%, transparent); } to { background: transparent; } }
.ghost-link { color: var(--muted); font-size: 13px; text-decoration: none; padding: 8px 6px; }
.ghost-link:hover { color: var(--accent); text-decoration: none; }
.wd-row a { white-space: nowrap; flex: none; }

/* watch: mint-page layout */
.mintpage { padding: 26px 28px; }
.mp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.mp-head h1 { margin: 0 0 4px; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pill-btn:hover { border-color: var(--muted); text-decoration: none; filter: none; }
.pill-btn.danger { color: var(--bad); }
.mp-minted { margin-top: 26px; }
.mp-minted > .row:first-child { font-size: 15px; }
.mp-minted b { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.mp-bar { height: 12px; border-radius: 6px; background: var(--panel2); margin: 12px 0 8px; overflow: hidden; }
.mp-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, #ffffff), var(--accent)); transition: width .6s ease; }
.mp-stage { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 22px; padding: 22px 26px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; }
.mp-stage-l { display: grid; gap: 8px; }
.mp-stage-name { font-size: 22px; letter-spacing: .02em; }
.mp-price { font-family: var(--mono); font-size: 18px; }
.mp-status { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.mp-status.live { color: var(--ok); }
.mp-status.upcoming { color: var(--warn); }
.mp-status.soldout, .mp-status.ended { color: var(--bad); }
.dot-s { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.mp-status.live .dot-s { animation: pulse 1.4s ease-in-out infinite; }
.mp-stage-r { display: grid; gap: 10px; justify-items: start; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.stepper button { background: transparent; color: var(--text); border: none; border-radius: 0; font-size: 20px; padding: 12px 18px; font-weight: 400; }
.stepper button:hover { background: var(--panel); filter: none; }
.stepper button:disabled { opacity: .3; }
.stepper input { width: 52px; border: none; background: transparent; text-align: center; font-size: 17px; font-family: var(--mono); padding: 0; }
.mp-mint { border-radius: 999px; padding: 14px 40px; font-size: 18px; font-weight: 700; }
.mp-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.mp-mini > div { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.mp-mini span { font-size: 12px; color: var(--muted); }
.mp-mini b { font-family: var(--mono); font-size: 15px; }
.mp-h { margin: 28px 0 14px; font-size: 15px; font-family: var(--mono); color: var(--text); letter-spacing: .08em; }
.timeline { position: relative; display: grid; gap: 26px; }
.tl-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 18px; align-items: start; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 34px; bottom: -26px; width: 1px; background: var(--line); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--muted); margin-top: 2px; }
.tl-item.live .tl-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.tl-item.upcoming .tl-dot { border-color: var(--warn); }
.tl-item.locked .tl-dot { border-style: dashed; }
.tl-title { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.tl-tag { font-size: 12.5px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.tl-when { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.tl-meta { margin-top: 6px; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }
.elig { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; font-weight: 600; align-self: center; }
@media (max-width: 640px) { .mintpage { padding: 18px; } .mp-head h1 { font-size: 26px; } .mp-mini { grid-template-columns: 1fr; } .tl-item { grid-template-columns: 30px 1fr; } .elig { grid-column: 2; } }

/* swap */
.sw-info { margin-top: 14px; padding: 14px 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.sw-sym { font-size: 20px; }
.sw-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.sw-facts b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.sw-side { margin-top: 14px; }
.sw-side button { padding: 11px; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.sw-side button span { font-size: 11.5px; font-weight: 400; opacity: .7; margin-left: 6px; letter-spacing: 0; }
.sw-side button[data-side="sell"].on { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chips { gap: 6px; }
.slip-custom { width: 96px !important; flex: none !important; padding: 4px 8px; font-size: 12px; }
.sw-cols, .sw-row { display: grid; grid-template-columns: 22px 1fr 90px 120px 90px; gap: 10px; align-items: center; padding: 8px 14px; }
.sw-cols { padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.sw-row { border-bottom: 1px solid #2a1f17; font-size: 13px; }
.sw-row:last-child { border-bottom: none; }
.sw-row .mono { text-align: right; font-size: 12px; }
.sw-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.sw-row .qty { padding: 6px 8px; text-align: right; font-family: var(--mono); font-size: 12px; }
.sw-quote { margin-top: 16px; }
.sw-pair { font-family: var(--mono); font-size: 13px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; padding: 3px 10px; margin-left: 8px; vertical-align: 2px; }

/* swap card (ETH ⇄ USDG) */
.swapcard { max-width: 520px; margin: 0 auto; width: 100%; padding: 22px; }
.sx-head { display: flex; justify-content: space-between; align-items: center; }
.sx-head h2 { margin: 0; font-size: 26px; }
.sx-auto { font-family: var(--mono); font-size: 14px; color: var(--text); }
.sx-auto b { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; margin-right: 6px; font-weight: 600; }
.sx-gear { background: transparent; border: none; color: var(--text); font-size: 20px; padding: 4px 6px; }
.sx-gear:hover { color: var(--accent); filter: none; }
.sx-settings { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; }
.sx-from { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; }
.sx-from select { flex: 1; }
.sx-box { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.sx-pay, .sx-recv { padding: 18px 20px; display: grid; gap: 14px; }
.sx-pay { border-bottom: 1px solid var(--line); }
.sx-top, .sx-mid, .sx-bot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sx-top .chip { padding: 5px 12px; font-size: 13px; }
.sx-amt { display: flex; align-items: baseline; font-family: var(--mono); font-size: 40px; font-weight: 500; min-width: 0; flex: 1; }
.sx-amt input { border: none; background: transparent; padding: 0; font: inherit; color: var(--text); width: 100%; min-width: 0; }
.sx-amt input:focus { border: none; }
.sx-amt input::placeholder { color: var(--muted); }
.sx-amt.out { color: var(--text); }
.sx-token { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px 8px 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.tok-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; font-weight: 700; }
.tok-ic.eth { background: #e8e8e8; color: #3a3a3a; }
.tok-ic.usdg { background: color-mix(in srgb, var(--accent) 80%, #000); color: #0b0d0c; }
.sx-units { background: transparent; border: none; color: var(--muted); font-family: var(--mono); font-size: 14px; padding: 0; font-weight: 500; }
.sx-units:hover { color: var(--text); filter: none; }
.sx-bot .muted { font-family: var(--mono); font-size: 14px; }
.sx-flip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-size: 18px; padding: 0; display: grid; place-items: center; }
/* Stay put on hover/press: the general button hover lift (translateY) would replace the centring transform, the
   button would jump away from the cursor and back again — it shook. */
.sx-flip:hover, .sx-flip:active { border-color: var(--accent); color: var(--accent); filter: none; transform: translate(-50%, -50%); }
.sx-details { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.sx-details > div { display: flex; justify-content: space-between; gap: 10px; }
.sx-details span { color: var(--muted); }
.sx-details em { font-style: normal; opacity: .7; }
.sx-details b { font-family: var(--mono); font-weight: 500; text-align: right; }
.sx-go { display: block; width: 100%; margin-top: 12px; padding: 16px; border-radius: 999px; font-size: 18px; font-weight: 700; }
.sx-go:disabled { background: color-mix(in srgb, var(--accent) 12%, transparent); color: color-mix(in srgb, var(--accent) 45%, transparent); border-color: color-mix(in srgb, var(--accent) 22%, transparent); cursor: not-allowed; }
.sx-foot { text-align: center; margin: 12px 0 0; }

/* ---------- completion notifications ---------- */
.bell { padding: 6px 9px; display: inline-flex; align-items: center; color: var(--muted); }
.bell.on { color: var(--accent); border-color: var(--accent); }
#toasts { position: fixed; top: 64px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: toastIn .25s ease-out; transition: opacity .5s, transform .5s; font-size: 13px; }
.toast b { color: var(--text); }
.toast span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- sales PnL ---------- */
.sales-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.sales-tiles > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.sales-tiles span { font-size: 12px; color: var(--muted); }
.sales-tiles b { font-family: var(--mono); font-size: 18px; }
.sales-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.sales-col { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 640px) { .sales-tiles { grid-template-columns: 1fr 1fr; } }

/* ---------- mint presets ---------- */
.preset-row { gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.preset-row select { min-width: 200px; max-width: 100%; }

/* ---------- claim offers ---------- */
#offerCard { margin-top: 16px; }
.offer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 12px; }
.offer-grid label, #offerCard .check-row { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.offer-grid select, .offer-grid input { width: 100%; }
#offerCard .check-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--text); font-size: 13px; }
.offer-quote { margin-top: 14px; }
.offer-quote .oq-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.offer-quote .oq-tiles > div { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.offer-quote .oq-tiles span { font-size: 12px; color: var(--muted); }
.offer-quote .oq-tiles b { font-family: var(--mono); font-size: 16px; }
.offer-quote table { width: 100%; margin-top: 10px; font-size: 13px; }
.os-key { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .offer-grid, .offer-quote .oq-tiles { grid-template-columns: 1fr 1fr; } }

.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.preset-chips:empty { display: none; }
.preset-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel2); }
.preset-chip.on { border-color: var(--accent); }
.preset-chip button { background: none; border: 0; color: var(--text); font: inherit; font-size: 13px; padding: 5px 10px; cursor: pointer; }
.preset-chip .pc-load:hover { color: var(--accent); }
.preset-chip .pc-del { color: var(--muted); padding: 5px 10px 5px 4px; font-size: 15px; line-height: 1; }
.preset-chip .pc-del:hover { color: var(--bad); }

.cal-x { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-family: var(--mono); font-size: 13px; color: var(--accent); text-decoration: none; }
.cal-x:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-xrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cal-xrow .cal-x { margin-top: 0; }
.cal-xbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--line); }
.cal-xbtn:hover { color: var(--text); border-color: var(--accent); }
.cal-xedit { display: inline-flex; gap: 6px; align-items: center; }
.cal-xedit input { width: 170px; font-family: var(--mono); font-size: 12.5px; padding: 6px 9px; }
.cal-xedit button { padding: 6px 10px; font-size: 12px; }

/* Total spent and gas fees are money out: red */
#feeTotal, #feeGas { color: var(--bad); }

/* ---------- fit any screen ---------- */
/* Grid children default to their content's width; let them shrink to the screen instead. */
main, .tabpanel { grid-template-columns: minmax(0, 1fr); }
main > *, .tabpanel > *, .card > *, .sub > * { min-width: 0; }
html, body { overflow-x: clip; }   /* clip, not hidden: keeps the sticky header and contract bar working */
img, svg, video { max-width: 100%; }
/* Tab bars scroll sideways instead of pushing the page wider. */
.tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 480px) {
  .tabs .tab { padding-left: 10px; padding-right: 10px; letter-spacing: .04em; }
  main { padding: 14px 12px 48px; }
  .card { padding: 14px; }
}
@media (max-width: 560px) {
  /* Header: one tidy line — brand, chain status (trimmed), bell, Lock. */
  header { gap: 8px; padding: 10px 12px; }
  .brand { font-size: 15px; flex-shrink: 0; }
  .chainbar { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  header button { flex-shrink: 0; }
  /* Tables: tighter cells; the wallet list drops the Nonce column so ETH stays in view. */
  th, td { padding: 6px 6px; font-size: 13px; }
  .tablewrap th:nth-child(5), .tablewrap td:nth-child(5) { display: none; }
  .tablewrap td:nth-child(3) .key, .tablewrap td:nth-child(3) a + a { font-size: 11px; }
}
@media (max-width: 480px) {
  /* Swap: "Pay with" and the % chips stay on one row */
  .sx-top { gap: 6px; }
  .sx-top > .muted { white-space: nowrap; flex-shrink: 0; }
  #sxPct { flex-wrap: nowrap; gap: 4px; }
  #sxPct .chip { padding: 4px 8px; font-size: 12px; }
  #sxWallet { min-width: 0; text-overflow: ellipsis; }
}

/* ---------- market ---------- */
.list-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 760px) { .list-grid { grid-template-columns: 1fr 1fr; } }
.ml-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ml-row input { width: auto; }
.st-active { color: var(--ok); } .st-sold { color: var(--accent); } .st-cancelled, .st-expired { color: var(--muted); }

/* Make the OpenSea key link easy to spot */
#mkKeyState .os-key { color: var(--accent); font-weight: 600; }
#mkKeyState .warn + .os-key, #mkKeyState .os-key#osKeyEdit { border: 1px solid var(--accent); border-radius: 6px; padding: 2px 8px; text-decoration: none; }

/* OpenSea mint confirm: live-stage banner */
.mc-stage { display: block; padding: 11px 13px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); font-size: 14px; line-height: 1.5; }   /* one flowing sentence */
.mc-stage-dot { display: inline-block; vertical-align: middle; margin: -2px 8px 0 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(94,224,138,.15); }
.mc-free { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 3px 9px; }
/* Choose wallets & amounts (Market buy / list) */
#buyPerRows, #listPerRows { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
#buyPerRows .dist-row.fund, #listPerRows .dist-row.fund { grid-template-columns: 1fr auto 64px auto; }
#buyPerRows .qty, #listPerRows .qty { width: 64px; padding: 6px 8px; text-align: center; font-family: var(--mono); }
#buyPerRows .qty:disabled, #listPerRows .qty:disabled { opacity: .35; }
#buyPerRows input[type=checkbox], #listPerRows input[type=checkbox] { width: auto; }
.buy-per { margin-top: 10px; }
.buy-per summary { cursor: pointer; }
#offerCard .check-row input[type=checkbox] { width: auto; margin: 0; }

/* Repeat Mint via OpenSea */
.os-repeat { display: grid; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.os-repeat .check-row { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.os-repeat .check-row input { width: auto; margin: 0; }
.os-repeat-opts { display: flex; flex-wrap: wrap; gap: 12px; }
.os-repeat-opts label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.os-repeat-opts input { width: 110px; }
#osLoopState { font-family: var(--mono); }

/* Confirm listing */
.lc-fees { margin: 10px 0 12px; font-size: 13px; }
.lc-fee { display: inline-block; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin: 2px 2px 0 0; }

.lq-tiles { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .lq-tiles { grid-template-columns: 1fr 1fr; } }
.lc-gas { margin-top: 8px; }

/* Buy: floor + price levels */
.buy-floor { margin-top: 8px; font-size: 13px; }
.price-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.price-levels .chip { font-family: var(--mono); font-size: 12px; }
.buy-grid { grid-template-columns: 1.4fr 1fr 1.4fr 1fr; }
@media (max-width: 760px) { .buy-grid { grid-template-columns: 1fr 1fr; } }

.repeat-plan { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }

#salesCard .sales-tiles { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { #salesCard .sales-tiles { grid-template-columns: 1fr 1fr; } }

.price-range { display: flex; align-items: center; gap: 6px; }
.price-range input { flex: 1; min-width: 0; }
.range-to { font-size: 12px; }
/* swap: asset pickers (ETH / WETH / USDG) */
select.sx-pick { width: auto; padding: 8px 14px; background: var(--panel2); color: var(--text); cursor: pointer; }

/* ===== MINT · MARKET (merged tab): shared contract bar + simple action cards ===== */
.ca-bar {
  position: sticky; top: 58px; z-index: 4;
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, #1d150f, var(--panel));
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.ca-bar.set { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ca-row { display: flex; gap: 10px; align-items: center; }
.ca-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--accent); font-size: 16px; }
.ca-bar.set .ca-ic { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#caShared { flex: 1; min-width: 0; font-size: 14px; padding: 11px 14px; border-radius: 10px; background: var(--bg); }
#caShared:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#caClear { flex: none; }
.ca-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-left: 48px; min-height: 18px; }
.ca-meta .mono { font-size: 11.5px; color: var(--muted); }

.mm-card { border-radius: 14px; padding: 20px; }
.mm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-head h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.mm-head .muted { flex-basis: 100%; margin-left: 42px; margin-top: -4px; }
@media (min-width: 640px) { .mm-head .muted { flex-basis: auto; margin: 0; } }
.mm-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-weight: 800; font-size: 15px; color: #0b0d0c; }
.mm-ic.mint { background: var(--accent); }
.mm-ic.buy { background: #7cc6ff; }
.mm-ic.list { background: #ffb86b; }
.mm-ic.offer { background: #b79bff; }
#tab-mint .row.between + .row, #tab-mint .mm-card > .row:first-of-type { margin-top: 4px; }
button.big { padding: 11px 26px; font-size: 15px; border-radius: 10px; min-width: 140px; }
#tab-mint .offer-grid label { margin-top: 12px; }
#tab-mint .buy-per { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel2); }
#tab-mint .buy-per summary { list-style: none; }
#tab-mint .buy-per summary::-webkit-details-marker { display: none; }
#tab-mint .buy-per summary::before { content: "▸ "; color: var(--muted); }
#tab-mint .buy-per[open] summary::before { content: "▾ "; }
.buy-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); column-gap: 12px; }
.buy-grid .muted.small { display: block; margin-top: 4px; }

@media (max-width: 560px) {
  .ca-bar { top: 52px; padding: 12px; }
  .ca-ic { display: none; }
  .ca-meta { padding-left: 0; }
  .mm-card { padding: 16px; }
  .mm-head .muted { margin-left: 0; }
  #tab-mint .row > button { flex: 1 1 auto; }
  button.big { width: 100%; }
}
@media (max-width: 560px) {
  .price-levels { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .price-levels .chip { flex: none; }
  #caShared { font-size: 12.5px; }
}

/* ---- Rare NFTs ---- */
.mm-ic.rare { background: #ffd84d; }
.rare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.rare-item { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.rare-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rare-item img, .rare-item .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg); display: block; }
.rare-item .noimg { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.rare-item .ri-body { padding: 8px 10px 10px; display: grid; gap: 3px; font-size: 12.5px; }
.rare-item .ri-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.rare-item .ri-rank { font: 700 12px var(--mono); color: #ffd84d; }
.rare-item .ri-trait { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rare-item .ri-check { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; accent-color: var(--accent); }
.rare-item .ri-badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); color: #ffd84d; border-radius: 999px; padding: 2px 8px; font: 700 11px var(--mono); }
.rare-item.listed { opacity: .55; cursor: default; }
.rare-actions { margin-top: 12px; gap: 8px; position: sticky; bottom: 0; background: var(--panel); padding: 10px 0 2px; }

/* ---- Your listings: per-row cancel, multi-select, cancel all ---- */
.ml-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); overflow: hidden; }
.ml-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; }
.ml-head .mp-h { margin: 0; }
.ml-summary { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }
.ml-summary b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.ml-refresh { background: transparent; border: none; color: var(--accent); font: 600 12px var(--mono); padding: 2px 4px; letter-spacing: .04em; }
.ml-refresh:hover { filter: brightness(1.15); }
.ml-refresh:disabled { opacity: .5; }
.ml-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.ml-all { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text); cursor: pointer; white-space: nowrap; min-width: 100px; }
.ml-all input, .ml-cb input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.ml-filter { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.ml-filter button { background: transparent; border: none; color: var(--muted); padding: 4px 10px; font-size: 12px; font-weight: 500; border-radius: 5px; }
.ml-filter button b { font: 500 11px var(--mono); margin-left: 4px; opacity: .8; }
.ml-filter button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.ml-filter button:hover { filter: none; color: var(--text); }
.ml-search { width: 220px; max-width: 100%; padding: 6px 10px; font-size: 12.5px; }
.ml-spacer { flex: 1; }
.ml-bar button.ghost.danger:not(:disabled) { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.ml-cancel-all { background: var(--bad); border: 1px solid var(--bad); color: #1a0606; font-weight: 600; }
.ml-cancel-all:disabled, .ml-bar button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.ml-list { max-height: 460px; overflow: auto; }
.ml-item { display: grid; grid-template-columns: 22px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr) 104px 72px; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: default; transition: background .12s; }
.ml-item:last-child { border-bottom: none; }
.ml-item:has([data-pick]) { cursor: pointer; }
.ml-item:hover { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.ml-item.is-sel { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.ml-item.is-busy { opacity: .6; }
.ml-item.is-closed { opacity: .65; }
.ml-nft, .ml-price, .ml-exp { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ml-nft b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-id { font-family: var(--mono); color: var(--accent); font-weight: 500; }
.ml-wallet { font: 11.5px var(--mono); color: var(--muted); }
.ml-price b { font: 500 12.5px var(--mono); }
.ml-price span, .ml-exp span { font-size: 11.5px; color: var(--muted); }
.ml-exp b { font-weight: 500; font-size: 12.5px; }
.ml-pill { justify-self: start; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.ml-active { color: var(--ok); }
.ml-cancelling { color: var(--warn); animation: ml-pulse 1.2s ease-in-out infinite; }
.ml-sold { color: var(--accent); }
.ml-cancelled, .ml-expired { color: var(--muted); }
.ml-moved { color: var(--warn); }
@keyframes ml-pulse { 50% { opacity: .45; } }
.ml-act { justify-self: end; }
.ml-x { background: transparent; border: 1px solid var(--line); color: var(--bad); padding: 5px 10px; font-size: 12px; font-weight: 500; border-radius: 6px; opacity: .75; }
.ml-item:hover .ml-x { opacity: 1; border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.ml-x:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); filter: none; }
.ml-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.ml-note { margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .ml-item { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "cb nft act" ". price pill" ". exp exp"; row-gap: 6px; }
  .ml-cb { grid-area: cb; } .ml-nft { grid-area: nft; } .ml-price { grid-area: price; } .ml-exp { grid-area: exp; } .ml-pill { grid-area: pill; justify-self: end; } .ml-act { grid-area: act; }
  .ml-search { width: 100%; order: 5; }
  .ml-spacer { display: none; }
}

/* ---- DUST folder + Send NFTs ---- */
.action-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .action-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .action-grid { grid-template-columns: 1fr 1fr; } }
#distDir { grid-template-columns: repeat(4, 1fr); }
.dust-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; margin: 0; border: 1px solid var(--line); border-bottom: none; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, var(--panel2)), var(--panel2)); }
.dust-intro { display: flex; flex-direction: column; gap: 2px; min-width: 220px; flex: 1; }
.dust-intro b { font-family: var(--mono); letter-spacing: .06em; color: var(--accent); }
.dust-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dust-create { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--text); white-space: nowrap; }
.dust-create input, .ns-create input, .ns-per input { width: 64px; padding: 5px 8px; text-align: center; }
dialog.nftdlg { width: min(620px, calc(100vw - 32px)); }
.ns-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ns-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font: 600 11px/1 var(--mono); }
.ns-seg { grid-template-columns: repeat(5, 1fr); margin-top: 8px; }
.ns-seg button { padding: 7px 4px; font-size: 13px; }
.ns-create { font-size: 12.5px; gap: 10px; }
.ns-create span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ns-how { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.ns-mode { grid-template-columns: 1fr 1fr; flex: 1; min-width: 260px; }
.ns-mode button { padding: 7px 10px; font-size: 13px; }
.ns-per { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--text); white-space: nowrap; }
.ns-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12.5px; color: var(--text); cursor: pointer; }
.ns-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.dist-row .ns-hold { font: 500 12.5px var(--mono); text-align: right; }
.dist-row .ns-hold small { display: block; font: 11px var(--mono); color: var(--warn); }
.ns-quote { margin: 16px 0 4px; }
.ns-quote:empty { display: none; }
.ns-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ns-card { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ns-card span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ns-card b { font: 600 17px var(--mono); }
.ns-card small { font-size: 11.5px; color: var(--muted); }
.ns-warn { margin: 8px 0 0; font-size: 12.5px; color: var(--warn); }
.ns-plan { margin-top: 10px; }
.ns-plan summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.ns-plan .tablewrap { max-height: 220px; margin: 8px 0 0; }
.ns-jobhead { margin: 6px 0 10px; font-size: 13.5px; }
.ns-bar { display: flex; height: 6px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.ns-bar span { display: block; height: 100%; transition: width .3s; }
#nsBarOk { background: var(--ok); } #nsBarBad { background: var(--bad); }
.ns-jobrows { margin-top: 12px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ns-jobrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ns-jobrow:last-child { border-bottom: none; }
.ns-jobrow .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-st { font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; justify-self: end; }
.ns-st.queued { color: var(--muted); } .ns-st.sent { color: var(--warn); } .ns-st.confirmed { color: var(--ok); }
.ns-st.failed, .ns-st.reverted { color: var(--bad); } .ns-st.skipped { color: var(--muted); }
@media (max-width: 560px) { .ns-cards { grid-template-columns: 1fr 1fr; } .ns-seg { grid-template-columns: repeat(3, 1fr); } .ns-jobrow { grid-template-columns: 1fr auto; } }
.ns-pad { padding: 10px 14px; margin: 0; }
.ns-jobrow > span:first-child { white-space: normal; }

/* wallet range picker (1-15, 20-30 …) */
.range-pick { display: inline-flex; align-items: center; gap: 6px; }
.range-pick input { width: 150px; padding: 5px 8px; font-family: var(--mono); font-size: 12.5px; }
.range-pick button { padding: 5px 10px; font-size: 12.5px; }
.range-pick input, .range-pick input:-webkit-autofill { background: var(--bg) !important; color: var(--text) !important; -webkit-text-fill-color: var(--text); border: 1px solid var(--line); box-shadow: 0 0 0 40px var(--bg) inset; }
.range-pick input:focus { border-color: var(--accent); }
.range-pick input::-webkit-calendar-picker-indicator { filter: invert(.7); }

/* PNL card (click a day on the PNL calendar) */
.cal-day.has { cursor: pointer; transition: border-color .12s, transform .12s; }
.cal-day.has:hover, .cal-day.has:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-1px); }
dialog.pnlcarddlg { width: min(820px, calc(100vw - 24px)); }
.pnlcard-body { padding-bottom: 16px; }
.pnlcard-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); }


/* Fox MINT fonts (served from public/fonts — the page only loads fonts from itself) */
@font-face { font-family: "Unbounded"; src: url("fonts/unbounded-latin-800-normal.woff2?v=af06207654d4") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-500-normal.woff2?v=f674168ce155") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-700-normal.woff2?v=2731c236f3a1") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-500-normal.woff2?v=4765dee1c0be") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-700-normal.woff2?v=ed8b8f71b22b") format("woff2"); font-weight: 700; font-display: swap; }
/* Fox MINT logo */
.brand { display: inline-flex; align-items: center; gap: 7px; font-family: "Unbounded", var(--mono); font-weight: 800; letter-spacing: .3px; color: var(--accent); }
.brand b { color: var(--text); font-weight: 800; }
.brand-fox { width: 1.45em; height: 1.45em; flex-shrink: 0; }
/* PNL card dialog */
.pnlcarddlg h2 { font-family: "Space Grotesk", inherit; letter-spacing: .2px; }
.pnlcard-canvas { border: 0; border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
