/* ════════════════════════════════════════════════════════════════════════════════════════
   trade.css — the Syrpts terminal's on-chain trade panel, Menu Book extras and My orders
   (Step 7; approved design "Syrpts trading and deploys"). Drawn by js/syrpts-trade.js.
   Uses core.css's tokens; prices are in SDTX, shown as $.
   ════════════════════════════════════════════════════════════════════════════════════════ */
.trd { display: flex; flex-direction: column; gap: 12px; }
.trd [hidden] { display: none !important; }
.trd-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.5px; color: var(--text-secondary); text-transform: uppercase; }
.trd-help { font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary); }
.trd-mono { font-family: var(--font-mono); }

.trd-tabs, .trd-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden; }
.trd-sides { gap: 8px; border: 0; border-radius: 0; overflow: visible; }
.trd-tab { min-height: 42px; border: 0; background: transparent; color: var(--text-secondary); font-family: var(--font-display); font-weight: 700; letter-spacing: 1.5px; font-size: 0.92rem; cursor: pointer; }
.trd-tab[aria-selected="true"] { background: rgba(59,130,246,0.16); color: var(--text-primary); }
.trd-side { min-height: 42px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text-secondary); font-weight: 600; font-family: inherit; font-size: 0.92rem; cursor: pointer; }
.trd-side.buy[aria-pressed="true"] { border-color: var(--success); background: rgba(16,185,129,0.14); color: #34d399; }
.trd-side.sell[aria-pressed="true"] { border-color: var(--danger); background: rgba(239,68,68,0.12); color: #fca5a5; }

.trd-field { display: flex; flex-direction: column; gap: 6px; }
.trd-inputrow { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: var(--bg-tertiary); }
.trd-inputrow input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font-family: var(--font-mono); font-size: 1.1rem; padding: 10px 0; outline: none; }
.trd-inputrow:focus-within { border-color: var(--accent); }
.trd-unit { color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.85rem; }
.trd-max { padding: 4px 8px; border-radius: 4px; border: 0; background: rgba(59,130,246,0.16); color: #93c5fd; font-family: var(--font-mono); font-size: 0.72rem; cursor: pointer; }
.trd-select, .trd-plain { padding: 11px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: var(--bg-tertiary); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.95rem; }
.trd-out { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 8px; background: var(--bg-tertiary); border: 1px dashed rgba(255,255,255,0.12); font-family: var(--font-mono); font-size: 1.1rem; }
.trd-box { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); font-size: 0.82rem; }
.trd-row { display: flex; justify-content: space-between; gap: 10px; }
.trd-row > span:first-child { color: var(--text-secondary); }
.trd-row > span:last-child { font-family: var(--font-mono); text-align: right; }
.trd-good { color: #34d399 !important; }
.trd-warn { color: #fcd34d !important; }
.trd-bad { color: #fca5a5 !important; }

.trd-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.trd-chip { padding: 8px 0; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.8rem; cursor: pointer; }
.trd-chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(59,130,246,0.14); color: var(--text-primary); }

.trd-go { min-height: 48px; padding: 8px 10px; border-radius: 8px; border: 0; font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.25; letter-spacing: 1px; white-space: normal; overflow-wrap: anywhere; color: #06070b; cursor: pointer; }
.trd-go.buy { background: var(--success); }
.trd-go.sell { background: var(--danger); }
.trd-go:disabled { opacity: 0.45; cursor: not-allowed; }
.trd-btn { padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); background: transparent; color: var(--text-primary); font-family: inherit; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.trd-btn.primary { border: 0; background: var(--accent); color: #06070b; }
.trd-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.trd-note { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); font-size: 0.82rem; line-height: 1.5; }
.trd-note.warn { border-color: rgba(245,158,11,0.45); background: rgba(245,158,11,0.07); color: #fde68a; }
.trd-note.bad { border-color: rgba(239,68,68,0.45); background: rgba(239,68,68,0.07); }
.trd-note.good { border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.07); }
.trd-note.info { border-color: rgba(96,165,250,0.4); background: rgba(59,130,246,0.06); }
.trd-note b { color: var(--text-primary); font-weight: 600; }
.trd-tick { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; line-height: 1.5; color: var(--text-primary); }
.trd-tick input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--danger); }

.trd-state { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: var(--bg-tertiary); }
.trd-state.warn { border-color: rgba(245,158,11,0.4); }
.trd-state h4 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.trd-state p { margin: 0; font-size: 0.84rem; line-height: 1.55; color: var(--text-secondary); }
.trd-meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.trd-meter i { display: block; height: 100%; background: var(--warning); }
.trd-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 0.74rem; color: var(--text-secondary); }
.trd-steps div { display: flex; flex-direction: column; gap: 5px; }
.trd-steps i { display: block; height: 4px; border-radius: 2px; background: rgba(59,130,246,0.25); }
.trd-steps .on i { background: var(--accent); }
.trd-steps .on { color: var(--text-primary); }

/* the status strip above the terminal */
.dex-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 12px; padding: 9px 14px; border-radius: 8px; font-family: var(--font-mono); font-size: 0.78rem; color: #cbd5e1; border: 1px solid rgba(16,185,129,0.35); background: rgba(16,185,129,0.06); }
.dex-strip.waiting { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.06); }
.dex-strip .lead { color: #34d399; }
.dex-strip.waiting .lead { color: #fcd34d; }

/* Menu Book extras */
.dex-box { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; padding: 11px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); background: var(--bg-tertiary); font-size: 0.78rem; }
.dex-box.pool { border-color: rgba(96,165,250,0.25); background: transparent; }
.dex-box h5 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; letter-spacing: 1.5px; color: #cbd5e1; }
.dex-box.pool h5 { color: #93c5fd; }

/* My orders */
.trd-orders td, .trd-orders th { white-space: nowrap; }
.trd-cancel { padding: 5px 10px; border-radius: 6px; border: 1px solid rgba(239,68,68,0.5); background: transparent; color: #fca5a5; font-family: inherit; font-size: 0.78rem; cursor: pointer; }
.trd-cancel.back { border-color: rgba(255,255,255,0.18); color: var(--text-primary); }
.trd-pill { padding: 3px 9px; border-radius: 999px; background: rgba(245,158,11,0.12); color: #fcd34d; font-size: 0.74rem; }
