.zodiac-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: stretch;
}

.zodiac-stage {
  position: relative;
  min-height: clamp(560px, calc(100svh - 160px), 980px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050509;
  overflow: hidden;
  box-shadow: inset 0 0 42px rgba(134, 242, 214, 0.06), 0 0 24px rgba(254, 198, 48, 0.08);
}

#zodiac-canvas {
  display: block;
  width: 100%;
  height: clamp(560px, calc(100svh - 160px), 980px);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#zodiac-canvas.is-panning {
  cursor: grabbing;
}

#zodiac-canvas.is-hovering-node:not(.is-panning) {
  cursor: pointer;
}

.zodiac-toolbar,
.zodiac-status,
.zodiac-legend {
  position: absolute;
  z-index: 6;
  border: 1px solid rgba(244, 239, 227, 0.13);
  border-radius: var(--radius);
  background: rgba(10, 6, 14, 0.76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.zodiac-toolbar {
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  padding: 6px;
  max-width: min(720px, calc(100% - 24px));
}

.zodiac-toolbar select {
  width: min(190px, 100%);
  min-height: 38px;
  padding: 7px 28px 7px 9px;
  border: 1px solid rgba(134, 242, 214, 0.24);
  border-radius: 6px;
  color: var(--ink);
  background: #17111d;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.zodiac-toolbar .icon-button {
  width: 38px;
  height: 38px;
  color: var(--green-2);
  background: rgba(244, 239, 227, 0.06);
}

.zodiac-toolbar .icon-button:hover,
.zodiac-toolbar .icon-button:focus-visible {
  color: #171611;
  background: var(--green-2);
}

.zodiac-toolbar svg {
  width: 20px;
  height: 20px;
}

.zodiac-toolbar .icon-button[aria-pressed="false"] {
  color: rgba(244, 239, 227, 0.48);
  border-color: rgba(244, 239, 227, 0.1);
  background: rgba(244, 239, 227, 0.03);
}

.zodiac-symbol-button {
  display: block;
  color: inherit;
  font-family: "Times New Roman", "Noto Sans Hebrew", serif;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.zodiac-status {
  left: 12px;
  top: 12px;
  max-width: min(260px, calc(100% - 24px));
  padding: 8px 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}

.zodiac-legend {
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 6px;
  max-width: min(330px, calc(100% - 24px));
  padding: 9px 10px;
  pointer-events: none;
}

.zodiac-legend span {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.zodiac-layout.is-symbolic-hidden .zodiac-legend-symbol {
  display: none;
}

.zodiac-legend small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.zodiac-dot {
  width: 12px;
  height: 12px;
  justify-self: center;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
}

.zodiac-dot--star {
  background: #e4ecff;
  color: rgba(174, 201, 255, 0.72);
}

.zodiac-dot--line {
  height: 0;
  border-top: 2px solid rgba(134, 242, 214, 0.72);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.zodiac-dot--letter {
  background: #fec630;
  color: rgba(254, 198, 48, 0.82);
}

.zodiac-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: clamp(560px, calc(100svh - 160px), 980px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #14101b;
}

.zodiac-detail__head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.zodiac-detail__head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.1;
}

.zodiac-detail__head h3 b {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(254, 198, 48, 0.56);
}

.zodiac-detail__head small,
.zodiac-source-note,
.zodiac-selected span,
.zodiac-letter-card small,
.zodiac-warning {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.zodiac-sign-code {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(134, 242, 214, 0.3);
  border-radius: var(--radius);
  color: var(--green-2);
  background: rgba(134, 242, 214, 0.08);
  font-size: 0.86rem;
  font-weight: 950;
}

.zodiac-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.zodiac-metrics span,
.zodiac-letter-card,
.zodiac-selected {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(244, 239, 227, 0.12);
  border-radius: var(--radius);
  background: rgba(244, 239, 227, 0.05);
}

.zodiac-metrics b {
  color: var(--gold);
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.zodiac-metrics small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.zodiac-letter-card {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  border-color: rgba(254, 198, 48, 0.28);
}

.zodiac-letter-card strong {
  grid-row: span 2;
  color: var(--gold);
  font-family: "Times New Roman", "Noto Sans Hebrew", serif;
  font-size: 2.1rem;
  text-align: center;
  text-shadow: 0 0 16px rgba(254, 198, 48, 0.66);
}

.zodiac-letter-card span {
  color: var(--ink);
  font-weight: 900;
}

.zodiac-letter-card--muted {
  grid-template-columns: 1fr;
  border-color: rgba(244, 239, 227, 0.12);
}

.zodiac-selected {
  border-color: rgba(134, 242, 214, 0.28);
}

.zodiac-selected strong {
  color: var(--green-2);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.zodiac-selected strong[dir="rtl"] {
  color: var(--gold);
  font-family: "Times New Roman", "Noto Sans Hebrew", serif;
  font-size: 1.8rem;
}

.zodiac-warning {
  color: #ff9d9d;
}

.zodiac-source-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(244, 239, 227, 0.1);
}

@media (max-width: 1120px) {
  .zodiac-layout {
    grid-template-columns: 1fr;
  }

  .zodiac-detail {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .zodiac-stage,
  #zodiac-canvas {
    min-height: 620px;
    height: 620px;
  }

  .zodiac-toolbar {
    right: 10px;
    left: 10px;
    justify-content: stretch;
  }

  .zodiac-toolbar select {
    flex: 1 1 calc(50% - 6px);
  }

  .zodiac-toolbar .icon-button {
    flex: 1 1 44px;
    min-width: 44px;
  }

  .zodiac-status {
    top: auto;
    bottom: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
  }

  .zodiac-legend {
    display: none;
  }

  .zodiac-metrics {
    grid-template-columns: 1fr;
  }
}
