* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: #101a2b; font-family: Arial, sans-serif; }
.market-chart-embed {
  --widget-border: #263a53;
  --widget-muted: #9aacc2;
  --widget-text: #f3f7fc;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--widget-border);
  border-radius: 12px;
  background: #142237;
  color: var(--widget-text);
}
.market-chart-embed__title { margin: 0 0 6px; color: var(--widget-text); font-size: 17px; line-height: 1.4; }
.market-chart-embed__description { margin: 0; color: var(--widget-muted); font-size: 12px; line-height: 1.55; }
.market-chart-embed .market-chart-summary { margin-top: 13px; }
.market-chart-embed .market-change-chart { margin-top: 13px; }
.market-chart-embed__credit { margin-top: 14px; padding-top: 9px; border-top: 1px solid rgba(38,58,83,.75); font-size: 10px; text-align: right; }
.market-chart-embed__credit a { color: var(--widget-muted); text-decoration: none; }
.market-chart-embed__credit a:hover { color: var(--widget-text); }
.market-chart-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.market-chart-summary__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--widget-border);
  border-radius: 20px;
  background: #0e1a2a;
  color: #b7c6d8;
  font-size: 11px;
  font-weight: 600;
}
.market-chart-summary__item.is-positive { border-color: rgba(52,211,153,.22); color: #6de0b0; }
.market-chart-summary__item.is-negative { border-color: rgba(248,113,113,.22); color: #ff9292; }
.market-change-chart { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.market-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 3fr) 68px;
  gap: 9px;
  align-items: center;
}
.market-chart-coin { display: flex; min-width: 0; align-items: center; gap: 8px; }
.market-chart-coin img { width: 25px; height: 25px; flex: 0 0 25px; padding: 2px; border-radius: 50%; background: #fff; object-fit: contain; }
.market-chart-coin__name { display: block; overflow: hidden; color: #e4edf7; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.market-chart-coin__symbol { display: block; margin-top: 2px; color: var(--widget-muted); font-size: 9px; font-weight: 600; letter-spacing: .04em; }
.market-chart-track {
  position: relative;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(115,137,165,.13);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(248,113,113,.09) 0%, rgba(248,113,113,.09) 49.7%, rgba(113,129,152,.35) 49.7%, rgba(113,129,152,.35) 50.3%, rgba(52,211,153,.09) 50.3%, rgba(52,211,153,.09) 100%);
}
.market-chart-track:after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #9aacc2;
  content: "";
}
.market-chart-bar {
  position: absolute;
  top: 3px;
  z-index: 1;
  height: 12px;
  border-radius: 5px;
  animation: market-chart-grow .55s cubic-bezier(.2,.7,.25,1) both;
}
.market-chart-bar.is-positive { left: 50%; width: var(--bar-width); transform-origin: left center; background: linear-gradient(90deg,#2cc98f,#55e2ac); box-shadow: 0 0 11px rgba(52,211,153,.28); }
.market-chart-bar.is-negative { right: 50%; width: var(--bar-width); transform-origin: right center; background: linear-gradient(270deg,#ef626d,#ff8a86); box-shadow: 0 0 11px rgba(248,113,113,.25); }
.market-chart-bar.is-neutral { left: calc(50% - 2px); width: 4px; background: #a4b4c7; }
@keyframes market-chart-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.market-chart-value {
  justify-self: end;
  min-width: 60px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #d7e2ef;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.market-chart-value.is-positive { border-color: rgba(52,211,153,.16); background: rgba(52,211,153,.08); color: #69dfae; }
.market-chart-value.is-negative { border-color: rgba(248,113,113,.16); background: rgba(248,113,113,.08); color: #ff9292; }
.market-chart-value.is-neutral { border-color: rgba(164,180,199,.16); background: rgba(164,180,199,.08); color: #bdc9d7; }
.market-chart-axis {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 3fr) 68px;
  gap: 9px;
  margin-top: -3px;
  color: var(--widget-muted);
  font-size: 10px;
}
.market-chart-axis__labels { display: flex; justify-content: space-between; padding: 0 2px; }
.widget-empty-note { display: flex; min-height: 160px; align-items: center; justify-content: center; color: var(--widget-muted); font-size: 13px; }
@media (max-width: 767px) {
  .market-chart-embed { padding: 14px; }
  .market-chart-row, .market-chart-axis { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 61px; gap: 6px; }
  .market-chart-coin { gap: 5px; }
  .market-chart-coin img { width: 21px; height: 21px; flex-basis: 21px; }
  .market-chart-coin__name { font-size: 10px; }
  .market-chart-value { min-width: 56px; padding: 4px 5px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .market-chart-bar { animation: none; }
}
