/* Home page side stock charts — wide desktop only; hidden via body.home-charts-hidden */

:root {
  --home-center-max: 900px;
  --home-side-gap: 16px;
  --home-chart-col-gap: 10px;
  --home-chart-max-width: 330px;
  --home-charts-stack-offset: 0px;
  --home-charts-stack-height: auto;
}

.home-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

body:not(.home-charts-hidden) .home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(var(--home-center-max), 100%) minmax(0, 1fr);
  column-gap: var(--home-side-gap);
  align-items: start;
}

.home-center {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

body.home-charts-hidden .home-charts-col {
  display: none !important;
}

.home-charts-col {
  display: flex;
  flex-direction: column;
  gap: var(--home-chart-col-gap);
  padding: 1.5rem 0 1rem;
  min-width: 0;
}

body:not(.home-charts-hidden) .home-charts-col {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-self: start;
  width: min(var(--home-chart-max-width), 100%);
  margin-top: var(--home-charts-stack-offset, 0);
  height: var(--home-charts-stack-height, auto);
  padding-top: 0;
  padding-bottom: 0;
}

body:not(.home-charts-hidden) .home-charts-col--left {
  justify-self: end;
  padding-left: max(0.35rem, env(safe-area-inset-left, 0));
  padding-right: 0.15rem;
}

body:not(.home-charts-hidden) .home-charts-col--right {
  justify-self: start;
  padding-right: max(0.35rem, env(safe-area-inset-right, 0));
  padding-left: 0.15rem;
}

.home-charts-col--left {
  padding-left: max(0.5rem, env(safe-area-inset-left, 0));
  padding-right: 0.25rem;
}

.home-charts-col--right {
  padding-right: max(0.5rem, env(safe-area-inset-right, 0));
  padding-left: 0.25rem;
}

.home-chart-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 0.38rem 0.42rem 0.42rem;
  background: rgba(0, 0, 0, 0.52);
  min-width: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

body:not(.home-charts-hidden) .home-chart-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
  margin-bottom: 0.32rem;
  flex: 0 0 auto;
}

.home-chart-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(212, 175, 55, 0.95);
  user-select: none;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-chart-live {
  flex: 0 0 auto;
  padding: 0.18rem 0.34rem;
  border-radius: 5px;
  background: rgba(10, 10, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.home-chart-price {
  font-size: 0.68rem;
  font-weight: 700;
  color: #f0f4f8;
  transition: color 0.2s ease;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.home-chart-price--tick {
  color: #f6e8c8;
}

.home-chart-price--loading,
.home-chart-price--unavailable {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(240, 244, 248, 0.58);
}

.home-chart-session {
  display: block;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(177, 195, 210, 0.88);
  line-height: 1.1;
}

.home-chart-session.is-extended {
  color: rgba(212, 175, 55, 0.95);
}

.home-chart-session.is-closed {
  color: rgba(177, 195, 210, 0.72);
}

.home-chart-session:empty {
  display: none;
}

.home-chart-wrap {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
}

body:not(.home-charts-hidden) .home-chart-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.home-chart-frame {
  width: 100%;
  height: 200px;
  border: 0;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.home-chart-crosshair-layer {
  position: absolute;
  top: 40px;
  right: 54px;
  bottom: 66px;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  cursor: crosshair;
  z-index: 2;
}

.home-chart-wrap.is-crosshair-ready .home-chart-crosshair-layer {
  pointer-events: auto;
}

.home-chart-crosshair-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.home-chart-guide-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(212, 175, 55, 0.85);
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
  opacity: 0;
  pointer-events: none;
}

.home-chart-wrap.is-crosshair-active .home-chart-guide-v {
  opacity: 1;
}

.home-chart-price-badge {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 2px;
  background: #007aff;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.home-chart-wrap.is-crosshair-active .home-chart-price-badge {
  opacity: 1;
}

body:not(.home-charts-hidden) .home-chart-frame {
  height: 100%;
  min-height: 0;
}

@media (max-width: 768px) {
  body:not(.home-charts-hidden) .home-shell {
    display: flex;
    flex-direction: column;
  }

  .home-charts-col {
    display: none !important;
  }
}
