/* The HTML5 [hidden] attribute is supposed to set display:none, but our
   own rules use display: flex / grid / inline-block which silently win
   on specificity. Force it once globally so toggling .hidden actually
   hides the element regardless of which class it carries. */
[hidden] { display: none !important; }

:root {
  color-scheme: dark;
  --bg: #0c0a14;
  --card: #16132580;
  --card-strong: #1b1730;
  --border: #2f2647;
  --border-strong: #423764;
  --text: #fff3d8;
  --muted: #b6a98a;
  --accent: #fbc02d;          /* Dogecoin gold */
  --accent-strong: #ffd23f;   /* brighter pop gold */
  --accent-bark: #c2a633;     /* dark gold (the original Dogecoin spec colour) */
  --doge-tongue: #ff6f9b;     /* Shiba tongue pink for tiny pops */
  --success: #6ee7b7;
  --error: #fb7185;

  --display-font: "Comic Neue", "Comic Sans MS", "Chalkboard SE", "Marker Felt", system-ui, sans-serif;
  --body-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  /* Prevent any rogue overflow from causing horizontal sway on mobile. */
  overflow-x: clip;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  background-color: var(--bg);
}

/* Fixed doge collage backdrop, heavily darkened so cards stay readable.
   Pseudo-element so it can sit behind everything and respect background-attachment
   on mobile (where iOS Safari ignores fixed attachment on background-image). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% -10%, rgba(42, 31, 77, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(58, 32, 86, 0.40) 0%, transparent 45%),
    linear-gradient(180deg, rgba(12, 10, 20, 0.78) 0%, rgba(12, 10, 20, 0.85) 100%),
    url("./bg.png") center / cover no-repeat,
    var(--bg);
  pointer-events: none;
}

a { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
header > div:first-child { min-width: 0; flex: 1 1 260px; }

header h1 {
  margin: 0 0 6px;
  font-size: 2.1rem;
  letter-spacing: 0.005em;
  font-family: var(--display-font);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 55%, #fff3d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
  filter: drop-shadow(0 2px 6px rgba(251, 192, 45, 0.25));
}
header > div > p {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.wow-badge {
  display: inline-block;
  font-family: var(--display-font);
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1430;
  background: linear-gradient(135deg, var(--doge-tongue) 0%, var(--accent-strong) 100%);
  padding: 2px 9px;
  border-radius: 999px;
  transform: rotate(-6deg) translateY(-6px);
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 4px 12px rgba(255, 111, 155, 0.35);
  -webkit-text-fill-color: #1a1430;
  background-clip: padding-box;
}

.muted { color: var(--muted); margin: 0; }
.small { font-size: 0.85rem; }
.label { color: var(--muted); margin-right: 6px; font-size: 0.85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  backdrop-filter: blur(8px);
  box-shadow:
    0 1px 0 rgba(251, 192, 45, 0.06) inset,
    0 18px 40px -16px rgba(0, 0, 0, 0.6);
}

.card.center { text-align: center; }

.card h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}
.such-much {
  display: inline-block;
  font-family: var(--display-font);
  font-weight: 700;
  color: var(--doge-tongue) !important;
  margin-left: 6px;
  transform: rotate(-3deg);
  vertical-align: middle;
}

/* ---- Wallet pill ----- */
.wallet-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

/* Connected-wallet status card that lives inside the header. Compact, with a
   live-dot, monospace short address, native balance, and network name. */
.wallet-status {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(42, 31, 77, 0.55) 0%, rgba(28, 23, 54, 0.7) 100%);
  border: 1px solid rgba(251, 192, 45, 0.32);
  box-shadow:
    0 1px 0 rgba(255, 220, 100, 0.12) inset,
    0 6px 18px rgba(0, 0, 0, 0.35);
  min-width: 0;
  max-width: 100%;
  font-family: var(--body-font);
  line-height: 1.25;
}
.wallet-status[hidden] { display: none !important; }

.wallet-status-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wallet-status-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  padding-left: 16px;
}

.wallet-status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.18);
}

.wallet-status-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.wallet-status-balance {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.wallet-status-sep { color: var(--border-strong); }
.wallet-status-chain {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.wallet-status-disconnect {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wallet-status-disconnect:hover {
  background: rgba(251, 192, 45, 0.12);
  color: var(--accent-strong);
  box-shadow: none;
}

button {
  background: var(--accent);
  color: #1a1430;
  border: none;
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 120ms ease, transform 60ms ease, opacity 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 0 rgba(255, 220, 100, 0.4) inset, 0 6px 14px rgba(251, 192, 45, 0.15);
}
button:hover {
  background: var(--accent-strong);
  box-shadow: 0 1px 0 rgba(255, 230, 130, 0.6) inset, 0 8px 20px rgba(255, 210, 60, 0.32);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

button.primary {
  padding: 12px 22px;
  font-size: 1.05rem;
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
}
button.primary:hover {
  background: linear-gradient(180deg, #ffe066 0%, var(--accent-strong) 100%);
}

/* SVG-based sparkles flanking the Print token CTA only. We use an inline
   <svg> via data: URI so the decoration renders identically across systems
   without depending on an emoji font being installed. */
#deployBtn::before,
#deployBtn::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a1430'><path d='M12 0l2.5 8.5L23 11l-8.5 2.5L12 22l-2.5-8.5L1 11l8.5-2.5z'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.85;
  vertical-align: -2px;
}
#deployBtn::before { margin-right: 8px; }
#deployBtn::after  { margin-left: 8px; }

button.connected { background: #2a2542; color: var(--text); }
button.connected:hover { background: #3a3358; }

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 9px 14px;
  font-weight: 500;
}
button.ghost:hover { background: rgba(233, 208, 184, 0.08); }
button.ghost.small { padding: 4px 9px; font-size: 0.8rem; }

a.ghost {
  display: inline-block;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
}
a.ghost.small { font-size: 0.8rem; padding: 4px 9px; }
a.ghost:hover { background: rgba(233, 208, 184, 0.08); }

/* Faucet pill in the header — sized to align with the Connect Wallet primary
   so the two read as a matched pair, but ghost-styled so it doesn't compete
   for attention with the primary CTA. */
a.ghost.faucet-btn {
  font-size: 0.92rem;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid rgba(251, 192, 45, 0.4);
  color: var(--accent);
  background: rgba(251, 192, 45, 0.06);
  white-space: nowrap;
}
a.ghost.faucet-btn:hover {
  background: rgba(251, 192, 45, 0.14);
  border-color: rgba(251, 192, 45, 0.7);
}

button[hidden], section[hidden] { display: none !important; }

/* ---- MetaMask deep-link button (mobile no-wallet path) ----- */
a.mm-deeplink-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 12px 18px;
  font-size: 1.05rem;
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 9px;
  color: #1a1430;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
  box-shadow: 0 1px 0 rgba(255, 220, 100, 0.4) inset, 0 6px 14px rgba(251, 192, 45, 0.18);
  white-space: nowrap;
}
a.mm-deeplink-btn[hidden] { display: none !important; }
a.mm-deeplink-btn:hover {
  background: linear-gradient(180deg, #ffe066 0%, var(--accent-strong) 100%);
  color: #1a1430;
}

/* ---- No-wallet modal (mobile install prompt) ----- */
.no-wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  pointer-events: none;
}
.no-wallet-modal[hidden] { display: none !important; }
.no-wallet-modal.open { pointer-events: auto; }

.no-wallet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 18, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease;
}
.no-wallet-modal.open .no-wallet-backdrop { opacity: 1; }

.no-wallet-sheet {
  position: relative;
  width: min(480px, 100%);
  background: linear-gradient(180deg, #1c1733 0%, #14112a 100%);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px 18px 14px 14px;
  padding: 22px 22px 28px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(251,192,45,0.12);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.18,1.1,.35,1), opacity 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.no-wallet-modal.open .no-wallet-sheet {
  transform: translateY(0);
  opacity: 1;
}

.no-wallet-sheet h3 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.15rem;
  color: var(--accent);
}
.no-wallet-sheet p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.no-wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.no-wallet-actions a,
.no-wallet-actions button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--display-font);
  font-weight: 700;
}
.no-wallet-actions .nw-primary {
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #1a1430;
  border: none;
  box-shadow: 0 4px 14px rgba(251,192,45,0.25);
}
.no-wallet-actions .nw-primary:hover {
  background: linear-gradient(180deg, #ffe066 0%, var(--accent-strong) 100%);
}
.no-wallet-actions .nw-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
}
.no-wallet-actions .nw-secondary:hover { background: rgba(255,255,255,0.05); }

/* ---- Tabs ----- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 2px;
  margin-bottom: 4px;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); background: transparent; }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 18px rgba(251, 192, 45, 0.35);
}
.tab-panel { display: flex; flex-direction: column; gap: 18px; }
.tab-panel[hidden] { display: none; }

/* ---- Tokens-tab filter row ----- */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
#tokensSearch {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* ---- Tokens list ----- */
.tokens-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tokens-list li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.tokens-list .token-meta { min-width: 0; }
.tokens-list .token-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  flex-wrap: wrap;
}
.tokens-list .token-symbol-tag {
  color: var(--muted);
  font-size: 0.85rem;
}
.tokens-list .token-stats {
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.tokens-list .token-addr {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.tokens-list .token-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tokens-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

/* ---- Mint tab ----- */
/* Mint tab — search + pagination controls */
.mint-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.mint-search {
  flex: 1 1 220px;
  position: relative;
  min-width: 0;
}
.mint-search input[type="search"] {
  width: 100%;
  padding: 10px 32px 10px 12px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--body-font);
  appearance: none;
  -webkit-appearance: none;
}
.mint-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.mint-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251, 192, 45, 0.18);
}
.mint-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px 4px;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 8px;
}
.mint-pagesize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mint-pagesize select {
  padding: 6px 8px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--body-font);
}
.mint-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.mint-pagination button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.mint-page-info {
  font-family: var(--body-font);
  color: var(--muted);
  font-size: 0.88rem;
  min-width: 130px;
  text-align: center;
}

.mint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mint-list li {
  display: grid;
  grid-template-columns: 48px 1fr 240px;
  gap: 14px;
  align-items: center;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.mint-list .mint-info { min-width: 0; }
.mint-list .mint-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  flex-wrap: wrap;
}
.mint-list .mint-stats {
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  gap: 14px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.mint-list .mint-addr {
  color: var(--muted);
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mint-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.mint-progress .bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.mint-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
  transition: width 200ms ease;
}
.mint-progress .pct {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.mint-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mint-form .row {
  display: flex;
  gap: 6px;
}
.mint-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.85rem;
}
.mint-form button.mint-go {
  padding: 7px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.mint-form .hint {
  color: var(--muted);
  font-size: 0.7rem;
}
.mint-form .err {
  color: #ff8a9b;
  font-size: 0.7rem;
}
.mint-form .row-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.mint-form .row-actions a,
.mint-form .row-actions button {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.72rem;
  text-align: center;
}
.mint-soldout, .mint-quota-hit {
  background: rgba(255,138,107,0.12);
  color: var(--accent-strong);
  font-size: 0.7rem;
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
}
.mint-needs-wallet {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px 4px;
}

@media (max-width: 700px) {
  .mint-list li {
    grid-template-columns: 40px 1fr;
  }
  .mint-form { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .tokens-list li {
    grid-template-columns: 40px 1fr;
  }
  .tokens-list .token-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* (Retired: the standalone #statusCard was moved into the header wallet
   panel. Kept this anchor comment so the section ordering is obvious if
   anyone diffs the file.) */

/* ---- Step layout ----- */
.step { display: grid; gap: 18px; }
.step:not(.single) {
  grid-template-columns: 1.4fr 1fr;
}
.step.single { grid-template-columns: 1fr; }

@media (max-width: 760px) {
  .step:not(.single) { grid-template-columns: 1fr; }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  justify-content: space-between;
}
.step-header h2 {
  font-family: var(--display-font);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}

/* ---- Form ----- */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}
.field .help { color: var(--muted); font-size: 0.78rem; margin: 0; }
.field .error { color: var(--error); font-size: 0.8rem; margin: 0; }

.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

input[type="text"], input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0c0a14;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 120ms ease;
}
input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}
input[aria-invalid="true"] { border-color: var(--error); }

.suffix {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  padding: 0 2px;
}

/* ---- Mode picker (radio cards) ----- */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}
.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-strong);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.mode-card:hover { border-color: var(--border-strong); }
.mode-card input[type="radio"] {
  margin: 4px 0 0;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.mode-card input[type="radio"]:checked {
  border-color: var(--accent);
}
.mode-card input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent);
}
.mode-card:has(input:checked) {
  border-color: var(--accent);
  background: #221c3d;
}
.mode-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mode-content strong {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-content .help { font-size: 0.8rem; color: var(--muted); margin: 0; }
.tag {
  font-size: 0.65rem;
  background: var(--accent);
  color: #1a1430;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
}

[data-mode-fields] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* ---- Toggle switch ----- */
.toggle-field { padding: 6px 0; }
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 120ms ease;
}
.track::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 120ms ease;
}
.switch input:checked + .track {
  background: var(--accent);
}
.switch input:checked + .track::before {
  transform: translateX(16px);
  background: #1a1430;
}
.switch-text { display: flex; flex-direction: column; }
.switch-text strong { font-weight: 600; font-size: 0.9rem; }
.switch-text .help { font-size: 0.78rem; }

/* ---- Advanced details ----- */
.advanced {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  user-select: none;
  list-style: none;
}
.advanced summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 120ms ease;
}
.advanced[open] summary::before { transform: rotate(90deg); }
.advanced > .field, .advanced > .toggle-field { margin-top: 12px; }

/* ---- Summary ----- */
.summary {
  margin-top: 12px;
  padding: 14px 16px;
  background: #0a0816;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.summary h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  font-size: 0.9rem;
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
.gas-line { margin: 10px 0 0; font-size: 0.85rem; }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Preview ----- */
.preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: sticky;
  top: 24px;
  align-self: start;
}
.preview-title {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.token-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a1430;
  margin: 6px 0 4px;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 24px rgba(233, 208, 184, 0.2);
  overflow: hidden;
  position: relative;
}
.token-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.token-avatar.small {
  width: 48px; height: 48px; font-size: 1.2rem;
  margin: 0;
}
.preview-name { font-weight: 600; font-size: 1.05rem; }
.preview-symbol { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }
.preview-meta {
  margin: 8px 0 0;
  width: 100%;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 10px;
  font-size: 0.86rem;
  text-align: left;
}
.preview-meta dt { color: var(--muted); }
.preview-meta dd { margin: 0; }

/* ---- Deploying ----- */
.spinner {
  width: 36px; height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Success / Manage ----- */
.success-card .check {
  display: inline-block;
  background: var(--success);
  color: #0a0816;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-weight: 700;
  margin-right: 6px;
}
.success-token {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 8px;
  padding: 10px 14px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.deployment-info {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  font-size: 0.92rem;
}
.deployment-info dt { color: var(--muted); }
.deployment-info dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.deployment-info code { word-break: break-all; }

.manage-card { margin-top: 0; }
.manage-card h3 { margin: 0 0 14px; font-size: 1.05rem; }
.manage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.manage-stats > div { display: flex; flex-direction: column; }
.manage-stats .label { display: block; margin-bottom: 2px; }
.manage-action {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}
.manage-action:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.manage-action h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}
.manage-action .input-row input { min-width: 140px; }

/* ---- Deployments list ----- */
.deployments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.deployments li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.deployments li .token-avatar { margin: 0; }
.deployments li .deploy-meta { flex: 1; min-width: 0; }
.deployments li .deploy-name { font-weight: 500; }
.deployments li .deploy-addr {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deployments li .deploy-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.deployments li .deploy-date { color: var(--muted); font-size: 0.75rem; }

/* ---- Log ----- */
.log-card {
  font-size: 0.78rem;
  color: var(--muted);
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px 16px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

@media (max-width: 560px) {
  header { flex-direction: column; }
  .wallet-pill {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  /* When the connected-wallet status card is visible, give it priority over
     the Faucet pill: status first, full-width, then Faucet button right-aligned
     so the layout never overflows horizontally on small phones. */
  .wallet-pill .wallet-status {
    order: 1;
    width: 100%;
    flex: 1 1 100%;
  }
  .wallet-pill #faucetBtn { order: 2; margin-left: auto; }
  .wallet-pill #connect    { order: 3; }
  .wallet-pill #disconnect { order: 4; }

  main { padding: 24px 16px 40px; }
  .preview-card { position: static; }

  /* Tighter tab padding so all four tabs (incl. "Tokens on DogeOS") fit
     within a typical phone viewport without horizontal scroll. */
  .tabs { gap: 0; }
  .tab { padding: 10px 10px; font-size: 0.9rem; }
}

/* Final defensive overflow guards: long monospace addresses inside cards
   should always wrap or truncate rather than stretching their parent. */
.card code,
.deployments li .deploy-addr,
.tokens-list .token-addr,
.mint-list .mint-addr { max-width: 100%; }
.deployments li .deploy-meta,
.tokens-list .token-meta,
.mint-list .mint-info { min-width: 0; }

/* =========================================================
   Tx-success modal (deploy / mint completion popup)
   ========================================================= */
.tx-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: none; /* re-enabled on .open */
}
.tx-modal[hidden] { display: none !important; }

.tx-modal.open { pointer-events: auto; }
.tx-modal.open .tx-modal-backdrop { opacity: 1; }
.tx-modal.open .tx-modal-card { transform: translateY(0) scale(1); opacity: 1; }

.tx-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(251, 192, 45, 0.18) 0%, transparent 60%),
    rgba(8, 5, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 200ms ease-out;
  cursor: pointer;
}

.tx-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background:
    radial-gradient(circle at 80% -20%, rgba(255, 210, 63, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 0% 110%, rgba(255, 111, 155, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #1c1733 0%, #14112a 100%);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px 22px 20px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(251, 192, 45, 0.15),
    0 0 50px rgba(251, 192, 45, 0.18);
  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition:
    transform 280ms cubic-bezier(.18, 1.1, .35, 1),
    opacity   220ms ease-out;
}

.tx-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 120ms, color 120ms;
}
.tx-modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.tx-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.tx-modal-burst {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #0c0a14;
  background:
    radial-gradient(circle at 30% 25%, #ffe98a 0%, var(--accent-strong) 45%, var(--accent) 100%);
  box-shadow:
    0 0 0 4px rgba(251, 192, 45, 0.18),
    0 0 28px rgba(251, 192, 45, 0.55);
  animation: tx-modal-burst 600ms cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes tx-modal-burst {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.tx-modal-title-block { min-width: 0; }
.tx-modal-title-block h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.55rem;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 55%, var(--text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.tx-modal-subtitle {
  margin: 2px 0 0;
  font-family: var(--display-font);
  font-size: 0.85rem;
  color: var(--doge-tongue);
  letter-spacing: 0.04em;
  transform: rotate(-2deg);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.tx-modal-token {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 14px;
}
.tx-modal-token-meta { display: flex; flex-direction: column; min-width: 0; }
.tx-modal-token-name {
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-modal-token-symbol {
  font-size: 0.8rem;
  color: var(--muted);
}
.tx-modal-headline {
  margin-left: auto;
  font-family: var(--display-font);
  font-size: 1.15rem;
  color: var(--accent-strong);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(251, 192, 45, 0.4);
}

.tx-modal-details {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  row-gap: 8px;
}
.tx-modal-details dt {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 2px;
}
.tx-modal-details dd {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tx-modal-details dd code {
  font-size: 0.82rem;
  color: var(--text);
}
.tx-modal-details a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  border-bottom: 1px dashed var(--accent-bark);
}
.tx-modal-details a:hover { color: var(--accent-strong); border-bottom-style: solid; }
.tx-modal-details .copy-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms;
}
.tx-modal-details .copy-btn:hover { color: var(--accent-strong); border-color: var(--accent-bark); }
.tx-modal-details .copy-btn.copied { color: var(--success); border-color: var(--success); }

.tx-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.tx-modal-actions button,
.tx-modal-actions a {
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 140ms;
  font-family: inherit;
}
.tx-modal-actions button:hover,
.tx-modal-actions a:hover {
  border-color: var(--accent-bark);
  color: var(--accent-strong);
  transform: translateY(-1px);
}
.tx-modal-actions .primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: var(--accent-strong);
  color: #1a1430;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(251, 192, 45, 0.35);
}
.tx-modal-actions .primary:hover {
  color: #0c0a14;
  box-shadow: 0 8px 24px rgba(251, 192, 45, 0.55);
}

/* Confetti — 20 absolutely-positioned dots that rain from the burst icon when the
   modal opens. Keep it lightweight: pure CSS, no JS, no SVG sprites. */
.tx-modal-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.tx-modal-confetti span {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 7px;
  height: 11px;
  border-radius: 1.5px;
  opacity: 0;
  animation: tx-confetti-fall 1500ms cubic-bezier(.25, 1, .4, 1) forwards;
}
.tx-modal-confetti span:nth-child(1)  { background: var(--accent);        --x: -180px; --r: -45deg;  animation-delay: 0ms; }
.tx-modal-confetti span:nth-child(2)  { background: var(--accent-strong); --x:  180px; --r:  35deg;  animation-delay: 80ms; }
.tx-modal-confetti span:nth-child(3)  { background: var(--doge-tongue);   --x: -100px; --r: -25deg;  animation-delay: 40ms; }
.tx-modal-confetti span:nth-child(4)  { background: var(--accent-bark);   --x:  130px; --r:  60deg;  animation-delay: 120ms; }
.tx-modal-confetti span:nth-child(5)  { background: var(--text);          --x:  -60px; --r:  15deg;  animation-delay: 160ms; }
.tx-modal-confetti span:nth-child(6)  { background: var(--accent-strong); --x:   70px; --r: -20deg;  animation-delay: 220ms; }
.tx-modal-confetti span:nth-child(7)  { background: var(--doge-tongue);   --x: -210px; --r:  50deg;  animation-delay: 60ms; }
.tx-modal-confetti span:nth-child(8)  { background: var(--accent);        --x:  220px; --r: -55deg;  animation-delay: 100ms; }
.tx-modal-confetti span:nth-child(9)  { background: var(--accent-bark);   --x: -130px; --r:  30deg;  animation-delay: 200ms; }
.tx-modal-confetti span:nth-child(10) { background: var(--text);          --x:   30px; --r: -10deg;  animation-delay: 280ms; }
.tx-modal-confetti span:nth-child(11) { background: var(--accent-strong); --x: -240px; --r:  20deg;  animation-delay: 140ms; }
.tx-modal-confetti span:nth-child(12) { background: var(--accent);        --x:  240px; --r:  -8deg;  animation-delay: 180ms; }
.tx-modal-confetti span:nth-child(13) { background: var(--doge-tongue);   --x: -160px; --r:  40deg;  animation-delay: 320ms; }
.tx-modal-confetti span:nth-child(14) { background: var(--accent-bark);   --x:  160px; --r: -40deg;  animation-delay: 260ms; }
.tx-modal-confetti span:nth-child(15) { background: var(--text);          --x:  -40px; --r:  55deg;  animation-delay: 360ms; }
.tx-modal-confetti span:nth-child(16) { background: var(--accent-strong); --x:   90px; --r: -30deg;  animation-delay: 240ms; }
.tx-modal-confetti span:nth-child(17) { background: var(--doge-tongue);   --x: -110px; --r:  -5deg;  animation-delay: 400ms; }
.tx-modal-confetti span:nth-child(18) { background: var(--accent);        --x:  110px; --r:  25deg;  animation-delay: 340ms; }
.tx-modal-confetti span:nth-child(19) { background: var(--accent-bark);   --x: -200px; --r: -15deg;  animation-delay: 0ms; }
.tx-modal-confetti span:nth-child(20) { background: var(--text);          --x:  200px; --r:  45deg;  animation-delay: 440ms; }
@keyframes tx-confetti-fall {
  0%   { opacity: 0; transform: translate(0, 0)               rotate(0deg);          }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), 280px)    rotate(var(--r));      }
}

@media (max-width: 520px) {
  .tx-modal-card { padding: 20px 16px 16px; border-radius: 14px; }
  .tx-modal-details { grid-template-columns: 1fr; row-gap: 4px; }
  .tx-modal-details dt { padding-top: 6px; font-size: 0.78rem; }
  .tx-modal-headline { display: none; }
  .tx-modal-actions { flex-direction: column-reverse; align-items: stretch; }
  .tx-modal-actions button, .tx-modal-actions a { justify-content: center; }
}

/* =========================================================
   Wallet tab — list of LaunchTokens the user holds/owns
   ========================================================= */
.wallet-prompt {
  padding: 24px 14px;
  text-align: center;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
}
.wallet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wallet-section { margin-top: 18px; }
.wallet-section + .wallet-section { margin-top: 22px; }
.wallet-section-header { margin-bottom: 10px; }
.wallet-section-header h3 {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 2px;
  color: var(--accent);
}
.wallet-section-header p { margin: 0; }
#walletPrintedSection .wallet-section-header h3 { color: var(--accent-strong); }
.wallet-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 140ms, background 140ms;
}
.wallet-row:hover {
  border-color: var(--accent-bark);
  background: rgba(251, 192, 45, 0.04);
}
.wallet-row.owner {
  border-color: rgba(251, 192, 45, 0.35);
  background: linear-gradient(180deg, rgba(251, 192, 45, 0.06) 0%, rgba(255,255,255,0.02) 60%);
}
.wallet-info { min-width: 0; }
.wallet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex-wrap: wrap;
}
.wallet-title .token-symbol-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 999px;
}
.wallet-tag {
  font-family: var(--display-font);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: lowercase;
}
.wallet-tag.owner {
  color: #1a1430;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 2px 8px rgba(251, 192, 45, 0.35);
}
.wallet-tag.held {
  color: var(--text);
  background: rgba(110, 231, 183, 0.18);
  border: 1px solid rgba(110, 231, 183, 0.3);
}
.wallet-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 4px;
}
.wallet-stats code {
  color: var(--text);
  font-size: 0.88rem;
}
.wallet-stats .label { font-size: 0.78rem; color: var(--muted); margin-right: 3px; }
.wallet-addr {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 96px;
}
.wallet-actions .ghost {
  text-align: center;
  white-space: nowrap;
}
.wallet-actions .ghost.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: var(--accent-strong);
  color: #1a1430;
  font-weight: 700;
}
.wallet-actions .ghost.primary:hover {
  color: #0c0a14;
}

@media (max-width: 560px) {
  .wallet-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "avatar info"
      "actions actions";
  }
  .wallet-row > .token-avatar { grid-area: avatar; }
  .wallet-info  { grid-area: info; }
  .wallet-actions {
    grid-area: actions;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .wallet-actions .ghost { flex: 1 1 auto; }
}

/* Inline manage view (re-parented from #tab-launch). */
.wallet-manage-host { display: flex; flex-direction: column; gap: 12px; }
.wallet-back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--display-font);
  font-weight: 700;
  padding: 8px 14px;
  margin: 0;
}
.wallet-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
