/* Unified plaza cards — gold AI standard for every strategy */
html.plaza-page,
body.plaza-page {
  overflow-x: hidden;
  max-width: 100vw;
}
body.plaza-page .wrap,
body.plaza-page .editorial-main,
body.plaza-page .market-grid {
  max-width: 100%;
  overflow-x: hidden;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1199px) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .market-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.m-card.strategy-card.plaza-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 16px 14px 14px;
  border: 1px solid var(--border-line);
  background: #fff;
  border-radius: 4px;
  box-shadow: none;
  overflow: hidden;
}

.m-card.strategy-card.plaza-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  min-height: 0;
  color: #000000;
  padding-right: 0;
}

.ai-badge,
.classic-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 8px;
  margin: 0;
  border-radius: 4px;
}

.ai-badge {
  color: #000000;
  border: 1px solid #000000;
  background: #ffffff;
}

.classic-badge {
  color: #6b6b6b;
  border: 1px solid var(--border-line);
  background: #f7f7f7;
}

.plaza-card .ai-eq-thumb,
.plaza-card .plaza-eq-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  background: #f7f7f7;
  border: 1px solid var(--border-line);
  margin: 2px 0 0;
}

.plaza-card .plaza-eq-svg {
  aspect-ratio: 200 / 80;
}

.plaza-card .card-principle {
  display: block !important;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #333333;
  font-weight: 400;
  max-height: none;
  overflow: visible;
  white-space: normal;
}

.plaza-card .card-meta {
  display: block !important;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6b6b6b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plaza-card .tags {
  display: none !important;
}

.plaza-card .plaza-eq-svg,
.plaza-card .ai-eq-thumb {
  width: 100%;
  height: 86px;
  display: block;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  object-fit: cover;
  object-position: center;
}

.plaza-card .stat-caps.plaza-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.plaza-card .stat-cap {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 8px 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
}

.plaza-card .stat-cap span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1.3;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
}

.plaza-card .stat-cap b {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  min-height: 0;
}

.plaza-card .stat-cap b.is-up {
  color: var(--color-up);
}

.plaza-card .stat-cap b.is-down {
  color: var(--color-down);
}

.plaza-card .stat-tip {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.35;
  color: #94a3b8;
  font-style: normal;
  font-weight: 500;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
}

.plaza-card .card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.plaza-card .card-actions .btn-cta,
.plaza-card .card-actions a.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.plaza-card .card-hit {
  display: none !important;
}

#aiStratModal .ai-eq-full,
#aiStratModal .plaza-eq-svg {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  background: #0b0b0c;
  border: 1px solid rgba(212, 160, 23, 0.25);
}

/* Outer #aiStratMetrics must NOT be a 3-col grid — its only child is .stat-caps */
#aiStratModal #aiStratMetrics,
#aiStratModal .plaza-metric-row {
  display: block;
  width: 100%;
  margin: 10px 0 14px;
  min-width: 0;
}

#aiStratModal #aiStratMetrics .stat-caps.plaza-metrics,
#aiStratModal .stat-caps.plaza-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0;
}

#aiStratModal .stat-cap {
  min-width: 0;
  overflow: hidden;
  background: #0f172a;
  border-color: #334155;
}

#aiStratModal .stat-cap span,
#aiStratModal .stat-tip {
  color: #94a3b8;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
  line-height: 1.35;
}

#aiStratModal .stat-cap b {
  color: #f8fafc;
  white-space: nowrap;
}

#aiStratModal #aiStratCopy {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #c8c8c8;
}

#aiStratModal .btn-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  .m-card.strategy-card.plaza-card {
    padding: 14px 12px 12px !important;
    gap: 8px !important;
  }

  .plaza-card .stat-caps.plaza-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plaza-card .ai-eq-thumb,
  .plaza-card .plaza-eq-svg {
    max-height: 160px;
  }

  #aiStratModal #aiStratMetrics .stat-caps.plaza-metrics,
  #aiStratModal .stat-caps.plaza-metrics {
    grid-template-columns: 1fr;
  }

  /* Undo legacy mobile hides that stripped principle / metrics */
  body:not(.home-boards):not(.live-page) .m-card.strategy-card.plaza-card .card-principle,
  body:not(.home-boards):not(.live-page) .m-card.strategy-card.plaza-card .card-meta,
  body:not(.home-boards):not(.live-page) .m-card.strategy-card.plaza-card .stat-caps {
    display: block !important;
  }

  body:not(.home-boards):not(.live-page) .m-card.strategy-card.plaza-card .stat-caps.plaza-metrics {
    display: grid !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .plaza-card .stat-caps.plaza-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.m-card.strategy-card.plaza-card.is-focus {
  outline: 2px solid #38bdf8;
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.16);
  z-index: 2;
}

.m-card.strategy-card.plaza-card.is-hidden {
  display: none !important;
}

.m-card.strategy-card.plaza-card.plaza-fade {
  animation: plazaIn 0.28s ease;
}

@keyframes plazaIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.grid-hero-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  color: #b45309;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  border: 1px solid #d97706;
}

.plaza-card.is-grid-hero {
  border-color: rgba(217, 119, 6, 0.55);
}

.plaza-grid-kpi {
  margin-bottom: 4px;
}

.term-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 10px;
}

.term-tabs-mobile-select {
  display: block !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
  white-space: normal !important;
  padding: 0 !important;
}

.term-tabs-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.term-tabs-select-lab {
  font-size: 12px;
  font-weight: 700;
  color: #111;
}

.term-tabs-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

.term-tab.tab-hero,
.term-tab[data-filter="grid"] {
  background: linear-gradient(180deg, #fef3c7, #fde68a) !important;
  color: #b45309 !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.35) !important;
  animation: gridTabPulse 2.4s ease-in-out infinite;
  position: relative;
}

.term-tab.tab-hero.active,
.term-tab[data-filter="grid"].active {
  background: linear-gradient(180deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
}

.term-tab .hot-dot {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  background: #dc2626;
  color: #fff;
  padding: 1px 5px;
  margin-right: 4px;
  letter-spacing: 0.06em;
}

@keyframes gridTabPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(217, 119, 6, 0.28); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.55); }
}
