/* common/css/astro-tools.css — shared layout for astronomy phase1 tools */

.astro-grid {
  display: grid;
  gap: 12px;
}

.astro-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.astro-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.astro-card {
  border: 1px solid var(--line, #d8dee9);
  border-radius: 10px;
  padding: 12px;
  background: var(--card, #fff);
}

.astro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.astro-note {
  font-size: 0.92rem;
  color: var(--muted, #54627a);
}

.astro-form-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.astro-form-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.astro-form-row.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.astro-results-table {
  width: 100%;
  border-collapse: collapse;
}

.astro-results-table th,
.astro-results-table td {
  border-bottom: 1px solid var(--line, #d8dee9);
  padding: 7px 8px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.astro-results-table th {
  width: 32%;
  font-weight: 600;
}

.astro-err {
  color: #b00020;
  font-size: 0.87rem;
  min-height: 1.2em;
}

.astro-value {
  font-variant-numeric: tabular-nums;
}

.astro-chart {
  width: 100%;
  min-height: 250px;
  border: 1px solid var(--line, #d8dee9);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.astro-chart svg {
  width: 100%;
  height: 260px;
  display: block;
}

.astro-chart-ui {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 2fr) minmax(220px, 1.5fr);
}

.astro-chart-legend,
.astro-chart-events {
  border: 1px solid var(--line, #d8dee9);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.astro-chart-legend-title,
.astro-mini-title {
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #54627a);
}

.astro-chart-legend-list {
  display: grid;
  gap: 6px;
}

.astro-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #1f2937;
}

.astro-chart-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: var(--astro-legend-color, #6b7280);
  position: relative;
  display: inline-block;
}

.astro-chart-legend-swatch.is-line {
  border-radius: 999px;
  height: 3px;
}

.astro-chart-legend-swatch.is-line::before {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  border-radius: 999px;
  background: var(--astro-legend-color, #6b7280);
}

.astro-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.astro-mini-table th,
.astro-mini-table td {
  border-bottom: 1px solid var(--line, #d8dee9);
  padding: 5px 4px;
  text-align: left;
  vertical-align: top;
}

.astro-mini-table th {
  font-weight: 600;
  width: 52%;
  white-space: nowrap;
  color: #475569;
}

.astro-mini-table td {
  font-variant-numeric: tabular-nums;
  color: #1f2937;
}

.astro-chart-wrap {
  position: relative;
}

.astro-tooltip {
  position: absolute;
  z-index: 2;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
}

.astro-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.astro-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.astro-inline-list > * {
  flex: 1 1 140px;
}

@media (max-width: 900px) {
  .astro-grid.cols-2,
  .astro-grid.cols-3,
  .astro-form-row,
  .astro-form-row.cols-3,
  .astro-form-row.cols-4 {
    grid-template-columns: 1fr;
  }

  .astro-chart-ui {
    grid-template-columns: 1fr;
  }
}
