.atlas-trade-card {
  display: grid;
  gap: var(--atlas-space-2);
  min-width: 0;
  padding: 12px !important;
  border-left: 3px solid var(--atlas-neutral) !important;
  overflow: hidden;
}
.atlas-trade-card.long { border-left-color: var(--atlas-long) !important; }
.atlas-trade-card.short { border-left-color: var(--atlas-short) !important; }
.atlas-trade-card.invalidated { border-color: var(--atlas-invalid) !important; opacity: .76; }
.atlas-trade-card-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.atlas-trade-card-header h2 { margin: 0; color: var(--atlas-text); font-size: 1.12rem; line-height: 1.1; }
.atlas-trade-card-header p { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 5px 0 0; color: var(--atlas-text-muted); font-size: .72rem; font-weight: var(--atlas-weight-bold); text-transform: uppercase; }
.atlas-trade-card-direction.long { color: var(--atlas-long) !important; }
.atlas-trade-card-direction.short { color: var(--atlas-short) !important; }
.atlas-trade-card-score { min-width: 72px; text-align: right; }
.atlas-trade-card-score strong { display: block; color: var(--atlas-gold); font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums; }
.atlas-trade-card-score span,
.atlas-trade-card span,
.atlas-trade-card small { color: var(--atlas-text-muted); font-size: .59rem; font-weight: var(--atlas-weight-bold); letter-spacing: .07em; text-transform: uppercase; }
.atlas-trade-card-decision { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: 8px; padding: 9px 10px; border-left: 3px solid var(--atlas-wait); border-radius: var(--atlas-radius-sm); background: rgba(232, 185, 94, .07); }
.atlas-trade-card-decision strong { display: block; margin-top: 2px; color: var(--atlas-wait); font-size: .84rem; line-height: 1.15; }
.atlas-trade-card-decision.at-entry { border-color: var(--atlas-long); background: rgba(67, 201, 139, .07); }
.atlas-trade-card-decision.at-entry strong { color: var(--atlas-long); }
.atlas-trade-card-decision.price-extended,
.atlas-trade-card-decision.entry-missed,
.atlas-trade-card-decision.invalidated { border-color: var(--atlas-invalid); background: rgba(229, 101, 112, .07); }
.atlas-trade-card-decision.price-extended strong,
.atlas-trade-card-decision.entry-missed strong,
.atlas-trade-card-decision.invalidated strong { color: var(--atlas-invalid); }
.atlas-trade-card-execution,
.atlas-trade-card-plan,
.atlas-trade-card-ratios { display: grid; gap: 6px; min-width: 0; }
.atlas-trade-card-execution,
.atlas-trade-card-ratios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.atlas-trade-card-plan { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.atlas-trade-card-execution > div,
.atlas-trade-card-plan > div,
.atlas-trade-card-ratios > div { min-width: 0; padding: 7px 8px; border: 1px solid var(--atlas-border); border-radius: var(--atlas-radius-sm); background: var(--atlas-surface-subtle); }
.atlas-trade-card-execution strong,
.atlas-trade-card-plan strong,
.atlas-trade-card-ratios strong { display: block; margin-top: 3px; color: var(--atlas-text); font-size: .78rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.atlas-trade-card-plan > div:first-child strong { color: var(--atlas-short); }
.atlas-trade-card-plan > div:not(:first-child) strong { color: var(--atlas-long); }
.atlas-trade-card-context { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-trade-card-context > span { display: inline-grid; gap: 2px; min-width: 0; padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--atlas-info) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--atlas-info) 7%, transparent); }
.atlas-trade-card-context strong { color: var(--atlas-info); font-size: .66rem; overflow-wrap: anywhere; }
.atlas-trade-card-guidance { margin: 0; padding: 6px 8px; border-left: 2px solid var(--atlas-wait); color: var(--atlas-text-secondary); font-size: .72rem; line-height: 1.35; }
.atlas-trade-card-guidance span { display: block; margin-bottom: 2px; }
.atlas-trade-card-guidance strong { margin-right: 7px; color: var(--atlas-gold-bright); }
.atlas-trade-card-guidance em { color: var(--atlas-text-secondary); font-style: normal; }
.atlas-trade-card-guidance.guidance-actionable { border-color: var(--atlas-long); }
.atlas-trade-card-guidance.guidance-actionable strong { color: var(--atlas-long); }
.atlas-trade-card-guidance.guidance-avoid,
.atlas-trade-card-guidance.guidance-invalidated { border-color: var(--atlas-invalid); }
.atlas-trade-card-guidance.guidance-avoid strong,
.atlas-trade-card-guidance.guidance-invalidated strong { color: var(--atlas-invalid); }
.atlas-trade-card-action { justify-self: stretch; min-height: 40px !important; color: var(--atlas-gold-bright) !important; background: transparent !important; border-color: var(--atlas-border-emphasis) !important; box-shadow: none !important; }
.atlas-trade-card-action:focus-visible { outline: 2px solid var(--atlas-gold-bright) !important; outline-offset: 3px; }

@media (min-width: 760px) {
  .atlas-trade-card { grid-template-columns: minmax(180px, .9fr) minmax(220px, 1.15fr) minmax(200px, 1fr); align-items: center; }
  .atlas-trade-card-header, .atlas-trade-card-decision, .atlas-trade-card-context, .atlas-trade-card-guidance, .atlas-trade-card-action { grid-column: auto; }
  .atlas-trade-card-execution, .atlas-trade-card-plan, .atlas-trade-card-ratios { grid-column: span 1; }
  .atlas-trade-card-action { align-self: stretch; }
}

@media (max-width: 430px) {
  .atlas-trade-card { padding: 10px !important; }
  .atlas-trade-card-plan strong, .atlas-trade-card-execution strong, .atlas-trade-card-ratios strong { font-size: .74rem; }
}

@media (max-width: 360px) {
  .atlas-trade-card-decision { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
  .atlas-trade-card-score { min-width: 62px; }
  .atlas-trade-card-plan > div, .atlas-trade-card-execution > div, .atlas-trade-card-ratios > div { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-trade-card, .atlas-trade-card-action { transition: none !important; }
}

@media (forced-colors: active) {
  .atlas-trade-card, .atlas-trade-card-decision, .atlas-trade-card-action { border: 1px solid CanvasText !important; }
}

/* Scanner cards are a comparison surface; the workspace holds the full analysis. */
.atlas-trade-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 9px !important;
}

.atlas-trade-card.recommendation-avoid,
.atlas-trade-card.recommendation-invalidated { border-left-color: var(--atlas-invalid) !important; }
.atlas-trade-card.recommendation-wait { border-left-color: var(--atlas-wait) !important; }
.atlas-trade-card.recommendation-actionable { border-left-color: var(--atlas-positive) !important; }

.atlas-trade-card-header { gap: 6px; align-items: center; }
.atlas-trade-card-header h2 { font-size: 1rem; }
.atlas-trade-card-header p { gap: 5px; margin-top: 3px; font-size: .66rem; }
.atlas-trade-card-score { min-width: 60px; }
.atlas-trade-card-score strong { font-size: 1.25rem; }

.atlas-trade-card-recommendation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--atlas-wait) 40%, transparent);
  border-left: 3px solid var(--atlas-wait);
  border-radius: var(--atlas-radius-sm);
  background: color-mix(in srgb, var(--atlas-wait) 7%, transparent);
}

.atlas-trade-card-recommendation > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.atlas-trade-card-recommendation > div > span { color: var(--atlas-text-muted); font-size: .58rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.atlas-trade-card-recommendation > div > strong { color: var(--atlas-wait); font-size: .9rem; line-height: 1.1; overflow-wrap: anywhere; }
.atlas-trade-card-recommendation > em { grid-column: 1 / -1; color: var(--atlas-text-secondary); font-size: .68rem; font-style: normal; line-height: 1.25; }
.atlas-trade-card-recommendation.recommendation-avoid,
.atlas-trade-card-recommendation.recommendation-invalidated { border-color: color-mix(in srgb, var(--atlas-invalid) 45%, transparent); border-left-color: var(--atlas-invalid); background: color-mix(in srgb, var(--atlas-invalid) 9%, transparent); }
.atlas-trade-card-recommendation.recommendation-avoid > div > strong,
.atlas-trade-card-recommendation.recommendation-invalidated > div > strong { color: var(--atlas-invalid); }
.atlas-trade-card-recommendation.recommendation-actionable { border-color: color-mix(in srgb, var(--atlas-positive) 45%, transparent); border-left-color: var(--atlas-positive); background: color-mix(in srgb, var(--atlas-positive) 8%, transparent); }
.atlas-trade-card-recommendation.recommendation-actionable > div > strong { color: var(--atlas-positive); }

.atlas-trade-card-decision { gap: 5px 9px; padding: 6px 8px; }
.atlas-trade-card-decision > div { min-width: 0; }
.atlas-trade-card-decision > div > strong { font-size: .76rem; overflow-wrap: anywhere; }
.atlas-trade-card-decision.recommendation-avoid,
.atlas-trade-card-decision.recommendation-invalidated { border-color: var(--atlas-invalid); background: color-mix(in srgb, var(--atlas-invalid) 6%, transparent); }
.atlas-trade-card-decision.recommendation-avoid strong,
.atlas-trade-card-decision.recommendation-invalidated strong { color: var(--atlas-text-secondary); }
.atlas-trade-card-decision.price-extended.recommendation-wait { border-color: var(--atlas-wait); background: color-mix(in srgb, var(--atlas-wait) 6%, transparent); }
.atlas-trade-card-decision.price-extended.recommendation-wait strong { color: var(--atlas-wait); }

.atlas-trade-card-execution,
.atlas-trade-card-ratios { gap: 5px; }
.atlas-trade-card-execution > div,
.atlas-trade-card-ratios > div { padding: 5px 7px; }
.atlas-trade-card-execution strong,
.atlas-trade-card-ratios strong { margin-top: 2px; font-size: .72rem; overflow-wrap: anywhere; }

.atlas-trade-card-guidance { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 3px 7px; padding: 4px 6px; font-size: .66rem; line-height: 1.25; }
.atlas-trade-card-guidance span { display: inline; margin: 0; white-space: nowrap; }
.atlas-trade-card-guidance strong { margin: 0; white-space: nowrap; }
.atlas-trade-card-guidance em { min-width: 0; overflow-wrap: anywhere; }
.atlas-trade-card-guidance.guidance-actionable { border-color: var(--atlas-positive); }
.atlas-trade-card-guidance.guidance-actionable strong { color: var(--atlas-positive); }
.atlas-trade-card-guidance.guidance-avoid,
.atlas-trade-card-guidance.guidance-invalidated { border-color: var(--atlas-invalid); }
.atlas-trade-card-guidance.guidance-avoid strong,
.atlas-trade-card-guidance.guidance-invalidated strong { color: var(--atlas-invalid); }

.atlas-trade-card-details { min-width: 0; border: 1px solid var(--atlas-border); border-radius: var(--atlas-radius-sm); background: var(--atlas-surface-subtle); }
.atlas-trade-card-details > summary { min-height: 40px; padding: 10px 9px; color: var(--atlas-info); font-size: .65rem; font-weight: 900; letter-spacing: .04em; cursor: pointer; }
.atlas-trade-card-details[open] { display: grid; gap: 7px; padding-bottom: 8px; }
.atlas-trade-card-details[open] > summary { border-bottom: 1px solid var(--atlas-border); }
.atlas-trade-card-details > .atlas-trade-card-plan,
.atlas-trade-card-details > .atlas-trade-card-context { margin: 0 8px; }
.atlas-trade-card-details .atlas-trade-card-plan > div { padding: 5px 6px; }
.atlas-trade-card-details .atlas-trade-card-plan strong { font-size: .72rem; overflow-wrap: anywhere; }

.atlas-trade-card-action { min-height: 44px !important; padding: 7px 10px !important; font-size: .68rem !important; }

@media (max-width: 430px) {
  .atlas-trade-card { gap: 5px; padding: 8px !important; }
  .atlas-trade-card-plan strong,
  .atlas-trade-card-execution strong,
  .atlas-trade-card-ratios strong { font-size: .7rem; }
}

@media (max-width: 360px) {
  .atlas-trade-card-header h2 { font-size: .94rem; }
  .atlas-trade-card-score { min-width: 54px; }
  .atlas-trade-card-decision { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .atlas-trade-card-guidance { grid-template-columns: auto auto; }
  .atlas-trade-card-guidance em { grid-column: 1 / -1; }
}
