/* Bảng tuần hoàn — main styles */
[hidden] { display: none !important; }

.bth-container { max-width: 1280px; padding-top: 40px; }

.back-link { display: inline-block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; transition: color 0.2s ease; }
.back-link:hover { color: var(--accent); }

.bth-hero { margin-bottom: 24px; }
.bth-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.bth-hero .tagline { font-size: 0.95rem; }

/* Info panel */
.bth-info {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  min-height: 130px; margin-bottom: 16px;
  display: flex; align-items: center;
}
.bth-info-empty { color: var(--text-muted); margin: 0 auto; font-size: 0.92rem; }

.bth-info-content { display: flex; gap: 16px; align-items: flex-start; flex: 1; min-width: 0; }
.bth-info-cell {
  width: 86px; height: 86px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; padding: 4px;
}
.bth-info-cell-num { font-size: 0.7rem; opacity: 0.7; line-height: 1; }
.bth-info-cell-sym { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.bth-info-cell-mass { font-size: 0.65rem; opacity: 0.7; line-height: 1; }

.bth-info-body { flex: 1; min-width: 0; }
.bth-info-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bth-info-head strong { font-size: 1.2rem; font-weight: 700; }
.bth-info-name-vi { color: var(--text-muted); font-size: 0.88rem; }
.bth-info-cat-badge { font-size: 0.7rem; padding: 2px 8px; border: 1px solid; border-radius: 4px; letter-spacing: 0.04em; }

.bth-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px;
  font-size: 0.84rem;
}
.bth-prop { color: var(--text); }
.bth-prop-label { color: var(--text-muted); font-size: 0.78rem; }
.bth-prop strong { font-weight: 600; }

/* Grid */
.bth-table-wrap { overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.bth-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(48px, 1fr));
  grid-template-rows: repeat(7, auto) 14px auto auto;
  gap: 2px;
  min-width: 880px;
}

.bth-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #162232; border: 1px solid var(--el-color, #253549);
  font: inherit; padding: 2px; cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.bth-cell:hover {
  background: color-mix(in srgb, var(--el-color) 22%, #162232);
  transform: scale(1.12); z-index: 10;
  box-shadow: 0 0 12px color-mix(in srgb, var(--el-color) 40%, transparent);
}
.bth-cell-num { font-size: 9px; line-height: 1; color: #8b9db5; font-family: 'JetBrains Mono', monospace; }
.bth-cell-sym { font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--el-color); font-family: 'JetBrains Mono', monospace; }
.bth-cell-mass { font-size: 8px; line-height: 1; color: #4a6180; font-family: 'JetBrains Mono', monospace; }

.bth-cell.bth-placeholder {
  background: transparent; cursor: default;
  border-style: dashed; border-color: #4a6180;
}
.bth-cell.bth-placeholder:hover { transform: none; box-shadow: none; background: transparent; }
.bth-cell.bth-placeholder .bth-cell-sym { color: #8b9db5; font-size: 11px; }

.bth-loading { text-align: center; color: var(--text-muted); padding: 24px; font-size: 0.9rem; }

/* Legend */
.bth-legend {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 8px; margin-bottom: 16px;
}
.bth-legend-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 6px;
  font: inherit; font-size: 0.8rem; cursor: pointer;
  transition: all 0.15s ease;
}
.bth-legend-pill:hover { transform: translateY(-1px); }
.bth-legend-pill.is-on { background: rgba(255,255,255,0.04); }
.bth-legend-dot { width: 10px; height: 10px; display: inline-block; border-radius: 2px; }
