/* Trade Mode. Card Show Mode shell, with the approved gold on this screen. */

body.trade-mode {
  --gold: #E8C478;
  --slab-gold: #E8C478;
  --gold2: #B8913F;
  background: #060810;
  overflow: hidden;
}

body.trade-mode .ticker-section,
body.trade-mode #betaBanner,
body.trade-mode .sidebar,
body.trade-mode .topbar,
body.trade-mode .pwa-install-banner,
body.trade-mode .pwa-update-toast {
  display: none !important;
}

body.trade-mode .app-shell { display: block !important; }
body.trade-mode .main-content { width: 100% !important; max-width: 100vw !important; margin: 0 !important; }

#page-trade {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background: #060810;
  color: #f0f4ff;
  overflow: hidden;
}

body.trade-mode #page-trade .csm-header {
  border-bottom-color: rgba(232, 196, 120, 0.22);
  gap: 10px;
  flex-wrap: wrap;
}

body.trade-mode #page-trade .csm-mode-badge {
  background: #E8C478;
  color: #060810;
}

body.trade-mode #page-trade .csm-input,
body.trade-mode #page-trade .csm-camera-btn {
  border-color: rgba(232, 196, 120, 0.35);
}

body.trade-mode #page-trade .csm-camera-btn {
  background: rgba(232, 196, 120, 0.08);
  color: #E8C478;
}

body.trade-mode #page-trade .csm-search-btn { background: #E8C478; }
body.trade-mode #page-trade .csm-input:focus,
body.trade-mode #page-trade .csm-camera-btn:hover { border-color: #E8C478; }

body.trade-mode #page-trade .csm-panel {
  border-color: rgba(232, 196, 120, 0.22);
}

body.trade-mode #page-trade .csm-panel-kicker {
  background: rgba(232, 196, 120, 0.12);
  border-color: rgba(232, 196, 120, 0.45);
  color: #E8C478;
}

body.trade-mode #page-trade .csm-toggle.on { background: #E8C478; }

.tc-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 24px 28px;
}

.tc-asof,
.tc-sub,
.tc-meta,
.tc-note,
.tc-card-price {
  font-family: var(--mono);
  color: #8892aa;
}

.tc-asof {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  margin: 8px 0 0;
}

.tc-verdict {
  max-width: 720px;
  margin: 12px auto 8px;
  text-align: center;
}

.tc-line {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  color: #E8C478;
  margin: 0;
}

.tc-sub { margin: 4px 0 0; font-size: 0.82rem; }

.tc-refresh,
.tc-text-btn,
.tc-port-btn,
.tc-pill,
.tc-accept,
.tc-icon-btn {
  font-family: var(--mono);
  cursor: pointer;
}

.tc-refresh,
.tc-accept {
  margin-top: 10px;
  background: #E8C478;
  color: #060810;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 8px 14px;
}

.tc-accept {
  max-width: 100%;
}

.tc-accept:disabled {
  background: transparent;
  color: #86efac;
  border: 1px solid rgba(134, 239, 172, 0.45);
}

#page-trade .csm-search-row {
  min-width: 0;
  max-width: 100%;
}

#page-trade .csm-input {
  min-width: 0;
  width: 0;
  flex: 1 1 0;
}

.tc-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
}

.tc-side {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 196, 120, 0.22);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
}

.tc-side-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  min-width: 0;
}

.tc-label {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(232, 196, 120, 0.25);
  color: #f0f4ff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 2px 0;
}

.tc-total {
  font-family: var(--mono);
  font-weight: 800;
  color: #E8C478;
  font-size: 1.25rem;
  max-width: 100%;
  min-width: 0;
  text-align: right;
  line-height: 1.15;
}

.tc-total-missing {
  font-size: 0.82rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.tc-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.tc-port-btn,
.tc-text-btn,
.tc-pill {
  background: rgba(232, 196, 120, 0.08);
  color: #E8C478;
  border: 1px solid rgba(232, 196, 120, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.tc-pill.on,
.tc-text-btn.on {
  background: #E8C478;
  color: #060810;
}

.tc-suggest,
.tc-picker,
.tc-portfolio {
  margin-top: 8px;
}

.tc-hit,
.tc-port-row {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: #f0f4ff;
  border: 1px solid rgba(232, 196, 120, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: var(--body);
}

.tc-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.tc-card > div { min-width: 0; }

.tc-card img {
  width: 56px;
  height: 78px;
  object-fit: contain;
  border-radius: 6px;
  background: #0a0e1a;
}

.tc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.tc-card-name {
  font-family: var(--display);
  font-weight: 800;
  min-width: 0;
}

.tc-meta,
.tc-note,
.tc-card-price { font-size: 0.72rem; margin-top: 3px; }

.tc-card-price { color: #E8C478; font-weight: 800; font-size: 0.95rem; }

.tc-row-actions,
.tc-pills,
.tc-cash {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.tc-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(232, 196, 120, 0.35);
  background: transparent;
  color: #E8C478;
}

.tc-qty { font-family: var(--mono); min-width: 1.4em; text-align: center; }

.tc-value,
.tc-cash-input,
.tc-grade {
  background: rgba(255, 255, 255, 0.04);
  color: #f0f4ff;
  border: 1px solid rgba(232, 196, 120, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: var(--mono);
}

.tc-agree {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #f0f4ff;
}

.tc-stale { margin-left: 6px; text-transform: none; letter-spacing: 0; }

.tc-hero { margin-top: 8px; }
.tc-hero[hidden],
.tc-agree[hidden],
.tc-port-btn[hidden] { display: none !important; }
.tc-hero .csm-hero-svg { width: 100%; height: auto; max-height: 320px; }

.tc-done {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6, 8, 16, 0.92);
  text-align: center;
  padding: 24px;
}

.tc-done[hidden] { display: none !important; }

.tc-done-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.4rem;
  color: #E8C478;
  margin: 0;
  letter-spacing: 0.04em;
}

.tc-done-sub,
.tc-done-note {
  font-family: var(--mono);
  margin: 0;
  color: #f0f4ff;
}

.tc-done-note { color: #8892aa; }

.tc-canvas {
  position: fixed;
  inset: 0;
  z-index: 70;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #060810;
  cursor: pointer;
}

.tc-canvas[hidden] { display: none !important; }

@media (max-width: 800px) {
  .tc-scroll { padding: 10px 16px 24px; }
  .tc-columns {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .tc-side {
    width: 100%;
    max-width: 560px;
  }
  .tc-hero { display: flex; justify-content: center; }
  .tc-hero .csm-stage { justify-items: center; }
  .tc-hero .csm-hero-svg { max-height: 220px; }
  #page-trade .csm-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  #page-trade .csm-panel-kicker,
  #page-trade .csm-panel strong,
  #page-trade .csm-panel span:not(.csm-panel-kicker) {
    grid-column: 1;
    grid-row: auto;
    text-align: center;
  }
  .tc-side-head {
    grid-template-columns: 40px minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .tc-label { text-align: center; }
  .tc-total {
    grid-column: 1 / -1;
    text-align: center;
  }
  .tc-tools,
  .tc-cash,
  .tc-agree,
  .tc-pills,
  .tc-row-actions { justify-content: center; }
  .tc-accept { display: block; margin-left: auto; margin-right: auto; }
  .tc-done-title { font-size: 1.7rem; }
  body.trade-mode #page-trade .csm-header {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
  }
}
