/*
 * Trader space (loaded by every page of the space), grid v3: the dialogs (verify, payout pre-flight, terms) as plates, the
 * follow-up of payouts (three steps, the trader's progress in blue), the notifications and the profile. The account
 * pages are in space-dash.css and space-account.css. Tokens of ../v3.css only; hover under (hover: hover); the motion is
 * short and stops for prefers-reduced-motion.
 */

.sp-dim { color: var(--ink-2); }

/* ---------- dialogs ---------- */
.sp-dlg {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 24px 26px; color: var(--ink);
  background: var(--plate-bg), var(--bg); border: 0; border-radius: 4px; box-shadow: var(--plate-shadow);
}
.sp-dlg::backdrop { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.sp-dlg[open] { display: grid; gap: 18px; animation: sp-pop 220ms var(--ease-v3) both; }
.sp-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sp-dlg-head h2 { margin: 0; font-size: 1.6rem; font-weight: 660; font-stretch: 116%; letter-spacing: -0.03em; line-height: 1.05; }
@keyframes sp-pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

/* ---------- payout pre-flight and follow-up ---------- */
#pfTitle:focus { outline: none; }                       /* the title takes the focus at opening: no ring on a heading */
.sp-pv-head { display: grid; gap: 12px; }
.sp-pv-amountfield .form-msg:empty { display: none; }
.sp-pv-amountrow { display: flex; align-items: center; gap: 8px; }
.sp-pv-amountrow .text-input { flex: 1 1 auto; min-width: 0; }
.sp-pv-amountfield { margin: 0; gap: 6px; }
.sp-pv-amountfield .small { margin: 0; }
.sp-pv-amountfield > .btn { justify-self: start; }      /* "Try again" under the sentence of a failed read */
.sp-pv-receive { display: grid; gap: 4px; padding: 16px 18px; border-radius: 12px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-pv-receive .sp-card-label { color: var(--link); }
.sp-pv-amount { margin: 0; font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 500; letter-spacing: -0.03em; color: var(--white); }
.sp-pv-dest { display: grid; gap: 4px; }
.sp-pv-address { margin: 0; padding: 12px 14px; font-size: 14.5px; word-spacing: 0.25em; overflow-wrap: anywhere; background: var(--well-top); border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-pv-network { margin: 0; font-size: var(--t-sm); }
.sp-dlg .sp-dl-row dd { white-space: nowrap; }
.sp-pv-money .sp-dl-row[data-deduction="true"] dd { color: var(--ink-2); }
.sp-pv-money .sp-dl-row[data-key="split"] dd { color: var(--white); font-weight: 560; }
.sp-tracks { display: grid; gap: 10px; }
.sp-track { display: grid; gap: 12px; padding: 16px 18px; border: 0; border-radius: 12px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-track-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.sp-step { position: relative; display: flex; gap: 10px; min-width: 0; font-size: var(--t-sm); }
.sp-step p { margin: 4px 0 0; }
.sp-step-dot { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--hair-3); }
.sp-step[data-state="done"] .sp-step-dot { background: var(--acc); box-shadow: 0 0 0 3px var(--tint); }
.sp-step[data-state="now"] .sp-step-dot { box-shadow: inset 0 0 0 2px var(--link), 0 0 0 4px var(--tint); }
.sp-step[data-state="failed"] .sp-step-dot { background: var(--silver); box-shadow: none; }
.sp-step[data-state="todo"] { color: var(--ink-3); }
.sp-target { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---------- notifications ---------- */
.sp-filter { display: flex; flex-wrap: wrap; gap: 6px; }
/* the filter keys: their face, wall, pressed and chosen states are the keycap choices of ../v3.css (founder 2026-11-05) */
.sp-filter .btn { min-height: 44px; padding: 0 14px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.sp-notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sp-note-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none;
  background: var(--cell); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair); transition: box-shadow 0.2s;
}
.sp-note[data-read="false"] .sp-note-link { background: linear-gradient(180deg, var(--card-top), var(--card-bottom)); box-shadow: inset 0 0 0 1px var(--hair-2), inset 3px 0 0 var(--acc); }
:root[dir="rtl"] .sp-note[data-read="false"] .sp-note-link { box-shadow: inset 0 0 0 1px var(--hair-2), inset -3px 0 0 var(--acc); }
.sp-note-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-note-icon[data-tone="up"] { color: var(--mood-ok); }
.sp-note-icon[data-tone="down"], .sp-note-icon[data-tone="warn"] { color: var(--mood-watch); }
.sp-note-icon[data-tone="acc"] { color: var(--link); background: var(--tint); }
.sp-note-body { display: grid; gap: 3px; min-width: 0; }
.sp-note-title { font-size: var(--t-sm); font-weight: 600; }
.sp-note-text { font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.sp-note-when { font-size: var(--t-xs); color: var(--ink-3); overflow-wrap: anywhere; }

/* ---------- profile ---------- */
.sp-methods { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sp-method { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 12px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-method[data-linked="false"] { background: transparent; box-shadow: inset 0 0 0 1px var(--hair); }
.sp-method-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair-2); }
.sp-method[data-linked="true"] .sp-method-icon { color: var(--link); background: var(--tint); }
.sp-method-body { display: grid; gap: 2px; min-width: 0; }
.sp-method-body .mono { font-size: var(--t-xs); color: var(--ink-2); overflow-wrap: anywhere; }
.sp-method-state { display: grid; justify-items: end; gap: 4px; font-size: var(--t-xs); }
.sp-link-box, .sp-reauth { display: grid; gap: 10px; padding-top: 6px; }
#destCurrent { white-space: pre-line; }
.sp-pv-pick { margin: 0; }

@media (hover: hover) {
  .sp-note-link:hover { box-shadow: inset 0 0 0 1px var(--hair-3); }
}

@media (max-width: 899px) {
  .sp-dlg { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto auto 0; border-radius: 4px 4px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .sp-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sp-method { grid-template-columns: auto minmax(0, 1fr); }
  .sp-method-state { grid-column: 2; justify-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-dlg[open] { animation: none; }
}

/* the notifications grouped by day: a quiet heading before each day, the unread dot on the row's edge */
.sp-note-day { margin: 10px 0 0; padding: 0 2px 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--hair); }
.sp-note-day:first-child { margin-top: 0; }
.sp-note-day.mono { font-weight: 500; }
.sp-note[data-read="false"] .sp-note-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-start: 8px; border-radius: 50%; background: var(--acc); vertical-align: 2px; }
