.tipo-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.tipo-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.tipo-tab:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.tipo-tab.active {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
  color: #fff;
}

.tipo-tab i {
  font-size: 0.8rem;
}

/* FROM GRID */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

/* Field that occupies the entire row */
.field-full {
  grid-column: 1 / -1;
}

/* Planet select */
.input-wrapper select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-input, #f8fafc);
  color: var(--text, #1e293b);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
  transition: border-color 0.18s;
}

.input-wrapper select:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

/* Formula used */
.formula-used {
  margin-top: 1.25rem;
}

.formula-used .formula-box {
  background: var(--bg-formula, #f1f5f9);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1.1rem;
  overflow-x: auto;
}

.formula-used .formula-box code {
  font-size: 0.95rem;
  color: var(--primary, #2563eb);
  font-weight: 600;
  white-space: nowrap;
}

/* SVG GRAPHIC */
.bar-chart-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--bg-chart, #f8fafc);
  padding: 0.5rem 0;
}

.bar-chart-wrap svg text {
  font-family: 'Montserrat', sans-serif;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.chart-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

/* Second by second table */
.table-section {
  margin-top: 2rem;
}

.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.table-header-row h2 {
  margin: 0;
  font-size: 1.1rem;
}

.btn-toggle-table {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.btn-toggle-table:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table-wrapper thead {
  background: var(--primary, #2563eb);
  color: #fff;
}

.table-wrapper thead th {
  padding: 0.65rem 1rem;
  text-align: right;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
}

.table-wrapper thead th:first-child {
  text-align: left;
}

.table-wrapper tbody tr:nth-child(even) {
  background: var(--bg-alt, #f8fafc);
}

.table-wrapper tbody td {
  padding: 0.55rem 1rem;
  text-align: right;
  color: var(--text, #1e293b);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.table-wrapper tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--primary, #2563eb);
}

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

/* SEO block — formulas */
.seo-block .formula-box {
  background: var(--bg-formula, #f1f5f9);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1.1rem;
  margin: 0.75rem 0 1rem;
  overflow-x: auto;
}

.seo-block .formula-box code {
  font-size: 1rem;
  color: var(--primary, #2563eb);
  font-weight: 600;
  white-space: nowrap;
}

.formula-legend {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 1rem;
}

.formula-legend li {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
}

.formula-legend strong {
  color: var(--text, #1e293b);
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .tipo-tabs {
    gap: 0.4rem;
  }

  .tipo-tab {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }

  .table-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .formula-legend {
    grid-template-columns: 1fr;
  }
}