.ema-arrangement-compact {
  display: block;
  width: min(100%, 158px);
  margin-top: 5px;
  padding: 5px 6px 6px;
  border: 1px solid #dce6f1;
  border-radius: 7px;
  background: #f8fbff;
  line-height: 1.2;
}

.ema-arrangement-heading {
  display: block;
  margin-bottom: 4px;
  color: #536783;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.ema-arrangement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 5px;
}

.ema-arrangement-item {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.ema-arrangement-time {
  color: #62758f;
  font-size: 10px;
}

.ema-arrangement-value {
  padding: 1px 3px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.ema-arrangement-value.is-long { color: #087844; background: #dff6e9; }
.ema-arrangement-value.is-short { color: #bc3847; background: #fde9e9; }
.ema-arrangement-value.is-mixed { color: #8c650c; background: #fff1bf; }
.ema-arrangement-value.is-unavailable { color: #7c8aa0; background: #edf1f5; }

.desktop-insight-ema-card {
  grid-area: ema;
  border-color: #bfd3ea;
  background: linear-gradient(120deg, #f7faff, #fff);
}

.ema-arrangement-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ema-arrangement-title span {
  color: #73849b;
  font-size: 12px;
}

.ema-arrangement-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ema-arrangement-panel .ema-arrangement-item {
  padding: 10px 12px;
  border: 1px solid #e2eaf4;
  border-radius: 8px;
  background: #fff;
}

.ema-arrangement-panel .ema-arrangement-time { font-size: 12px; }
.ema-arrangement-panel .ema-arrangement-value { padding: 4px 8px; font-size: 12px; }
.ema-arrangement-empty { margin: 0; color: #8492a7; font-size: 13px; }

/* Declare the entire parent grid here: the base stylesheet may be cached at its older URL. */
.desktop-insight-layout {
  grid-template-areas:
    "overview focus"
    "price-matrix fund-matrix"
    "ema ema"
    "summary summary";
}

.capital-snapshot-notice + .desktop-insight-layout {
  grid-template-areas:
    "overview overview"
    "price-matrix fund-matrix"
    "ema ema"
    "summary summary";
}

@media (max-width: 760px) {
  .desktop-insight-layout {
    grid-template-areas:
      "overview"
      "focus"
      "price-matrix"
      "fund-matrix"
      "ema"
      "summary";
  }
  .capital-snapshot-notice + .desktop-insight-layout {
    grid-template-areas:
      "overview"
      "price-matrix"
      "fund-matrix"
      "ema"
      "summary";
  }
}

/* Fixed signal tables keep an 88–96px coin column; use two genuinely compact rows. */
.ema-arrangement-compact {
  width: 100%;
  margin-top: 4px;
  padding: 4px 3px 5px;
}
.ema-arrangement-compact .ema-arrangement-heading {
  margin-bottom: 3px;
  font-size: 9px;
}
.ema-arrangement-compact .ema-arrangement-grid { gap: 2px 1px; }
.ema-arrangement-compact .ema-arrangement-item {
  justify-content: flex-start;
  gap: 1px;
}
.ema-arrangement-compact .ema-arrangement-time { font-size: 9px; }
.ema-arrangement-compact .ema-arrangement-value {
  padding: 0 2px;
  font-size: 9px;
}
