:root {
  color-scheme: light;
  --bg: #eef7fb;
  --panel: #ffffff;
  --ink: #081827;
  --muted: #587086;
  --line: #d4e3ef;
  --green: #087a60;
  --green-soft: #e8fff6;
  --red: #b42318;
  --red-soft: #fff1ef;
  --blue: #1166d8;
  --blue-soft: #eaf5ff;
  --gold: #a15c00;
  --gold-soft: #fff7df;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf7ff 0%, var(--bg) 42%, #ffffff 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
button, input { font: inherit; }
.traded-shell { width: min(1320px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 46px; }
.traded-hero, .traded-summary, .traded-card, .traded-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(18, 44, 72, .08);
}
.traded-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #092d4b, #087a60);
}
.traded-hero a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 8px 10px 0;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  color: #083047;
  background: #e8fff7;
  font-weight: 900;
  text-decoration: none;
}
.traded-hero span, .section-heading span, .traded-card span {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.traded-hero h1 { margin: 8px 0; font-size: clamp(36px, 6vw, 68px); line-height: .95; }
.traded-hero p { max-width: 780px; margin: 0; color: #e8f9ff; font-size: 18px; line-height: 1.45; }
.traded-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 300px; }
button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font-weight: 900;
}
button.danger, .traded-card button, .traded-table-wrap button { background: #531e28; color: #ffd8dc; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(17,102,216,.25); outline-offset: 2px; }
.traded-status {
  margin: 14px 0;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}
.traded-status.live { color: var(--green); }
.traded-status.error { color: var(--red); border-color: #ffb7bd; background: var(--red-soft); }
.traded-summary { display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; }
.traded-summary div { padding: 16px; border-right: 1px solid var(--line); }
.traded-summary div:last-child { border: 0; }
.traded-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.traded-summary strong { display: block; margin-top: 6px; font-size: 24px; overflow-wrap: anywhere; }
.gain, .positive { color: var(--green) !important; }
.loss, .negative { color: var(--red) !important; }
.traded-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 12px; margin: 14px 0; }
.traded-card { display: grid; gap: 9px; align-content: start; padding: 15px; }
.traded-card.gain { border-color: #76cfb6; background: var(--green-soft); }
.traded-card.loss { border-color: #ffb7bd; background: var(--red-soft); }
.traded-card.flat { border-color: #e6c574; background: var(--gold-soft); }
.traded-card strong { display: block; overflow-wrap: anywhere; font: 850 12px ui-monospace, Consolas, monospace; }
.traded-card b { font-size: 28px; }
.traded-card small { color: var(--muted); line-height: 1.35; }
.traded-card-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.traded-card-actions a, .traded-card-actions button {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid #bfd2e3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #083047;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
.traded-card-actions button { border-color: #ff9aa5; background: #531e28; color: #ffd8dc; }
.traded-card-actions button.close, .traded-table-wrap button.close { border-color: #65b99c; background: var(--green); color: #fff; }
.traded-panel { overflow: hidden; margin-top: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 18px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 4px 0 0; font-size: 28px; }
.section-heading > strong { color: var(--gold); font-size: 12px; }
.traded-table-wrap { overflow: auto; }
table { width: 100%; min-width: 1480px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
td:first-child { color: var(--green); font: 850 12px ui-monospace, Consolas, monospace; }
td small { display: block; margin-top: 4px; color: var(--muted); font: 800 11px Arial, Helvetica, sans-serif; }
.traded-table-wrap a { color: #1166d8; font-weight: 900; text-decoration: none; }
tbody tr:last-child td { border: 0; }
.traded-note { margin: 18px 4px 0; max-width: 850px; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 920px) {
  .traded-hero { grid-template-columns: 1fr; }
  .traded-actions { min-width: 0; }
  .traded-summary { grid-template-columns: repeat(2, 1fr); }
  .traded-summary div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .traded-shell { width: calc(100% - 18px); }
  .traded-actions, .traded-summary { grid-template-columns: 1fr; }
  .traded-summary div { border-right: 0; }
}
