/* Spice Flow overlay — Phase 2 only.
   Everything here is additive. It themes the Spice Flow surfaces to Mystic's
   existing visual language (see design-tokens.md); it does not restyle host controls. */

/* ---------- account pill ---------- */

.acct-pill {
  height: 50px;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
}
.acct-pill:hover { background: var(--raised); }
.acct-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex: none; }
.acct-pill .tot { font-weight: 600; }
.acct-pill .sep { opacity: 0.35; }
.acct-pill svg { width: 14px; height: 14px; opacity: 0.7; }

/* ---------- account popover ---------- */

.acct-panel {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 392px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  z-index: 45;
  display: none;
  overflow: hidden;
}
.acct-panel.is-open { display: block; }

.ap-head { padding: 18px 18px 16px; }
.ap-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ap-live {
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(74, 222, 128, 0.14); color: #4ade80;
}
.ap-total { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.ap-break { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ap-addr {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  font-size: 13px; color: var(--muted);
}
.ap-addr button { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.ap-addr button:hover { color: var(--text); }
.ap-addr svg { width: 13px; height: 13px; }

.ap-sec { border-top: 1px solid var(--line); padding: 14px 18px; }
.ap-sec h5 {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}

.ap-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.ap-row img, .ap-row .letter { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.ap-row .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 10px; font-weight: 700; }
.ap-row .l { min-width: 0; flex: 1; }
.ap-row .sym { font-size: 14px; font-weight: 600; }
.ap-row .sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ap-row .sub svg { width: 11px; height: 11px; opacity: 0.7; }
.ap-row .r { text-align: right; flex: none; }
.ap-row .amt { display: block; font-size: 14px; font-weight: 600; }
.ap-row .usd { display: block; font-size: 11px; color: var(--muted); }
.ap-row .gain { display: block; font-size: 11px; color: #4ade80; }
.ap-row .sym { display: block; }

.ap-chain { display: inline-flex; align-items: center; gap: 4px; }
.ap-chain img { width: 12px; height: 12px; border-radius: 50%; }

.ap-actions { display: flex; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.ap-actions button { flex: 1; padding: 12px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.ap-dep { background: var(--primary); color: #fff; }
.ap-dep:hover { background: var(--primary-hover); }
.ap-wd { background: var(--raised); color: var(--text); }
.ap-wd:hover { background: #322748; }

/* ---------- modal shell ---------- */

.sf-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 6, 14, 0.72);
  display: none; align-items: flex-start; justify-content: center;
  padding: 110px 20px 40px;
  overflow-y: auto;
}
.sf-overlay.is-open { display: flex; }

.sf-modal {
  width: 452px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62);
}
.sf-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px;
}
.sf-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sf-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sf-close { opacity: 0.6; font-size: 20px; line-height: 1; padding: 0 4px; }
.sf-close:hover { opacity: 1; }
.sf-body { padding: 0 20px 20px; }

.sf-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }

/* ---------- source selector (the Spice Flow intervention) ---------- */

.src {
  position: relative;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 13px 15px;
}
.src:focus-within { background: var(--field-focus); border-color: rgba(55, 62, 239, 0.4); }

.src-row { display: flex; align-items: center; gap: 12px; }
.src-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 11px 7px 8px;
  flex: none;
}
.src-btn:hover { border-color: rgba(255, 255, 255, 0.24); }
.src-btn .tk { position: relative; width: 26px; height: 26px; flex: none; }
.src-btn .tk img.t, .src-btn .tk .letter { width: 26px; height: 26px; border-radius: 50%; }
.src-btn .tk .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 9px; font-weight: 700; }
.src-btn .tk img.c {
  position: absolute; right: -3px; bottom: -3px;
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--surface);
}
.src-btn .nm { text-align: left; }
.src-btn .nm b { display: block; font-size: 14px; font-weight: 600; }
.src-btn .nm span { display: block; font-size: 10px; color: var(--muted); }
.src-btn svg { width: 13px; height: 13px; opacity: 0.65; }

.src-amt { flex: 1; min-width: 0; text-align: right; }
.src-amt input {
  width: 100%; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 24px; font-weight: 700; text-align: right; outline: none;
}
.src-amt input::placeholder { color: #6b6b78; }

.src-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--muted); }
.src-meta .pcts { display: flex; gap: 5px; }
.src-meta .pcts button {
  font-size: 10px; font-weight: 700; color: var(--text);
  background: var(--surface); border-radius: 4px; padding: 3px 7px;
}
.src-meta .pcts button:hover { background: var(--raised); }

/* dropdown listing the user's balances */
.src-list {
  position: absolute; left: 15px; right: 15px; top: calc(100% - 6px);
  max-height: 288px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.6);
  z-index: 12; padding: 6px; display: none;
}
.src-list.is-open { display: block; }
.src-list h6 {
  margin: 8px 8px 5px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.src-opt {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: var(--radius); text-align: left;
}
.src-opt:hover { background: var(--raised); }
.src-opt .tk { position: relative; width: 28px; height: 28px; flex: none; }
.src-opt .tk img.t, .src-opt .tk .letter { width: 28px; height: 28px; border-radius: 50%; }
.src-opt .tk .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 10px; font-weight: 700; }
.src-opt .tk img.c {
  position: absolute; right: -3px; bottom: -3px;
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--surface);
}
.src-opt .l { flex: 1; min-width: 0; }
.src-opt .l b { display: block; font-size: 14px; font-weight: 600; }
.src-opt .l span { display: block; font-size: 11px; color: var(--muted); }
.src-opt .r { text-align: right; }
.src-opt .r b { display: block; font-size: 13px; font-weight: 600; }
.src-opt .r span { display: block; font-size: 11px; color: var(--muted); }

/* ---------- receive line + tx details ---------- */

.recv {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 13px;
}
.recv img, .recv .letter { width: 20px; height: 20px; border-radius: 50%; }
.recv .letter { display: flex; align-items: center; justify-content: center; background: var(--raised); font-size: 8px; font-weight: 700; }
.recv b { font-weight: 600; }

.txd { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.txd .r { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
.txd .r .k { color: var(--muted); }
.txd .r .v { font-weight: 600; }
.txd .r.tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; font-size: 13.5px; }
.txd .attr {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 11px; color: var(--muted);
}
.txd .attr svg { width: 12px; height: 12px; opacity: 0.7; }

/* chain picker for withdraw destination */
.chain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.chain-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 10px; border-radius: var(--radius);
  background: var(--field); border: 1px solid transparent;
  font-size: 13px; font-weight: 500;
}
.chain-opt:hover { background: var(--field-focus); }
.chain-opt.is-sel { border-color: var(--primary); background: rgba(55, 62, 239, 0.12); }
.chain-opt img { width: 19px; height: 19px; border-radius: 50%; }

/* ---------- network cell in merged tables ---------- */

.netcell { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.netcell img { width: 22px; height: 22px; border-radius: 50%; flex: none; }

/* merged-table column templates — Network column added ahead of the host's first column */
.cols-vault-n   { grid-template-columns: 112fr 228fr 138fr 232fr 132fr 118fr 100fr 30fr; gap: 0; }
.cols-market-n  { grid-template-columns: 118fr 170fr 170fr 105fr 175fr 130fr 110fr 100fr; }
.cols-mult-n    { grid-template-columns: 118fr 165fr 110fr 145fr 185fr 185fr 95fr 105fr; }

/* ---------- spice asset label (§13.5) ---------- */

.spice-sub { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.spice-sub svg { width: 11px; height: 11px; opacity: 0.65; }
.spice-sub button { color: inherit; display: inline-flex; align-items: center; gap: 4px; font-size: inherit; }
.spice-sub button:hover { color: var(--text); }

.explain {
  margin-top: 12px; padding: 14px;
  background: var(--field); border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.55; color: var(--muted);
  display: none;
}
.explain.is-open { display: block; }
.explain b { color: var(--text); font-weight: 600; }
.explain ul { margin: 8px 0 0; padding-left: 17px; }
.explain li { margin: 3px 0; }
.explain .pw { margin-top: 10px; font-size: 11px; opacity: 0.8; }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(14px);
  background: var(--raised); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 120;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
